Skip to content

Display extensionId as the description in the formatter dropdown #71910

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

Merged

Conversation

connorshea
Copy link
Contributor

@connorshea connorshea commented Apr 8, 2019

Unfortunately I wasn't able to figure out how to get a locally compiled version of Code working, so I wasn't able to test that this change does what I want.

Resolves #71904

Now displays the extension ID next to the formatter's displayName (there are supposed to be two formatters here, that's an unrelated thing with the extension I'm using to test this):

Screen Shot 2019-04-07 at 9 37 46 PM

@connorshea
Copy link
Contributor Author

This probably needs to be tested against the case where the formatter is included by default with VSCode (or would that still be considered an extension and therefore return an extensionId?).

@jrieken jrieken added this to the April 2019 milestone Apr 9, 2019
@jrieken
Copy link
Member

jrieken commented Apr 9, 2019

with VSCode (or would that still be considered an extension and therefore return an extensionId?)

Sure, all extensions are equal

@@ -127,7 +127,8 @@ class DefaultFormatter extends Disposable implements IWorkbenchContribution {
const picks = formatter.map((formatter, index) => {
return <IIndexedPick>{
index,
label: formatter.displayName || formatter.extensionId || '?'
label: formatter.displayName || formatter.extensionId || '?',
description: formatter.extensionId!.value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better description: formatter.extensionId && formatter.extensionId.value A formatter should always have an extension id but must not have one...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just kind of assumed the !. TypeScript operator worked like &. in Ruby, it seems like this is a better equivalent for &. anyway.

@jrieken
Copy link
Member

jrieken commented Apr 10, 2019

thanks

@jrieken jrieken merged commit 8789ee6 into microsoft:master Apr 10, 2019
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Include the extension that provides the formatter when choosing a formatter
2 participants