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
Show the folder path a file is in, in title of the window #66746
Conversation
…ipen/feature-66660
…en/feature-66660
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vedipen I am not a big fan of the logic in titlebarPart.ts
to get the labels for short, medium and long folder. You implicitly assume that the label you get from the input is already a path, but that might not be true. A better solution imho would be to get the resource from the input and then do what the fileEditorInput
does, e.g. here https://github.com/Microsoft/vscode/blob/cfd5d35/src/vs/workbench/parts/files/common/editors/fileEditorInput.ts#L171
@bpasero Thanks for the feedback. Updated the logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vedipen I think we can still improve this a bit, specifically I think we do not need to check for file
scheme but can try to support this for any resource. This would help in cases where the user opens remote resources which are not local.
As such I suggest:
- continue to use the
toResource(editor, { supportSideBySide: true })
but remove the check forfile
scheme - use
resources.dirname()
instead ofpaths.dirname()
which takes care of resources - pass that into
this.labelService.getUriLabel
as before - use
resources.basename
instead ofpaths.basename
for the short label
@bpasero Is this ideal or should we add a function for getting these paths (or maybe use |
Thanks I think its fine. I will push small tweaks after to clean up a bit. |
* Add active folder feature * use urilabel instead * use resource instead of path * show empty instead for activeFolderShort
Closes #66660
Added variables -
${activeFolderShort}
: the name of the folder the file is contained in${activeFolderMedium}
: the path of the folder the file is contained in, relative to the workspace folder${activeFolderLong}
: the full path of the folder the file is contained inResulting view