Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>vscode-comment-queriesNew to Visual Studio Code? Get it now.
vscode-comment-queries

vscode-comment-queries

YiJie

|
749 installs
| (2) | Free
Query type by comment.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Vscode Comment Queries

|zh-Hans |en-US

通过注释语法与内嵌提示展示你的代码中的变量类型,通过插件商店安装。

演示

相对查询

pre-line-point

next-line-point

left-right-point

cross-line-point

绝对查询

absolute-point

cross-file-point

功能

  • 支持多语言

    • TypeScript
    • Python
    • Golang
  • [x] 相对文件行列 query 查询

    • [x] 上下文件行
    //   _x2?
    //   _?
    type T = 1 | 2
    //   ^?
    //   ^x2?
    
    • [ ] 左右文件列
    type /*>?*/ T /*<?*/ = 1 | 2 //<4?
    
  • [x] 绝对文件行列 query 查询

    • [x] 当前文件指定行列

      // @114,514?
      // @[114, 514]?
      
    • [x] 跨文件指定行列查询

      • [x] 相对路径支持

        // @./foo.ts:114:514?
        
      • [x] 绝对路径支持

        // @/users/xxx/codes/foo.ts:114:514?
        

插件配置

  • [ ] 移除提示消息的前缀
  • [ ] 消息展示长度限制

Q&A

  • Q: 为什么无法展示提示信息
  • A: 请检查你的 vscode 版本是否支持 editor.inlayHints.enabled 配置项,并将其设置为 on
  • Q: 在顶行上行查询或者底行下行查询会报错(可能)
  • A: 我没做校验,先不做
  • Q: 查询对应行列无元素的时候会偏移计算失误
  • A: 还不想修,你自己可以修
  • Q: 为什么不支持在 python 和 go 中 (<ctrl|cmd> + mouse right click) 跳转到定义
  • A: 没有实现,个人暂时没有需求(你可以提供一个 pr 支持)

相关

在 IDEA 中使用

Release Notes

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft