| Commit message (Collapse) | Author | Age |
... | |
| | |
|
|/
|
|
|
|
|
| |
Declaration, type-definition, and implementation capabilities were
previously disabled if the client received table output from the server
capabilities. The workDoneProgress capability is sent for many servers
for all supported capabilities as part of this table. Default to setting
capability to table instead of false.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The official developer documentation in in :h dev-lua-doc specifies to
use "--@" for special/magic tokens. However, this format is not
consistent with EmmyLua notation (used by some Lua language servers) nor
with the C version of the magic docstring tokens which use three comment
characters.
Further, the code base is currently split between usage of "--@",
"---@", and "--- @". In an effort to remain consistent, change all Lua
magic tokens to use "---@" and update the developer documentation
accordingly.
|
|\
| |
| | |
perf(treesitter): avoid string lookup of highlight name in hot loop
|
| |
| |
| |
| |
| | |
These numbers are guaranteed to be stable even if you do "highlight
clear" (all attributes disappear, but not the id to name mapping itself)
|
| |
| |
| |
| |
| |
| |
| |
| | |
According to the protocol definition `rootPath`, `rootUri` and
`workspaceFolders` are allowed to be null.
Some language servers utilize this to provide "single file" support.
If all three are null, they don't attempt to index a directory but
instead only provide capabilities for a single file.
|
|/ |
|
| |
|
| |
|
|
|
|
| |
(#15297)
|
| |
|
|\
| |
| | |
fix(treesitter): do not map hl_group when no mapping is set
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This changes the behavior of the hl_cache to the old one.
- when the capture exists as a hlgroup -> use it
- when hl_map contains a mapping -> use it
- else do nothing (before: map capture to non-existing capture)
Before also captures `@foo.bar` would intend to use the hlgroup `foo.bar`
which results in a confusing error since hlgroups can't contain dots.
|
|/ |
|
| |
|
|
|
| |
Makes it easier to tell with language server caused an error.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new function to redraw diagnostics from the current diagnostic
cache, without receiving a "publishDiagnostics" message from the server.
This is already being done in two places in the Lua stdlib, so this
function unifies that functionality in addition to providing it to third
party plugins.
An example use case for this could be a command or key-binding for
toggling diagnostics virtual text. The virtual text configuration option
can be toggled using `vim.lsp.with` followed by
`vim.lsp.diagnostic.redraw()` to immediately redraw the diagnostics
with the updated setting.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
* Add vim.lsp.diagnostic.set_qflist() function
* replaces opts.open_loclist with unified opts.open
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 } }`
|
| |
|
|
|
|
|
|
| |
- remove incorrect usage of docstrings
- fix make_formatting_params return type documentation to 'DocumentFormattingParams'
- make progress_handler private
- fix links
|
|\
| |
| | |
fix(lsp): accept file URIs without a hostname
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
RFC 8089, which defines the file URI scheme, also allows URIs without a
hostname, i.e. of the form file:/path/to/file. These are returned by
some language servers and accepted by other LSP implementations, such as
VSCode's, so it is reasonable for us to accept them as well.
|
| |
| |
| |
| |
| |
| | |
the `textDocument/rangeFormatting` nad `textDocument/formatting` did not
pass bufnr to apply_text_edits, meaning edits were applied to
the user's currently active buffer. This could result in text being
applied to the wrong buffer.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
ipairs terminates on the first nil index when iterating over table keys:
for i,k in ipairs( {[1] = 'test', [3] = 'test'} ) do
print(i, k)
end
prints:
1 test
Instead, use pairs which continues iterating over the entire table:
for i,k in pairs( {[1] = 'test', [3] = 'test'} ) do
print(i, k)
end
prints:
1 test
3 test
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`return err_message(tostring(err))` caused errors to be printed as
`table: 0x123456789` instead of showing the error code and error
message.
This also removes some `if err` blocks that never got called because at
the end of `handlers.lua` all the handlers are wrapped with logic that
adds generic error handling.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
results
Relates to https://github.com/neovim/neovim/issues/15050
Users should get some indication if there was an error or an empty
result.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before:
Lens1Lens2
After:
Lens1 | Lens2
Fixes https://github.com/neovim/neovim/issues/15048
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adds indentation that matches the number prefix to ensure diagnostic
messages spawning multiple lines align.
Before:
Diagnostics:
1. • Variable not in scope: red :: t0 -> t
• Perhaps you meant one of these:
‘rem’ (imported from Prelude), ‘read’ (imported from Prelude),
‘pred’ (imported from Prelude)
2. • Variable not in scope: repeDoubleColon :: [Char] -> t0
• Perhaps you meant ‘replaceDoubleColon’ (line 32)
After:
Diagnostics:
1. • Variable not in scope: red :: t0 -> t
• Perhaps you meant one of these:
‘rem’ (imported from Prelude), ‘read’ (imported from Prelude),
‘pred’ (imported from Prelude)
2. • Variable not in scope: repeDoubleColon :: [Char] -> t0
• Perhaps you meant ‘replaceDoubleColon’ (line 32)
|
| | |
|
| |
| |
| |
| | |
(#15023)
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Options formatted as a list of comma-separated key-value pairs may have
values that contain leading and trailing whitespace characters. For
example, the `listchars` option has a default value of
`"tab:> ,trail:-,nbsp:+"`. When converting this value to a lua table,
leading and trailing whitespace should not be trimmed.
Co-authored-by: Robert Hrusecky <robert.hrusecky@utexas.edu>
|
| |
|
| |
|
| |
|