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

Strange behaviour when calling LSPStop in neovim #139

Open
dehanj opened this issue Sep 5, 2024 · 6 comments
Open

Strange behaviour when calling LSPStop in neovim #139

dehanj opened this issue Sep 5, 2024 · 6 comments

Comments

@dehanj
Copy link

dehanj commented Sep 5, 2024

Hi,

When i try to stop the harper-ls using LSPStop, the diagnostic hints stays in the buffer with the swirly lines under the words.
It seems as the ls has actually stopped because the Code Action is not available anymore. If I try to start harper-ls again, it does not seem to change anything. No Code action available, but the diagnostics with swirly lines is still there.

It seems isolated to harper-ls, I can toggle other ls just fine.

Not sure if this is a bug or something I'm missing.

I run NVIM v0.10.1.
I have installed harper-ls through Mason:

    ◍ harper-ls harper_ls
      The Grammar Checker for Developers.

      installed version v0.10.0                                                                         
      homepage          https://github.com/elijah-potter/harper                                         
      languages         Markdown, Rust, TypeScript, JavaScript, Python, Go, C, C++, Ruby, C#, TOML, Lua 
      categories        LSP                                                                             
      executables       harper-ls                                                                       

In the lsp.log I do see these entries:

[ERROR][2024-09-05 09:25:09] .../vim/lsp/rpc.lua:770	"rpc"	"/Users/dh/.local/share/nvim/mason/bin/harper-ls"	"stderr"	"\27[2m2024-09-05T07:25:09.954766Z\27[0m \27[32m INFO\27[0m \27[2mtower_lsp::service::layers\27[0m\27[2m:\27[0m exit notification received, stopping\n"
[ERROR][2024-09-05 09:27:15] .../vim/lsp/rpc.lua:770	"rpc"	"/Users/dh/.local/share/nvim/mason/bin/harper-ls"	"stderr"	"\27[2m2024-09-05T07:27:15.166087Z\27[0m \27[31mERROR\27[0m \27[2mtower_lsp::transport\27[0m\27[2m:\27[0m language server has exited\n"

I cannot find any entries in the lsp.log about starting harper_ls, not even after calling LSPStart harper-ls

Let me know if some more info is needed.
Any help would be appreciated.

@piersolenski
Copy link

Having this issue too!

@dehanj dehanj changed the title Strange behavoiur when calling LSPStop in neovim Strange behaviour when calling LSPStop in neovim Sep 9, 2024
@adam-coates
Copy link

Also same here, and :Lsprestart won't restart harper-ls.
This might also be related, but when I use a user defined dictionary (e.g. nvim's native dictionary vim.fn.stdpath("config") .. "/spell/en.utf-8.add") and then add a new word to the dictionary, then harper-ls still flags this word as misspelled, unless I close and reopen the nvim buffer.

@jfly
Copy link
Contributor

jfly commented Oct 25, 2024

This seems to be an issue with the underlying tower-lsp crate:

One LSP server has implemented a workaround for this in denoland/deno#21251, but it would sure be preferable if things were just fixed in tower-lsp.

Edit: I've put together a PR to tower-lsp here: ebkalderon/tower-lsp#428, and confirmed that this solves this issue. If you want to try it out, you can try my harper fork here: https://github.com/jfly/harper/tree/actually-exit.

jfly added a commit to jfly/harper that referenced this issue Oct 25, 2024
jfly added a commit to jfly/harper that referenced this issue Oct 26, 2024
@elijah-potter
Copy link
Owner

elijah-potter commented Oct 27, 2024

Oh wow. @jfly that's fantastic. While it would be great if you're PR was merged into tower-lsp, it doesn't look like the maintainer is still working on it. If we don't see your PR merged in the next week or so, a separately maintained fork might be necessary.

@jfly
Copy link
Contributor

jfly commented Oct 27, 2024

Emphasis mine:

it would be great if you're PR was merged into tower-lsp

#225 ;) (sorry! this is meant as a joke)

it doesn't look like the maintainer is still working on it

Yeah, things seem pretty dead upstream, and the code in master doesn't even compile 😢

a separately maintained fork might be necessary

If you want to wait and see before forking, an alternative would be to implement some version of the workaround deno did: denoland/deno#21251. (I personally would prefer that you use a fork with my change, though)

jfly added a commit to jfly/harper that referenced this issue Oct 27, 2024
@SylvanFranklin
Copy link

Hullo! Sorry about now finding this issue before posting mine. Thanks @jfly for working on this! Unfortunate about the inactivity around Tower, seems like it could use a new head maintainer.

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

6 participants