1

I am trying to setup f# language server with neovim lsp. I have this in init.lua

nvim_lsp.fsautocomplete.setup{
  capabilities = capabilities,
  on_attach = on_attach,
  cmd = {'dotnet', '/Users/aritra/fsautocomplete.netcore/fsautocomplete.dll', '--background-service-enabled'},
  root_dir = nvim_lsp.util.root_pattern('*.sln', '.git', '*.fsproj')
}

I can see that lsp is attached to the client but no lsp feature is working. It gives an error like this RPC[Error] code_name = Internal Error, message = "Cahced typecheck results not yet available"

Also, fsautocomplete is now available from dotnet toolchain. How do I set this up properly so that lsp features work properly with any F# project or files?

Aritra Dattagupta
  • 760
  • 1
  • 7
  • 22

1 Answers1

0

Install fsautocomplete globally using dotnet tool install fsautocomplete --global.

As of fsautocomplete version 0.46.2, one can use the setup below

local nvim_lsp = require("lspconfig")

nvim_lsp.fsautocomplete.setup{
  capabilities = capabilities,
  on_attach = on_attach,
  cmd = {'<path to dotnet-fsautocomplete>', '--background-service-enabled'},
}

Hover, lsp diagnostics, code formatting and code actions are working as expected.

Aritra Dattagupta
  • 760
  • 1
  • 7
  • 22