hrsh7th / vim-lamp

💡Language Server Protocol client for Vim.
MIT License
32 stars 0 forks source link

The ability to reload diagnostic #23

Closed Shatur closed 4 years ago

Shatur commented 4 years ago

Sometimes diagnostics are not properly updated. It would be nice to have the ability to trigger diagnostics update manually. Is it possible to implement?

hrsh7th commented 4 years ago

I found the critical bug...

Shatur commented 4 years ago

Okay, I will try without any plugins.

Tested call lamp#config('experimental.did_change_on_focus', v:true) , still not works :(

Shatur commented 4 years ago

I think that LSP implementation in Vimscript is hard and such thing should be native. I tested a lot of lsp plugins and your seems the best to me because of speed. But now native implementation becomes usable with completion-nvim and diagnostics-nvim, I will switch to it for now for daily use. I suggest to check it out :) But feel free to request to test something with vim-lamp.

hrsh7th commented 4 years ago

Please forgive my lack of strength.

Thank you for interested to vim-lamp.

My plugin's supports vim and nvim both. But I wondering to drop vim support is good for now...the reason is that we should use lua maybe...

Shatur commented 4 years ago

No need to apologize, you did an awesome job! Switching to lua sounds as a good idea as for me. But Neovim will have native LSP implementation. It very flexible and fast. Maybe it would be better to use it?

hrsh7th commented 4 years ago

I'm using multiple language server for one filetype every day but native lsp does not support it in my knowledge.

I planning to create completion plugin in lua.

Shatur commented 4 years ago

I'm using multiple language server for one filetype every day but native lsp does not support it in my knowledge.

Interesting :) Why do you need several language servers?

I planning to create completion plugin in lua.

You will discontinue compete or just rewrite it? Curretnly compete is very good, I tested completion-nvim but it lacks some features. I thought to request native LSP completion source for compete (if this is possible). But implementation in lua can be much faster, you are right.

hrsh7th commented 4 years ago

For example, Editing typescript, Probably we choose typescript-language-server but I want to use prettier for formatting.

In this case, we use typescript-language-server and diagnostic-languageserver or efm-langserver both.

Another case, Editing Vim script, we choose vim-language-server but I want to use vint for linting.

I love compete's behavior and implementation but I do not satisfied with its performance. So I planning to improve with lua.

I'm considering whether to modify or scratch.

Shatur commented 4 years ago

Did not know about such case. Interesting. I using vint manually for now :(

It would be awesome :)

hrsh7th commented 4 years ago

When using vint with diagnostic-languageserver, we will get vint diagnostics on realtime :)

Shatur commented 4 years ago

Sounds awesome. I hope such ability will be added to the native LSP plugin.

I followed you on github, to track updates about compete rewriting.

hrsh7th commented 4 years ago

We can reload diagnostics by BufWritePost.

Shatur commented 4 years ago

Thanks, did not know :) But diff problem still exists?

hrsh7th commented 4 years ago

Probably the diff problem was solved (I have some internal improvement point for it but it does not problem for now).

Shatur commented 4 years ago

I tested the latest commit and the diff problem looks solved!

But :doautocmd BufWritePost not reload diagnostics :( asciicast

I have another idea to solve it. What if just improve diagnostics? I used diagnostics-nvim which adds some nice collbacks for native LSP. The idea is hide annoying inline diagnostics and just display a sign. And user will can show it manually. This also better for multiline errors (very common in C++). Is it possible to implement such diagnostics in this plugin? This is how VSCode works and it will remove the need for a manual reset of the diagnostic since does not interfere.

Shatur commented 4 years ago

Example: изображение

Shatur commented 4 years ago

@hrsh7th, I see that make diagnostics look in this way. Thank you a lot! Looks very nice.

hrsh7th commented 4 years ago

Thank you for request it.

I was thinking to implement it but dosen't because bit troublesome.

The diagnostics visualization is hard thing so I want to your feedback.