mirror of
https://github.com/mattn/vim-lsp-settings.git
synced 2025-12-12 20:35:54 +01:00
add fsautocomplete for fsharp
This commit is contained in:
18
installer/install-fsautocomplete.cmd
Normal file
18
installer/install-fsautocomplete.cmd
Normal file
@@ -0,0 +1,18 @@
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
curl -L -o dotnet-runtime-3.1.1-win-x64.zip "https://download.visualstudio.microsoft.com/download/pr/d9768135-4646-4839-9eea-b404bb940452/8275e4320514bab636b1627c62906ef9/dotnet-runtime-3.1.1-win-x64.zip"
|
||||
call "%~dp0\run_unzip.cmd" dotnet-runtime-3.1.1-win-x64.zip
|
||||
|
||||
set url=https://ci.appveyor.com/api/projects/fsautocomplete/fsautocomplete/artifacts/bin/pkgs/fsautocomplete.netcore.zip?branch=master
|
||||
|
||||
set zip=fsautocomplete.zip
|
||||
curl -L %url% -o %zip%
|
||||
call "%~dp0\run_unzip.cmd" %zip%
|
||||
|
||||
echo @echo off ^
|
||||
|
||||
%%~dp0\dotnet.exe fsautocomplete.dll %%* ^
|
||||
|
||||
> fsautocomplete.cmd
|
||||
27
installer/install-fsautocomplete.sh
Executable file
27
installer/install-fsautocomplete.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
if command -v dotnet >/dev/null 2>&1; then
|
||||
echo "dotnet installed"
|
||||
dotnetcmd=dotnet
|
||||
else
|
||||
echo "dotnet not found, installing..."
|
||||
# REF https://github.com/neovim/nvim-lsp/blob/master/lua/nvim_lsp/pyls_ms.lua
|
||||
curl -L https://dot.net/v1/dotnet-install.sh | bash -s -- -i "./.dotnet"
|
||||
dotnetcmd="\\$DIR/.dotnet/dotnet"
|
||||
fi
|
||||
|
||||
url="https://ci.appveyor.com/api/projects/fsautocomplete/fsautocomplete/artifacts/bin/pkgs/fsautocomplete.netcore.zip?branch=master"
|
||||
zip=fsautocomplete.zip
|
||||
curl -L "$url" -o "$zip"
|
||||
unzip -o -d "fsautocomplete.netcore" "$zip"
|
||||
|
||||
cat <<EOF >fsautocomplete
|
||||
#!/bin/sh
|
||||
|
||||
DIR=\$(cd \$(dirname \$0); pwd)
|
||||
$dotnetcmd \$DIR/fsautocomplete.netcore/fsautocomplete.dll
|
||||
EOF
|
||||
|
||||
chmod +x fsautocomplete
|
||||
@@ -130,6 +130,10 @@
|
||||
}
|
||||
],
|
||||
"fsharp": [
|
||||
{
|
||||
"command": "fsautocomplete",
|
||||
"requires": []
|
||||
},
|
||||
{
|
||||
"command": "fsharp-language-server",
|
||||
"requires": [
|
||||
|
||||
13
settings/fsautocomplete.vim
Normal file
13
settings/fsautocomplete.vim
Normal file
@@ -0,0 +1,13 @@
|
||||
augroup vimlsp_settings_fsautocomplete
|
||||
au!
|
||||
LspRegisterServer {
|
||||
\ 'name': 'fsautocomplete',
|
||||
\ 'cmd': {server_info->lsp_settings#get('fsautocomplete', 'cmd', [lsp_settings#exec_path('fsautocomplete'), '--background-service-enabled'])},
|
||||
\ 'root_uri':{server_info->lsp_settings#get('fsautocomplete', 'root_uri', lsp_settings#root_uri(g:lsp_settings_root_markers))},
|
||||
\ 'initialization_options': lsp_settings#get('fsautocomplete', 'initialization_options', {'AutomaticWorkspaceInit': v:true}),
|
||||
\ 'whitelist': lsp_settings#get('fsautocomplete', 'whitelist', ['fsharp']),
|
||||
\ 'blacklist': lsp_settings#get('fsautocomplete', 'blacklist', []),
|
||||
\ 'config': lsp_settings#get('fsautocomplete', 'config', {}),
|
||||
\ 'workspace_config': lsp_settings#get('fsautocomplete', 'workspace_config', {}),
|
||||
\ }
|
||||
augroup END
|
||||
Reference in New Issue
Block a user