diff options
| author | Michael Lingelbach <m.j.lbach@gmail.com> | 2021-02-20 10:57:54 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-20 10:57:54 -0800 |
| commit | dafd7a96055961452f6e2bd5e8411b45088ebfc6 (patch) | |
| tree | 02e43423c3ab72bf45c85da22b4b79016d441e59 /lua | |
| parent | [docgen] Update CONFIG.md (diff) | |
| parent | LSP Config for F# using FsAutoComplete (diff) | |
| download | nvim-lspconfig-dafd7a96055961452f6e2bd5e8411b45088ebfc6.tar nvim-lspconfig-dafd7a96055961452f6e2bd5e8411b45088ebfc6.tar.gz nvim-lspconfig-dafd7a96055961452f6e2bd5e8411b45088ebfc6.tar.bz2 nvim-lspconfig-dafd7a96055961452f6e2bd5e8411b45088ebfc6.tar.lz nvim-lspconfig-dafd7a96055961452f6e2bd5e8411b45088ebfc6.tar.xz nvim-lspconfig-dafd7a96055961452f6e2bd5e8411b45088ebfc6.tar.zst nvim-lspconfig-dafd7a96055961452f6e2bd5e8411b45088ebfc6.zip | |
Merge pull request #747 from PhilT/lsp-config-for-fsharp
LSP Config for F# using FsAutoComplete
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/fsautocomplete.lua | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lua/lspconfig/fsautocomplete.lua b/lua/lspconfig/fsautocomplete.lua new file mode 100644 index 00000000..5ae42d30 --- /dev/null +++ b/lua/lspconfig/fsautocomplete.lua @@ -0,0 +1,39 @@ +local configs = require 'lspconfig/configs' +local util = require 'lspconfig/util' + +configs.fsautocomplete = { + default_config = { + root_dir = util.root_pattern('*.sln', '*.fsproj', '.git'); + filetypes = {'fsharp'}; + init_options = { + AutomaticWorkspaceInit = true; + }; + }; + docs = { + description = [[ +https://github.com/fsharp/FsAutoComplete + +Language Server for F# provded by FsAutoComplete (FSAC). + +Download a release of FsAutoComplete from [here](https://github.com/fsharp/FsAutoComplete/releases). +Instructions to compile from source are found on the main repository. + +FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. + +You may also need to configure the filetype as Vim defaults to Forth for `*.fs` files: + +`autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp` + +This is automatically done by plugins such as [vim-polyglot](https://github.com/sheerun/vim-polyglot), [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp) or [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp). + +**By default, this config doesn't have a `cmd` set.** This is because nvim-lspconfig does not make assumptions about your path. You must add the following to your init.vim or init.lua to set `cmd` to the absolute path ($HOME and ~ are not expanded) of your unzipped and compiled fsautocomplete.dll. + +```lua +require'lspconfig'.fsautocomplete.setup{ + cmd = {'dotnet', 'path/to/fsautocomplete.dll', '--background-service-enabled'} +} +``` + ]]; + }; +} +-- vim:et ts=2 sw=2 |
