Extension fails to run in WSL environment; only partial operation in windows environment when running WSL folders.
Describe the bug Essentially the bug is precisely as described in the title. When running the extension in WSL2, it doesn't function: The default folding functionality remains. The most that will happen is an ellipsis will appear next to the line being folded. This appears to affect every attempted language (Tested in HTML, JS, CSS, and JSON files).
When a WSL file (That is, a file that is stored within the WSL2 directories) is opened from VSCode, while VSCode is running on Windows, the extension will mostly work, except for that trailing brackets remain. Ie, The description of a function's contents therein will appear next to the line being folded, but the trailing brackets remain.
Also, while in WSL2, VSCode runs the extension in the Remote Extension Host, giving the message: "This extension is running in the remote extension host because it prefers to run there."
To Reproduce Steps to reproduce the behavior:
- Launch a folder VSCode in WSL2
- Ensure Extension is installed. Open any .js file
- Attempt to collapse any function, object, array, etc.
- See error - failure to produce desired folding
Expected behavior The folding described in the extension about page therein.
Screenshots Pre Fold (in Express App): https://i.imgur.com/whtiLMN.png Post Fold: https://i.imgur.com/7NalNcd.png
Pre Fold: https://i.imgur.com/KTeffxo.png Post Fold: https://i.imgur.com/fYMkEWO.png
Desktop (please complete the following information):
- OS: Windows 10 Pro 19044.2486 -- Version 21H2
- WSL2 OS : Ubuntu-20.04
Additional context This probably isn't relevant as I haven't been able to investigate the extension's code deeper than just a barely surface level, but at a brief glance through the code I see the use of __dirname. I've run into problems when building apps in WSL2 with __dirname - having instead to use a custom __dirname absolute path such that: const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
Again this probably isn't relevant to the operation of your extension, but such an inconsistency like that between WSL and other operating environments (one which necessitates a workaround to things like absolute file paths) may be worth investigating.
Thanks so much for the hard work and the wonderful extension. You're seriously doing the work that Microsoft hasn't been able to do in almost an entire decade - excellent project.
Hey thanks for the detailed report, always a joy to see those.
Would you mind clean install this version and let me know if it works?
Gave it a try - no such luck unfortunately. That version does however work quite well when I open the directory solely in Windows. Seems to just be the WSL2 Ubuntu-20.04 environment in which it doesn't work.
Appreciate the hard work, Good luck!
(It really is long past time I drop WSL. Been clinging to it on my home machine out of sheer force of habit, if nothing else).
Oh sad, I'll look more into it.