Skip to content
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

Support editor labels on non-file scheme "files" #64697

Closed
eamodio opened this issue Dec 9, 2018 · 7 comments
Closed

Support editor labels on non-file scheme "files" #64697

eamodio opened this issue Dec 9, 2018 · 7 comments
Assignees
Labels
feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded workbench-editors Managing of editor widgets in workbench window
Milestone

Comments

@eamodio
Copy link
Contributor

eamodio commented Dec 9, 2018

Related to 4e3f58f#diff-81002b6983f6ca938fb1efc58cd9da2f from #55110 (comment)

I am trying to add a custom label to gitlens scheme files (to add the revision info), but it looks like labels only work for editors that are instances of ResourceEditorInput

See
https://github.com/Microsoft/vscode/blob/e444eaa768a1e8bd8315f2cee265d725e96a8162/src/vs/workbench/services/editor/browser/editorService.ts#L549-L586

And since the gitlens scheme is a registered FileSystemProvider it seems to be treated as a FileEditorInput

Can labels be supported on non-file scheme "files"?

Also this new label was only added to vscode.open, can it be added to window.showTextDocument as well?

/cc @joaomoreno

@jrieken jrieken assigned joaomoreno and unassigned jrieken Dec 10, 2018
@joaomoreno joaomoreno assigned bpasero and unassigned joaomoreno Dec 10, 2018
@bpasero bpasero added feature-request Request for new features or functionality api labels Dec 10, 2018
@bpasero bpasero removed their assignment Dec 10, 2018
@bpasero
Copy link
Member

bpasero commented Apr 9, 2019

@isidorn is this covered with the proposed API registerResourceLabelFormatter?

@isidorn
Copy link
Contributor

isidorn commented Apr 10, 2019

@bpasero no. I mean the extension can register the formatting rules as @eamodio probably already does. But the issue here is what @eamodio points out, you are using the labelService only for the ResourceEditorInput. That is the actual issue, that FileEditorInput does not go to the labelService to fetch the label.

@bpasero
Copy link
Member

bpasero commented Apr 10, 2019

@isidorn got it, this is probably something we should look at

@isidorn
Copy link
Contributor

isidorn commented Apr 10, 2019

@bpasero I can look into it. Are there some caveats that I am missing, or we simply need to add the name property to the FileEditorInput also?

@bpasero
Copy link
Member

bpasero commented Apr 10, 2019

@isidorn each editor input has a getName() method (along getDescription() and getTitle()). Currently it looks like the file editor input is simply calling into basenameOrAuthority(resource) instead of using your label service (here).

I feel like we should use the same as for resource inputs for name, description and title to be consistent.

@isidorn isidorn self-assigned this Apr 10, 2019
@isidorn isidorn added workbench-editors Managing of editor widgets in workbench window and removed api labels Apr 10, 2019
@isidorn isidorn added this to the April 2019 milestone Apr 10, 2019
@isidorn
Copy link
Contributor

isidorn commented Apr 10, 2019

@eamodio please try it out in tomorrow's vscode insiders and let us know if the issue gets fixed for you
@bpasero I have change the FileEditorInput to use the labelService when computing its name.

@isidorn isidorn added the verification-needed Verification of issue is requested label May 8, 2019
@isidorn
Copy link
Contributor

isidorn commented May 8, 2019

@bpasero @eamodio can some of you verify this, so we add a verified label?

@bpasero bpasero added the verified Verification succeeded label May 8, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded workbench-editors Managing of editor widgets in workbench window
Projects
None yet
Development

No branches or pull requests

5 participants