ionide-vscode-fsharp
ionide-vscode-fsharp copied to clipboard
.NET SDK 6.0.400 and 7.0.100 previews don't currently work with Ionide
Describe the bug
We don't know what the cause is yet, but we currently fail many basic editor scenarios on these SDK versions.
I might experience the same or at least a similar problem, but with dotnet --version = 6.0.303.
Type checking stops working "suddenly". I cannot figure out if that's deterministic, or what action causes it. The logs show lots of there entries:
[Error - 12:09:44] Request textDocument/documentSymbol failed.
Message: File 'c:\Users\ronal\source\repos\github\vide\src\htmlDslTest01.fs' not parsed
Code: -32603
[Error - 12:09:45] Request textDocument/inlayHint failed.
Message: Cached typecheck results not yet available
Code: -32603
[Error - 12:09:48] Request textDocument/inlayHint failed.
Message: Cached typecheck results not yet available
Code: -32603
[Error - 12:09:54] Request textDocument/inlayHint failed.
Message: Cached typecheck results not yet available
Code: -32603
This applies to all files in the solution. There is no clear way how to work around. I do
- restarts (vscode)
- reboots (machine)
- Clear Project Caches
- Enable / disable ionide background service
- switching ionide versions 7 <-> 6
Then suddenly (I absolutely don't understand when or why), it starts working again.
Interesting thing: .fsx
files always work!
Additional innfos:
- I used this repo for testing.
- I see the issue occurring on 2 different machines (Win 10 and 11).
- ionide version(s) used: 7.0.0 and 6.0.6
... just moved a file in the project (type checking wasn't working at that time), and I saw this (last entry):
Maybe this might help.
I can confirm the same. 6.0.300 works , the moment I upgraded to 6.0.400 it got broken on MacOS
The root cause has been diagnosed and fixed in the ionide/proj-info repo ,now it's a matter of flowing that into FSAC and updating this repo.
Ah fantastic, that's why I am a proud donator to ionide :) Any ETD guess?
hopefully a week or so? the FSAC pipelines have been giving me a bit of trouble though.
Would it be possible to write a unit test that checks if the code is working with various .net sdk versions, maybe with the help of docker containers?
@inouiw that's exactly what's taking my time :) the plan is to test FSAC against pipelines for the global.json in the repo, the latest 6.x SDK, and the latest 7.x SDK to help us not hit this gap again.
hey @baronfel , not trying to put any pressure or anything but just to see what's coming, are you able to progress on this issue?
There's a version of FSAC released that fixes this, but it introduced a failure mode that we need to fix before we include that version in Ionide.
@baronfel ping me on teams if you'd like some help to get these fixes through the pipe
Thanks @dsyme - been blocked on https://github.com/fsharp/FsAutoComplete/issues/1009 lately, that's the only real blocker to releasing a new Ionide. For some reason our emacs clients (and possibly others?) are reporting crashes in modes that the VSCode LSP Client isn't. Been rabbit-holed for a bit trying to run that down, and it's likely entirely in our LSP transport library and not in any compiler-related services at all. The library is written by Andrew Arnott on the VS team though, so I may reach out to him for pointers.
We're mostly prepped for a release - those changes are in https://github.com/ionide/ionide-vscode-fsharp/pull/1782. Waiting for some community feedback from our emacs users to see about a proposed fix for crashes in their LSP client, and then we'll be good to go I believe.
I've released Ionide 7.2.0 this morning that should resolve the primary problems with supporting 6.0.4xx and 7.0.1xx SDKs, as well as a number of other performance regressions and text synchronization issues. Please check out the release notes for more information, and let us know how it works for you!
Awesome! Thanks so much!
Chet Husk @.***> schrieb am Sa., 24. Sept. 2022, 21:20:
Closed #1758 https://github.com/ionide/ionide-vscode-fsharp/issues/1758 as completed.
— Reply to this email directly, view it on GitHub https://github.com/ionide/ionide-vscode-fsharp/issues/1758#event-7452486172, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOANBCT3CVM274AYMMW4TV75IBLANCNFSM56LVG5HQ . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>
Works great for me.
Thank you @baronfel!!!
Anything we can do to help on future iterations?
@dsyme the problems are almost always related to updates in the SDK, specifically finding references as the SDKs move ahead - as a result the majority of the work is in the https://github.com/ionide/proj-info library, and any additional contributions around testing, features, etc would be lovely there. One learning from this time around is that we must be proactive about running the language server (or whichever application is hosting the MSBuild project analysis) on the same SDK as the project is TFM-targeted for - there no longer is a way around this as long as we use in-process MSBuild evaluation. As a result I've incorporated test matrices for the various SDK versions we need to support into both proj-info and FSAC's test suites, and updated the hosting code in Ionide for VSCode to use the correct runtime when spawning FSAC instances. Our friends that use emacs/vim/etc typically use fsautocomplete via the .NET tool, and so spawning the tool handles the runtime negotiation part.
All of this is to say that I hope future iterations a) will be shorter and b) will be more easily detected and handled. When 8.0 previews start rolling out in a couple months I expect us to at least be able to start testing on them, if not building for them.
I am sorry to say this but I think there are still some stability issues. Many times intellisense and colorization dies abrubtly in this release
System.AggregateException: One or more errors occurred. (Index and length must refer to a location within the string. (Parameter 'length'))
---> System.ArgumentOutOfRangeException: Index and length must refer to a location within the string. (Parameter 'length')
at System.String.Substring(Int32 startIndex, Int32 length)
at FsAutoComplete.NamedText.GetText(Range m) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete.Core/FileSystem.fs:line 134
at FsAutoComplete.CodeFix.AddMissingFunKeyword.binder@1-2(FSharpFunc`2 getLineText, Diagnostic diagnostic, CodeActionParams codeActionParams, NamedText lines) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/CodeFixes/AddMissingFunKeyword.fs:line 19
at [email protected](FSharpResult`2 _arg1)
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, b result1, FSharpFunc`2 userCode) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 465
at [email protected](AsyncActivation`1 ctxt)
at [email protected](AsyncActivation`1 ctxt)
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 104
--- 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 [email protected](FSharpFunc`2 customizeRpc) in /_//src/LanguageServerProtocol.fs:line 268
at FsAutoComplete.Lsp.startCore(ToolsPath toolsPath, DirectoryInfo stateStorageDir, FSharpFunc`2 workspaceLoaderFactory) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/FsAutoComplete.Lsp.fs:line 2947
at FsAutoComplete.Lsp.start(ToolsPath toolsPath, DirectoryInfo stateStorageDir, FSharpFunc`2 workspaceLoaderFactory) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/FsAutoComplete.Lsp.fs:line 2959
[Error - 4:54:41 AM] The F# server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
And looks like LSP related issue. I suggest reopening the bug.
This is a different thing entirely, please raise a new issue with these details.