ionic-team / vscode-extension

15 stars 0 forks source link

Support VS Code Workspaces #70

Closed piotr-cz closed 1 year ago

piotr-cz commented 1 year ago

Extension doesn't pick up existing project when:

In this context VS Code workspaces should not be mistaken with npm workspaces.

Example worskspace Apps.code-workspace file:

{
  "folders": [
    {
      "path": "api",
      "name": "Api"
    },
    {
      "path": "mobile",
      "name": "Ionic App"
    }
  ]
}

Here only when Ionic App is first in list, it's picked by extension and related menu items shows up (Run, Debug, etc). In other cases, only New Angular Project, New React Project and New Vue Project shows up.

References:

Related issues that were closed as resolved because of monorepo feature:

dtarnawsky commented 1 year ago

Hi @piotr-cz,

Version 1.17.0 now supports VS Code Workspaces!

Give it a try and let me know if you run into any problems.

piotr-cz commented 1 year ago

@dtarnawsky I just tested v1.17.0 and extension still doesn't work for me with setup as in issue description.

Using latest VS Code v1.74.1

piotr-cz commented 1 year ago

Maybe an UI such as the one which is used for VS Code Source Control would be better for this case?

When workspace is opened, each folder is presented as an accordion item.

dtarnawsky commented 1 year ago

Hi @piotr-cz,

Are you able to supply a sample (either zipped copy or github repo) that doesn't work for you?

Can you confirm that you are using 1.17.0?

wsamoht commented 1 year ago

I just did some testing and I cannot replicate the issue on 1.17.0 on a new VS code workspace. On an existing workspace with 8 folders/projects, 3 of the 8 are being recognized as Ionic projects when in fact only one is. I had to manually select the ****-mobile project in the Ionic plugin Project selector. It seems to remain selected upon re-open of the Workspace.

What is the plugin looking for to know if a project is an Ionic project? The ****-app and ****-marketing-website are both PHP projects so they shouldn't be considered an Ionic project.

ionic-vscode-plugin-projects

piotr-cz commented 1 year ago

@dtarnawsky Yes, I'm using v1.17.0 for sure. I can prepare minimal reproducible example but cannot say when :/

@wsamoht How did you open Ionic plugin Project selector? I can just see actions related to first folder of opened workspace

wsamoht commented 1 year ago

How did you open Ionic plugin Project selector?

@piotr-cz I just clicked on the Ionic plugin icon in the left bar and it was collapsed at the very bottom of the plugin panel.

dtarnawsky commented 1 year ago

@wsamoht : The extension will inspect all folders mentioned in the workspace json file and any that have a package.json will show up as projects. Basic functionality like script running and package updates will be displayed and if there is a ionic.config.jsonor capacitor.config.json file then additional features from Capacitor will appear.

@piotr-cz: There isn't anything special you need to do in VS Code other than open your workspace file and then click the Ionic extension: the project list should appear in the bottom left. It's always possible there could be a bug in the extension based on your project which is why I would need a sample to reproduce the issue. You can also toggle the developer tools to see if there are any exceptions there which may provide something helpful.

piotr-cz commented 1 year ago

Project selector doesn't show, and there are no errors in Developer Tools console. By the way I'm using scoped package name.

Below is a screenshot for how the panel looks like when ionic folder is first in workspace list.

image