ionic-team / vscode-ionic

Visual Studio Code Ionic Extension
Other
10 stars 1 forks source link

the extension is unable to find working directory #136

Closed Bader-Idris closed 4 months ago

Bader-Idris commented 5 months ago

Since I have a full-stack project, I have included the front-end directory within the client subdirectory. This setup causes the Ionic extension to not recognize the workspace's working directory in Visual Studio Code. As a result, I am forced to open a separate Visual Studio Code window to access the extension's options.

I tried settings > options

please use some regExp to make the extension understand subdirectories

dtarnawsky commented 5 months ago

Is there a package.json in your root folder? If so then the extension thinks you want to only look at the root folder, rather a view that works as a multi-folder mono repo.

It will also work if you use any monorepo tech: npm workspaces etc.

Bader-Idris commented 5 months ago

The root folder does not have a package.json file

It's as 👇

Client/ Server/ DockerFiles

dtarnawsky commented 5 months ago

I created a sample repo with those 3 folders with an Ionic app in the Client folder: https://github.com/dtarnawsky/cs-mono-folder

The Ionic extension shows the project "Client" as expected like this: Screenshot 2024-04-22 at 7 49 13 AM

Is there something special with your Client folder? perhaps your app is several subfolders under Client?

Bader-Idris commented 5 months ago

My GitHub repo, which, as I mentioned, isn't familiarized through the Ionic extension, serves as an example of what I meant.

Maybe there are privileges issues

dtarnawsky commented 5 months ago

Thanks for access to the repo. I found a couple of interesting things that the VS Code needed to handle (which have been done in v1.85.3 just released):

Bader-Idris commented 5 months ago

Your mentioned package is installed globally, and the XML file is newly added to the project. I assure you that it's not the cause because the issue was occurring before adding the file to the project. I also tried checking the extension after its latest update in the root directory, but it didn't recognize the existing project.

tylerxue commented 4 months ago

i have the same issue. the more weird is, it only happens on Win, when i work on Mac with the same repo which cloned from Win, the vs code with the same version ionic extension detects the ionic project and everything is fine. while on Win, the vs code can't detect the ionic project and the ionic panel shows nothing.

dtarnawsky commented 4 months ago

Hi @tylerxue, if you are able to provide a sample project that does not work then I can test it and fix any problems found.

I've tested the @Bader-Idris's repo on Windows and Mac and both work as expected.

dtarnawsky commented 4 months ago

Closing this issue as the original issue was addressed.