Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add v-analyzer #696

Merged
merged 1 commit into from
Sep 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ You can change the directory to install servers by set `g:lsp_settings_servers_d
| Veryl | veryl-ls | Yes | Yes |
| Vue | volar-server | Yes | Yes |
| Vue | vls | Yes | Yes |
| V | v-analyzer | Yes | Yes |
| V | vlang-vls | Yes | Yes |
| XML | lemminx | Yes | Yes |
| YAML | yaml-language-server | Yes | Yes |
Expand Down
14 changes: 14 additions & 0 deletions installer/install-v-analyzer.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@echo off

curl -o install.vsh "https://raw.githubusercontent.com/v-analyzer/v-analyzer/master/install.vsh"

for /f "delims=" %%a in (install.vsh) do (
set line=%%a
setlocal enabledelayedexpansion
echo !line:'~/.config/v-analyzer='.!>>install2.vsh
endlocal
)

v install2.vsh
del install.vsh install2.vsh
move bin\v-analyzer.exe .
7 changes: 7 additions & 0 deletions installer/install-v-analyzer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

url="https://raw.githubusercontent.com/v-analyzer/v-analyzer/master/install.vsh"

# Replace hard-coded installation path "~/.config/v-analyzer" with "."
v -e "$(curl -fsSL "$url" | sed 's#~/.config/v-analyzer#.#g')"
mv bin/v-analyzer v-analyzer
11 changes: 11 additions & 0 deletions settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,17 @@
}
],
"vlang": [
{
"command": "v-analyzer",
"url": "https://github.com/v-analyzer/v-analyzer",
"description": "Bring IDE features for V programming languages in VS Code, Vim and other editors",
"requires": [
"v"
],
"root_uri_patterns": [
"v.mod"
]
},
{
"command": "vlang-vls",
"url": "https://github.com/vlang/vls",
Expand Down
14 changes: 14 additions & 0 deletions settings/v-analyzer.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
augroup vim_lsp_settings_vlang_vls
au!
LspRegisterServer {
\ 'name': 'v-analyzer',
\ 'cmd': {server_info->lsp_settings#get('v-analyzer', 'cmd', [lsp_settings#exec_path('v-analyzer')]+lsp_settings#get('v-analyzer', 'args', []))},
\ 'root_uri':{server_info->lsp_settings#get('v-analyzer', 'root_uri', lsp_settings#root_uri('v-analyzer'))},
\ 'initialization_options': lsp_settings#get('v-analyzer', 'initialization_options', v:null),
\ 'allowlist': lsp_settings#get('v-analyzer', 'allowlist', ['vlang']),
\ 'blocklist': lsp_settings#get('v-analyzer', 'blocklist', []),
\ 'config': lsp_settings#get('v-analyzer', 'config', lsp_settings#server_config('v-analyzer')),
\ 'workspace_config': lsp_settings#get('v-analyzer', 'workspace_config', {}),
\ 'semantic_highlight': lsp_settings#get('v-analyzer', 'semantic_highlight', {}),
\ }
augroup END
Loading