From 81b6b6b815cbb885b54424c5399d015d0f08ef29 Mon Sep 17 00:00:00 2001 From: Jordi Ramos Date: Mon, 29 Jul 2024 15:09:14 -0700 Subject: [PATCH] Fix completion handler bug that causes language server to crash (#7401) filter out incorrect request, can be undone after issue # 7250 is resolved --- src/razor/src/completion/completionHandler.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/razor/src/completion/completionHandler.ts b/src/razor/src/completion/completionHandler.ts index bf45e7a8f..1ca47a316 100644 --- a/src/razor/src/completion/completionHandler.ts +++ b/src/razor/src/completion/completionHandler.ts @@ -156,7 +156,10 @@ export class CompletionHandler { // TODO: Snippet support try { - if (delegatedCompletionItemResolveParams.originatingKind != LanguageKind.CSharp) { + if ( + delegatedCompletionItemResolveParams.originatingKind != LanguageKind.CSharp || + delegatedCompletionItemResolveParams.completionItem.data.TextDocument == null + ) { return delegatedCompletionItemResolveParams.completionItem; } else { const newItem = await vscode.commands.executeCommand(