Skip to content

Commit b8755e3

Browse files
authored
ci(lint): migrate from single_file_support #3789
1 parent 015c802 commit b8755e3

File tree

3 files changed

+27
-16
lines changed

3 files changed

+27
-16
lines changed

.github/ci/lint.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ _check_deprecated_in_nvim_0_11() {
6767
if git grep -P 'validate_bufnr' -- 'lsp/*.lua' ; then
6868
_fail 'Do not use util.validate_bufnr(). Nvim stdlib already treats bufnr=0 as "current buffer".'
6969
fi
70+
if git grep -P 'single_file_support' -- 'lsp/*.lua' ; then
71+
_fail 'vim.lsp.config assumes "single-file support" by default. If the LS does not support that, set workspace_required=true.'
72+
fi
7073
}
7174

7275
_check_deprecated_utils() {

doc/lspconfig.txt

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ nvim-lspconfig is a collection of community-contributed configurations for the
1111
Nvim LSP client. See |lspconfig-all| for the complete list of provided
1212
configurations.
1313

14-
Note: nvim-lspconfig is just a convenience layer, it is NOT required for Nvim
15-
|LSP| support. See |lsp-quickstart| to setup LSP without nvim-lspconfig.
14+
Note: nvim-lspconfig is just a collection of configs. It has no API or
15+
"framework". It is not required for Nvim |LSP| support. See |lsp-quickstart|
16+
to setup LSP without nvim-lspconfig.
1617

1718
==============================================================================
1819
QUICKSTART *lspconfig-quickstart*
@@ -32,10 +33,10 @@ See also |lsp-quickstart|.
3233
==============================================================================
3334
USAGE *lspconfig-usage*
3435

35-
nvim-lspconfig is of a collection of language server configurations. Each
36-
configuration provides defaults for |vim.lsp.config()| which you can use as-is
36+
Each config provides defaults for |vim.lsp.config()| which you can use as-is
3737
(by calling `vim.lsp.enable(…)`) or override (by calling |vim.lsp.config()|
38-
before enable()).
38+
before enable()). This "composability" is a central feature of vim.lsp.config,
39+
which allows nvim-lspconfig to just provide the config "defaults".
3940

4041
To activate a config, call |vim.lsp.enable()|. Each config in |lspconfig-all|
4142
is available as `vim.lsp.config('<name>')` and `vim.lsp.enable('<name>')`. For
@@ -55,19 +56,26 @@ without activating it: >lua
5556
vim.print(vim.lsp.config['clangd'])
5657
<
5758
*lspconfig-vs-vim.lsp.config*
58-
Note the these current differences/limitations of |vim.lsp.config()| compared
59-
to the legacy nvim-lspconfig interface:
59+
Note these differences of |vim.lsp.config()| compared to the legacy
60+
nvim-lspconfig interface:
6061

6162
- `single_file_support` is assumed by default. Can be disabled by specifying
6263
`workspace_required=false` (see |vim.lsp.ClientConfig|).
63-
6464
- `on_new_config` is currently missing, see https://github.com/neovim/neovim/issues/32287
65-
Function executed after a root directory is detected. Used to modify the
66-
server configuration (including `cmd` itself).
65+
- However, defining `root_dir` as a function is very flexible and may fit
66+
your use-case instead. https://github.com/neovim/neovim/issues/32037#issuecomment-2825599872
6767

6868
==============================================================================
6969
COMMANDS *lspconfig-commands*
7070

71+
Any server-specific commands provided by a config are buffer-local and
72+
prefixed with "Lsp". Thus you can see available commands (from a LSP-enabled
73+
buffer) by typing: >vim
74+
75+
:Lsp<tab>
76+
77+
The following _global_ commands are provided by nvim-lspconfig:
78+
7179
:LspInfo *:LspInfo*
7280
Alias to `:checkhealth vim.lsp`. Shows the status of active LSP clients and
7381
servers.
@@ -95,15 +103,16 @@ See |lspconfig-all| for the list of provided LSP configurations.
95103
If a server is missing, you can define one easily via |vim.lsp.config()|
96104
(requires Nvim 0.11+), see |lsp-config|.
97105

98-
==============================================================================
99-
COMPLETION SUPPORT *lspconfig-completion*
106+
------------------------------------------------------------------------------
107+
NEW CONFIGS *lspconfig-new*
100108

101-
See |lsp-completion|.
109+
To create a new config, see |lsp-config| (requires Nvim 0.11+).
110+
To contribute a config to nvim-lspconfig, see ../CONTRIBUTING.md.
102111

103112
==============================================================================
104-
ADDING NEW SERVERS *lspconfig-new*
113+
COMPLETION SUPPORT *lspconfig-completion*
105114

106-
See ../CONTRIBUTING.md or |lsp-config| (requires Nvim 0.11+).
115+
See |lsp-completion|.
107116

108117
==============================================================================
109118
DEBUGGING AND TROUBLESHOOTING *lspconfig-debugging*

lsp/bright_script.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@
99
return {
1010
cmd = { 'bsc', '--lsp', '--stdio' },
1111
filetypes = { 'brs' },
12-
single_file_support = true,
1312
root_markers = { 'makefile', 'Makefile', '.git' },
1413
}

0 commit comments

Comments
 (0)