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
WorkspaceFolder.raw
is weird
#142418
Comments
Its stored data and used proper typings |
@sandy081 but this is now bringing back a cyclic dependency between |
Ah ok, I did not know about that. |
It seems workspace related types shall be defined in workspace file. So moved |
@sandy081 I still do not understand why a
This sounds like 2 kinds of sources for what a workspace folder is? Why is that? If you somehow need this original raw information in your configuration service then I would rather suggest to add a new method to the workspace folder that answers exactly the question you ask and not make it a public property. |
I need raw data (truth) while updating the workspace configuration file, for eg when updating/adding/removing a workspace folder so that the update is not changing any underlying semantics of that specific workspace folder. Otherwise, I would have to create another class extending WorkspaceFolder to store this info. I can do it but may not worth. |
The only client seems to be this code: vscode/src/vs/workbench/services/configuration/browser/configurationService.ts Lines 223 to 229 in 1d79533
Can it a) move into the |
Not both options are possible. As said the better option would be to have a |
The part that imho is debt is around the fact that creating
I would have expected here that we only asks to pass in the And similar, when I am using the If we somehow need to signal that the |
FYI
If you think you are not sure what's |
@sandy081 why do we need access to the raw data to begin with? Is there any property in workspaceFolder.name === workspaceFolder.raw.name
workspaceFolder.uri.toString() === workspaceFolder.raw.uri
workspaceFolder.uri.path === workspaceFolder.raw.path ? |
raw paths are not same as the computed uri path, because the raw path can be relative and we also normalize the URIs. Name is also optional and we compute it. Please refer to this code vscode/src/vs/platform/workspaces/common/workspaces.ts Lines 197 to 233 in 99cfdd5
|
That is something we should document, pushed it: vscode/src/vs/platform/workspace/common/workspace.ts Lines 385 to 392 in 7141d2a
|
See:
vscode/src/vs/platform/workspace/common/workspace.ts
Lines 334 to 337 in 2f17858
There seems to be 2 competing parameters for what the folder is.
I found this while trying to untangle dependencies from
workspace
toworkspaces
and had to inline this one.The text was updated successfully, but these errors were encountered: