In my experience, the built in LSP is a mixed bag. Getting language servers configured is a breeze, diagnostics and go-to definition work just fine. But trying to get autocomplete and snippets to work is an exercise in frustration. There's a handful of different hobbyist implementations which are all somewhat-maintained and somewhat work together but it's buggy and you end up needing to do 20x the effort of using VS code to get not quite the same ease of use.
I really hope they'll do some official work on lua-based solutions for autocomplete and code snippets in the future to really round out the LSP support, if that's something that they want to highlight as a feature of neovim. I still think VS code is the way to go if you want LSP features, but 0.5 is a terrific step forward and everyone who worked on it should be very proud.
Agreed. It took me half a day and I came not remotely to the UX and performance of coc.vim. Most incl. the nvim team are not aware that eg. tsserver is the fastest and most responsive code formatter for TS (yes, it goes beyond the LSP spec but that's how it is, also for historical reasons). Prettier does not come close.
Maybe they've never tried or deliberately ignore coc.vim for whatever reason. coc.vim works almost out of the box, has the fastest and most pragmatic maintainer who helps anyone and tsserver makes it as good and as fast as VS Code. Instead of just cloning coc.vim's tsserver implementation—or why do they no contribute to coc.vim??—roll their own inferior solution, years later. It's not that nvim's LSP implementation is at its beginning and we can expect more is coming, no the maintainers just do not know or ignore the status quo. Feels very much like Bram a decade ago.
Hi, I'm a maintainer. I think this is a huge mischaracterization of the team. We definitely are aware (and inform users) the current state using the theia wrapper lags coc.nvim and vscode. We've never said anything disparaging about coc.nvim, and the built-in client is still seeing rapid development.
On a different note, we have made upstream requests to MS, worked with language server authors, and generally try to contribute positively to the language server ecosystem. Neovim users will always be free to use coc.
If you have actionable items for improving the client, please reach out on our discourse or on our matrix channel. Thanks!
I didn't have issues with compe until I started using snippets, at which point I needed to manually modify the lua code that they provide for you (to own and maintain yourself) for tab completion. I had to spend a fair amount of time getting the right compe - snippet provider setup that would populate correctly.
Once I added snippets and modified the completion code, the ability to hit "Enter" to select an autocompletion selection broke and I couldn't manage to fix it without preventing the key from entering a newline in insert mode. I ended up just remapping it to a new key. But even then, it's still a little quirky- if I type some text and hit tab expecting to add some spacing, I'd instead get prompted for autocomplete suggestions I wasn't looking for.
I get that all this is fun for some people, but I just want sane defaults that work like VS code.
I have a question. Once you hit the tab and get a list of completion items through either completion-nvim or nvim-compe, how do you further narrow down the list? All I can do is cycle through items or match by prefix, but I want further narrowing by matching substring/regex/flex anywhere in the items à la Ivy/Helm from Emacs (or any of the so many completion systems available in Emacs).
Yeah coc.nvim is a much better experience in my usage. I want to love the native LSP, but the hodgepodge of in-progress or abandoned completion, suggestion, signature, diagnostic, etc. UI is a big pain point right now.
For example I have to install 3 different plugins to get all the LSP UI so it means I have 3 different opinions on how various parts of its UI should look and it's a real mess--the popups for suggestions as I type are totally different looking compared to the popups to show function signatures (and each has their own bespoke way of being configured).
Which UI plugins do you need? We've done a lot of work leading up to 0.5 in improving the built-in handlers, so you shouldn't need a UI plugin. I think the main plugins people install (in addition to lspconfig):
* nvim-compe (autocompletion)
* vim-vsnip (snippets)
* lsp_signature.nvim (automatically pop up signature window, note signature_help is built-into core, just manually triggered)
Some people use lspsaga.nvim, but borders are already merged into the core handlers (and our floating windows now provide better markdown styling than lspsaga), so the main utility of lspsaga is in the different way of interacting with code actions, which I personally do not prefer.
Anyways, please open an issue or PR if you have concrete suggestions (or start a discussion on our discourse)! I'm personally very invested in improving the UX around the built-in language server client, and it has really improved leading up to the 0.5 release.
I tried nvim-compe, but it explicitly doesn't support signatures (see https://github.com/hrsh7th/nvim-compe#does-not-work-function... ). So I installed the recommended lsp_signature.nvim and it's a bit of a mess. The UI for lsp_signature has enormous borders and doesn't match at all with the rest of compe.
Perhaps there are ways to tweak lsp_signature UI... but at this point, I chucked it all and went back to coc.nvim which does it all (suggestions, signatures, etc.) all with the same UI.
Make it like that--make it work with all UI out of the box and not make me dig through tons of plugins. That's my honest suggestion. Sorry I'm not joining a discord, etc. to give this feedback.
I understand the frustration (making neovim more cohesive is definitely a goal). It sounds like coc provides the UI you are used to, so there's no harm in sticking with that!
Many of our users explicitly don't want automatically called functions that would slow down the editor (autocommands that map signature requests to the language server, for example), so by nature neovim's core implementation is extremely conservative.
One thing I would like to do, is make the automatic pop-ups for signature easier to implement with our current handler, which means a plugin like signature-x could use our upcoming lsp.config option to configure it's borders (https://github.com/neovim/neovim/pull/14681), and match the rest of the UI.
I also have another project I was working on before the 0.5 stabilization phase (https://github.com/mjlbach/neovim-ui). The goal with this is to have composable/overridable UI elements built into core (which we would use for our internal lsp functions), that can be used (or overridden) by UI plugins.
In summary, I think the likelihood of autocompletion (and generally auto-anything) being built-into core is very small, but providing the APIs in neovim core to make snippets - autocompletion - automated UI elements easier for plugin authors is a high priority.
If we're just spitballing thoughts, I'd like something that's kind of the opposite of zen mode. I don't always want signatures and completions and things binging and bopping and showing me suggestions--if I'm working on a codebase and language I'm fluent in then all of that gets turned off. But if I have to pick up some under-documented massive codebase where everyone just uses VS code/intellisense--I'm going to need all the suggestions.
So IMHO I'd love effectively a dial, perhaps the 'distractions' dial. It's not a binary on/off, it's a spectrum. It could be off--nothing at all distracts me (zen mode basically). It might be on a little bit--perhaps just showing current stuff LSP does by default, errors, etc. And it might get cranked up to max--every keystroke throwing more information at me about what's happening, what am I editing, what's related to it, etc. During an editing session I might move inbetween each level on the distraction dial many times. Kind of like zooming in and out as you're editing a photo.
That's an interesting idea! It's for sure possible, it would just take some conditionals/functions to reset diagnostics in your init.vim/init.lua. I personally turn off virtual_text in my private config. I think our current APIs already facilitate this, so I'm happy to answer questions on our discourse or on matrix about how users can do this.
The only thing that pops up by default right now is diagnostics.
I really hope they'll do some official work on lua-based solutions for autocomplete and code snippets in the future to really round out the LSP support, if that's something that they want to highlight as a feature of neovim. I still think VS code is the way to go if you want LSP features, but 0.5 is a terrific step forward and everyone who worked on it should be very proud.