ionide / FsAutoComplete

F# language server using Language Server Protocol
Other
396 stars 153 forks source link

FsAutoComplete not working on Replit #1109

Open thyvini opened 1 year ago

thyvini commented 1 year ago

I've created an empty F# env in replit, and tried to set LSP, but it's not working. When trying to run manually, it's failing with the following exception:

[16:17:05.107 ERR] [Startup] Start - LSP mode crashed
System.AggregateException: One or more errors occurred. (Header does not end with expected 
 character sequence: )
 ---> StreamJsonRpc.BadRpcHeaderException: Header does not end with expected 
 character sequence: 
   at StreamJsonRpc.HeaderDelimitedMessageHandler.ReadHeadersAsync(CancellationToken cancellationToken)
   at StreamJsonRpc.HeaderDelimitedMessageHandler.ReadCoreAsync(CancellationToken cancellationToken)
   at StreamJsonRpc.MessageHandlerBase.ReadAsync(CancellationToken cancellationToken)
   at StreamJsonRpc.JsonRpc.ReadAndHandleRequestsAsync()
   --- End of inner exception stack trace ---
   at Ionide.LanguageServerProtocol.Server.startWithSetup[client](FSharpFunc`2 setupRequestHandlings, Stream input, Stream output, FSharpFunc`2 clientCreator, FSharpFunc`2 customizeRpc) in /_//src/LanguageServerProtocol.fs:line 179
   at Ionide.LanguageServerProtocol.Server.start@276-2.Invoke(FSharpFunc`2 customizeRpc) in /_//src/LanguageServerProtocol.fs:line 276
   at FsAutoComplete.Lsp.FSharpLspServerModule.startCore(ToolsPath toolsPath, DirectoryInfo stateStorageDir, FSharpFunc`2 workspaceLoaderFactory) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/LspServers/FsAutoComplete.Lsp.fs:line 2984
   at FsAutoComplete.Parser.lspFactory@157-1.Invoke(Unit unitVar0) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 157
   at FsAutoComplete.Lsp.FSharpLspServerModule.start(FSharpFunc`2 startCore) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/LspServers/FsAutoComplete.Lsp.fs:line 3026
thyvini commented 1 year ago

I've tried both with and without --adaptive-lsp-server-enabled

baronfel commented 1 year ago

This looks like a protocol-level failure - do you have any docs or have any expertise with replit in terms of how they set up their character sets/encodings for spawned applications?

thyvini commented 1 year ago

I don't, I've tried to find for something more deep in the documentation but couldn't find anything, I will try to ask for support from them.

vzarytovskii commented 9 months ago

Look similar to https://github.com/fsharp/FsAutoComplete/issues/1185, suspicious.

thyvini commented 7 months ago

Got an update.

I can now set up the LSP and it seems to run, but I'm getting another error:

[VRB] Errors while processing code action request for file:///home/runner/FSharp/main.fs with {"Diagnostics":[],"Only":null,"TriggerKind":null,"$type":"CodeActionContext"} at {"Start":{"Line":14,"Character":4,"$type":"Position"},"End":{"Line":14,"Character":4,"$type":"Position"},"$type":"Range"}: ["No typecheck results for /home/runner/FSharp/main.fs","No typecheck results for /home/runner/FSharp/main.fs","No typecheck results for /home/runner/FSharp/main.fs","No typecheck results for /home/runner/FSharp/main.fs","No typecheck results for /home/runner/FSharp/main.fs","No typecheck results for /home/runner/FSharp/main.fs","No typecheck results for /home/runner/FSharp/main.fs","No typecheck results for /home/runner/FSharp/main.fs","No typecheck results for /home/runner/FSharp/main.fs"]