| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| |
|
|
|
| |
`vim.api.nvim_buf_create_user_command` callback is called with a table
argument that contains a parsed command. Need to use `args` or `fargs`
key to get command arguments.
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
The `pyright.organizeimports` is private, so client:exec_cmd()
fails because it refuses to run commands that are not advertised
as capabilities.
Solution:
Call client.request() to side-step the check in client:exec_cmd().
YOLO
|
| | |
|
| | |
|
| |
|
|
| |
Current code will always trigger error (unless you are already authd),
because result.code is invalid. result.userCode must be used instead.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
This commit adds preliminary `typescript-tools` support for `vue_ls`. This is to
allow for a smooth transition if support for `typescript.tsserverRequest` is
added.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
Problem:
The current `on_init` of `vue_ls` requiers `vtsls` or `ts_ls` to already be
attached, which is not always guaranteed.
Solution:
Add a retry mechanism that reruns the logic for some time to give the
other ls a chance to catch up.
|
| |
|
|
|
|
|
|
|
| |
Problem:
The current logic used unnecessary table merging even though there is
only one element expected anyway.
Solution:
Just use index accessing and `or`
|
| |
|
|
|
|
|
|
|
| |
Problem:
If project had a nested child gitlab file named: .gitlab-ci.yml it would
take it as root.
Solution:
If inside GIT repository just use git repository root as root and still
keep the option for .gitlab* as fallback if there is no git repo yet.
|
| |
|
|
| |
fix #4023
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
The current version of the config will let you do formatting manually
`:lua vim.lsp.buf.format()` but the lsp doesn't have capabilities
registered correctly so if you use auto formatting like outlined in
[help pages](https://neovim.io/doc/user/lsp.html#lsp-attach)
if not client:supports_method('textDocument/willSaveWaitUntil')
and client:supports_method('textDocument/formatting') then
vim.api.nvim_create_autocmd('BufWritePre', {
group = vim.api.nvim_create_augroup('my.lsp', {clear=false}),
buffer = args.buf,
callback = function()
vim.lsp.buf.format({ bufnr = args.buf, id = client.id, timeout_ms = 1000 })
end,
})
end
, it won't enable for the yaml lsp because
`client:supports_method('textDocument/formatting')` returns false.
Solution:
The `on_init` hook, while hacky, will mark the capability as true.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
Faking capabilities isn't necessary to enable formatting support. It's a
dynamically registered capability that yamlls announces whenever yaml
formatting is enabled in settings, which it isn't by default.
See
https://github.com/redhat-developer/yaml-language-server/blob/3821411ee8c92e5b7e5ca88f84ab443ae3b2791a/src/yamlServerInit.ts#L128
https://github.com/redhat-developer/yaml-language-server/blob/3821411ee8c92e5b7e5ca88f84ab443ae3b2791a/src/languageserver/handlers/settingsHandlers.ts#L159-L174
Fixes: 63a016437e44 ("feat(yamlls): document formatting support #4003")
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
'nixd' is the only place I saw 'git' in root_markers, without the dot,
so I think it's a mistake. Change it to '.git'.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
PROBLEM:
Monorepos (or "workspaces") in Typescript are more and more popular and
the associated tooling is evolving to improve the developer experience
in such setup. Especially, the `typescript-language-server` and the
`vscode-eslint-language-server` now supports monorepos, **removing the
need to spawn a different server for each package of a workspace**.
Example: with a few packages as the servers need to load every other
package to work (the `typescript-language-server`, even if spawned
multiple times with different `root_dir`, will load in memory other
packages to resolve the types), the amount of memory used grows
exponentially. But in fact, those servers support monorepos: they
support multiple configurations in subpackages and will load the correct
one to process a buffer. The ESLint server even supports loading
multiple ESLint binaries (and therefore versions), while keeping one
instance of the server.
SOLUTION:
Instead of only relying on the configuration files as `root_markers`,
discover the root of the package / monorepo by finding the Lock files
created by node package managers:
* `package-lock.json`: Npm
* `yarn.lock`: Yarn
* `pnpm-lock.yaml`: Pnpm
* `bun.lockb`: Bun
We still need to look at configuration files to enable the conditionnaly
attachment of the LSP for a buffer (for ESLint, we want to attach the
LSP only if there are ESLint configuration files) in case of LSP that
operates on files that are "generic" (like `typescript` or
`javascript`).
To do that, I replace the `root_markers` that were the configuration
files by a `root_dir` function that superseds them. It will both:
* look for a configuration file upward to check if the LSP needs to be attached
* look for the root of the "project" via the lock files to specify the `root_dir` of the LSP
PRIOR EXPERIMENTATIONS:
I've tried to play with the `reuse_client` quite a lot, trying to
understand if we need to spawn a new server or not looking at the
Typescript / ESLint binary that was loaded, but in fact it's way easier
to just have a better `root_dir` that is the true root of the project
for the LSP server: in case of those two servers, the root of the
package / monorepo.
I also tried to use the current directory opened as the `root_dir`, but
it's less powerful on nvim compared to VSCode as we navigate more inside
folders using terminal commands and then open vim.
I think this method also removes the need from a project-local config
(which could be quite useful anyway for ESLint flat config setting which
auto-detection is a bit unreliable / compute heavy) as this should work
normally accross all different setups.
Fixes #3910
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* fix(zk): update config to 0.11+
- Remove buf.execute_command in favor of :exec_cmd
- Set title on :exec_cmd
* fix(clangd): update config to 0.11+
- Use client and bufnr as arguments of on_attach
- Silence wrong diagnostics about unknown method
- Call request as method
- Align the style of the two functions
- Drop border setup in favor of winborder option
* fix(denols): update config to 0.11+
- Call request_sync as method
- Use vim.notify instead of nvim_err_writeln
* fix(elmls): update config to 0.11+
- Use vim.bo[bufnr] instead of nvim_buf_get_option
* fix(markdown_oxide): update config to 0.11+
- Use drop buf.execute command and use :exec_cmd
* fix(rust_analyzer): update config to 0.11+
- Call request as method
- Silence wrong diagnostic
* fix(svlangserver): update config to 0.11+
- Drop .buf.execute_command and use :exec_cmd
* fix(texlab): update config to 0.11+
- Use bufnr and client as arguments of on_attach
- Update documentation to indicate implemented commands
* fix(tinymist): update config to 0.11+
- Drop check for neovim version
- Make sure the name starts with Lsp to remove the exemption from the CI
check
|
| | |
| |
| |
| |
| |
| | |
- Drop check for neovim version
- Make sure the name starts with Lsp to remove the exemption from the CI
check
|
| | |
| |
| |
| |
| | |
- Use bufnr and client as arguments of on_attach
- Update documentation to indicate implemented commands
|
| | |
| |
| |
| | |
- Drop .buf.execute_command and use :exec_cmd
|
| | |
| |
| |
| |
| | |
- Call request as method
- Silence wrong diagnostic
|
| | |
| |
| |
| | |
- Use drop buf.execute command and use :exec_cmd
|
| | |
| |
| |
| | |
- Use vim.bo[bufnr] instead of nvim_buf_get_option
|
| | |
| |
| |
| |
| | |
- Call request_sync as method
- Use vim.notify instead of nvim_err_writeln
|
| | |
| |
| |
| |
| |
| |
| |
| | |
- Use client and bufnr as arguments of on_attach
- Silence wrong diagnostics about unknown method
- Call request as method
- Align the style of the two functions
- Drop border setup in favor of winborder option
|
| | |
| |
| |
| |
| | |
- Remove buf.execute_command in favor of :exec_cmd
- Set title on :exec_cmd
|
| |/
|
|
| |
https://github.com/blopker/codebook/commit/5b451a39dfaed33dc365f77d5c5938a0b9ca41e8
https://github.com/blopker/codebook/commit/e4564a231de77e59e111050d5ae854f674ff13b2
|
| |
|
|
|
|
|
| |
- Drop support for <0.11 in vim.lsp.config version
- Use vim.ui.input instead of vim.fn.input
- Replace explicit border setting in favor to winborder option
- Call request as method to avoid deprecation warning
- Simplify command setup via for loop
|
| |
|
|
|
|
|
|
|
|
| |
This adds a `get_language_id()` handler to the docker language server
config to correctly set the language ID to `dockercompose` as expected
by the server. Before this change, the nvim filetype of
`yaml.docker-compose` was passed to the server as the language ID,
resulting in in a docker compose file being misinterpreted as a
Dockerfile.
See also: e3d837b938bd1d7e84c3eb0362b6761e4d5dc15d / #3982
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Currently, `on_init` tries to use `or` to combine two function calls
that return tables and returns truthy on the first value but an empty
table is considered truthy in lua causing an error when using `vtsls`.
This properly checks if either `ts_ls` or `vtsls` exists and extends the
`clients` list for proper error handling.
|
| |
|
|
| |
typescript-language-server now supports tsserver/request:
https://github.com/typescript-language-server/typescript-language-server/releases/tag/v4.4.0
|
| |
|
|
|
|
|
| |
Problem:
No clear documentation about requirement to set `installPath`.
Solution:
Add documentation in `matlab_ls.lua`.
|