浏览代码

Ensures we don't show CodeLens if disabled

main
Eric Amodio 2 年前
父节点
当前提交
474fad812c
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. +3
    -2
      src/codelens/codeLensProvider.ts

+ 3
- 2
src/codelens/codeLensProvider.ts 查看文件

@ -110,6 +110,9 @@ export class GitCodeLensProvider implements CodeLensProvider {
// Since we can't currently blame edited virtual documents, don't even attempt anything if dirty
if (document.isDirty && isVirtualUri(document.uri)) return [];
const cfg = configuration.get('codeLens', document);
if (!cfg.enabled) return [];
const trackedDocument = await this.container.tracker.getOrAdd(document);
if (!trackedDocument.isBlameable) return [];
@ -126,8 +129,6 @@ export class GitCodeLensProvider implements CodeLensProvider {
}
}
const cfg = configuration.get('codeLens', document);
let languageScope = cfg.scopesByLanguage?.find(ll => ll.language?.toLowerCase() === document.languageId);
if (languageScope == null) {
languageScope = {

正在加载...
取消
保存