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

fix: check workspace after client initial #2356

Merged
merged 9 commits into from
Dec 26, 2022
Merged

fix: check workspace after client initial #2356

merged 9 commits into from
Dec 26, 2022

Conversation

glepnir
Copy link
Member

@glepnir glepnir commented Dec 25, 2022

Problem

logic bug

Solution

rewrite

Fix #2355

@glepnir glepnir changed the title fix: some server need restart fix: check workspace after client initial Dec 26, 2022
@folke
Copy link
Member

folke commented Dec 26, 2022

Can confirm that the lastest commits here fix #2355!

@glepnir
Copy link
Member Author

glepnir commented Dec 26, 2022

hmmm wired . there has something I don't know , as the sumneko's wiki said there need restart server after insert workspace. I just send the didChangeworkspacefolders request to it . if server need restart that mean client.stop then
start new client ? this will spawn a new process with new pid, we don't have client.restart function, use new config start or use config with attached_buffers and workspace_folders data from before client ? I don't know here how the sumeko lua-language-server work..

https://github.com/sumneko/lua-language-server/wiki/Developing#multiple-workspace-support

@folke
Copy link
Member

folke commented Dec 26, 2022

Looking at the sumneko code, it does actually support dyanmically changing the workspace folders, but before this PR, diagnostics for the current buffer would be wrong. Haven't checked your PR here, but the incorrect diagnostics now no longer show up.

@folke
Copy link
Member

folke commented Dec 26, 2022

Should I re-open that linked sumneko issue?

@glepnir
Copy link
Member Author

glepnir commented Dec 26, 2022

it does actually support dyanmically changing the workspace folders

don't look at the sumneko code .if it support maybe wiki is old.

but the incorrect diagnostics now no longer show up.

Just to make sure this PR solves the actual problem. I will wait for you to use it for a while. If it doesn't have any problems anymore I will merge.

Should I re-open that linked sumneko issue?

maybe not. we don't have any handlers for request workspace/diagnostic? / * in core and I also don't see them in lsp-mode lsp-bridge vim-lsp yegappan/lsp .. as lsp spec said this is useful. don't know why there.

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_diagnostic

@folke
Copy link
Member

folke commented Dec 26, 2022

Oh right. I actually implemented the workspace/diagnostic/refresh handler in my config. Still need to upstream that to core. Or maybe that's already in core in the meantime. Need to check.

@glepnir
Copy link
Member Author

glepnir commented Dec 26, 2022

there has something to do in core diagnostic , I only have a rough idea of how workspace/diagnostic works, but it will take some trying when i have time .

@glepnir
Copy link
Member Author

glepnir commented Dec 26, 2022

now confirm right ?

@folke
Copy link
Member

folke commented Dec 26, 2022

I've done more testing and this PR seems to fix the issues I had with diagnostics.

@glepnir
Copy link
Member Author

glepnir commented Dec 26, 2022

thanks for your kind reply.

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

Successfully merging this pull request may close these issues.

b0bd429 breaks sumneko_lua
2 participants