Skip to content

Commit

Permalink
Fix completion handler bug that causes language server to crash (#7401)
Browse files Browse the repository at this point in the history
filter out incorrect request, can be undone after issue # 7250 is resolved
  • Loading branch information
jordi1215 authored and dibarbet committed Jul 30, 2024
1 parent 5e5e7fa commit 81b6b6b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/razor/src/completion/completionHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<CompletionItem>(
Expand Down

0 comments on commit 81b6b6b

Please sign in to comment.