Ver código fonte

Adds "container" support to markdown files

main
Eric Amodio 4 anos atrás
pai
commit
d4bf43bc3e
1 arquivos alterados com 14 adições e 1 exclusões
  1. +14
    -1
      src/codelens/codeLensProvider.ts

+ 14
- 1
src/codelens/codeLensProvider.ts Ver arquivo

@ -95,7 +95,7 @@ export class GitCodeLensProvider implements CodeLensProvider {
];
constructor(
context: ExtensionContext,
_context: ExtensionContext,
private readonly _git: GitService,
private readonly _tracker: DocumentTracker<GitDocumentState>,
) {}
@ -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);

Carregando…
Cancelar
Salvar