Skip to content

Commit 946c58c

Browse files
authored
feat(solidity_ls)!: switch to first-party npm package (#3011)
The unofficial npm package was only uploaded once, two years ago: https://www.npmjs.com/package/solidity-language-server There is now a first-party package: juanfranblanco/vscode-solidity#432 (comment) https://www.npmjs.com/package/vscode-solidity-server
1 parent c656fe5 commit 946c58c

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed
Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
local util = require 'lspconfig.util'
22

3-
local bin_name = 'solidity-language-server'
4-
if vim.fn.has 'win32' == 1 then
5-
bin_name = bin_name .. '.cmd'
6-
end
3+
local root_files = {
4+
'hardhat.config.js',
5+
'hardhat.config.ts',
6+
'foundry.toml',
7+
'remappings.txt',
8+
'truffle.js',
9+
'truffle-config.js',
10+
'ape-config.yaml',
11+
}
712

813
return {
914
default_config = {
10-
cmd = { bin_name, '--stdio' },
15+
cmd = { 'vscode-solidity-server', '--stdio' },
1116
filetypes = { 'solidity' },
12-
root_dir = util.root_pattern('.git', 'package.json'),
17+
root_dir = util.root_pattern(unpack(root_files)) or util.root_pattern('.git', 'package.json'),
18+
single_file_support = true,
1319
},
1420
docs = {
1521
description = [[
16-
npm install -g solidity-language-server
22+
https://github.com/juanfranblanco/vscode-solidity
23+
24+
`vscode-solidity-server` can be installed via `npm`:
25+
26+
```sh
27+
npm install -g vscode-solidity-server
28+
```
1729
18-
solidity-language-server is a language server for the solidity language ported from the vscode solidity extension
30+
`vscode-solidity-server` is a language server for the Solidity language ported from the VSCode "solidity" extension.
1931
]],
2032
default_config = {
21-
root_dir = [[root_pattern(".git", "package.json")]],
33+
root_dir = [[root_pattern("]] .. table.concat(root_files, '", "') .. [[", ".git", "package.json")]],
2234
},
2335
},
2436
}

0 commit comments

Comments
 (0)