Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switching between Svelte files and other file types lead to an annoying error #55

Open
nima-dvlp opened this issue Jun 24, 2022 · 1 comment

Comments

@nima-dvlp
Copy link

nima-dvlp commented Jun 24, 2022

Description

Trying to type / or > on any file type except for the Svelte files, leads to this error at the bottom of the screen :

[coc.nvim]: UnhandledRejection: Request html/tag failed with message: Cannot call methods on an unopened document
Error: Request html/tag failed with message: Cannot call methods on an unopened document
    at gu (/home/nima/.local/share/nvim/plugged/coc.nvim/build/index.js:38:224)
    at bp (/home/nima/.local/share/nvim/plugged/coc.nvim/build/index.js:37:11261)
    at Immediate.<anonymous> (/home/nima/.local/share/nvim/plugged/coc.nvim/build/index.js:37:11111)
    at processImmediate (node:internal/timers:466:21)

How to reproduce :

Open a svelte file(activate Svelte LSP), open another file type(ts, js, json, anything except svelte), then try to issue / or > in insert mode, this error hits, and it's so destructive!

What it is

I think this is how you try to handle closing tags like below:

<SvelteComponent>    </
<!--                  ^ here / issued -->

Why there is an html/tag request for other filetypes than Svelte or HTML?

nima-dvlp added a commit to nima-dvlp/coc-svelte that referenced this issue Jun 24, 2022
Requesting `html/tag` on non-svelete/html file causes coc-extensions#55
@freddyshim
Copy link

I'm experiencing the same issue and it's very annoying. Can we get this fix merged to master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants