Comments (8)
One benefit (and design requirement) of vim.treesitter.language.add
is that it can be called from multiple sources. I think that requirement should apply to LSP too, i.e. servers can be specified in multiple sources: config, plugins, etc.
from neovim.
Just to throw in another idea.
I've been debugging some LSP stuff and wondering whether something like this would also be useful:
vim.lsp.log.set_level(vim.lsp.log.levels.DEBUG)
-- vim.lsp.log.set_format_func(vim.inspect)
api.nvim_create_user_command('LspLog', function()
local log_path = vim.lsp.get_log_path()
vim.cmd.split(log_path)
end, {})
Something like this could reduce friction with LSP issues, since atm, getting the log file is rather tedious, and can quickly solve certain kinds of issues. Just an idea. A similar treesitter analogue is :InspectTree
.
With that said, the LSP logging does need some improvements because currently the log is shared between all servers and nvim sessions and grows indefinitely unless it is manually cleared.
from neovim.
Nvim core would need the concept of "registering" or "managing" a client without it being started. For example, a
vim.lsp.register
API that makes Nvim aware of a client configuration without actually starting it.
Do we only need a way to "define" clients and add them to a list, or is there more involved (such as lifecycle, cleanup, ... which is the usual unpleasantness implied by a "registry")? Maybe vim.lsp.add_client()
or vim.lsp.def_client()
could be the name. Or vim.lsp.config()
from neovim.
+1, but I would prefer we add :Lsp
with stop
, restart
and info
sub-commands.
Ah sorry, didn't read OP fully, that's what you are already proposing.
from neovim.
Nvim core would need the concept of "registering" or "managing" a client without it being started. For example, a vim.lsp.register API that makes Nvim aware of a client configuration without actually starting it. This same functionality would be needed for :LspStart as well, if we want to include that.
Note we already have vim.treesitter.language.register/add
which serves a similar purpose, would be nice if we could mirror that, or have them align.
from neovim.
we already have
vim.treesitter.language.register/add
which serves a similar purpose, would be nice if we could mirror that, or have them align.
Definitely. gpanders mentioned vim.lsp.config
, I wonder if that can be the interface for "defining a client". See also #24054
from neovim.
We definitely want to support "language server plugins" as a first-class use case here (not for every server, mind you, but for those that require more work to set up or have custom commands that are out of scope for core).
from neovim.
Something like this could reduce friction with LSP issues, since atm, getting the log file is rather tedious
Not opposed to it, but just to point this out: :checkh lsp
prints the path to the log file and you can use gf
or <C-W>f
on that to open it. It's admittedly not the most straightforward, but it's not too bad in a pinch.
from neovim.
Related Issues (20)
- nvim__redraw causes some visible screen tearing HOT 4
- Use `sccache` for build process if avalible HOT 4
- quickfix: incremental search/replace (substitution) HOT 1
- `get_node_text()` behaves differently between buffer and string sources on EOL char
- crash when adjusting vertical split size with mouse with smoothscroll + number
- `json_encode()` assert false on c0 or c1 utf-8 chars HOT 1
- search function HOT 3
- User guide usr_01.txt has links to invalid/outdated URL? HOT 1
- Setting foldmethod and foldexpr to treesitter affect terminal buffer HOT 1
- `E490: no fold found` with tree-sitter HOT 8
- Transposed xcalloc arguments
- Viewport/scroll position not remembered on buffer :bn/:bp switch HOT 1
- Incorrect documentation of optional feature example (conceal) in usr_02.txt
- default colorscheme overrides terminal colors for :Man HOT 3
- Incorrect type annotation for vim.lsp.buf_request_sync HOT 1
- `nvim_buf_get_text()` segfault with large negative column HOT 1
- Press ESC once to exit insert mode, cursor display issue HOT 6
- Problem with the βenterβ key in alacritty terminal HOT 1
- Some emojis aren't rendered with recent Kitty versions HOT 1
- Setting a float value in a table in a table using `vim.api.nvim_win_set_var` results in the inner table have values as a table with `true` and `false` as the indexes HOT 3
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 neovim.