Skip to content

Commit

Permalink
Merge branch 'neovim:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitrisDimitropoulos authored Jan 30, 2024
2 parents 84d9618 + 0219062 commit 7ef9b64
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 101 deletions.
67 changes: 3 additions & 64 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,73 +5,12 @@ body:
- type: markdown
attributes:
value: |
Before reporting: search existing issues and ensure you are running the latest nightly of neovim and the latest version of nvim-lspconfig. Note that this repository implements configuration and initialization of language servers. Implementation of the language server spec itself is located in the neovim core repository.
Do NOT file bugs in this repo. The configs in this repo are unsupported and provided only as a starting point. We depend on users (like you) to troubleshoot issues with their specific LSP setups and [send improvements](https://github.com/neovim/nvim-lspconfig/blob/master/CONTRIBUTING.md).
If you have a feature request or found a bug in the core Nvim `vim.lsp` module (not this repo), [report it to Nvim](https://github.com/neovim/neovim/issues/new?assignees=&labels=bug%2Clsp&projects=&template=lsp_bug_report.yml).
- type: textarea
attributes:
label: "Description"
description: "A short description of the problem you are reporting."
validations:
required: true
- type: textarea
attributes:
label: "Neovim version"
description: "Output of `nvim --version`"
placeholder: |
NVIM v0.6.0-dev+209-g0603eba6e
Build type: Release
LuaJIT 2.1.0-beta3
validations:
required: true
- type: input
attributes:
label: "Nvim-lspconfig version"
description: "Commit hash"
placeholder: 1344a859864d4e6d23d3f3adf56d49e6386ec0d2
- type: input
attributes:
label: "Operating system and version"
placeholder: "macOS 11.5"
validations:
required: true
- type: input
attributes:
label: "Affected language servers"
description: "If this issue is specific to one or more language servers, list them here. If not, write 'all'."
placeholder: "clangd"
validations:
required: true
- type: textarea
attributes:
label: "Steps to reproduce"
description: "Steps to reproduce using the minimal config provided below."
placeholder: |
1. `nvim -nu minimal.lua`
2. ...
validations:
required: true
- type: textarea
attributes:
label: "Actual behavior"
description: "Observed behavior."
validations:
required: true
- type: textarea
attributes:
label: "Expected behavior"
description: "A description of the behavior you expected."
- type: textarea
attributes:
label: "Minimal config"
render: Lua
description: "You can download a minimal_init.lua via `curl -fLO https://raw.githubusercontent.com/neovim/nvim-lspconfig/master/test/minimal_init.lua`. Then edit it to include your language server and add necessary configuration and paste it here."
validations:
required: true
- type: input
attributes:
label: "LSP log"
description: "If not using the `minimal_init.lua`, add `vim.lsp.set_log_level('debug')` to your LSP setup, upload the log file at `$HOME/.cache/nvim/lsp.log` to https://gist.github.com, and paste the link here."
validations:
required: true



24 changes: 0 additions & 24 deletions .github/ISSUE_TEMPLATE/feature_request.yml

This file was deleted.

18 changes: 16 additions & 2 deletions doc/server_configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -1239,11 +1239,11 @@ require'lspconfig'.biome.setup{}
```
- `root_dir` :
```lua
root_pattern('package.json', 'node_modules', '.git', 'biome.json')
root_pattern('biome.json')
```
- `single_file_support` :
```lua
true
false
```


Expand Down Expand Up @@ -5918,6 +5918,16 @@ require'lspconfig'.mdx_analyzer.setup{}
```lua
{ "markdown.mdx" }
```
- `init_options` :
```lua
{
typescript = {}
}
```
- `on_new_config` :
```lua
see source file
```
- `root_dir` :
```lua
see source file
Expand Down Expand Up @@ -11383,6 +11393,10 @@ require'lspconfig'.vale_ls.setup{}
```lua
see source file
```
- `single_file_support` :
```lua
true
```


## vdmj
Expand Down
18 changes: 16 additions & 2 deletions doc/server_configurations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1239,11 +1239,11 @@ require'lspconfig'.biome.setup{}
```
- `root_dir` :
```lua
root_pattern('package.json', 'node_modules', '.git', 'biome.json')
root_pattern('biome.json')
```
- `single_file_support` :
```lua
true
false
```


Expand Down Expand Up @@ -5918,6 +5918,16 @@ require'lspconfig'.mdx_analyzer.setup{}
```lua
{ "markdown.mdx" }
```
- `init_options` :
```lua
{
typescript = {}
}
```
- `on_new_config` :
```lua
see source file
```
- `root_dir` :
```lua
see source file
Expand Down Expand Up @@ -11383,6 +11393,10 @@ require'lspconfig'.vale_ls.setup{}
```lua
see source file
```
- `single_file_support` :
```lua
true
```


## vdmj
Expand Down
3 changes: 3 additions & 0 deletions lua/lspconfig/configs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ function configs.__newindex(t, config_name, config_def)
api.nvim_create_autocmd('BufReadPost', {
pattern = fn.fnameescape(root_dir) .. '/*',
callback = function(arg)
if #M.manager:clients() == 0 then
return true
end
M.manager:try_add_wrapper(arg.buf, root_dir)
end,
group = lsp_group,
Expand Down
10 changes: 3 additions & 7 deletions lua/lspconfig/server_configurations/biome.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,8 @@ return {
'typescript.tsx',
'typescriptreact',
},
root_dir = function(fname)
return util.find_package_json_ancestor(fname)
or util.find_node_modules_ancestor(fname)
or util.find_git_ancestor(fname)
end,
single_file_support = true,
root_dir = util.root_pattern 'biome.json',
single_file_support = false,
},
docs = {
description = [[
Expand All @@ -30,7 +26,7 @@ npm install [-g] @biomejs/biome
```
]],
default_config = {
root_dir = [[root_pattern('package.json', 'node_modules', '.git', 'biome.json')]],
root_dir = [[root_pattern('biome.json')]],
},
},
}
2 changes: 1 addition & 1 deletion lua/lspconfig/server_configurations/lua_ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ return {
end
root = util.root_pattern 'lua/'(fname)
if root then
return root .. '/lua/'
return root
end
return util.find_git_ancestor(fname)
end,
Expand Down
13 changes: 13 additions & 0 deletions lua/lspconfig/server_configurations/mdx_analyzer.lua
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
local util = require 'lspconfig.util'

local function get_typescript_server_path(root_dir)
local project_root = util.find_node_modules_ancestor(root_dir)
return project_root and (util.path.join(project_root, 'node_modules', 'typescript', 'lib')) or ''
end

return {
default_config = {
cmd = { 'mdx-language-server', '--stdio' },
filetypes = { 'markdown.mdx' },
root_dir = util.root_pattern 'package.json',
single_file_support = true,
settings = {},
init_options = {
typescript = {},
},
on_new_config = function(new_config, new_root_dir)
if vim.tbl_get(new_config.init_options, 'typescript') and not new_config.init_options.typescript.tsdk then
new_config.init_options.typescript.tsdk = get_typescript_server_path(new_root_dir)
end
end,
},
commands = {},
docs = {
Expand Down
2 changes: 1 addition & 1 deletion lua/lspconfig/server_configurations/texlab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ return {
default_config = {
cmd = { 'texlab' },
filetypes = { 'tex', 'plaintex', 'bib' },
root_dir = util.root_pattern('.latexmkrc', '.git'),
root_dir = util.root_pattern('.git', '.latexmkrc'),
single_file_support = true,
settings = {
texlab = {
Expand Down
1 change: 1 addition & 0 deletions lua/lspconfig/server_configurations/vale_ls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ return {
cmd = { 'vale-ls' },
filetypes = { 'markdown', 'text' },
root_dir = util.root_pattern '.vale.ini',
single_file_support = true,
},
docs = {
description = [[
Expand Down

0 comments on commit 7ef9b64

Please sign in to comment.