Skip to content
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

not working with neovim lsp #843

Closed
gasacchi opened this issue Oct 25, 2021 · 4 comments · Fixed by #844
Closed

not working with neovim lsp #843

gasacchi opened this issue Oct 25, 2021 · 4 comments · Fixed by #844

Comments

@gasacchi
Copy link

gasacchi commented Oct 25, 2021

when using fsautocomplete with neovim builtin lsp, lsp doesn't working

Client 1 quit with exit code 3 and signal 0 

my fsautocomplete:

require'lspconfig'.fsautocomplete.setup{}

when i try to run dotnet fsautocomplete --background-service-enabled give me error like:

[09:48:08.207 ERR] [Startup] Start - LSP mode crashed
System.IO.FileNotFoundException: Could not load file or assembly 'Fantomas.Client, Version=0.3.1.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.

File name: 'Fantomas.Client, Version=0.3.1.0, Culture=neutral, PublicKeyToken=null'
   at FsAutoComplete.Commands..ctor(FSharpCompilerServiceChecker checker, State state, BackgroundService backgroundService, Boolean hasAnalyzers, FSharpOption`1 rootPath)
   at FsAutoComplete.Lsp.FSharpLspServer..ctor(Boolean backgroundServiceEnabled, State state, FSharpLspClient lspClient) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/FsAutoComplete.Lsp.fs:line 183
   at FsAutoComplete.Lsp.startCore@2073-2.Invoke(FSharpLspClient lspClient) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/FsAutoComplete.Lsp.fs:line 2073
   at LanguageServerProtocol.Server.start[a,b](FSharpMap`2 requestHandlings, Stream input, Stream output, FSharpFunc`2 clientCreator, FSharpFunc`2 serverCreator) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/LanguageServerProtocol/LanguageServerProtocol.fs:line 2782
   at FsAutoComplete.Lsp.startCore(Boolean backgroundServiceEnabled, ToolsPath toolsPath, FSharpFunc`2 workspaceLoaderFactory) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/FsAutoComplete.Lsp.fs:line 2073
   at FsAutoComplete.Lsp.start(Boolean backgroundServiceEnabled, ToolsPath toolsPath, FSharpFunc`2 workspaceLoaderFactory) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/FsAutoComplete.Lsp.fs:line 2079
~/Documents .NET v5.0.205 🎯 net5.0 

Dotnet version : 5.0.205
fsautocomplete: FsAutoComplete 0.48.1 (git sha da8f783)

@nojaf
Copy link
Contributor

nojaf commented Oct 25, 2021

Your .NET version does look a bit old, I have 5.0.401 could you perhaps try and upgrade your SDK (if possible).

@baronfel
Copy link
Contributor

This appears to be something wrong with the packaging of the dotnet tool version of fantomas. Ionide doesn't use this version of FSAC so it wasn't immediately apparent. If you look at the nuget package layout for 0.48.1, the Fantomas.Client dll isn't in the tools/net5.0/any folder as I'd expect it to be. We should investigate and fix this, then publish a new patch version of the dotnet tool.

@baronfel
Copy link
Contributor

Taking a brief look, this is probably a transitive dependency issue. The Fantomas.Client dependency is a direct dependency of FsAutoComplete.Core, but only a transitive of FsAutoComplete, and we run dotnet pack on FsAutoComplete to make the tool which somehow drops this. This is a behavioral difference from dotnet publish, which does include the transitive dependencies. A quick fix would be to add a direct dependency to Fantomas.Client to the FsAutoComplete, but I'd rather learn what the differences are and align the two methods.

@baronfel
Copy link
Contributor

This should be fixed in 0.48.2, which is being released now. Thank you for taking the time to report, I really want our vim/emacs/non-VSCode users to be happy with the experience overall :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants