Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>X CodeLens Usage InlayNew to Visual Studio Code? Get it now.
X CodeLens Usage Inlay

X CodeLens Usage Inlay

rainhan99

|
1 install
| (0) | Free
自动渲染主题颜色,在选中符号右侧显示灰色用量提示(usages),点击弹出引用列表并可侧边新开跳转。
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

X CodeLens Usage Inlay

在声明行(函数/方法/结构体/类/接口/枚举/命名空间/模块)结尾显示灰色“X usages”。鼠标悬浮即显示引用列表,点击项即可跳转;可选在选中后自动打开内联引用面板(Peek)。依赖各语言的引用提供能力(ReferenceProvider / 语言服务器)。

功能

  • 打开文件后,对可见区域内的声明行直接显示“X usages”(无需选中)。
  • 鼠标悬浮“usages”即可看到带标题的悬浮列表(可点击跳转)。
  • 可选:选中后自动打开内联引用面板(Peek),或使用 QuickPick 列表。
  • 选择引用项后在侧边新开并跳转到该位置;也可打开内置 Peek References 面板。
  • 高性能:去抖动、LRU+TTL 缓存、取消过时请求、计数上限、列表条数限制。
  • 自动调度亮色主题:在多窗口/多项目场景中自动为每个 VS Code 窗口分配不同的亮色主题,可自定义调色板与优先主题。

配置

  • xCodelens.enabled: 启用/禁用(默认 true)
  • xCodelens.languages: 启用语言(默认 TS/JS/Go/Rust/Python)
  • xCodelens.debounceMs: 选区变化去抖动毫秒数(默认 250)
  • xCodelens.maxItems: QuickPick 最多展示条数(默认 100)
  • xCodelens.countCap: 计数显示上限,超过显示 99+(默认 99)
  • xCodelens.showZero: 引用为 0 时是否显示(默认 false)
  • xCodelens.openBehavior: 打开方式 beside/active(默认 beside)
  • xCodelens.cacheTtlMs: 缓存 TTL(默认 10000ms)
  • xCodelens.cacheMaxEntries: 缓存最大条目数(默认 500)
  • xCodelens.autoShowList: 选中后自动显示引用(默认 false)
  • xCodelens.autoShowDelayMs: 自动弹出延时(默认 200ms)
  • xCodelens.autoShowMode: 自动显示方式 peek/quickpick(默认 peek)
  • xCodelens.autoThemeEnabled: 自动调度亮色主题(默认 true)
  • xCodelens.autoThemeCustomTheme: 优先使用的主题名(留空则自动从调色板挑选)
  • xCodelens.autoThemePalette: 可用亮色主题列表(默认包含 10 个常用亮色主题)
  • xCodelens.showAtLineEnd: 在行尾显示 usages(默认 true)
  • xCodelens.decorationColor: 行尾 usages 颜色
  • xCodelens.decorationMargin: 行尾 usages 与代码间距
  • xCodelens.alwaysShowOnVisible: 是否对可见区域声明行默认显示(默认 true)
  • xCodelens.visibleMaxLines: 单次渲染可见区域最大行数(默认 80)
  • xCodelens.symbolKinds: 显示 usages 的符号种类(默认仅函数/方法/结构体/类/接口/枚举/命名空间/模块)
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft