-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
loaded scripts explorer: show '~' for paths outside of workspace #31002
Comments
@weinand here is the code we use for that: https://github.com/Microsoft/vscode/blob/master/src/vs/base/common/labels.ts#L74 |
@bpasero great, thx! |
@bpasero it would make sense to offer getPathLabel() from https://github.com/Microsoft/vscode/blob/master/src/vs/base/common/labels.ts#L31 in vscode.d.ts |
This would need to expose a resource property in TreeItem object. This will also helps in resolving the icon. |
Yeah that's what I thought 👍 |
In my case I would use "getPathLabel()" to convert a debug resource into a "standard" path, but I need my own extension code to break that path into a hierarchy for the TreeDataProvider. I'm not sure that this could/should be done in a generic way. |
@jrieken @egamma (since you did something similar via f911acf) after talking to @weinand we wonder if we should not have a API method similar to
|
That is just a *nix-special-case to replace my home-directory with |
@jrieken yeah this method actually already does what That said I wonder if we need to be careful about changing I would deprecate It is easy to find out how extensions use I think as long as an extension is using this method purely as a way to get a label, it is fine. But having this method be more explicit that the use case is for labels only makes sense to me. |
show '~' for paths outside of workspace (identical to workbench behavior)
The text was updated successfully, but these errors were encountered: