Skip to content

Conversation

@cartermp
Copy link
Contributor

Fixes #9732

The problem is that for code like this:

let x = async { return 12 }

async has two captured name resolutions:

  • An Item.Value
  • A Item.CustomBuilder

Both are technically correct "views" of async, but the latter is the correct classification type when you consider colorization. Because the cache we use de-duplicates based on range, and ItemValue comes first in the array of captured name resolutions, async was classified as a Value and ultimately colored as plaintext.

This prefers Item.CustomBuilder for the purposes of classification.

Copy link
Contributor

@TIHan TIHan left a comment

Choose a reason for hiding this comment

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

This is reasonable, though interesting that there are two different Items with the same range. I'm wondering why there were two in the first place. Would it be possible to only emit one of them? Don't think it's super necessary, but considering this is a heuristic it would be fair to investigate.

@cartermp
Copy link
Contributor Author

There may be a different fix in name resolution that distincts them down, though I this depends on what it would be used for. For the purposes of classification we want a specific resolution, but maybe another tooling scenario wants both.

Feels a little bit like the whole RangeAlternate business.

@cartermp cartermp merged commit 7ae37f1 into dotnet:master Jul 24, 2020
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CE builder syntax no longer colored as keyword color

2 participants