60 Commits

Author SHA1 Message Date
Olivia Kinnear
45c93f91a2
feat: remove :Lsp* commands for nvim 0.12 #4234 2025-12-16 13:04:57 -05:00
Olivia Kinnear
2b52bc2190
fix: LspRestart/LspStop with arguments #4159 2025-10-27 15:49:06 -07:00
Olivia Kinnear
0d90bb9bfb
feat: force-stop server with :LspStop! (bang) #4140
Problem:
Some servers don't stop properly.

Calling `:LspStop` _twice_ will induce a force-stop, but that is not easy to
discover: b67eff38fe/runtime/lua/vim/lsp/client.lua (L864-L866)
> By default, it will just request the server to shutdown without force. If
> you request to stop a client which has previously been requested to
> shutdown, it will automatically escalate and force shutdown.

Solution:
Nvim should automatically force-stop after X seconds, but until that is
supported, adding a bang "!" variant is reasonable.
2025-10-23 07:01:08 -07:00
Justin M. Keyes
1f7fbc34e6
refactor!: deprecate old framework/configs, Nvim 0.10 #4077 2025-09-17 20:30:24 -07:00
altermo
0c195851ee
perf: use has() instead of vim.version #4053 2025-09-03 05:20:34 -07:00
Sebastian Lyng Johansen
26ccc7f9f7
refactor(lsp): vim.lsp.get_log_path() -> vim.lsp.log.get_filename() #3997 2025-08-14 11:31:21 -07:00
Markus Koller
7ad4a11cc5
fix!: drop support for multiple args in :LspStop/:LspRestart #3896
Problem:
:LspStop/:LspRestart support multiple args, which is unlikely to be used
for interactive usage. These commands are intended for interactive
usage, not scripts. Scripts should use the vim.lsp API.

Solution:
It is unlikely that users specify multiple args, so let's drop it to
simplify the code and interface.
2025-06-13 15:56:33 -07:00
Markus Koller
77d3fdfb35
fix: support :LspRestart without arguments #3895
Problem:
After the refactoring in e4d1c8b for Neovim 0.11.2 this command now
requires an argument.

Solution:
Restore the previous behaviour where `:LspRestart` defaults to
restarting all active servers.
2025-06-10 07:14:18 -07:00
Markus Koller
a182334ba9
fix: support :LspStart/LspStop without arguments #3890
Problem:
After the refactoring in e4d1c8b for Neovim 0.11.2 these commands now
require an argument.

Solution:
Restore the previous behaviour where `:LspStart` defaults to
enabling all servers matching the filetype of the current buffer, and
`:LspStop` defaults to disabling all servers attached to the current
buffer.
2025-06-07 18:23:32 -07:00
Steve Vermeulen
cf24921259
fix: enable :LspLog command in Nvim 0.11.2 #3883 2025-06-02 02:55:41 -07:00
Lorenzo Bellina
e4d1c8bf90
feat: support :LspStart/LspRestart in Nvim 0.11.2+ #3734 2025-05-04 13:18:24 -07:00
Chris Bandy
4ea9083b6d
refactor: replace vim.loop with vim.uv #3703
The former is deprecated in neovim 0.10. Remove the check added in
9b89ba5f158f73779cd58d0bb2783dfb40b28b0e.

See: https://github.com/neovim/neovim/blob/v0.10.0/runtime/doc/deprecated.txt#L55
2025-04-10 15:48:31 -07:00
Justin M. Keyes
3dbc4a61e5
refactor: deprecate util.get_lsp_clients #3694 2025-04-05 16:29:56 -07:00
Justin M. Keyes
401e50fae6
feat: alias :LspInfo to :checkhealth vim.lsp #3663
Problem:
`:checkhealth lspconfig` has no benefits vs `:checkhealth vim.lsp`.

Solution:
- on Nvim 0.11+, `:LspInfo` is an alias to `:checkhealth vim.lsp`
  instead of `:checkhealth lspconfig`.
- `lua/lspconfig/health.lua` will be removed in a few months.
2025-03-26 12:13:08 -07:00
dundargoc
1f941b3668
revert: "refactor!: make available_servers function private" #3589
This reverts commit e118ce58dab72c17216292eef7df4cee3cf60885.

It turns out `util.available_servers` is used more than anticipated, so
we revert the privatization for the time being.

