mirror of
https://github.com/mattn/vim-lsp-settings.git
synced 2025-12-12 20:35:54 +01:00
Merge branch 'master' into update-servers
This commit is contained in:
39
.github/workflows/ci.yml
vendored
Normal file
39
.github/workflows/ci.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: ci
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
version: [stable, nightly]
|
||||
vim_type: ['Vim', 'Neovim']
|
||||
include:
|
||||
- vim_type: 'Vim'
|
||||
neovim: false
|
||||
- vim_type: 'Neovim'
|
||||
neovim: true
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- id: vim
|
||||
uses: rhysd/action-setup-vim@v1
|
||||
with:
|
||||
version: ${{ matrix.version }}
|
||||
neovim: ${{ matrix.neovim }}
|
||||
- name: 'Setup vim-themis'
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
repository: thinca/vim-themis
|
||||
path: vim-themis
|
||||
- name: Run tests
|
||||
env:
|
||||
THEMIS_VIM: ${{ steps.vim.outputs.executable }}
|
||||
run: |
|
||||
./vim-themis/bin/themis ./test
|
||||
44
.github/workflows/linux_neovim.yml
vendored
44
.github/workflows/linux_neovim.yml
vendored
@@ -1,44 +0,0 @@
|
||||
name: linux_neovim
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
name: [neovim-v04-x64,neovim-nightly-x64]
|
||||
include:
|
||||
- name: neovim-v04-x64
|
||||
os: ubuntu-latest
|
||||
neovim_version: v0.4.3
|
||||
- name: neovim-nightly-x64
|
||||
os: ubuntu-latest
|
||||
neovim_version: nightly
|
||||
runs-on: ${{matrix.os}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Download neovim
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/nvim/bin
|
||||
curl -L https://github.com/neovim/neovim/releases/download/${{matrix.neovim_version}}/nvim.appimage -o ~/nvim/bin/nvim
|
||||
chmod u+x ~/nvim/bin/nvim
|
||||
- name: Download test runner
|
||||
shell: bash
|
||||
run: git clone --depth 1 --branch v1.5.4 --single-branch https://github.com/thinca/vim-themis ~/themis
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=~/nvim/bin:$PATH
|
||||
export PATH=~/themis/bin:$PATH
|
||||
export THEMIS_VIM=nvim
|
||||
nvim --version
|
||||
themis --reporter spec
|
||||
46
.github/workflows/linux_vim.yml
vendored
46
.github/workflows/linux_vim.yml
vendored
@@ -1,46 +0,0 @@
|
||||
name: linux_vim
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
name: [vim-v82-x64, vim-v81-x64]
|
||||
include:
|
||||
- name: vim-v82-x64
|
||||
os: ubuntu-latest
|
||||
vim_version: 8.2.0037
|
||||
glibc_version: 2.15
|
||||
- name: vim-v81-x64
|
||||
os: ubuntu-latest
|
||||
vim_version: 8.1.2414
|
||||
glibc_version: 2.15
|
||||
runs-on: ${{matrix.os}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Download vim
|
||||
shell: bash
|
||||
run: |
|
||||
mkdir -p ~/vim/bin
|
||||
curl -L https://github.com/vim/vim-appimage/releases/download/v${{matrix.vim_version}}/GVim-v${{matrix.vim_version}}.glibc${{matrix.glibc_version}}-x86_64.AppImage -o ~/vim/bin/vim
|
||||
chmod u+x ~/vim/bin/vim
|
||||
- name: Download test runner
|
||||
shell: bash
|
||||
run: git clone --depth 1 --branch v1.5.4 --single-branch https://github.com/thinca/vim-themis ~/themis
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=~/vim/bin:$PATH
|
||||
export PATH=~/themis/bin:$PATH
|
||||
export THEMIS_VIM=vim
|
||||
vim --version
|
||||
themis --reporter spec
|
||||
44
.github/workflows/mac_neovim.yml
vendored
44
.github/workflows/mac_neovim.yml
vendored
@@ -1,44 +0,0 @@
|
||||
name: mac_neovim
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest]
|
||||
name: [neovim-v04-x64,neovim-nightly-x64]
|
||||
include:
|
||||
- name: neovim-v04-x64
|
||||
os: macos-latest
|
||||
neovim_version: v0.4.3
|
||||
- name: neovim-nightly-x64
|
||||
os: macos-latest
|
||||
neovim_version: nightly
|
||||
runs-on: ${{matrix.os}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Download neovim
|
||||
shell: bash
|
||||
run: curl -L https://github.com/neovim/neovim/releases/download/${{matrix.neovim_version}}/nvim-macos.tar.gz -o ~/nvim.tar.gz
|
||||
- name: Extract neovim
|
||||
shell: bash
|
||||
run: tar xzf ~/nvim.tar.gz -C ~/
|
||||
- name: Download test runner
|
||||
shell: bash
|
||||
run: git clone --depth 1 --branch v1.5.4 --single-branch https://github.com/thinca/vim-themis ~/themis
|
||||
- name: Run tests
|
||||
shell: bash
|
||||
run: |
|
||||
export PATH=~/nvim-osx64/bin:$PATH
|
||||
export PATH=~/themis/bin:$PATH
|
||||
export THEMIS_VIM=nvim
|
||||
nvim --version
|
||||
themis --reporter spec
|
||||
46
.github/workflows/windows_neovim.yml
vendored
46
.github/workflows/windows_neovim.yml
vendored
@@ -1,46 +0,0 @@
|
||||
name: windows_neovim
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
name: [neovim-v04-x64,neovim-nightly-x64]
|
||||
include:
|
||||
- name: neovim-v04-x64
|
||||
os: windows-latest
|
||||
neovim_version: v0.4.3
|
||||
neovim_arch: win64
|
||||
- name: neovim-nightly-x64
|
||||
os: windows-latest
|
||||
neovim_version: nightly
|
||||
neovim_arch: win64
|
||||
runs-on: ${{matrix.os}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Download neovim
|
||||
shell: PowerShell
|
||||
run: Invoke-WebRequest -Uri https://github.com/neovim/neovim/releases/download/${{matrix.neovim_version}}/nvim-${{matrix.neovim_arch}}.zip -OutFile neovim.zip
|
||||
- name: Extract neovim
|
||||
shell: PowerShell
|
||||
run: Expand-Archive -Path neovim.zip -DestinationPath $env:USERPROFILE
|
||||
- name: Download test runner
|
||||
shell: PowerShell
|
||||
run: git clone --depth 1 --branch v1.5.4 --single-branch https://github.com/thinca/vim-themis $env:USERPROFILE\themis
|
||||
- name: Run tests
|
||||
shell: cmd
|
||||
run: |
|
||||
SET PATH=%USERPROFILE%\Neovim\bin;%PATH%;
|
||||
SET PATH=%USERPROFILE%\themis\bin;%PATH%;
|
||||
SET THEMIS_VIM=nvim
|
||||
nvim --version
|
||||
themis --reporter spec
|
||||
52
.github/workflows/windows_vim.yml
vendored
52
.github/workflows/windows_vim.yml
vendored
@@ -1,52 +0,0 @@
|
||||
name: windows_vim
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
name: [vim-v82-x64, vim-v81-x64, vim-v80-x64]
|
||||
include:
|
||||
- name: vim-v82-x64
|
||||
os: windows-latest
|
||||
vim_version: 8.2.0037
|
||||
vim_arch: x64
|
||||
vim_ver_path: vim82
|
||||
- name: vim-v81-x64
|
||||
os: windows-latest
|
||||
vim_version: 8.1.2414
|
||||
vim_arch: x64
|
||||
vim_ver_path: vim81
|
||||
- name: vim-v80-x64
|
||||
os: windows-latest
|
||||
vim_version: 8.0.1567
|
||||
vim_arch: x64
|
||||
vim_ver_path: vim80
|
||||
runs-on: ${{matrix.os}}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Download vim
|
||||
shell: PowerShell
|
||||
run: Invoke-WebRequest -Uri https://github.com/vim/vim-win32-installer/releases/download/v${{matrix.vim_version}}/gvim_${{matrix.vim_version}}_${{matrix.vim_arch}}.zip -OutFile vim.zip
|
||||
- name: Extract vim
|
||||
shell: PowerShell
|
||||
run: Expand-Archive -Path vim.zip -DestinationPath $env:USERPROFILE
|
||||
- name: Download test runner
|
||||
shell: PowerShell
|
||||
run: git clone --depth 1 --branch v1.5.4 --single-branch https://github.com/thinca/vim-themis $env:USERPROFILE\themis
|
||||
- name: Run tests
|
||||
shell: cmd
|
||||
run: |
|
||||
SET PATH=%USERPROFILE%\vim\${{matrix.vim_ver_path}};%PATH%;
|
||||
SET PATH=%USERPROFILE%\themis\bin;%PATH%;
|
||||
vim --version
|
||||
themis --reporter spec
|
||||
@@ -1 +1,2 @@
|
||||
disable=SC2002
|
||||
disable=SC2046
|
||||
|
||||
10
README.md
10
README.md
@@ -1,11 +1,7 @@
|
||||
# vim-lsp-settings
|
||||
|
||||
[](https://github.com/mattn/vim-lsp-settings/actions)
|
||||
[](https://github.com/mattn/vim-lsp-settings/actions)
|
||||
[](https://github.com/mattn/vim-lsp-settings/actions)
|
||||
[](https://github.com/mattn/vim-lsp-settings/actions)
|
||||
[](https://github.com/mattn/vim-lsp-settings/actions)
|
||||
[](https://github.com/mattn/vim-lsp-settings/actions)
|
||||
[](https://github.com/mattn/vim-lsp-settings/actions)
|
||||
|
||||
Auto configurations for Language Servers for [vim-lsp](https://github.com/prabirshrestha/vim-lsp).
|
||||
|
||||
@@ -103,6 +99,7 @@ Because there is no way to update a server, please run `:LspInstallServer` again
|
||||
| GraphQL | gql-language-server | Yes | Yes |
|
||||
| Groovy | groovy-language-server | Yes | Yes |
|
||||
| Haskell | haskell-ide-engine | No | No |
|
||||
| Haskell | haskell-language-server | No | No |
|
||||
| HTML | html-languageserver | Yes | Yes |
|
||||
| HTML | angular-language-server | Yes | Yes |
|
||||
| HTML | tailwindcss-intellisense | Yes | Yes |
|
||||
@@ -127,6 +124,7 @@ Because there is no way to update a server, please run `:LspInstallServer` again
|
||||
| Python | pyls (pyls without dependencies) | Yes | Yes |
|
||||
| Python | pyls-ms (Microsoft Version) | Yes | Yes |
|
||||
| Python | jedi-language-server | Yes | Yes |
|
||||
| Python | pyright-langserver | Yes | Yes |
|
||||
| R | languageserver | Yes | No |
|
||||
| Reason | reason-language-server | Yes | Yes |
|
||||
| Ruby | solargraph | Yes | Yes |
|
||||
@@ -142,12 +140,14 @@ Because there is no way to update a server, please run `:LspInstallServer` again
|
||||
| TeX | digestif | Yes | No |
|
||||
| Terraform | terraform-lsp | Yes | Yes |
|
||||
| Terraform | terraform-ls | Yes | Yes |
|
||||
| TTCN-3 | ntt | Yes | Yes |
|
||||
| TypeScript | typescript-language-server | Yes | Yes |
|
||||
| TypeScript | rome | Yes | Yes |
|
||||
| TypeScript | eslint-language-server | Yes | Yes |
|
||||
| Vim | vim-language-server | Yes | Yes |
|
||||
| Vala | vala-language-server | No | No |
|
||||
| Vue | vue-language-server | Yes | Yes |
|
||||
| V | vls | Yes | Yes |
|
||||
| XML | lemminx | Yes | Yes |
|
||||
| YAML | yaml-language-server | Yes | Yes |
|
||||
| ZIG | zls | No | No |
|
||||
|
||||
@@ -105,6 +105,7 @@ function! s:vim_lsp_installer(ft, ...) abort
|
||||
let l:missing = 0
|
||||
for l:require in l:conf.requires
|
||||
if !lsp_settings#executable(l:require)
|
||||
call lsp_settings#utils#warning(l:conf.command . ' requires ' . l:require)
|
||||
let l:missing = 1
|
||||
break
|
||||
endif
|
||||
@@ -116,7 +117,7 @@ function! s:vim_lsp_installer(ft, ...) abort
|
||||
return [l:conf.command, l:command]
|
||||
endif
|
||||
endfor
|
||||
return []
|
||||
return [v:false] " placeholder, so that empty() returns false, but len() < 2 returns true
|
||||
endfunction
|
||||
|
||||
function! lsp_settings#server_config(name) abort
|
||||
@@ -336,6 +337,10 @@ function! s:vim_lsp_install_server(ft, command, bang) abort
|
||||
call lsp_settings#utils#error('Server not found')
|
||||
return
|
||||
endif
|
||||
if len(l:entry) < 2
|
||||
call lsp_settings#utils#error('Server could not be installed. See :messages for details.')
|
||||
return
|
||||
endif
|
||||
if empty(a:bang) && confirm(printf('Install %s ?', l:entry[0]), "&Yes\n&Cancel") !=# 1
|
||||
return
|
||||
endif
|
||||
@@ -369,7 +374,7 @@ function! s:vim_lsp_settings_suggest(ft) abort
|
||||
|
||||
redraw!
|
||||
echohl Directory
|
||||
echomsg 'Please do :LspInstallServer to enable Language Server ' . l:entry[0]
|
||||
unsilent echomsg 'Please do :LspInstallServer to enable Language Server ' . l:entry[0]
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
function! lsp_settings#profile#load_local() abort
|
||||
try
|
||||
let l:root = lsp#utils#find_nearest_parent_directory('.', '.vim-lsp-settings')
|
||||
if !empty(l:root) && filereadable(l:root . '/settings.json')
|
||||
let l:settings = json_decode(join(readfile(l:root . '/settings.json'), "\n"))
|
||||
if has_key(g:, 'lsp_settings')
|
||||
for [l:k, l:v] in items(l:settings)
|
||||
if has_key(g:lsp_settings, l:k)
|
||||
let g:lsp_settings[l:k] = extend(g:lsp_settings[l:k], l:v)
|
||||
else
|
||||
let g:lsp_settings[l:k] = l:v
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
let g:lsp_settings = l:settings
|
||||
endif
|
||||
let l:root = finddir('.vim-lsp-settings', ';')
|
||||
if empty(l:root)
|
||||
return
|
||||
endif
|
||||
if !filereadable(l:root . '/settings.json')
|
||||
return
|
||||
endif
|
||||
let l:settings = json_decode(join(readfile(l:root . '/settings.json'), "\n"))
|
||||
if has_key(g:, 'lsp_settings')
|
||||
for [l:k, l:v] in items(l:settings)
|
||||
if has_key(g:lsp_settings, l:k)
|
||||
let g:lsp_settings[l:k] = extend(g:lsp_settings[l:k], l:v)
|
||||
else
|
||||
let g:lsp_settings[l:k] = l:v
|
||||
endif
|
||||
endfor
|
||||
else
|
||||
let g:lsp_settings = l:settings
|
||||
endif
|
||||
catch
|
||||
endtry
|
||||
|
||||
@@ -5,9 +5,10 @@ function! lsp_settings#utils#msg(msg) abort
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
function! lsp_settings#utils#msg_inline(msg) abort
|
||||
echohl Comment
|
||||
echo a:msg
|
||||
function! lsp_settings#utils#warning(msg) abort
|
||||
redraw
|
||||
echohl WarningMsg
|
||||
echomsg a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
@echo off
|
||||
|
||||
ros install cxxxr/cl-lsp
|
||||
ros install cxxxr/lem cxxxr/cl-lsp
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
ros install cxxxr/cl-lsp
|
||||
ros install cxxxr/lem cxxxr/cl-lsp
|
||||
|
||||
@@ -38,7 +38,7 @@ case $distributor_id in
|
||||
Ubuntu)
|
||||
ubuntu_version=$(lsb_release -a 2>&1 | grep 'Release' | awk '{print $2}')
|
||||
case $ubuntu_version in
|
||||
14.04 | 16.04 | 18.04)
|
||||
14.04 | 16.04 | 18.04 | 20.04)
|
||||
platform="linux-gnu-ubuntu-$ubuntu_version"
|
||||
;;
|
||||
esac
|
||||
@@ -65,15 +65,24 @@ filename_v9="clang+llvm-9.0.0-x86_64-$platform"
|
||||
url_v9="http://releases.llvm.org/9.0.0/$filename_v9.tar.xz"
|
||||
filename_v10="clang+llvm-10.0.0-x86_64-$platform"
|
||||
url_v10="https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/$filename_v10.tar.xz"
|
||||
filename_v11="clang+llvm-11.0.0-x86_64-$platform"
|
||||
url_v11="https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.0/$filename_v11.tar.xz"
|
||||
|
||||
response_code=$(curl -sIL ${url_v10} -o /dev/null -w "%{response_code}")
|
||||
response_code=$(curl -sIL ${url_v11} -o /dev/null -w "%{response_code}")
|
||||
|
||||
if [ "${response_code}" == "404" ]; then
|
||||
url="${url_v9}"
|
||||
filename="${filename_v9}"
|
||||
response_code=$(curl -sIL ${url_v10} -o /dev/null -w "%{response_code}")
|
||||
|
||||
if [ "${response_code}" == "404" ]; then
|
||||
url="${url_v9}"
|
||||
filename="${filename_v9}"
|
||||
else
|
||||
url="${url_v10}"
|
||||
filename="${filename_v10}"
|
||||
fi
|
||||
else
|
||||
url="${url_v10}"
|
||||
filename="${filename_v10}"
|
||||
url="${url_v11}"
|
||||
filename="${filename_v11}"
|
||||
fi
|
||||
|
||||
echo "Downloading clangd and LLVM..."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
set VERSION=0.5.0
|
||||
set VERSION=0.6.2
|
||||
curl -L -o elixir-ls.zip "https://github.com/elixir-lsp/elixir-ls/releases/download/v%VERSION%/elixir-ls.zip"
|
||||
call "%~dp0\run_unzip.cmd" elixir-ls.zip
|
||||
del elixir-ls.zip
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
version="v0.5.0"
|
||||
version="v0.6.2"
|
||||
url="https://github.com/elixir-lsp/elixir-ls/releases/download/$version/elixir-ls.zip"
|
||||
curl -LO "$url"
|
||||
unzip elixir-ls.zip
|
||||
|
||||
5
installer/install-ntt.cmd
Normal file
5
installer/install-ntt.cmd
Normal file
@@ -0,0 +1,5 @@
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
set VERSION=0.5
|
||||
curl -L "https://github.com/nokia/ntt/releases/download/v%VERSION%/ntt_windows_x86_64.tar.gz" | tar xz ntt.exe
|
||||
21
installer/install-ntt.sh
Executable file
21
installer/install-ntt.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -o pipefail
|
||||
|
||||
version="0.5"
|
||||
os="$(uname -s | tr "[:upper:]" "[:lower:]")"
|
||||
|
||||
case "${os}" in
|
||||
darwin|linux)
|
||||
url="https://github.com/nokia/ntt/releases/download/v${version}/ntt_${os}_x86_64.tar.gz"
|
||||
curl -L "$url" | tar xz ntt
|
||||
chmod +x ntt
|
||||
;;
|
||||
|
||||
*)
|
||||
echo >&2 "$os is not supported"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
@@ -5,7 +5,7 @@ set VERSION=3.1.1
|
||||
curl -L -o dotnet-runtime-%VERSION%-win-x64.zip "https://download.visualstudio.microsoft.com/download/pr/d9768135-4646-4839-9eea-b404bb940452/8275e4320514bab636b1627c62906ef9/dotnet-runtime-%VERSION%-win-x64.zip"
|
||||
call "%~dp0\run_unzip.cmd" dotnet-runtime-%VERSION%-win-x64.zip
|
||||
|
||||
set VERSION=0.5.51
|
||||
set VERSION=0.5.59
|
||||
set url=https://pvsc.blob.core.windows.net/python-language-server-stable/Python-Language-Server-win-x64.%VERSION%.nupkg
|
||||
|
||||
set nupkg=./pyls.nupkg
|
||||
|
||||
@@ -17,7 +17,7 @@ darwin)
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
version="0.5.51"
|
||||
version="0.5.59"
|
||||
url="https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-${system}-x64.${version}.nupkg"
|
||||
|
||||
nupkg="./pyls.nupkg"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
set VERSION=2020-10-19
|
||||
set VERSION=2020-12-21
|
||||
curl -L -o rust-analyzer-windows.exe "https://github.com/rust-analyzer/rust-analyzer/releases/download/%VERSION%/rust-analyzer-windows.exe"
|
||||
|
||||
move rust-analyzer-windows.exe rust-analyzer.exe
|
||||
|
||||
@@ -13,7 +13,7 @@ darwin)
|
||||
;;
|
||||
esac
|
||||
|
||||
version="2020-10-19"
|
||||
version="2020-12-21"
|
||||
curl -L -o rust-analyzer-$platform "https://github.com/rust-analyzer/rust-analyzer/releases/download/$version/rust-analyzer-$platform"
|
||||
|
||||
mv rust-analyzer-$platform rust-analyzer
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
set VERSION=0.20.3
|
||||
set VERSION=1.8.1
|
||||
curl -L -o "vscode-lua.vsix" "https://github.com/sumneko/vscode-lua/releases/download/v%VERSION%/lua-%VERSION%.vsix"
|
||||
|
||||
call "%~dp0\run_unzip.cmd" vscode-lua.vsix
|
||||
|
||||
@@ -13,7 +13,7 @@ darwin)
|
||||
;;
|
||||
esac
|
||||
|
||||
version="0.20.3"
|
||||
version="1.8.1"
|
||||
url="https://github.com/sumneko/vscode-lua/releases/download/v$version/lua-$version.vsix"
|
||||
asset="vscode-lua.vsix"
|
||||
|
||||
|
||||
8
installer/install-vlang-vls.cmd
Normal file
8
installer/install-vlang-vls.cmd
Normal file
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
|
||||
git clone --depth=1 https://github.com/vlang/vls .
|
||||
|
||||
echo Compiling vlang/vls...
|
||||
v -prod cmd/vls
|
||||
move cmd/vls/vls.exe vlang-vls.exe
|
||||
rd /Q /S -rf instructions.png cmd jsonrpc lsp vls tests
|
||||
7
installer/install-vlang-vls.sh
Executable file
7
installer/install-vlang-vls.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
git clone --depth=1 https://github.com/vlang/vls .
|
||||
|
||||
echo 'Compiling vlang/vls...'
|
||||
v -prod cmd/vls
|
||||
mv cmd/vls/vls vlang-vls
|
||||
rm -rf instructions.png cmd jsonrpc lsp vls tests
|
||||
@@ -81,6 +81,18 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"context": [
|
||||
{
|
||||
"command": "texlab",
|
||||
"requires": []
|
||||
},
|
||||
{
|
||||
"command": "digestif",
|
||||
"requires": [
|
||||
"luarocks"
|
||||
]
|
||||
}
|
||||
],
|
||||
"cpp": [
|
||||
{
|
||||
"command": "clangd",
|
||||
@@ -218,6 +230,18 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"gdscript": [
|
||||
{
|
||||
"command": "godot",
|
||||
"requires": []
|
||||
}
|
||||
],
|
||||
"gdscript3": [
|
||||
{
|
||||
"command": "godot",
|
||||
"requires": []
|
||||
}
|
||||
],
|
||||
"glsl": [
|
||||
{
|
||||
"command": "glslls",
|
||||
@@ -294,6 +318,14 @@
|
||||
"stack.yaml",
|
||||
"package.yaml"
|
||||
]
|
||||
},
|
||||
{
|
||||
"command": "haskell-language-server",
|
||||
"requires": [],
|
||||
"root_uri_patterns": [
|
||||
"stack.yaml",
|
||||
"package.yaml"
|
||||
]
|
||||
}
|
||||
],
|
||||
"html": [
|
||||
@@ -847,6 +879,22 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"ttcn": [
|
||||
{
|
||||
"command": "ntt",
|
||||
"requires": [],
|
||||
"root_uri_patterns": [
|
||||
"package.yml"
|
||||
],
|
||||
"vim_plugin": {
|
||||
"extensions": [
|
||||
"ttcn",
|
||||
"ttcn3"
|
||||
],
|
||||
"name": "gustafj/vim-ttcn"
|
||||
}
|
||||
}
|
||||
],
|
||||
"typescript": [
|
||||
{
|
||||
"command": "typescript-language-server",
|
||||
@@ -937,6 +985,18 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"vlang": [
|
||||
{
|
||||
"command": "vlang-vls",
|
||||
"requires": [
|
||||
"git",
|
||||
"v"
|
||||
],
|
||||
"root_uri_patterns": [
|
||||
"v.mod"
|
||||
]
|
||||
}
|
||||
],
|
||||
"vue": [
|
||||
{
|
||||
"command": "vls",
|
||||
|
||||
@@ -39,7 +39,7 @@ function! s:handle_document_switch_source_header(ctx, server, type, has_extensio
|
||||
\ 'col': 0,
|
||||
\ }
|
||||
|
||||
call lsp#utils#location#_open_vim_list_item(l:loc)
|
||||
call lsp#utils#location#_open_vim_list_item(l:loc, '')
|
||||
echo 'Retrieved ' . a:type
|
||||
redraw
|
||||
endif
|
||||
@@ -83,8 +83,8 @@ function! s:document_switch_source_header() abort
|
||||
endfunction
|
||||
|
||||
function! s:on_lsp_buffer_enabled() abort
|
||||
command! LspDocumentSwitchSourceHeader call <SID>document_switch_source_header()
|
||||
nnoremap <plug>(lsp-switch-source-header) :<c-u>call <SID>document_switch_source_header()<cr>
|
||||
command! -buffer LspDocumentSwitchSourceHeader call <SID>document_switch_source_header()
|
||||
nnoremap <buffer> <plug>(lsp-switch-source-header) :<c-u>call <SID>document_switch_source_header()<cr>
|
||||
endfunction
|
||||
|
||||
augroup lsp_install_clangd
|
||||
|
||||
14
settings/godot.vim
Normal file
14
settings/godot.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
augroup vim_lsp_settings_godot
|
||||
au!
|
||||
LspRegisterServer {
|
||||
\ 'name': 'godot',
|
||||
\ 'tcp': {server_info->lsp_settings#get('godot', 'tcp', '127.0.0.1:6008')},
|
||||
\ 'root_uri':{server_info->lsp_settings#get('godot', 'root_uri', lsp_settings#root_uri('godot'))},
|
||||
\ 'initialization_options': lsp_settings#get('godot', 'initialization_options', v:null),
|
||||
\ 'allowlist': lsp_settings#get('godot', 'allowlist', ['gdscript3', 'gdscript']),
|
||||
\ 'blocklist': lsp_settings#get('godot', 'blocklist', []),
|
||||
\ 'config': lsp_settings#get('godot', 'config', lsp_settings#server_config('godot')),
|
||||
\ 'workspace_config': lsp_settings#get('godot', 'workspace_config', {}),
|
||||
\ 'semantic_highlight': lsp_settings#get('godot', 'semantic_highlight', {}),
|
||||
\ }
|
||||
augroup END
|
||||
14
settings/haskell-language-server.vim
Normal file
14
settings/haskell-language-server.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
augroup vim_lsp_settings_haskell_language_server
|
||||
au!
|
||||
LspRegisterServer {
|
||||
\ 'name': 'haskell-language-server',
|
||||
\ 'cmd': {server_info->lsp_settings#get('haskell-language-server', 'cmd', [lsp_settings#exec_path('haskell-language-server-wrapper'), '--lsp'])},
|
||||
\ 'root_uri':{server_info->lsp_settings#get('haskell-language-server', 'root_uri', lsp_settings#root_uri('haskell-language-server'))},
|
||||
\ 'initialization_options': lsp_settings#get('haskell-language-server', 'initialization_options', v:null),
|
||||
\ 'allowlist': lsp_settings#get('haskell-language-server', 'allowlist', ['haskell']),
|
||||
\ 'blocklist': lsp_settings#get('haskell-language-server', 'blocklist', []),
|
||||
\ 'config': lsp_settings#get('haskell-language-server', 'config', lsp_settings#server_config('haskell-language-server')),
|
||||
\ 'workspace_config': lsp_settings#get('haskell-language-server', 'workspace_config', {}),
|
||||
\ 'semantic_highlight': lsp_settings#get('haskell-language-server', 'semantic_highlight', {}),
|
||||
\ }
|
||||
augroup END
|
||||
14
settings/ntt.vim
Normal file
14
settings/ntt.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
augroup vim_lsp_settings_ntt
|
||||
au!
|
||||
LspRegisterServer {
|
||||
\ 'name': 'ntt',
|
||||
\ 'cmd': {server_info->lsp_settings#get('ntt', 'cmd', [lsp_settings#exec_path('ntt'), 'langserver'])},
|
||||
\ 'root_uri':{server_info->lsp_settings#get('ntt', 'root_uri', lsp_settings#root_uri('ntt'))},
|
||||
\ 'initialization_options': lsp_settings#get('ntt', 'initialization_options', v:null),
|
||||
\ 'allowlist': lsp_settings#get('ntt', 'allowlist', ['ttcn3', 'ttcn']),
|
||||
\ 'blocklist': lsp_settings#get('ntt', 'blocklist', []),
|
||||
\ 'config': lsp_settings#get('ntt', 'config', lsp_settings#server_config('ntt')),
|
||||
\ 'workspace_config': lsp_settings#get('ntt', 'workspace_config', {}),
|
||||
\ 'semantic_highlight': lsp_settings#get('ntt', 'semantic_highlight', {}),
|
||||
\ }
|
||||
augroup END
|
||||
@@ -8,7 +8,13 @@ augroup vim_lsp_settings_pyright_langserver
|
||||
\ 'allowlist': lsp_settings#get('pyright-langserver', 'allowlist', ['python']),
|
||||
\ 'blocklist': lsp_settings#get('pyright-langserver', 'blocklist', []),
|
||||
\ 'config': lsp_settings#get('pyright-langserver', 'config', lsp_settings#server_config('pyright-langserver')),
|
||||
\ 'workspace_config': lsp_settings#get('pyright-langserver', 'workspace_config', {}),
|
||||
\ 'workspace_config': lsp_settings#get('pyright-langserver', 'workspace_config', {
|
||||
\ 'python': {
|
||||
\ 'analysis': {
|
||||
\ 'useLibraryCodeForTypes': v:true
|
||||
\ },
|
||||
\ },
|
||||
\ }),
|
||||
\ 'semantic_highlight': lsp_settings#get('pyright-langserver', 'semantic_highlight', {}),
|
||||
\ }
|
||||
augroup END
|
||||
|
||||
@@ -4,7 +4,11 @@ augroup vim_lsp_settings_rust_analyzer
|
||||
\ 'name': 'rust-analyzer',
|
||||
\ 'cmd': {server_info->lsp_settings#get('rust-analyzer', 'cmd', [lsp_settings#exec_path('rust-analyzer')])},
|
||||
\ 'root_uri':{server_info->lsp_settings#get('rust-analyzer', 'root_uri', lsp_settings#root_uri('rust-analyzer'))},
|
||||
\ 'initialization_options': lsp_settings#get('rust-analyzer', 'initialization_options', v:null),
|
||||
\ 'initialization_options': lsp_settings#get('rust-analyzer', 'initialization_options', {
|
||||
\ 'completion': {
|
||||
\ 'autoimport': { 'enable': v:true },
|
||||
\ },
|
||||
\ }),
|
||||
\ 'allowlist': lsp_settings#get('rust-analyzer', 'allowlist', ['rust']),
|
||||
\ 'blocklist': lsp_settings#get('rust-analyzer', 'blocklist', []),
|
||||
\ 'config': lsp_settings#get('rust-analyzer', 'config', lsp_settings#server_config('rust-analyzer')),
|
||||
|
||||
@@ -78,9 +78,75 @@ function! s:document_build() abort
|
||||
echo 'Building document ...'
|
||||
endfunction
|
||||
|
||||
let s:forwardsearch_status_success = 0
|
||||
let s:forwardsearch_status_error = 1
|
||||
let s:forwardsearch_status_failure = 2
|
||||
let s:forwardsearch_status_unconfigured = 3
|
||||
|
||||
function! s:handle_document_forwardsearch(ctx, server, type, has_extension, data) abort "ctx = {counter, list, last_command_id}
|
||||
if a:ctx['last_command_id'] != lsp#_last_command()
|
||||
return
|
||||
endif
|
||||
|
||||
if lsp#client#is_error(a:data['response']) || !has_key(a:data['response'], 'result')
|
||||
call lsp#utils#error('Failed to retrieve '. a:type . ' for ' . a:server . ': ' . lsp#client#error_message(a:data['response']))
|
||||
return
|
||||
elseif type(a:data['response']['result']) !=# v:t_dict || !has_key(a:data['response']['result'], 'status')
|
||||
call lsp#utils#error('No searchable document found')
|
||||
return
|
||||
endif
|
||||
let l:status = a:data['response']['result']['status']
|
||||
if l:status ==# s:forwardsearch_status_success
|
||||
echomsg 'Preview success'
|
||||
elseif l:status ==# s:forwardsearch_status_error
|
||||
call lsp#utils#error('Preview failed: previewer process executed the command with errors')
|
||||
elseif l:status ==# s:forwardsearch_status_failure
|
||||
call lsp#utils#error('Preview failed: previewer process failed to start or crashed')
|
||||
elseif l:status ==# s:forwardsearch_status_unconfigured
|
||||
call lsp#utils#error('Preview failed: previewer command is not configured')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:document_forwardsearch() abort
|
||||
let l:servers = lsp#get_whitelisted_servers()
|
||||
|
||||
let l:has_extension = 0
|
||||
for l:server in l:servers
|
||||
if stridx(l:server, 'texlab') != -1
|
||||
let l:has_extension += 1
|
||||
endif
|
||||
endfor
|
||||
|
||||
if l:has_extension == 0
|
||||
call lsp#utils#error('Searching document not supported for '.&filetype)
|
||||
return
|
||||
endif
|
||||
|
||||
let l:command_id = lsp#_new_command()
|
||||
let l:ctx = { 'counter': l:has_extension, 'list':[], 'last_command_id': l:command_id }
|
||||
for l:server in l:servers
|
||||
if stridx(l:server, 'texlab') == -1
|
||||
continue
|
||||
endif
|
||||
|
||||
call lsp#send_request(l:server, {
|
||||
\ 'method': 'textDocument/forwardSearch',
|
||||
\ 'params': {
|
||||
\ 'textDocument': lsp#get_text_document_identifier(),
|
||||
\ 'position': lsp#get_position()
|
||||
\ },
|
||||
\ 'on_notification': function('s:handle_document_forwardsearch', [l:ctx, l:server, 'header/source', l:has_extension]),
|
||||
\ })
|
||||
endfor
|
||||
|
||||
echo 'Forward search...'
|
||||
endfunction
|
||||
|
||||
function! s:on_lsp_buffer_enabled() abort
|
||||
command! LspDocumentBuild call <SID>document_build()
|
||||
nnoremap <plug>(lsp-document-build) :<c-u>call <SID>document_build()<cr>
|
||||
command! -buffer LspDocumentBuild call <SID>document_build()
|
||||
nnoremap <buffer> <plug>(lsp-document-build) :<c-u>call <SID>document_build()<cr>
|
||||
command! -buffer LspDocumentForwardSearch call <SID>document_forwardsearch()
|
||||
nnoremap <buffer> <plug>(lsp-document-forwardsearch) :<c-u>call <SID>document_forwardsearch()<cr>
|
||||
endfunction
|
||||
|
||||
augroup lsp_install_texlab
|
||||
|
||||
14
settings/vlang-vls.vim
Normal file
14
settings/vlang-vls.vim
Normal file
@@ -0,0 +1,14 @@
|
||||
augroup vim_lsp_settings_vlang_vls
|
||||
au!
|
||||
LspRegisterServer {
|
||||
\ 'name': 'vlang-vls',
|
||||
\ 'cmd': {server_info->lsp_settings#get('vlang-vls', 'cmd', [lsp_settings#exec_path('vlang-vls')])},
|
||||
\ 'root_uri':{server_info->lsp_settings#get('vlang-vls', 'root_uri', lsp_settings#root_uri('vlang-vls'))},
|
||||
\ 'initialization_options': lsp_settings#get('vlang-vls', 'initialization_options', v:null),
|
||||
\ 'allowlist': lsp_settings#get('vlang-vls', 'allowlist', ['vlang']),
|
||||
\ 'blocklist': lsp_settings#get('vlang-vls', 'blocklist', []),
|
||||
\ 'config': lsp_settings#get('vlang-vls', 'config', lsp_settings#server_config('vlang-vls')),
|
||||
\ 'workspace_config': lsp_settings#get('vlang-vls', 'workspace_config', {}),
|
||||
\ 'semantic_highlight': lsp_settings#get('vlang-vls', 'semantic_highlight', {}),
|
||||
\ }
|
||||
augroup END
|
||||
Reference in New Issue
Block a user