Skip to content

Commit

Permalink
Fix getDocumenSymbol before didOpen. (#7104)
Browse files Browse the repository at this point in the history
  • Loading branch information
sean-mcmanus authored Mar 4, 2021
1 parent 9b290c5 commit d2cb685
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import * as vscode from 'vscode';
import { DefaultClient, LocalizeDocumentSymbol, GetDocumentSymbolRequestParams, GetDocumentSymbolRequest } from '../client';
import * as util from '../../common';
import { processDelayedDidOpen } from '../extension';

export class DocumentSymbolProvider implements vscode.DocumentSymbolProvider {
private client: DefaultClient;
Expand All @@ -26,6 +27,9 @@ export class DocumentSymbolProvider implements vscode.DocumentSymbolProvider {
return documentSymbols;
}
public async provideDocumentSymbols(document: vscode.TextDocument): Promise<vscode.SymbolInformation[] | vscode.DocumentSymbol[]> {
if (!this.client.TrackedDocuments.has(document)) {
processDelayedDidOpen(document);
}
return this.client.requestWhenReady(() => {
const params: GetDocumentSymbolRequestParams = {
uri: document.uri.toString()
Expand Down

0 comments on commit d2cb685

Please sign in to comment.