Skip to content

Commit ed47a38

Browse files
docs: update configs.md
skip-checks: true
1 parent 3dde1b8 commit ed47a38

File tree

2 files changed

+36
-36
lines changed

2 files changed

+36
-36
lines changed

doc/configs.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,12 @@ Note, that if you override the default `cmd`, you must also update `on_new_confi
568568
local project_library_path = "/path/to/project/lib"
569569
local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path}
570570

571-
require'lspconfig'.angularls.setup{
571+
vim.lsp.config('angularls', {
572572
cmd = cmd,
573573
on_new_config = function(new_config,new_root_dir)
574574
new_config.cmd = cmd
575575
end,
576-
}
576+
})
577577
```
578578

579579
Snippet to enable the language server:
@@ -1095,7 +1095,7 @@ npm install -g azure-pipelines-language-server
10951095
By default `azure-pipelines-ls` will only work in files named `azure-pipelines.yml`, this can be changed by providing additional settings like so:
10961096
```lua
10971097
vim.lsp.config('azure_pipelines_ls', {
1098-
... -- other configuration for setup {}
1098+
... -- other configuration
10991099
settings = {
11001100
yaml = {
11011101
schemas = {
@@ -6882,7 +6882,7 @@ vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { pattern = { "*.nelua"
68826882
**By default, nelua-lsp doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary.
68836883

68846884
```lua
6885-
vim.lsp.config('nelua_lsp.setup, {
6885+
vim.lsp.config('nelua_lsp', {
68866886
cmd = { "nelua", "-L", "/path/to/nelua-lsp/", "--script", "/path/to/nelua-lsp/nelua-lsp.lua" },
68876887
})
68886888
```
@@ -7258,7 +7258,7 @@ Default config:
72587258

72597259
https://github.com/nokia/ntt
72607260
Installation instructions can be found [here](https://github.com/nokia/ntt#Install).
7261-
Can be configured by passing a "settings" object to `ntt.setup{}`:
7261+
Can be configured by passing a "settings" object to vim.lsp.config('ntt'):
72627262
```lua
72637263
vim.lsp.config('ntt', {
72647264
settings = {
@@ -9713,7 +9713,7 @@ https://github.com/shader-slang/slang
97139713
The `slangd` binary can be downloaded as part of [slang releases](https://github.com/shader-slang/slang/releases) or
97149714
by [building `slang` from source](https://github.com/shader-slang/slang/blob/master/docs/building.md).
97159715

9716-
The server can be configured by passing a "settings" object to `slangd.setup{}`:
9716+
The server can be configured by passing a "settings" object to vim.lsp.config('slangd'):
97179717

97189718
```lua
97199719
vim.lsp.config('slangd', {
@@ -10654,7 +10654,7 @@ https://github.com/bmatcuk/stylelint-lsp
1065410654
npm i -g stylelint-lsp
1065510655
```
1065610656

10657-
Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`:
10657+
Can be configured by passing a `settings.stylelintplus` object to vim.lsp.config('stylelint_lsp'):
1065810658

1065910659
```lua
1066010660
vim.lsp.config('stylelint_lsp', {
@@ -11611,7 +11611,7 @@ vim.lsp.config('ts_ls', {
1161111611
})
1161211612

1161311613
-- You must make sure volar is setup
11614-
-- e.g. require'lspconfig'.volar.setup{}
11614+
-- e.g. vim.lsp.config('volar')
1161511615
-- See volar's section for more information
1161611616
```
1161711617

@@ -12573,7 +12573,7 @@ Volar will run embedded `ts_ls` therefore there is no need to run it separately.
1257312573
```lua
1257412574
local lspconfig = require('lspconfig')
1257512575

12576-
lspconfig.volar.setup {
12576+
vim.lsp.config('volar', {
1257712577
-- add filetypes for typescript, javascript and vue
1257812578
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
1257912579
init_options = {
@@ -12582,9 +12582,9 @@ lspconfig.volar.setup {
1258212582
hybridMode = false,
1258312583
},
1258412584
},
12585-
}
12586-
-- you must remove ts_ls setup
12587-
-- lspconfig.ts_ls.setup {}
12585+
})
12586+
-- you must remove "ts_ls" config
12587+
-- vim.lsp.config['ts_ls'] = {}
1258812588
```
1258912589

1259012590
**Overriding the default TypeScript Server used by Volar**
@@ -12594,19 +12594,19 @@ e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are
1259412594

1259512595
- use a global TypeScript Server installation
1259612596
```lua
12597-
require'lspconfig'.volar.setup {
12597+
vim.lsp.config('volar', {
1259812598
init_options = {
1259912599
typescript = {
1260012600
-- replace with your global TypeScript library path
1260112601
tsdk = '/path/to/node_modules/typescript/lib'
1260212602
}
1260312603
}
12604-
}
12604+
})
1260512605
```
1260612606

1260712607
- use a local server and fall back to a global TypeScript Server installation
1260812608
```lua
12609-
require'lspconfig'.volar.setup {
12609+
vim.lsp.config('volar', {
1261012610
init_options = {
1261112611
typescript = {
1261212612
-- replace with your global TypeScript library path
@@ -12619,7 +12619,7 @@ require'lspconfig'.volar.setup {
1261912619
new_config.init_options.typescript.tsdk = lib_path
1262012620
end
1262112621
end
12622-
}
12622+
})
1262312623
```
1262412624

1262512625
Snippet to enable the language server:
@@ -12868,7 +12868,7 @@ root.
1286812868

1286912869
```lua
1287012870
vim.lsp.config('yamlls', {
12871-
... -- other configuration for setup {}
12871+
...
1287212872
settings = {
1287312873
yaml = {
1287412874
... -- other settings. note this overrides the lspconfig defaults.
@@ -12890,7 +12890,7 @@ To override a schema to use a specific k8s schema version (for example, to use 1
1289012890

1289112891
```lua
1289212892
vim.lsp.config('yamlls', {
12893-
... -- other configuration for setup {}
12893+
...
1289412894
settings = {
1289512895
yaml = {
1289612896
... -- other settings. note this overrides the lspconfig defaults.

doc/configs.txt

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ Note, that if you override the default `cmd`, you must also update `on_new_confi
178178
local project_library_path = "/path/to/project/lib"
179179
local cmd = {"ngserver", "--stdio", "--tsProbeLocations", project_library_path , "--ngProbeLocations", project_library_path}
180180

181-
require'lspconfig'.angularls.setup{
181+
vim.lsp.config('angularls', {
182182
cmd = cmd,
183183
on_new_config = function(new_config,new_root_dir)
184184
new_config.cmd = cmd
185185
end,
186-
}
186+
})
187187

188188
Snippet to enable the language server: >lua
189189
vim.lsp.enable('angularls')
@@ -590,7 +590,7 @@ An Azure Pipelines language server
590590

591591
By default `azure-pipelines-ls` will only work in files named `azure-pipelines.yml`, this can be changed by providing additional settings like so >lua
592592
vim.lsp.config('azure_pipelines_ls', {
593-
... -- other configuration for setup {}
593+
... -- other configuration
594594
settings = {
595595
yaml = {
596596
schemas = {
@@ -4984,7 +4984,7 @@ in lua >lua
49844984

49854985
**By default, nelua-lsp doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of the unzipped run script or binary.
49864986
>lua
4987-
vim.lsp.config('nelua_lsp.setup, {
4987+
vim.lsp.config('nelua_lsp', {
49884988
cmd = { "nelua", "-L", "/path/to/nelua-lsp/", "--script", "/path/to/nelua-lsp/nelua-lsp.lua" },
49894989
})
49904990

@@ -5272,7 +5272,7 @@ ntt
52725272

52735273
https://github.com/nokia/ntt
52745274
Installation instructions can be found [here](https://github.com/nokia/ntt#Install).
5275-
Can be configured by passing a "settings" object to `ntt.setup{}` >lua
5275+
Can be configured by passing a "settings" object to vim.lsp.config('ntt') >lua
52765276
vim.lsp.config('ntt', {
52775277
settings = {
52785278
ntt = {
@@ -7140,7 +7140,7 @@ https://github.com/shader-slang/slang
71407140
The `slangd` binary can be downloaded as part of [slang releases](https://github.com/shader-slang/slang/releases) or
71417141
by [building `slang` from source](https://github.com/shader-slang/slang/blob/master/docs/building.md).
71427142

7143-
The server can be configured by passing a "settings" object to `slangd.setup{}`:
7143+
The server can be configured by passing a "settings" object to vim.lsp.config('slangd'):
71447144
>lua
71457145
vim.lsp.config('slangd', {
71467146
settings = {
@@ -7841,7 +7841,7 @@ https://github.com/bmatcuk/stylelint-lsp
78417841
>sh
78427842
npm i -g stylelint-lsp
78437843

7844-
Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`:
7844+
Can be configured by passing a `settings.stylelintplus` object to vim.lsp.config('stylelint_lsp'):
78457845
>lua
78467846
vim.lsp.config('stylelint_lsp', {
78477847
settings = {
@@ -8593,7 +8593,7 @@ adds Vue support to this language server.
85938593
})
85948594

85958595
-- You must make sure volar is setup
8596-
-- e.g. require'lspconfig'.volar.setup{}
8596+
-- e.g. vim.lsp.config('volar')
85978597
-- See volar's section for more information
85988598

85998599
`location` MUST be defined. If the plugin is installed in `node_modules`,
@@ -9326,7 +9326,7 @@ See `ts_ls` section for more information
93269326
Volar will run embedded `ts_ls` therefore there is no need to run it separately >lua
93279327
local lspconfig = require('lspconfig')
93289328

9329-
lspconfig.volar.setup {
9329+
vim.lsp.config('volar', {
93309330
-- add filetypes for typescript, javascript and vue
93319331
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
93329332
init_options = {
@@ -9335,27 +9335,27 @@ Volar will run embedded `ts_ls` therefore there is no need to run it separately
93359335
hybridMode = false,
93369336
},
93379337
},
9338-
}
9339-
-- you must remove ts_ls setup
9340-
-- lspconfig.ts_ls.setup {}
9338+
})
9339+
-- you must remove "ts_ls" config
9340+
-- vim.lsp.config['ts_ls'] = {}
93419341

93429342
**Overriding the default TypeScript Server used by Volar**
93439343

93449344
The default config looks for TypeScript in the local `node_modules`. This can lead to issues
93459345
e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are:
93469346

93479347
- use a global TypeScript Server installatio >lua
9348-
require'lspconfig'.volar.setup {
9348+
vim.lsp.config('volar', {
93499349
init_options = {
93509350
typescript = {
93519351
-- replace with your global TypeScript library path
93529352
tsdk = '/path/to/node_modules/typescript/lib'
93539353
}
93549354
}
9355-
}
9355+
})
93569356

93579357
- use a local server and fall back to a global TypeScript Server installatio >lua
9358-
require'lspconfig'.volar.setup {
9358+
vim.lsp.config('volar', {
93599359
init_options = {
93609360
typescript = {
93619361
-- replace with your global TypeScript library path
@@ -9368,7 +9368,7 @@ e.g. when working on a [monorepo](https://monorepo.tools/). The alternatives are
93689368
new_config.init_options.typescript.tsdk = lib_path
93699369
end
93709370
end
9371-
}
9371+
})
93729372

93739373
Snippet to enable the language server: >lua
93749374
vim.lsp.enable('volar')
@@ -9559,7 +9559,7 @@ the a glob pattern relative to the detected project root. Check `:checkhealth vi
95599559
root.
95609560
>lua
95619561
vim.lsp.config('yamlls', {
9562-
... -- other configuration for setup {}
9562+
...
95639563
settings = {
95649564
yaml = {
95659565
... -- other settings. note this overrides the lspconfig defaults.
@@ -9579,7 +9579,7 @@ Currently, kubernetes is special-cased in yammls, see the following upstream iss
95799579
To override a schema to use a specific k8s schema version (for example, to use 1.18):
95809580
>lua
95819581
vim.lsp.config('yamlls', {
9582-
... -- other configuration for setup {}
9582+
...
95839583
settings = {
95849584
yaml = {
95859585
... -- other settings. note this overrides the lspconfig defaults.

0 commit comments

Comments
 (0)