Commit Graph

46 Commits

Author SHA1 Message Date
dundargoc
1f941b3668
revert: "refactor!: make available_servers function private" #3589
Some checks are pending
docgen / docgen (push) Waiting to run
This reverts commit e118ce58da.

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
Some checks are pending
docgen / docgen (push) Waiting to run
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 5a87140919),
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
Ranjith Hegde
fe7a6f41e5
feat!: 0.7 API update (#1984)
* switch to lua api for autocommands
* switch to nvim_create_user_command
* move to lua plugin initialization

NOTICE: Defining commands in server configurations will be deprecated in
future releases.
See `:help lspconfig.txt` to setup the same in an `on_attach` function.

Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
2022-08-23 07:03:20 -07:00
Jose Alvarez
6c94309c99
fix: only stop/restart managed clients on :LspStop/:LspRestart (#1591) 2021-12-21 15:13:58 -08:00
Vsevolod
a209627886
feat: improve interface for :Lsp* commands (#1324) 2021-10-17 16:13:21 -07:00
Michael Lingelbach
1dfab4f50f Add stop, start, and restart commands 2021-03-28 01:48:57 -07:00
Michael Lingelbach
f60ba8558f Add compatibility functions with deprecation notice 2021-01-03 06:53:47 -08:00
Michael Lingelbach
93c3431158 Remove all installers and install logic 2021-01-03 06:53:43 -08:00
Hirokazu Hata
ddcd9e6aae
Rename nvim_lsp to lspconfig 2020-09-06 17:49:21 +09:00
kazukazuinaina
053fe9dba0 [add] check Duplicate
fix typo

fix typo
2020-03-08 15:21:31 +09:00
Justin M. Keyes
1856032725 :LspInstall : set complete fn to Lua fn
The sid() hack didn't work on my system, and we can reference Lua global
functions meanwhile.
2019-12-08 00:47:37 -08:00
Ashkan Kiani
5686a90890
Redo installation. (#17)
* Redo installation.

Servers which want to be auto installed should specify
skeleton[name].install()
and it will be automatically added to the list of installable servers.

- Add :LspInstall and :LspInstallInfo
- Auto generate docs for servers with .install() available.
- Add util.npm_installer
- Refactor utf8 capabilities common config into a single function
- Add contribution notes.
- Also expose util.base_install_dir for other installers potentially
- Fix tsserver's arguments and add javascript filetypes
2019-11-15 17:26:22 -08:00