Skip to content

Commit

Permalink
add v-analyzer
Browse files Browse the repository at this point in the history
  • Loading branch information
zakuro9715 committed Sep 3, 2023
1 parent 98da469 commit 615863a
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
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

0 comments on commit 615863a

Please sign in to comment.