Comments (8)
First, you can check that lsp-zero's initial setup was executed. A global variable called loaded_lsp_zero
should exists. Execute this command.
:echo g:loaded_lsp_zero
That should print the value 1
.
Then you can check if the autocommand LspAttach
was created.
:autocmd LspAttach
To verify that the autocommand was executed in the current buffer you can check if the command LspZeroFormat
exists.
:command LspZeroFormat
from lsp-zero.nvim.
Thanks for the quick reply.
When checking if lsp-zero's initial setup was executed (via :echo g:loaded_lsp_zero
), it's undefined.
However, when running :LspInfo
right away, I see that 2 clients are attached to the buffer. Perhaps I'm missing something about how lsp-zero is initialised, (or how lsp servers are supposed to be initialised)
The next check :autocmd LspAttach
does return some result, though a bit empty perhaps.
The final suggestion does not yield any result.
Where should I go from here ?
For some more context, I don't use mason & mason-lspconfig. The neovim plugins are pre-installed directly via nixpkgs(using home manager), and the same thing with the language server binaries.
I can confirm that the server binaries are on the path, and I've had no issues so far with any other plugins, so I'm sort of trusting that the installations are not messed up somehow.
One more question, when I manually trigger the :LspRestart
, should I be expecting the "global" hook to be re-triggered as well, or is that only a one time thing per buffer ?
from lsp-zero.nvim.
The problem here is the initial setup of lsp-zero is not being executed. Neovim should execute this file automatically, but is not happening. You need the autocommand to exists so the "global hook" (and other features) can work.
The ideal solution to this would be figuring out why Neovim is skipping lsp-zero's plugin script, and then fix that.
The dirty hack that you can do to try to make it work is to load the module lsp-zero.setup
manually.
require('lsp-zero.setup')
local lsp_zero = require('lsp-zero')
----
--- the rest of your config goes here...
---
You can check the state of the setup using this command.
:lua = require('lsp-zero.setup')
It should print this.
{
done = true,
extend_plugins = <function 1>,
ok = true
}
If you don't get that output, something is wrong in the setup script or you are not using version 3 of lsp-zero.
from lsp-zero.nvim.
Thanks for the quick reply again.
I'll try your suggestions and follow up with the results. I'll also try to ensure that I'm running the 3.0 version of the plugin and see if it's still the case.
I'm on the road today, but will have some answers in a day or two. 🙌🏽
from lsp-zero.nvim.
I have a question:
The neovim plugins are pre-installed directly via nixpkgs(using home manager), and the same thing with the language server binaries.
Are you using this package from nixpkgs?
That is pinned to an old commit from the main branch. Versions in lsp-zero have their branch (I still push bug fixes to old versions).
Whoever packages lsp-zero for nixpkgs should update the commit hash to something in the v3.x
branch.
from lsp-zero.nvim.
Are you using this package from nixpkgs?
Yes, that's the one. But, I'll try to get the plugin installed from the 3.x branch today and hopefully all will start working well.
from lsp-zero.nvim.
I just installed the plugin directly from the 3.x branch (using flake inputs to build the vimplugin via nix), and I can now confirm that all the debugging checks above works. And the global hook on attach also runs, given the print statement finally being emitted.
I'll do some more test and report back if something's not working as expected. But, for the time being, I'll close this issue. I'll also try to send a PR to update the nixpkgs upstream to use the 3.x branch.
Thanks for all the help. 🙌🏽
from lsp-zero.nvim.
@VonHeikemen Could you chime in the discussion above and let the maintainers in nixpkgs officially know that 3.x
is the expected default branch to be packaged ?
from lsp-zero.nvim.
Related Issues (20)
- grey foldcolumn when after installing lsp-zero.nvim HOT 2
- Client 1 quit with exit code 1 and signal 15 HOT 4
- What if I don't find my LSP in MASON HOT 3
- Bug: Formatting resets some content of a file
- Cannot add laravel-dev-tools HOT 2
- Highlight symbol under cursor HOT 3
- ThePrimeagen Config doesn't ensure lua lsp install. HOT 6
- add file paths to tutorial examples HOT 9
- Diagnostic signs in Neovim v0.10.0 and `vim.diagnostic.config()` HOT 2
- suggestions overlap with each other HOT 3
- Add 'linewidth' parameter to 'formatting_options' HOT 2
- Bug: use_fallback = true causing single-repeat issues HOT 3
- autocomplete on tab HOT 1
- How to integrate conform.nvim with lsp-zero.nvim HOT 2
- Need help to load friendly-snippets HOT 1
- lsp_zero.cmp_format() hides important information for rust_analyzer HOT 2
- error installing gopls(same thing happend with hls) HOT 2
- error installing hls(haskell server) HOT 1
- Allow setting max width on vim.diagnostics
- Add docs or possible fix for Volar 2? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lsp-zero.nvim.