Skip to content

Commit

Permalink
Temp fix for completions being empty on trigger char
Browse files Browse the repository at this point in the history
  • Loading branch information
tareqimbasher committed Nov 20, 2023
1 parent 22fbc18 commit b55272e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ export class OmniSharpCompletionProvider extends FeatureProvider implements ICom

const scriptId = EditorUtil.getScriptId(model);

const omnisharpCompletions = await this.omnisharpService.getCompletion(scriptId, request, this.getAbortSignal(token));
let omnisharpCompletions = await this.omnisharpService.getCompletion(scriptId, request, this.getAbortSignal(token));

if (ctx.triggerKind !== languages.CompletionTriggerKind.Invoke && (!omnisharpCompletions || !omnisharpCompletions.items.length)) {
omnisharpCompletions = await this.omnisharpService.getCompletion(scriptId, request, this.getAbortSignal(token));
}

if (token.isCancellationRequested || !omnisharpCompletions || !omnisharpCompletions.items) {
return new CompletionResults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ export class OmniSharpSemanticTokensProvider extends FeatureProvider implements

const response = await this.omnisharpService.getSemanticHighlights(scriptId, request, this.getAbortSignal(token));

if (model.isDisposed()) { // Can happen if model (ie. script tab) is closed before the response is returned
return null;
}

const versionAfterRequest = model.getVersionId();

if (versionBeforeRequest !== versionAfterRequest) {
Expand Down

0 comments on commit b55272e

Please sign in to comment.