From d2ee9b05a5b9c2c00f387bda79a4cc995c97bb4f Mon Sep 17 00:00:00 2001 From: phil294 Date: Wed, 25 May 2022 02:52:12 +0200 Subject: [PATCH] fix server crash in case of jsdoc-only/-intern errors --- server/src/modes/script/javascript.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/modes/script/javascript.ts b/server/src/modes/script/javascript.ts index f841c495..388215a4 100644 --- a/server/src/modes/script/javascript.ts +++ b/server/src/modes/script/javascript.ts @@ -1008,8 +1008,8 @@ export function languageServiceIncludesFile(ls: ts.LanguageService, documentUri: } function convertRange(document: TextDocument, span: ts.TextSpan): Range { - const startPosition = document.positionAt(span.start); - const endPosition = document.positionAt(span.start + span.length); + const startPosition = document.positionAt(span.start || 0); + const endPosition = document.positionAt((span.start + span.length) || 0); return Range.create(startPosition, endPosition); }