I have seen this recently as well. I think it might be an issue with the Intel Mac version of SourceKit-LSP. I haven’t had time to investigate further yet.
[Trace - 14:59:20] Sending request 'textDocument/hover - (13)'.
Params: {
"textDocument": {
"uri": "file:///Users/ruslan/Projects/MiniFrame.Server/Sources/App/Controllers/AuthController.swift"
},
"position": {
"line": 41,
"character": 52
}
}
[Trace - 14:59:21] Received response 'textDocument/hover - (13)' in 379ms.
No result returned.
It does not seem like it is enough to debug an issue and the entire output of the swift extension by the time I opened a single file and hovered was already around 29000 lines.
Should I post the entire 29 000 lines of output? Can I do anything else to help debugging this issue?
Just a small update. I managed to replicate an issue accidentally in a new and empty Vapor project by writing an invalid swift struct+function call (which was not reported by the extension as an error) but was causing my build to fail.
However, my current code base compiles and works fine in Xcode, and yet it seems to trigger an error in the lsp somehow.
Finally, I just want to mention that every time I reopen VS Code, it triggers Resolve Package Dependencies and it always takes quite some time. The extension is only showing Loading... while this is happening.
PS. I should have opened an issue in LSP repository indeed. I will open an issue there as soon as I can.
When it says loading it is calling swift package describe. It needs this to generate launch profiles, build tasks and various other things. Once this has finished it will trigger a swift package resolve and a swift package plugin --list to ensure all your dependencies are downloaded and it has a list of plugins available. If you don't want the resolve or plugin list then there is a swift.disableAutoResolve setting to disable it.
swift package reset
swift package resolve
swift package build
And then restarting VS Code, and it fixed my issue. Hinting works as expected.
Furthermore, opening files was returning -32802 error code from the LSP for the inlay hints command. Lastly, I can say that I recently migrated the project to 5.9 from 5.8, but I do not remember when exactly I started having LSP issues. I suspect that something changed in the incremental build process, which consequently broke the LSP.
I will soon close the issue in the extension repository, explaining that fully cleaning the build folder helped with the problem and that the problem is likely related to a change in the swift tools version.