From 7d5e39cfa64a64cadf0e8295a3984cac8fa6002d Mon Sep 17 00:00:00 2001 From: Adelar da Silva Queiróz Date: Fri, 11 Jun 2021 23:32:10 -0300 Subject: docs(fsautocomplete): update installation * Add global binary name as default cmd --- lua/lspconfig/fsautocomplete.lua | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/fsautocomplete.lua b/lua/lspconfig/fsautocomplete.lua index 5ae42d30..35d04986 100644 --- a/lua/lspconfig/fsautocomplete.lua +++ b/lua/lspconfig/fsautocomplete.lua @@ -1,8 +1,11 @@ local configs = require 'lspconfig/configs' local util = require 'lspconfig/util' -configs.fsautocomplete = { +local server_name = "fsautocomplete" + +configs[server_name] = { default_config = { + cmd = {'dotnet', 'fsautocomplete', '--background-service-enabled'}; root_dir = util.root_pattern('*.sln', '*.fsproj', '.git'); filetypes = {'fsharp'}; init_options = { @@ -13,26 +16,20 @@ configs.fsautocomplete = { 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. +Language Server for F# provided by FsAutoComplete (FSAC). FsAutoComplete requires the [dotnet-sdk](https://dotnet.microsoft.com/download) to be installed. +The prefered way to install FsAutoComplete is with `dotnet tool install --global fsautocomplete`. + +Instructions to compile from source are found on the main [repository](https://github.com/fsharp/FsAutoComplete). + 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. +This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim). -```lua -require'lspconfig'.fsautocomplete.setup{ - cmd = {'dotnet', 'path/to/fsautocomplete.dll', '--background-service-enabled'} -} -``` ]]; }; } -- cgit v1.2.3-70-g09d2