-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Biome plugin not working with WSL #49
Comments
I've got somewhat of the same issue here. My situation is a little different as I'm running my server inside docker instead of inside WSL, but the issue is very likely to be the same thing since I expect in both cases, IntelliJ is being run as client/server. The LSP server starts then exits immediately with error code 137 as can be seen in logs below.
I've read that exit code 137 can often mean running out of memory, but in my case everything looks perfectly fine from inside my docker container:
I'm not sure how to test if it's actually working, but when I run the command manually, it seems to be working, waiting for input and not exiting, so the lsp-proxy just won't stay up when running from the IDE.
IntelliJ IDEA 2024.1 (Ultimate Edition) |
I just noticed while running |
I think I have the same issue as well at #83 (comment) I think a good fix would be not to rely on the installed biome binary, and use one from the host system. Then we could execute biome.exe, and the windows file paths would work fine? I added this to Biome executable, and everything seems to work fine:
|
Using the binary from host is definitely not a good fix, because most users will not have the binary on their host machine if they have their projects inside WSL. At least that is the case in all of my projects where Biome is used. In addition there would be version mismatches. |
I totally agree, but I think/feel the easier fix would be for the plugin to download the binary instead of translating the filepaths... (but I'm sure the maintainers have a better idea :D) |
Downloading won't work in all environments (e.g. if you don't have access to internet). I researched a bit and found something that could be a viable solution. I played a bit with my AI friend since I don't want to setup intellij idea plugin development environment atm. Based on testing wslpath on my machine, this seems plausible to me, but sorry if this is blatantly wrong... also I wouldn't be surprised if there's built-in utils to handle these things inside intellij plugins 😅
Testable in e.g. PowerShell: wsl wslpath -u C:\\path\\to\\file
# -> outputs /mnt/c/path/to/file
wsl wslpath -w /mnt/c/path/to/file
# -> output: C:\path\to\file
|
Many plugins are installing their own binary when required, and I think its a more foolproof option without trying to parse the path. Then everything would run in the same environment (editor / biome) which solves a few things. But what fix does the maintainers prefer? would they accept a PR for either of these options? |
Did anybody come up with a solution? Plugin works perfectly for me on my linux laptop, but I can't get it to format files on Windows/WSL machine. |
My solution is to install Biome in windows, and configure the plugin/goland to use the windows binary, instead of looking for it in WSL |
I tried to use the plugin with a project in Windows Subsystem for Linux. I couldn't get it to work and tried to gather some relevant log entries from the IDEA logs.
First I tried with
Automatic Biome configuration
. The plugin seemingly loads fine, no errors. However the formatter hangs on save and I got this in the logs:Then I tried with
Manual Biome configuration
pointing executable and biome.json to files inside WSL. The plugin immediately indicates the language server is terminated (screenshot below). In addition when saving any file the log contains entries about invalid path (see below).Probably requires some additional handling to get it working with WSL, but I guess it should be doable since IDEA works nicely with WSL.
On a side note: would be worth it to add some error handling too, because especially with the automatic configuration there's no errors so the plugin just shows as not working or buggy for the user.
Environment information:
IntelliJ IDEA 2024.1 (Ultimate Edition)
Biome plugin v1.0.0
Biome 1.6.4
The text was updated successfully, but these errors were encountered: