| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
| |
Ref https://github.com/neovim/neovim/discussions/32015
|
| |
|
|
|
|
|
|
|
| |
* Cancel watcher in the "force" case.
* Cancel watcher outside the async callback. It seems nvim doesn't wait
async jobs on quitting, leaving detached inotifywait processes.
* Clean up cancelling callbacks.
|
|
|
|
|
|
|
|
| |
Problem:
Language server version information missing from `:checkhealth vim.lsp`.
Solution:
Store `InitializeResult.serverInfo.version` from the `initialize`
response and display for each client in `:checkhealth vim.lsp`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Design goals/requirements:
- Default configuration of a server can be distributed across multiple sources.
- And via RTP discovery.
- Default configuration can be specified for all servers.
- Configuration _can_ be project specific.
Solution:
- Two new API's:
- `vim.lsp.config(name, cfg)`:
- Used to define default configurations for servers of name.
- Can be used like a table or called as a function.
- Use `vim.lsp.confg('*', cfg)` to specify default config for all
servers.
- `vim.lsp.enable(name)`
- Used to enable servers of name. Uses configuration defined
via `vim.lsp.config()`.
|
|
|
|
|
| |
Not essential, but adds robustness and hardening for future
changes.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
LSP module has multiple "start" interfaces.
Solution:
- Enhance vim.lsp.start
- Deprecate vim.lsp.start_client
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
LSP spec uses the term "position encoding" where we say "offset encoding".
Solution:
- Rename it everywhere except `vim.lsp.Client.offset_encoding` (which would be breaking).
- Mention "position encoding" in the documentation for `vim.lsp.Client.offset_encoding`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Deprecated:
- `client.request()` -> `client:request()`
- `client.request_sync()` -> `client:request_sync()`
- `client.notify()` -> `client:notify()`
- `client.cancel_request()` -> `client:cancel_request()`
- `client.stop()` -> `client:stop()`
- `client.is_stopped()` `client:is_stopped()`
- `client.supports_method()` -> `client:supports_method()`
- `client.on_attach()` -> `client:on_attach()`
Fixed docgen to link class fields to the full function doc.
|
|
|
|
|
|
| |
Ensure filetype is always passed.
Fixes #31262
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Capability register logic is spread across 3 files.
Solution:
- Consolidate (and simplify) logic into the client.
- Teach client.supports_method about resolve methods
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
`vim.validate()` takes two forms when it only needs one.
Solution:
- Teach the fast form all the features of the spec form.
- Deprecate the spec form.
- General optimizations for both forms.
- Add a `message` argument which can be used alongside or in place
of the `optional` argument.
|
|
|
|
|
| |
- Also fix `vim.validate()` for PUC Lua when showing errors for values
that aren't string or number.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the api_info() output:
:new|put =map(filter(api_info().functions, '!has_key(v:val,''deprecated_since'')'), 'v:val')
...
{'return_type': 'ArrayOf(Integer, 2)', 'name': 'nvim_win_get_position', 'method': v:true, 'parameters': [['Window', 'window']], 'since': 1}
The `ArrayOf(Integer, 2)` return type didn't break clients when we added
it, which is evidence that clients don't use the `return_type` field,
thus renaming Dictionary => Dict in api_info() is not (in practice)
a breaking change.
|
|
|
|
|
|
| |
This reduces the number of nil checks around buf_versions usage
Test changes were lifted from 5c33815
Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
|
| |
|
|
|
|
|
|
|
|
|
| |
* Revert "fix(lsp): account for changedtick version gap on modified reset (#29170)"
This reverts commit 2e6d295f799c27372e5c0c44727fa613c81717fd.
* Revert "refactor(lsp): replace util.buf_versions with changedtick (#28943)"
This reverts commit 5c33815448e11b514678f39cecc74e68131d4628.
|
|
|
|
|
|
|
| |
`lsp.util.buf_versions` was already derived from changedtick (`on_lines`
from `buf_attach` synced the version)
As far as I can tell there is no need to keep track of the state in a
separate table.
|
|\
| |
| | |
feat(lsp): completion side effects
|
| | |
|
|/
|
|
|
|
|
| |
The root directory could show up as something like:
Root directory: ~/path/to/cwd/v:null
Despite being `nil`
|
|
|
| |
Co-authored-by: Jongwook Choi <wookayin@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vim.notify cannot be suppressed and it is not always necessary to
display a visible warning to the user if the RPC process fails to start.
For instance, a user may have the same LSP configuration across systems,
some of which may not have all of the LSP server executables installed.
In that case, the user receives a notification every time a file is
opened that they cannot suppress.
Instead of using vim.notify in vim.lsp.rpc, propagate a normal error up
through the call stack and use vim.notify in vim.lsp.start() only if
the "silent" option is not set.
This also updates lsp.start_client() to return an error message as its
second return value if an error occurred, rather than calling vim.notify
directly. Callers of lsp.start_client() will need to update call sites
appropriately if they wish to report errors to the user (or even better,
switch to vim.lsp.start).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Besides being redundant with vim.iter():flatten(), `tbl_flatten` has
these problems:
- Has `tbl_` prefix but only accepts lists.
- Discards some results! Compare the following:
- iter.flatten():
```
vim.iter({1, { { a = 2 } }, { 3 } }):flatten():totable()
```
- tbl_flatten:
```
vim.tbl_flatten({1, { { a = 2 } }, { 3 } })
```
Solution:
Deprecate tbl_flatten.
Note:
iter:flatten() currently fails ("flatten() requires a list-like table")
on this code from gen_lsp.lua:
local anonym = vim.iter({ -- remove nil
anonymous_num > 1 and '' or nil,
'---@class ' .. anonymous_classname,
}):flatten():totable()
Should we enhance :flatten() to work for arrays?
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
Some servers don't report progress during initialize unless the client
sets the `workDoneToken`
See https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#initiatingWorkDoneProgress
In particular:
> There is no specific client capability signaling whether a client will
> send a progress token per request. The reason for this is that this is
> in many clients not a static aspect and might even change for every
> request instance for the same request type. So the capability is signal
> on every request instance by the presence of a workDoneToken property.
And:
> Servers can also initiate progress reporting using the
> window/workDoneProgress/create request. This is useful if the server
> needs to report progress outside of a request (for example the server
> needs to re-index a database). The token can then be used to report
> progress using the same notifications used as for client initiated
> progress.
So far progress report functionality was relying entirely on the latter.
Solution:
Set a `workDoneToken`
Closes https://github.com/neovim/neovim/issues/27938
|
|
|
|
|
| |
- Changed `reuse_client` to check workspace folders in addition to
root_dir.
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove:
- uninitialized_clients
- active_clients
- all_buffer_active_clients
- Add:
- all_clients
- Use `lsp.get_clients()` to get buffer clients.
|
| |
|
|
|
|
| |
This reverts commit 3f238b39cfdf27657b2d9452c6ffd28f8209c95f.
|
|
|
|
|
|
|
|
|
|
|
| |
- Remove:
- uninitialized_clients
- active_clients
- all_buffer_active_clients
- Add:
- all_clients
- Use `lsp.get_clients()` to get buffer clients.
|
|
|
| |
continuation of https://github.com/neovim/neovim/pull/24013
|
|
|
|
|
|
|
|
| |
Co-authored-by: C.D. MacEachern <craig.daniel.maceachern@gmail.com>
Co-authored-by: Ynda Jas <yndajas@gmail.com>
Co-authored-by: Owen Hines <TheOdd@users.noreply.github.com>
Co-authored-by: Wanten <41904684+WantenMN@users.noreply.github.com>
Co-authored-by: lukasvrenner <118417051+lukasvrenner@users.noreply.github.com>
Co-authored-by: cuinix <915115094@qq.com>
|
|
|
|
|
|
| |
- Tags are now created with `[tag]()`
- References are now created with `[tag]`
- Code spans are no longer wrapped
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Context:
Nvim catches errors from the user's `on_exit` and rpc handler callbacks
and prints the error message.
Problem:
Printing the error message uses Nvim api functions. But callbacks
mentioned above run in `:h lua-loop-callbacks` where most of `vim.api`
is not allowed, so Nvim itself raises error.
Solution:
`vim.schedule()` the error reporting when necessary.
|
|\
| |
| | |
feat(lsp): add fswatch watchfunc backend
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Added `@inlinedoc` so single use Lua types can be inlined into the
functions docs. E.g.
```lua
--- @class myopts
--- @inlinedoc
---
--- Documentation for some field
--- @field somefield integer
--- @param opts myOpts
function foo(opts)
end
```
Will be rendered as
```
foo(opts)
Parameters:
- {opts} (table) Object with the fields:
- somefield (integer) Documentation
for some field
```
- Marked many classes with with `@nodoc` or `(private)`.
We can eventually introduce these when we want to.
|
|
|
|
| |
Followup to neovim/neovim#27443
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the LSP-Client object contained some fields that are also
in the client config, but for a lot of other fields, the config was used
directly making the two objects vaguely entangled with either not having
a clear role.
Now the config object is treated purely as config (read-only) from the
client, and any fields the client needs from the config are now copied
in as additional fields.
This means:
- the config object is no longet normalised and is left as the user
provided it.
- the client only reads the config on creation of the client and all
other implementations now read the clients version of the fields.
In addition, internal support for multiple callbacks has been added to
the client so the client tracking logic (done in lua.lsp) can be done
more robustly instead of wrapping the user callbacks which may error.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
The dispatchers used by the RPC client should be defined in the client,
so they have been moved there. Due to this, it also made sense to move
all code related to client configuration and the creation of the RPC
client there too.
Now vim.lsp.start_client is significantly simplified and now mostly
contains logic for tracking open clients.
- Renamed client.new -> client.start
|
| |
|