diff --git a/src/codelens/codeLensProvider.ts b/src/codelens/codeLensProvider.ts index 66648f4..169e10d 100644 --- a/src/codelens/codeLensProvider.ts +++ b/src/codelens/codeLensProvider.ts @@ -95,7 +95,7 @@ export class GitCodeLensProvider implements CodeLensProvider { ]; constructor( - context: ExtensionContext, + _context: ExtensionContext, private readonly _git: GitService, private readonly _tracker: DocumentTracker, ) {} @@ -342,6 +342,19 @@ export class GitCodeLensProvider implements CodeLensProvider { } break; + case SymbolKind.String: + if ( + languageScope.symbolScopes.includes(symbolName) || + // A special case for markdown files, SymbolKind.String seems to be returned for headers, so consider those containers + (languageScope.language === 'markdown' && languageScope.scopes.includes(CodeLensScopes.Containers)) + ) { + range = getRangeFromSymbol(symbol); + valid = + !languageScope.symbolScopes.includes(`!${symbolName}`) && + (includeSingleLineSymbols || !range.isSingleLine); + } + break; + default: if (languageScope.symbolScopes.includes(symbolName)) { range = getRangeFromSymbol(symbol);