aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--autoload/lsp_settings.vim15
-rw-r--r--installer/install-fsharp-language-server.cmd11
-rw-r--r--settings.json8
-rw-r--r--settings/fsharp-language-server.vim13
5 files changed, 48 insertions, 0 deletions
diff --git a/README.md b/README.md
index 1f7cefb..48f9d66 100644
--- a/README.md
+++ b/README.md
@@ -97,6 +97,7 @@ Currently, no way to uninstall/update server. Run this command again, newer vers
| Groovy | groovy-language-server | Yes |
| Dart | analysis-server-dart-snapshot | Yes |
| Erlang | erlang-ls | Yes |
+| F# | fsharp-language-server | Yes |
## License
diff --git a/autoload/lsp_settings.vim b/autoload/lsp_settings.vim
index e710d9a..08a8b3e 100644
--- a/autoload/lsp_settings.vim
+++ b/autoload/lsp_settings.vim
@@ -76,3 +76,18 @@ function! lsp_settings#root_uri(pattern) abort
endif
return lsp#utils#path_to_uri(l:dir)
endfunction
+
+function! lsp_settings#autocd(server_info) abort
+ if !has_key(a:server_info, 'root_uri')
+ return
+ endif
+ if type(a:server_info['root_uri']) ==# v:t_func
+ let l:root_uri = a:server_info['root_uri'](a:server_info)
+ else
+ let l:root_uri = a:server_info['root_uri']
+ endif
+ let l:path = lsp#utils#uri_to_path(l:root_uri)
+ if isdirectory(l:path)
+ exe 'cd' l:path
+ endif
+endfunction
diff --git a/installer/install-fsharp-language-server.cmd b/installer/install-fsharp-language-server.cmd
new file mode 100644
index 0000000..ebc389f
--- /dev/null
+++ b/installer/install-fsharp-language-server.cmd
@@ -0,0 +1,11 @@
+@echo off
+
+git clone https://github.com/fsprojects/fsharp-language-server .
+call npm install
+dotnet build -c Release
+
+echo @echo off ^
+
+dotnet %%~dp0\src\FSharpLanguageServer\bin\Release\netcoreapp2.0\FSharpLanguageServer.dll %%* ^
+
+> fsharp-language-server.cmd
diff --git a/settings.json b/settings.json
index e344ce4..6c8e019 100644
--- a/settings.json
+++ b/settings.json
@@ -102,6 +102,14 @@
]
}
],
+ "fsharp": [
+ {
+ "command": "fsharp-language-server",
+ "requires": [
+ "dotnet"
+ ]
+ }
+ ],
"go": [
{
"command": "gopls",
diff --git a/settings/fsharp-language-server.vim b/settings/fsharp-language-server.vim
new file mode 100644
index 0000000..a29f57d
--- /dev/null
+++ b/settings/fsharp-language-server.vim
@@ -0,0 +1,13 @@
+augroup vimlsp_settings_fsharp_language_server
+ au!
+ LspRegisterServer {
+ \ 'name': 'fsharp-language-server',
+ \ 'cmd': {server_info->lsp_settings#get('fsharp-language-server', 'cmd', [lsp_settings#exec_path('fsharp-language-server'), '--stdio'])},
+ \ 'root_uri':{server_info->lsp_settings#get('fsharp-language-server', 'root_uri', lsp_settings#root_uri(['.git/']))},
+ \ 'initialization_options': lsp_settings#get('fsharp-language-server', 'initialization_options', v:null),
+ \ 'whitelist': lsp_settings#get('fsharp-language-server', 'whitelist', ['fsharp']),
+ \ 'blacklist': lsp_settings#get('fsharp-language-server', 'blacklist', []),
+ \ 'config': lsp_settings#get('fsharp-language-server', 'config', {}),
+ \ 'workspace_config': lsp_settings#get('fsharp-language-server', 'workspace_config', {}),
+ \ }
+augroup END