Skip to content

Commit

Permalink
prevent html/tag request on non-svelte file!
Browse files Browse the repository at this point in the history
Requesting `html/tag` on non-svelete/html file causes coc-extensions#55
  • Loading branch information
nima-dvlp authored Jun 24, 2022
1 parent 7dda985 commit 5a9d903
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5a9d903

Please # to comment.