tomwhite007 / rename-angular-component

VS Code Extension: Rename Angular Component
https://marketplace.visualstudio.com/items?itemName=tomwhite007.rename-angular-component
Other
30 stars 2 forks source link

Extension does not support WSL #28

Closed YannickMG closed 2 years ago

YannickMG commented 2 years ago

Describe the bug After selecting a new name for a component/service in the extension's renaming dialogue, nothing visibly happens.

To Reproduce Steps to reproduce the behavior: Try using the extension in an angular application located in the WSL file system.

Expected behavior At least a clear error message in the "Rename Angular Component" logs which only displays the following:

------------------------
Rename Angular Component
------------------------

Screenshots or Demo Repo In the dev tools, one can find the following error:

[Extension Host] Rename process start console.ts:137
[Extension Host] setRenameDetails error:  Error: ENOENT: no such file or directory, open 'C:\home\USERNAME\app-name\package.json'

The application is in fact located at ~/app-name in the Linux file system, but the extension tried to access the application's folder using a path that is relative to my Windows home folder.

Desktop (please complete the following information):

Additional context Unrelated but I also couldn't find a logs file to upload even after turning on the option to generate it. I might not have known where to look though.

tomwhite007 commented 2 years ago

Hi @YannickMG

Thanks for your thorough issue report.

WSL is certainly a platform I had yet to test on.

The symptoms you’ve given me suggest that the extension fails as the Indexer process starts to initialise by locating the package.json file.

You’ve definitely taken all sensible steps and I appreciate you trying to create a log file. The log file would have been created in the root of your project as 'rename-angular-component-debug-log.txt'. But if it’s identifying the project file root when inside WSL that is the problem - as is likely from the symptom above, then it won’t have been able to create the file in the right place.

I’ll get onto this shortly.

DuckPluck commented 2 years ago

Hi @tomwhite007 got same issue. Really hope you can fix it soon!

tomwhite007 commented 2 years ago

Hi @DuckPluck I'm intent on getting this fixed in the next update.

tomwhite007 commented 2 years ago

Hi @YannickMG and @DuckPluck

I have run some tests, and can confirm I know what's required to upgrade the process to work on WSL. The work is not trivial, so you can watch this PR for progress: Feat/use vscode workspace fs #31 .

YannickMG commented 2 years ago

Thanks for the update. I would've thought that VS code would offer some standard API it also uses when dealing with remote environments, since it's a feature they advertise so much.

tomwhite007 commented 2 years ago

Hello @YannickMG and @DuckPluck

I put some proper time into the conversion to using vscode.workspace.fs api this week. To my horror, I've discovered the refactor which uses a reduced set of fs commands slows the extension processes down by more than 10 times. So slow that I'd lose most of my existing users.

It is with regret that I'm going to have to say, I can't support WSL.

My apologies guys, you'll have to open your project on the Windows FS side to use the extension. It's not often I say no, but my hand is forced, sorry.

YannickMG commented 2 years ago

No worries, thanks for looking into it.