Closes https://github.com/neovim/nvim-lspconfig/issues/3588
2025-01-27 13:04:47 -08:00
dundargoc
0e234f4cad refactor: silence luals warnings 2025-01-22 14:04:37 +01:00
dundargoc
e118ce58da refactor!: make available_servers function private
Work on https://github.com/neovim/nvim-lspconfig/issues/2079.
2025-01-21 06:21:29 +01:00
dundargoc
040001d85e refactor: fix luals warnings 2024-12-19 11:33:57 +01:00
dundargoc
687fcb939b refactor: remove outdated code
Lspconfig requires neovim version 0.9 at the time of writing this, so
discard any version checks and code for older versions.
2024-12-08 18:38:48 +01:00
dundargoc
9b89ba5f15 refactor: replace all instances of vim.uv with vim.loop
We still support neovim 0.9 currently, so we can't use vim.uv. Also add
a check so we don't accidentally reintroduce it.
2024-12-02 11:12:18 +01:00
Guilherme Soares
f012c1b176
feat: accept multiple clients/configs in LspRestart, LspStop #3438
## Problems:
- `:LspStop` doesn't support list of client ids or config names.
- `:LspRestart` doesn't support config names although supports list of
client ids
- Command completion uses ids and names, not allowing the user to hit
enter immediately after
finding the desired server

