-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Playing around with Neovim 0.5 LSP and fsharp-language-server #82
Comments
@PhilT Hi, I'm trying to use fsharp-language-server with nvim-lsp too, but not sure, why it doesn't work. Could you share your configuration, please? I created the following configuration, which seems correct for me: local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
configs.fsharp_language_server = {
default_config = {
-- Path to binary created with `dotnet publish -c Release -r linux-x64 src/FSharpLanguageServer`.
-- I also tried to use cmd for `dotnet exec $path/FSharpLanguageServer.dll`.
-- Both solutions work well from the command line.
cmd = {"/home/jubnzv/Sources/fsharp-language-server/src/FSharpLanguageServer/bin/Release/netcoreapp3.0/FSharpLanguageServer",};
filetypes = {'fsharp',};
root_dir = util.root_pattern(".git");
};
docs = {
description = [[
https://github.com/fsprojects/fsharp-language-server
This project is an implementation of the language server protocol using the F# Compiler Service.
]];
default_config = {
root_dir = [[root_pattern(".git")]];
};
};
} This is somewhat strange, since I don't get any errors in lsp logs and I also can execute fsharp-language server directly. |
You'll need the code from the PR that I raised above (neovim/neovim#13001). Here is Lua config in :lua << END
local nvim_lsp = require 'nvim_lsp'
local configs = require 'nvim_lsp/configs'
configs.fsharp = {
default_config = {
cmd = {"dotnet", "/home/phil/code/fsharp-language-server/src/FSharpLanguageServer/bin/Release/netcoreapp3.1/FSharpLanguageServer.dll"};
filetypes = {"fsharp"};
root_dir = nvim_lsp.util.root_pattern("*.fsproj", ".git");
};
}
local nvim_command = vim.api.nvim_command
local on_attach = function(client, bufnr)
require'completion'.on_attach{}
require'diagnostic'.on_attach{}
nvim_command('autocmd CursorHold <buffer> lua vim.lsp.util.show_line_diagnostics()')
end
nvim_lsp.fsharp.setup{on_attach = on_attach}
nvim_lsp.tsserver.setup{}
END
Shout if you need some more direction on setting it up. Cheers, |
@PhilT It started working after applying your patch. Thank you very much! :) |
@jubnzv Commit neovim/neovim#13174 means the patch is no longer required and works with the latest Neovim 0.5 master. |
@PhilT Thanks, yes, it works. There are some problems with nvim-lsp in neovim's HEAD (neovim/neovim#13210), but earlier versions works well with fsharp-lsp-server. |
FYI, I've been messing around trying to get Neovim nightly's LSP working with fsharp-language-server and I'm happy to report that with some tweaking (neovim/neovim#13001) it works! I get completion, errors, symbols, etc.
The text was updated successfully, but these errors were encountered: