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)
- vim.loader luac cache file names gets too long on ecryptfs HOT 2
- cmdheight=0: NULL dereference in grid_del_lines() HOT 5
- nvim ... --remote-expr execute("tabs") does not work anymore HOT 6
- Error while showing diagnostics open_float HOT 3
- "Unhandled Token" in neovim documentation search bar & headings HOT 2
- Mouse clicks causing crashes when `number`/`relativenumber` is used with a custom `statuscolumn` HOT 3
- :messages API HOT 2
- Text edits from efm-langserver are applied in reverse HOT 5
- Include auto pairs by default HOT 1
- Vertical split line disappears in diff mode with relativenumber
- When grepprg is set, grep results are not displayed in quickfix window HOT 1
- Neovim terminal text vanishes. HOT 1
- autowrite when receiving SIGHUP, SIGQUIT HOT 4
- Instruction for building on ARM on windows HOT 7
- terminal :enew buffer should set buftype=terminal before BufWinEnter autocmd HOT 2
- misleading information filetype.txt help doc HOT 3
- vim-patch PRs could also contribute to the news.txt
- lsp.util.apply_workspace_edit should restrict file manipulations according to client.workspace_folders HOT 1
- 'termsync' : cursor rendering issue on zellij with floating window HOT 8
- WinLeave and WinEnter point at the same buffer on tabnew HOT 5
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.