Commit 81f270a
Fix highlight errors when lsp crash or stop (#864)
* Fix highlight errors when lsp crash or stop
It adds a check wether the client is still available before
highlighting.
If the client is not there anymore it returns `true` to unregister the
autocommand
This fix the
`method textDocument/documentHighlight is not supported by any of the servers registered for the current buffer`
errors when doing a LspRestart or the server crashes
* Delete the highlight autocommands in the LspDetatch event
* Only delete autocmds for the current buffer with the group name
* Simplify clearing the autocommands
---------
Co-authored-by: Francis Belanger <[email protected]>1 parent f92fb11 commit 81f270a
1 file changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| 517 | + | |
517 | 518 | | |
518 | 519 | | |
| 520 | + | |
519 | 521 | | |
520 | 522 | | |
521 | 523 | | |
522 | 524 | | |
523 | 525 | | |
| 526 | + | |
524 | 527 | | |
525 | 528 | | |
526 | 529 | | |
| |||
537 | 540 | | |
538 | 541 | | |
539 | 542 | | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
540 | 551 | | |
541 | 552 | | |
542 | 553 | | |
| |||
0 commit comments