Skip to content

Commit

Permalink
Fix missing didChange Event in semantic token provider
Browse files Browse the repository at this point in the history
  • Loading branch information
CGNonofr committed Dec 21, 2021
1 parent 24e8220 commit b67dffc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions client/src/monaco-languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ export class MonacoLanguages implements Languages {
getLegend() {
return legend;
},
onDidChange: provider.onDidChange,
provideDocumentSemanticTokens: async (model, lastResultId, token) => {
if (!this.matchModel(selector, MonacoModelIdentifier.fromModel(model))) {
return undefined;
Expand Down
1 change: 1 addition & 0 deletions client/src/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ export interface SelectionRangeProvider {
}

export interface DocumentSemanticTokensProvider {
onDidChange?: Event<void>;
provideDocumentSemanticTokens(params: SemanticTokensParams, token: CancellationToken): ProviderResult<SemanticTokens>;
provideDocumentSemanticTokensEdits?(params: SemanticTokensDeltaParams, token: CancellationToken): ProviderResult<SemanticTokens | SemanticTokensEdit>;
}
Expand Down
1 change: 1 addition & 0 deletions client/src/vscode-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ export function createVSCodeApi(servicesProvider: Services.Provider): typeof vsc
}

return languages.registerDocumentSemanticTokensProvider(selector, {
onDidChange: provider.onDidChangeSemanticTokens,
provideDocumentSemanticTokens({ textDocument }, token) {
return provider.provideDocumentSemanticTokens(<any>textDocument, token) as any;
},
Expand Down

0 comments on commit b67dffc

Please sign in to comment.