Closed InSyncWithFoo closed 4 months ago
It seems all right 👌
No new problems were found according to the checks applied
💡 Qodana analysis was run in the pull request mode: only the changed files were checked
After many, many trial-and-error cycles, I think these are the key points:
GeneralCommandLine
uses Command Prompt for WindowsWSLDistribution.patchCommandLine()
is used to take care of this.
However, a new problem arised from there.
VirtualFile
sFile URIs in request and response objects seem to be derived from the .getUrl()
method, whose return values may not be RFC-compliant and thus invalid URIs. For example, it may emit file:////wsl$/Ubuntu/home/user
instead of file://wsl.localhost/Ubuntu/home/user
. To make things worse, VirtualFileManager.findFileByUrl()
doesn't accept correct file:
URIs.
I tackle this by replacing file:////wsl$
with file://wsl.localhost
and revert as necessary.
But that's not all.
wsl.localhost
, whereas Windows 10 uses wsl$
I believe there are also APIs to differentiate the two versions, but I'm blocked by a final problem.
False reportMissingImports
are emitted, suggesting that there are problems with either the withWorkDirectory()
call, how Pyright handles it, or both.
For comparison, no such diagnostics are emitted for the same file structure on Windows.
As a bonus, a visible IllegalStateException
might be thrown if your build is older than 2024.2 EAP 1, which has yet to be released.
The latest commit (c91b226
) should deal with the first two.
I asked about this on Slack about half a week ago, but no answers so far. Out of ideas for now.
Found a way: Only send (and receive) Linux paths, but reprocess those paths before passing them to the default LspServerDescriptor.findFileByUri()
. This also cures the false reportMissingImports
diagnostics above.
Fixes #54.