Pārlūkot izejas kodu

Adds "container" support to markdown files

main
Eric Amodio pirms 4 gadiem
vecāks
revīzija
d4bf43bc3e
1 mainītis faili ar 14 papildinājumiem un 1 dzēšanām
  1. +14
    -1
      src/codelens/codeLensProvider.ts

+ 14
- 1
src/codelens/codeLensProvider.ts Parādīt failu

@ -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);

Notiek ielāde…
Atcelt
Saglabāt