vscode-projects-plus
vscode-projects-plus copied to clipboard
Projects with `.code-workspace` paths aren't highlighted
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!
That would be cumbersome to implement without this proper API: https://github.com/Microsoft/vscode/issues/37421.
Let's wait until they implement it.
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.
@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.
"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",
}
]
@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.
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.
@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 https://github.com/Microsoft/vscode/issues/37421
It looks like the necessary API has been merged: https://github.com/microsoft/vscode/pull/72490 .
Hi! Any news on this issue? It seems that the missing API was added quite a long time ago.
I would love to get this functionality working and could help implementing it. I just need a hint about where to start :)