diff --git a/client/src/language/middlewareCompletion.ts b/client/src/language/middlewareCompletion.ts index 1f63bbbf..fa4d768a 100644 --- a/client/src/language/middlewareCompletion.ts +++ b/client/src/language/middlewareCompletion.ts @@ -11,7 +11,7 @@ import { getEmbeddedLanguageDocPosition } from './utils' export const middlewareProvideCompletion: CompletionMiddleware['provideCompletionItem'] = async (document, position, context, token, next) => { const embeddedLanguageDocInfos = await requestsManager.getEmbeddedLanguageDocInfos(document.uri.toString(), position) - if (embeddedLanguageDocInfos === undefined) { + if (embeddedLanguageDocInfos === undefined || embeddedLanguageDocInfos === null) { return await next(document, position, context, token) } const adjustedPosition = await getEmbeddedLanguageDocPosition(document, embeddedLanguageDocInfos, position) diff --git a/client/src/language/middlewareHover.ts b/client/src/language/middlewareHover.ts index ccb94ed9..51d21fe5 100644 --- a/client/src/language/middlewareHover.ts +++ b/client/src/language/middlewareHover.ts @@ -11,7 +11,7 @@ import { getEmbeddedLanguageDocPosition } from './utils' export const middlewareProvideHover: HoverMiddleware['provideHover'] = async (document, position, token, next) => { const embeddedLanguageDocInfos = await requestsManager.getEmbeddedLanguageDocInfos(document.uri.toString(), position) - if (embeddedLanguageDocInfos === undefined) { + if (embeddedLanguageDocInfos === undefined || embeddedLanguageDocInfos === null) { return await next(document, position, token) } const adjustedPosition = await getEmbeddedLanguageDocPosition(document, embeddedLanguageDocInfos, position) diff --git a/client/src/lib/src/types/requests.ts b/client/src/lib/src/types/requests.ts index 8c5f39ce..731de414 100644 --- a/client/src/lib/src/types/requests.ts +++ b/client/src/lib/src/types/requests.ts @@ -19,7 +19,7 @@ export interface RequestParams { } export interface RequestResult { - [RequestType.EmbeddedLanguageDocInfos]: Promise + [RequestType.EmbeddedLanguageDocInfos]: Promise // for unknown reasons, the client receives null instead of undefined } interface RequestEmbeddedLanguageDocInfosParams {