neoclide / coc-html

Html language server extension for coc.nvim.
208 stars 6 forks source link

Unhandled method html/tag #47

Closed clay-coffman closed 2 years ago

clay-coffman commented 2 years ago

Hey guys, sorry if this is a dumb question but I can't for the life of me figure out what is causing me to get this error. I get this error as soon as I attempt to close a tag. Here is my :CocInfo output


2021-12-31T14:01:58.324 INFO (pid:5959) [attach] - receive notification: highlight []
2021-12-31T14:02:01.184 INFO (pid:5959) [services] - registered service "html"
2021-12-31T14:02:01.185 INFO (pid:5959) [services] - HTML language server state change: stopped => starting
2021-12-31T14:02:01.485 INFO (pid:5959) [services] - HTML language server state change: starting => running
2021-12-31T14:02:01.492 INFO (pid:5959) [services] - service html started
2021-12-31T14:02:03.305 INFO (pid:5959) [attach] - Request action: doKeymap [ 'iPA==0' ]
2021-12-31T14:02:03.308 WARN (pid:5959) [handler-format] - Format on type provider not found for buffer: file:///Users/claycoffman/Dev/personal/learning/html/test.html
2021-12-31T14:02:03.329 INFO (pid:5959) [completion-complete] - Results from: html
2021-12-31T14:02:04.182 INFO (pid:5959) [attach] - receive notification: stopCompletion []
2021-12-31T14:02:04.183 INFO (pid:5959) [attach] - Request action: doKeymap [ 'iPg==0' ]
2021-12-31T14:02:04.185 WARN (pid:5959) [handler-format] - Format on type provider not found for buffer: file:///Users/claycoffman/Dev/personal/learning/html/test.html
2021-12-31T14:02:04.491 ERROR (pid:5959) [server] - unhandledRejection  Promise {
  <rejected> mg [Error]: Unhandled method html/tag
      at Kl (/Users/claycoffman/.local/share/nvim/plugged/coc.nvim/build/index.js:37:224)
      at tm (/Users/claycoffman/.local/share/nvim/plugged/coc.nvim/build/index.js:36:11261)
      at Immediate.<anonymous> (/Users/claycoffman/.local/share/nvim/plugged/coc.nvim/build/index.js:36:11111)
      at processImmediate (internal/timers.js:464:21) {
    code: -32601,
    data: undefined
  }
} mg [Error]: Unhandled method html/tag
    at Kl (/Users/claycoffman/.local/share/nvim/plugged/coc.nvim/build/index.js:37:224)
    at tm (/Users/claycoffman/.local/share/nvim/plugged/coc.nvim/build/index.js:36:11261)
    at Immediate.<anonymous> (/Users/claycoffman/.local/share/nvim/plugged/coc.nvim/build/index.js:36:11111)
    at processImmediate (internal/timers.js:464:21) {
  code: -32601,
  data: undefined
}```
fannheyward commented 2 years ago

get this error as soon as I attempt to close a tag

Can you give the steps for this? I tested with coc-html to close tags, can't reproduce this.

ZacharyRizer commented 2 years ago

I am also having this issue. If I write any html tag (div, p, span, etc) once I add the closing angled bracket '>' this error shows. Keys to cause this error: <div>

Screen Shot 2022-01-05 at 10 15 49 AM

This is my Coc Config inside init.nvim

Screen Shot 2022-01-05 at 10 17 46 AM

And the coc.settings.json Screen Shot 2022-01-05 at 10 21 29 AM

SlysDev commented 2 years ago

I reinstalled coc-html with :CocInstall coc-html, that worked for me. It seems like the installation was either outdated, corrupted, or not installed in the first place. Hope this helps!

ZacharyRizer commented 2 years ago

@SlysDev unfortunately this did not fix the issue for me. Same thing still occurs.

SlysDev commented 2 years ago

@SlysDev unfortunately this did not fix the issue for me. Same thing still occurs.

Did you try reinstalling coc.nvim entirely? Or running :CocFix?

ZacharyRizer commented 2 years ago

I did, still same issue.

yaegassy commented 2 years ago

This problem occurs when html.autoClosingTags is set to true.

The reason is probably that html/tag is no longer present in the latest version (v4.2 later?) of vscode-html-languageservice or html-language-features.

It looks like we need to implement autoInsertion.ts in coc-html instead. https://github.com/microsoft/vscode/blob/main/extensions/html-language-features/client/src/autoInsertion.ts

At the moment, set html.autoClosingTags to false.

{
  "html.autoClosingTags": false,
}
chemzqm commented 2 years ago

Fixed, unfortunately tag closing like <span>| won't work any more, should be server issue.

chemzqm commented 2 years ago

Fixed javascript validation and tag closing not work 51dadf2