Open massimo-cassandro opened 3 years ago
Is the setting favorites.saveSeparated
what you were looking for - or do you want an extra setting to specify the path?
Now favorites are written in workspace as:
"favorites.resources": [
{
"filePath": "/Users/user/absolute/computer/path/my_project/myfile.js",
"group": "Default"
}
}
This causes all paths to break if I switch to another computer or if I want to share favorites with other developers. The simplest solution, I mean, is to write workspace-relative paths:
"favorites.resources": [
{
"filePath": "myfile.js",
"group": "Default"
}
}
where filepath
is relative to my project (workspace) path
I see, thanks for adding the missing details. I totally agree and second this feature request.
To not break existing environments either relative or absolute paths should be used, so likely a favorites.relativeRessourcePaths
would be necessary.
It's also necessary for me because I usually need to push the setting file in the repository to Github and I don't want the setting file to show the disk path information to others.
Are you mean in workspace mode, right? the settings will be written with abs path as below:
{
"folders": [
{
"path": "test/web-api"
}
],
"settings": {
"favorites.resources": [
{
"filePath": "/Users/howard/codes/test/web-api/Jenkinsfile.dev.groovy",
"group": "Default"
}
]
}
}
In workspace mode, what location do you think can be used as base of the relative path? But true, as you mentioned, the abs path seems not ok to if we push the config file to central store. I will think about this. thanks for you guys suggestion
Yes, it's in workspace mode, and I found a good idea from VSCode:
As we can see, VSCode uses the relative path which is relative to the workspace file to save path information.
Yes, it's in workspace mode, and I found a good idea from VSCode:
Details
As we can see, VSCode uses the relative path which is relative to the workspace file to save path information.
But it seems to be useless because the extension has no idea about where the workspace file is...😓
Saving a favorite using a workspace-relative path would improve portability and sharing