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

Cached typecheck results not yet available, Code: -32603 #583

Closed
AlexChalk opened this issue Mar 28, 2020 · 10 comments
Closed

Cached typecheck results not yet available, Code: -32603 #583

AlexChalk opened this issue Mar 28, 2020 · 10 comments

Comments

@AlexChalk
Copy link

I have tried running this plugin on both macOS and linux (NixOS) via vim (coc.nvim), and I have observed the same error on both operating systems. Here's the process I've followed:

  1. clone project
  2. run dotnet tool restore && dotnet fake build --target LocalRelease
  3. configure coc.nvim as follows
"fsharp": {
  "command": "dotnet",
  "args": [
    "/path/to/FsAutoComplete/src/FsAutoComplete/bin/Release/netcoreapp2.1/dotnet-fsautocomplete.dll", "--background-service-enabled"
  ],
  "filetypes": [
    "fsharp"
  ],
  "ignoredRootPaths": [
    "/",
    "~"
  ]
},
  1. Open a project (I am using this one) and try to jump to a definition.

On both occasions, I see the following error in my logs:

[Error  - 8:33:06 PM] Request textDocument/definition failed.
  Message: Cached typecheck results not yet available
  Code: -32603 

Can anyone advise on how to resolve this issue?

@baronfel
Copy link
Contributor

Can you please enable Fsharp.verboseLogging = true, and copy the entire F# output log here instead of a tiny sliver?

@AlexChalk
Copy link
Author

Thanks @baronfel. I'm very new here, where do I set that flag and where can I find the entire output log?

(I've tried at the root level of my coc-settings.json and in the initializationOptions for the fsharp section of the config. The languageserver.fsharp log I previously posted from isn't any more verbose after this).

@baronfel
Copy link
Contributor

Not sure about coc.nvim, but you're expected to set that setting in the initialize call that the LSP client uses to start the LSP server.

@Zaid-Ajaj
Copy link
Contributor

I actually get this "error" as well sometime after I have deleted build artifacts (obj/bin), I only have to trigger a file save (i.e. by writing a space somewhere then saving the file) which seems to reset ionide's cache and reloads the symbols information into the workspace

@Krzysztof-Cieslak
Copy link
Member

@AlexChalk
Copy link
Author

@baronfel I passed the --verbose option on startup and got some additional output, is this helpful?

[10:06:32 DBG] [CheckerEvents] Script typecheck dependencies changed, purging expired script options
[10:06:32 DBG] [CheckerEvents] Script typecheck dependencies changed, purged 0 expired script options
[10:06:43 INF] [LSP] PositionHandler - Position request: /Users/alexanderchalk/Railway-Oriented-Programming-Example/src/FsRopExample/Program.fs at {"Line": 12, "Column": 52, "Encoding": 12582964, "$type": "pos"}
[10:06:43 VRB] [Checker] Current Queue Length is 0
[10:06:43 INF] [Checker] TryGetRecentCheckResultsForFile - /Users/alexanderchalk/Railway-Oriented-Programming-Example/src/FsRopExample/Program.fs
[10:06:43 INF] [LSP] PositionHandler - Cached typecheck results not yet available for /Users/alexanderchalk/Railway-Oriented-Programming-Example/src/FsRopExample/Program.fs

[Error  - 10:06:43 AM] Request textDocument/definition failed.
  Message: Cached typecheck results not yet available
  Code: -32603 

@AlexChalk
Copy link
Author

When I try the solution of @Zaid-Ajaj (add space, save, try again), I get this error, followed by a repeat of the 'Cached typecheck results' error.

[10:11:58 WRN] [LSP] ParseFile - Workspace not ready

If I try autoinitializing the workspace using the initialization options

"initializationOptions": {
  "AutomaticWorkspaceInit": true
},

and then add space, save, try again, I get this output (followed by the same Cached typecheck results error):

[10:13:57 INF] [LSP] ParseFile - Parsing /Users/alexanderchalk/Railway-Oriented-Programming-Example/src/FsRopExample/Program.fs
[10:13:57 VRB] [Checker] Current Queue Length is 0
[10:13:57 INF] [Checker] ParseAndCheckFileInProject - /Users/alexanderchalk/Railway-Oriented-Programming-Example/src/FsRopExample/Program.fs
[10:13:57 INF] [Compiler] Inside Compiler Function 4
[10:13:57 INF] [Compiler] Finished compiler function 1 with parameter /Users/alexanderchalk/Railway-Oriented-Programming-Example/src/FsRopExample/Program.fs_ProjectId=null-Failed_Aborted in 0.000981
[10:13:57 VRB] [Checker] Current Queue Length is 0
[10:13:57 INF] [Checker] ParseAndCheckFileInProject - /Users/alexanderchalk/Railway-Oriented-Programming-Example/src/FsRopExample/Program.fs completed with errors: [{"StartLineAlternate": 1, "EndLineAlternate": 1, "StartColumn": 0, "EndColumn": 0, "Severity": {"$type": "Error"}, "Message": "Assembly reference 'mscorlib.dll' was not found or is invalid", "Subcategory": "parameter", "FileName": "unknown", "ErrorNumber": 84, "$type": "FSharpErrorInfo"}]

Sounds like it could be an example of ionide/ionide-vscode-fsharp#1244?

@AlexChalk
Copy link
Author

AlexChalk commented Mar 28, 2020

It looked like these options might help me but I've tried in a few different places in coc-settings.json without luck, (the settings key makes most sense to me), and they don't resolve the issue:

{
  "FSharp.useSdkScripts": true,
  "FSharp.dotNetRoot": "/usr/local/share/dotnet/"
}

@Krzysztof-Cieslak
Copy link
Member

The project you're trying to use is really old - it's targeting an old version of F#, an old version of .Net (non-.Net Core, requiring mono), and uses old "verbose" project files.

Do you have mono installed, have you restored packages, can you build the project?

@AlexChalk
Copy link
Author

@Krzysztof-Cieslak, thanks for letting me know, I am new to the ecosystem and hadn't realized any of this.

I switched to trying with a newer project, and after using dotnet build and reloading the file, I have FSAC working: https://github.com/ChrisMarinos/FSharpKoans.

I'll close this now and try to understand exactly what was wrong on my own, but any info that could help me understand better would still be appreciated! Thanks for your help.

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

No branches or pull requests

4 participants