## Solution:
- Unify `LspStop` and `LspRestart` implementation supporting lists of
client ids and
config names
- Command completion only returns config names
- Modify docs
2024-11-17 10:02:16 -08:00
glepnir
87c7c83ce6
fix: fmt client id with name in complete of LspStop (#3436)
Problem: client id and name are separated by spaces, which may cause misunderstanding.
Solution: use colon combine as one thing.
2024-11-15 14:24:12 +08:00
Justin M. Keyes
6f0ec89858
refactor: minor cleanup #3379 2024-10-18 03:17:57 -07:00
Guilherme Soares
dda84e6dd9
fix(LspStop): correctly stop servers and notify user #3378
## Problem
The current `LspStop` behavior is confusing and wrong:

**Server name:**
- If the server with the given `server_name` is **not attached**:
  - No notification is shown, and **all** LSP servers are stopped.
- If the server with the given `server_name` is **attached**:
  - **Incorrectly** closes all LSP servers.
- If no servers are attached:
  - `server_name` is notified as missing.

**Server ID:**
- If the server with the given `server_id` is **not attached**:
  - Uses `get_managed_clients()` function 541f3a2781/plugin/lspconfig.lua (L45-L47) Which doesn't return all servers (e.g., `null-ls`), so it doesn't close all LSP clients.
- If the server with the given `server_id` is **attached**:
  - The correct LSP server is stopped (including `null-ls`).

**No arguments:**
- If servers are **attached**:
  - Stops all servers.
- If no servers are attached:
  - **Incorrectly** notifies the user with: `config "" not found`.

## Solution

**Server name:**
- If the server with the given `server_name` is **not attached**:
  - Notify the user, but **do not close** any servers.
- If the server with the given `server_name` is **attached**:
  - Close the specified server.

**Server ID:**
- If the server with the given `server_id` is **not attached**:
  - Notify the user, but **do not close** any servers.
- If the server with the given `server_id` is **attached**:
  - Close the specified server.

**No arguments:**
- If servers are **attached**:
  - Stops all servers.
- If no servers are attached:
  - No-op.
2024-10-18 02:46:51 -07:00
glepnir
b1de227da4
fix: command LspStop can receive server name (#3367) 2024-10-14 15:17:15 +08:00
Justin M. Keyes
e6569c18c2
feat(lspinfo): replace :LspInfo with :checkhealth #3339
Problem:
:LspInfo has its own "inner platlform" of highlights, mappings etc. And
it doesn't integrate with :checkhealth.

Solution:
- Move the lspinfo code to a healthcheck.
- LspInfo features such as highlights, "floating window" presentation,
  etc., should be added to :checkhealth in Nvim core, if they are really
  needed.
- Define a "q" mapping until Nvim stable has that in :checkhealth.
2024-10-02 06:57:18 -07:00
dundargoc
c25b9dd6bd refactor: replace deprecated vim.loop with vim.uv 2024-10-02 12:09:17 +02:00
glepnir
a284b14b3a
refactor: move all old get_clients to new compatible (#3159) 2024-05-17 17:40:27 +08:00
glepnir
ae0651d850
fix(command): check server config exist in lspconfig (#3131) 2024-04-29 16:09:54 +08:00
glepnir
559a7e8c6c
fix(command): get attached buffers list by using api (#3130)
Problem: buffers id as key in attached_buffers.

Solution: use api to get buffers list for later restart and attach
2024-04-29 14:44:42 +08:00
Daiki Noda
e3c3ab74d2
refactor: improve get_clients_from_cmd_args (#2943)
improve the get_clients_from_cmd_args for better readability and consistency.

- replace unnecessary dictionary-based approaches with array-based ones.
- use the '#' to improve code readability.
- use the '#' for an empty check.
2024-01-31 14:07:01 +08:00
Daiki Noda
6772c1ccec
chore: move loading status check to the top (#2942)
loading status check should be on the top
2023-12-21 13:52:12 +08:00
Daiki Noda
ab49b26438
chore: check version 0.8+ (#2940)
As documented in README.md(after 5a871409199d585b52b69952532e3fb435e64566),
nvim-lspconfig now supports version 0.8 or later.
Update code to perform this version check.

Co-authored-by: Daiki Noda <sys9kdr@noreply.github.com>
2023-12-20 14:17:45 +08:00
Daiki Noda
e4a56adbc5
perf: reduce an unnecessary function call #2913 2023-11-26 17:32:02 -08:00
Raphael
447443a240
fix(LspRestart): check client attched_buffers count by using tbl_count (#2725) 2023-07-18 20:46:44 +08:00
Raphael
295c646488
fix(command): LspRestart should attached before buffers (#2674) 2023-06-14 21:02:33 +08:00
Raphael
4bb563d835
fix: lsprestart only restart client which have attached buffer (#2669) 2023-06-12 21:15:11 +08:00
Rational-Curiosity
95b7a69bc6
fix(commands): Strange LspStop arguments, not matching doc (#2486)
fix LspStop command receive params bug.
2023-03-01 20:21:53 +08:00
Raphael
42ca8ce0f2
fix: wrong param in get_active_clients (#2362) 2022-12-27 12:14:47 +08:00
Raphael
cbf8762f15
fix: run all matched client in LspStart (#2314) 2022-12-13 20:07:09 +08:00
Raphael
c720632709
fix: improve client stop logic in LspStop (#2296) 2022-12-07 20:37:16 +08:00
Raphael
23c72d4da3
feat: support force stop language server (#2294)
* feat: support force stop language server

* feat: use vim syntax

* feat: update doc
2022-12-07 20:21:21 +08:00
Raphael
e96f639b60
fix: restart client after client is stopped after LspRestart (#2290)
* fix: restart client after client is stopped after LspRestart

* fix: format
2022-12-05 18:32:32 +08:00
Raphael
abe6c99c74
perf: use alias api variable (#2260) 2022-11-26 15:24:03 +08:00
Raphael
cedfda66a6
fix: lspstop should close the client by given client (#2101) 2022-08-28 21:38:53 +08:00
Raphael
03981bd991
feat: improve LspInfo (#2081)
* feat: improve LspInfo

* feat: update README for highlight

* fix: wrong typo

* fix: ci failed

* fix: remove unnecessary block

* fix: stylua format

* fix: set default border to none

* fix: update the doc

* fix: define names in if statement

* fix: use default_options to set border

* fix: use available servers list

* fix: fixup

* fix: format by stylua

* fix: use bufdelete event

* fix: format

* fix: add tips

* fix: stylua format

* fix: use wrap

* fix: add 122 to luacheck ignore

* fix: reset the default options

* fix: merge master

* fix: remove unecessary code

* feat: update the highlight group

* feat: update doc for highlight

* fix: remove highlig from README

* fix: remae highlight group in doc
2022-08-26 20:38:35 +08:00
Raphael
520c609210
fix: lspstart should be work without arg (#2090) 2022-08-26 11:12:52 +08:00
Raphael
bdfcca4af7
fix: add lsplog command (#2088) 2022-08-25 20:52:34 +08:00
Raphael
727fc415ed
fix: LspStop should be only stop the current buffer servers by default (#2082)
* fix: LspStop should be only stop the current buffer server by default

* fix: check filetypes in if statement
2022-08-25 06:00:56 +08:00
William Boman
891bfe8449
feat: sort autocompletion items alphabetically (#2084)
* feat: sort autocompletion items alphabetically

* Update plugin/lspconfig.lua

Co-authored-by: ii14 <59243201+ii14@users.noreply.github.com>

Co-authored-by: ii14 <59243201+ii14@users.noreply.github.com>
2022-08-25 05:41:59 +08:00