From 5a9d90303314404d135a512d8b6b2e0b805c8290 Mon Sep 17 00:00:00 2001 From: nima-dvlp <73692252+nima-dvlp@users.noreply.github.com> Date: Fri, 24 Jun 2022 12:16:34 +0430 Subject: [PATCH] prevent `html/tag` request on non-svelte file! Requesting `html/tag` on non-svelete/html file causes #55 --- src/extension.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/extension.ts b/src/extension.ts index 00cfbc7..54d6073 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -77,6 +77,13 @@ export function activate(context: ExtensionContext) { ls.onReady().then(() => { const tagRequestor = (document: TextDocument, position: Position) => { + if (!['svelte', 'html'].includes(document.uri.split('.').at(-1))) { + //console.log( + // 'tagRequestor rejected on no svelte file!', + // document.uri.split('.').at(-1), + //); + return; + } const param: TextDocumentPositionParams = { textDocument: { uri: document.uri }, position,