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

quickopen and quickoutline will now show the field icon for field symbols #21318

Merged
merged 1 commit into from
Feb 28, 2017

Conversation

hoovercj
Copy link
Member

This addresses #21315.

I noticed a few issues:

  1. SymbolKind.to and SymbolKind.from didn't map SymbolKind.Field to anything so SymbolKind.Property was used by default
  2. There were no classes for field icons except for one high contract mapping that field icons shared with variable icons. I could see that the icon used for variables in that location matched Field_16x.svg, so I operated under the assumption that in the other locations that variable icon classes were defined, field icon classes should be created to point to the same icon

@mention-bot
Copy link

@hoovercj, thanks for your PR! By analyzing the history of the files in this pull request, we identified @alexandrudima and @egamma to be potential reviewers.

@msftclas
Copy link

@hoovercj,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@roblourens roblourens requested a review from alexdima February 23, 2017 22:10
@roblourens roblourens removed the request for review from alexdima February 24, 2017 00:54
@bpasero bpasero assigned bpasero and unassigned alexdima Feb 24, 2017
@bpasero bpasero added this to the March 2017 milestone Feb 24, 2017
@bpasero
Copy link
Member

bpasero commented Feb 26, 2017

@hoovercj looks good to me but do you have an example where I could verify the fix? When I use TypeScript on an example like this:

class Test {
    public test: string;
}

It looks like public test:string is of kind property and not field.

@hoovercj
Copy link
Member Author

I recently added document symbol support in the HTML language service, so if that version has been pulled in by vscode then you should see html elements as fields/blue bricks in the quick outline. This is how I spotted the discrepancy, I returned SymbolKind.Field but they were appearing with the wrong property wrench icon.

I put together a small extension that you could use to preview the icons. There is a .vsix in the dist/ directory. You open a file named icons.ts and the symbol provider provides one symbol of each type so you can see the icons. Before this change you can see field uses a wrench, after it uses the blue brick.

Otherwise, a quick and dirty way of verifying that the icons are correct is looking at where I modified src/vs/editor/common/modes.ts and modifying the SymbolKind.from/to to always return field, property, or variable and then observe the effects in the document symbols outline.

@bpasero bpasero merged commit 70df4ad into microsoft:master Feb 28, 2017
@bpasero
Copy link
Member

bpasero commented Feb 28, 2017

Thanks!

@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.

5 participants