| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
|
|
| |
Problem: Argument type mismatches are excluded from EmmyLua checks.
Solution: Correct runtime annotations and calls, document local checker
workarounds, and enable the diagnostic.
AI-assisted
|
| |
|
|
| |
AI-assisted
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Enable EmmyLua's need-check-nil diagnostic and resolve nullable values
through more precise types, explicit invariants, and guards for missing
runtime state. Keep analyzer-specific workarounds local and update the
affected API documentation.
Exclude the bundled re.lua from analysis so its nil-check warnings do
not fail CI.
AI-assisted
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Enable checks for unused code, deprecated calls, return types, and
annotations.
Fix the warnings and replace the deprecated highlight function. Keep
exceptions where old APIs are still needed or the checker gets it wrong.
AI-assisted
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem:
Servers cannot request refreshing stale LSP folding ranges after a
project-wide change.
Solution:
Advertise `workspace.foldingRange.refreshSupport` and re-request folding
ranges for active buffers when handling `workspace/foldingRange/refresh`.
AI-assisted
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Diagnostic tracking used a separate bufstates table and manual
LspDetach/LspNotify autocmd management via _enable()/_refresh(),
duplicating the lifecycle logic already provided by the Capability
framework. This caused inconsistencies in how client attach/detach and
buffer teardown were handled compared to other LSP features.
Solution:
Replace the ad-hoc bufstate tracking and _enable/_refresh pattern in
vim.lsp.diagnostic with a proper Diagnostics subclass of Capability.
This cleans up a few random places in the main lsp module and client
module that were poking the diagnostics. It also fixes some pre-existing
bugs and inconsistencies that were discovered:
- Refresh diagnostics immediately on attach instead of lazily by the
first didOpen/didChange notification
- Fix Capability.active lookup in M.enable() to key by it_bufnr instead
of the filter bufnr
- Set lsp defaults before calling the _text_document_did_open_handler in
Client:on_attach() so defaults are there before any lsp notification
occurs
- Log (and return early) on any error from a diagnostic request result
instead of only returning early for server cancelled errors
|
| |
|
|
|
|
|
|
|
| |
Problem:
`make_position_params`/`get_line_byte_from_position`/`make_line_range_params`
are private functions and their functionality can be replaced by `vim.pos` now.
Solution:
Remove them, use `vim.pos` instead.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
callee #39336
Problem:
The fromRanges field of the result of callHierarchy/outgoingCalls is
documented as being relative to the caller. Using
vim.lsp.buf.outgoing_calls() opened the qflist with an entry with the
callee's filename, but the caller's line number.
Solution:
Open the qflist with the callers file (the bufnr from the request),
rather than the callees (the uri from the resulting CallHierarchyItem)
|
| |
|
|
|
|
|
|
|
| |
Problem:
The capability attach path for client/registerCapability can initialize a capability even when the capability was only registered in specific buffers
Solution:
Check supports_method() before attaching capabilities from the dynamic registration handler so unsupported registrations are ignored.
AI-assisted: OpenCode
|
| |
|
|
|
| |
* feat(lsp): migrate `document_color` to capability framework
* feat(lsp): use `vim.Range` in `document_color` module
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The [spec for `workspace/configuration`](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_configuration)
marks the `section` property of each item in `items` optional.
Therefore, I believe it violates the spec to skip over items without
a section, because then the length of the results won't match the length
of a valid `items` input. The spec does not elaborate on _what_ to
return in this case, but I don't think it would be controversial to say
that returning the full configuration, as done for an empty string, is
the most natural interpretation.
That empty string case, by the way, was initially [added in
response](https://github.com/neovim/nvim-lspconfig/commit/5da124fc82c24592abc3a97c68363bb4e85e3c85)
to a real world implementation requesting it. I don't have a similar
real world implementation to point to for the omitted `section`, but
I would note that `getConfiguration()` from `vscode-languageserver-node`
[defaults to a request with no section](https://github.com/Microsoft/vscode-languageserver-node/blob/d859bb14d1bcb3923eecaf0ef587e55c48502ccc/server/src/common/configuration.ts#L24-L26)
when called with no arguments. I surmise that this is intended as a way
to retrieve the full configuration.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
Problem: format_item return two value
Solution: `:h vim.ui.select()` say format_item should return string
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Problem: Currently, vim.notify is only used to display messages when the
message type is Error.
Solution: Use vim.notify to display messages for all message types.
|
| |
|
|
| |
Type fixes caught by emmylua
|
| |
|
|
|
| |
* refactor(docs): remove `@private` annotations from local functions
* refactor(docs): remove unnecessary `@nodoc` annotations
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Problem: setting `loclist = true` makes `on_list` being ignored. This
was not a problem before, but with `vim.lsp.buf.document_symbol` using
`loclist = true` as default it is needed to explicitly pass `loclist =
false` in order to use custom `on_list`.
Solution: prefer `on_list` over `loclist` and document the latter as
taking effect only in the default handler.
|
| |
|
|
| |
Ref https://github.com/neovim/neovim/discussions/32015
|
| | |
|
| | |
|
| |
|
| |
Co-authored-by: Jesse <github@jessebakker.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem:
Capability register logic is spread across 3 files.
Solution:
- Consolidate (and simplify) logic into the client.
- Teach client.supports_method about resolve methods
|
| |
|
|
|
|
|
|
|
|
| |
- Partition the handlers in vim.lsp.handlers as:
- client to server response handlers (RCS)
- server to client request handlers (RSC)
- server to client notification handlers (NSC)
Note use string indexes instead of protocol.methods for improved
typing in LuaLS (tip: use hover on RCS, RSC or NSC).
|
| |
|
|
| |
Deprecate `vim.lsp.handlers.hover` and `vim.lsp.handlers['textDocument/hover']`
|
| |
|
|
| |
Use `vim.lsp.completion.trigger()` instead'
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Problem:
- `vim.highlight` module does not follow `:help dev-name-common`, which
documents the name for "highlight" as "hl".
- Shorter names are usually preferred.
Solution:
Rename `vim.highlight` to `vim.hl`.
This is not a breaking change until 2.0 (or maybe never).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Relates to:
- https://github.com/neovim/neovim/issues/30034
- https://github.com/neovim/neovim/issues/17712
- https://github.com/neovim/neovim/issues/16363
Closes:
- https://github.com/neovim/neovim/issues/26936 (but only provides bufnr
and method)
- https://github.com/neovim/neovim/issues/22318
Might fix: https://github.com/neovim/neovim/issues/30737
|
| |
|
|
|
|
|
| |
Relates to:
- https://github.com/neovim/neovim/issues/17712
- https://github.com/neovim/neovim/issues/30034
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove following functions:
- vim.lsp.util.extract_completion_items
- vim.lsp.util.get_progress_messages
- vim.lsp.util.parse_snippet()
- vim.lsp.util.text_document_completion_list_to_complete_items
- LanguageTree:for_each_child
- health#report_error
- health#report_info
- health#report_ok
- health#report_start
- health#report_warn
- vim.health.report_error
- vim.health.report_info
- vim.health.report_ok
- vim.health.report_start
- vim.health.report_warn
|
| |\ |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
As suggested in
https://github.com/neovim/neovim/pull/28483#discussion_r1586878457 and
https://github.com/neovim/neovim/pull/28483#discussion_r1586878226
|
| | | |
|
| | |
| |
| |
| | |
As suggested in https://github.com/neovim/neovim/pull/28483#discussion_r1581712828
|
| | | |
|