Skip to content
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

Projects with .code-workspace paths aren't highlighted #27

Open
StefanoCecere opened this issue Jul 9, 2018 · 10 comments
Open

Projects with .code-workspace paths aren't highlighted #27

StefanoCecere opened this issue Jul 9, 2018 · 10 comments
Labels

Comments

@StefanoCecere
Copy link

i have a few .code-workspace proejcts.
they are opened, but in the bottom status bar title, they are shown as "No project"
(normal project show their title)

ciao!

@fabiospampinato
Copy link
Owner

fabiospampinato commented Jul 9, 2018

That would be cumbersome to implement without this proper API: microsoft/vscode#37421.

Let's wait until they implement it.

@Yzrsah
Copy link

Yzrsah commented Dec 5, 2018

I am having the issue of "No project"

This could be fixed with i.e. "search-path":

"projects": [
    {
      "name": "MyProject",
      "description": "MyProject Master Project",
      "icon": "globe",
      "path": "~/Source/MyProject/MyProject.code-workspace",
      "search-path": "~/Source/MyProject"
    }
  ]

This does almost nothing except restore back the default functionality of Project+ by allowing you to specify a path. Which fixes the problem. Or just make the "path" an optional array.

If/when the workspace config API is added, this does not interfere with that. The user might want to have an optional path and workspace file.

@fabiospampinato
Copy link
Owner

fabiospampinato commented Dec 5, 2018

@zyrsha I'm not sure how that extra property would solve the issue.

To be clear we can solve this today: if we can't recognize the current project we could open all .code-workspace files and check if any of them matches the current setup, no need for extra properties. But this solution is not great, in order to implement the "right" solution we would need to know the path to the current .code-workspace file, and there's no API for that.

@Yzrsah
Copy link

Yzrsah commented Dec 5, 2018

"projects": [
    {
      "name": "MyProject",
      "description": "MyProject Master Project",
      "icon": "globe",
      "path": "~/Source/MyProject/MyProject.code-workspace",
      "search-path": "~/Source/MyProject"
    }
  ]

Has the same path search behavior as if you used:

"projects": [
    {
      "name": "MyProject",
      "description": "MyProject Master Project",
      "icon": "globe",
      "path": "~/Source/MyProject"
    }
  ]

The only difference is that the workspace file is loaded when opening the project.
But the rest of the behavior of Project+ stays the same as it was before, as if you had added nothing new except for loading of a workspace file.

Alternate syntax for the same thing:

"projects": [
    {
      "name": "MyProject",
      "description": "MyProject Master Project",
      "icon": "globe",
      "path": "~/Source/MyProject"
      "workspace": "~/Source/MyProject/MyProject.code-workspace",
    }
  ]

@fabiospampinato
Copy link
Owner

fabiospampinato commented Dec 6, 2018

@zyrsha I'm not sure where you're getting at with this. We already support opening .code-workspace files (just put them as the value of path), and we could already support them even in the statusbar item without the need for any extra properties, but the solution would be very clunky.

@Yzrsah
Copy link

Yzrsah commented Feb 14, 2019

The issue can be fixed in a few lines of code.

You add a second key which allows to specify the project root and code-workspace separately.
So we have optionally TWO PATHS: the project root path, and the code workspace.
All Projects+ has to do is detect the project path, and open the code workspace if it's provided.
That's already the basic behavior and you can fix it by doing almost nothing because you already wrote the code to do it.

If Microsoft adds a new API for workspace in 2020, then update the extension.

As of now, this extension remains broken indefinitely. Because we use workspaces.

@fabiospampinato
Copy link
Owner

fabiospampinato commented Feb 14, 2019

@Yzrsah I don't think that's a solution, first of all it complicates things, buts most importantly a workspace will usually contain multiple root paths, and we have to know about all of them to make this work.

As I mentioned we could just read each .code-workspace file manually and extract this information, but it would be better if there was a proper API for this microsoft/vscode#37421

@wpbrown
Copy link

wpbrown commented Aug 7, 2019

It looks like the necessary API has been merged: microsoft/vscode#72490 .

@fabiospampinato fabiospampinato changed the title .code-workspace projects aren't highlighted Projects with .code-workspace paths aren't highlighted Apr 2, 2021
@maksim77
Copy link

Hi!
Any news on this issue? It seems that the missing API was added quite a long time ago.

@deiga
Copy link

deiga commented Aug 17, 2023

I would love to get this functionality working and could help implementing it. I just need a hint about where to start :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants