The handlers for textDocument/references, textDocument/documentSymbol,
and workspace/symbol open their results in the quickfix list by default
and are not configurable. They are also incompatible with `vim.lsp.with`
as they do not accept a configuration parameter.
Add a `config` parameter to the handler for these three messages which
allows them to be configured with `vim.lsp.with`. Additionally, add a
new configuration option 'loclist' that, when true, causes these
handlers to open their results in the location list rather than the
quickfix list.
This fixes an issue introduced in #14771 (fix: source syncolors.vim
before startup scripts) that affected highlights for users who set
'background' to light in their startup script. Because syncolor.vim
checks for the value of &background, it was always setting up the 'dark'
background colors, which looked wrong for users using light backgrounds.
The primary benefit of #14771 is that it decoupled highlighting from the
syntax engine. This is useful for e.g. treesitter, which still makes use
of highlights even if the syntax engine is disabled. For this reason, it
is still worthwhile to source syncolor.vim separately from synload.vim,
which #14771 accomplishes. However, we should still source syncolor.vim
after the user startup scripts, to ensure that we are respecting the
options the user sets.
Another corollary benefit is that this reduces some redundancy in
highlight definitions, since we now only source syncolors.vim if the
user did not already enable a colorscheme.
Some language servers *cough*rust-analyzer*cough* need an empty/custom
workspaceFolders for certain usecases. For example, rust-analyzer
needs an empty workspaceFolders table for standalone file support
(See https://github.com/rust-analyzer/rust-analyzer/pull/8955).
This can also be useful for other languages that need to commonly
open a certain directory (like flutter or lua), which would help
prevent spinning up a new language server altogether.
In case no workspaceFolders are passed, we fallback to what we had
before.
Passing `nil` is equivalent to passing 0, i.e. it simply uses the
current buffer number.
This fixes a bug when vim.lsp.diagnostic.disable() is called without
arguments.
Add two new methods to allow diagnostics to be disabled (and re-enabled)
in the current buffer. When diagnostics are disabled they are simply not
displayed to the user, but they are still sent by the server and
processed by the client.
Disabling diagnostics can be helpful in a number of scenarios. For
example, if one is working on a buffer with an overwhelming amount of
diagnostic warnings it can be helpful to simply disable diagnostics
without disabling the LSP client entirely. This also allows users more
flexibility on when and how they may want diagnostic information to be
displayed. For example, some users may not want to display diagnostic
information until after the buffer is first written.
An empty table was previously always treated as a list, which means that
while merging tables, whenever an empty table was encountered it would
always truncate any table on the left.
`vim.tbl_deep_extend("force", { b = { a = 1 } }, { b = {} })`
Before: `{ b = {} }`
After: `{ b = { a = 1 } }`
lua is used as part of implementation for more core features. As an
example, every user keypress will invoke a lua function to check for
keypress handlers (regardless if they are registered or not). Thus not
starting lua until it is first used doesn't make much sense anymore.
nlua_enter was also needed due to the earlier stateful &rtp
translation, which by now have been made stateless.