Skip to content

Extract out common QI code for Xaml to use.#52096

Merged
4 commits merged intodotnet:mainfrom
CyrusNajmabadi:extractQI
Mar 24, 2021
Merged

Extract out common QI code for Xaml to use.#52096
4 commits merged intodotnet:mainfrom
CyrusNajmabadi:extractQI

Conversation

@CyrusNajmabadi
Copy link
Contributor

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner March 24, 2021 00:18
@ghost ghost added the Area-IDE label Mar 24, 2021
@CyrusNajmabadi
Copy link
Contributor Author

@mgoertz-msft You would now call QuickInfoUtilities.CreateQuickInfoItemAsync which shares the real code with our QI impl. You can then take the QuickInfoItem returned and effectively do:

item.Sections.SelectMany(s => s.TaggedParts).ToImmutableArray() to just flatten it town to teh TaggedText array that you seem to use.

@mgoertz-msft
Copy link
Contributor

Thanks, I was wondering how I would get the TaggedText out of the QuickInfoItem now. :)


var showWarningGlyph = supportedPlatforms != null && supportedPlatforms.HasValidAndInvalidProjects();

var symbols = tokenInformation.Symbols;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

logic that cares abotu 'token' or 'tokenInformation' stayed here. The values we need from those are then just passed into the common helper which was moved to a Utilities class.

var sections = ImmutableArray.CreateBuilder<QuickInfoSection>(initialCapacity: groups.Count);

var symbol = tokenInformation.Symbols.First();
if (tokenInformation.ShowAwaitReturn)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this logic was moved, effectively unchanged. we just now don't access token/tokenInformation/etc. anymore, but we use the values passed in.

SupportedPlatformData? supportedPlatforms = null,
bool showAwaitReturn = false,
NullableFlowState flowState = NullableFlowState.None,
CancellationToken cancellationToken = default)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mgoertz-msft you can ignore the supportedPlatform/showAwaitReturn/flowState as i imagine you don't care about them.

SupportedPlatformData? supportedPlatforms = null,
bool showAwaitReturn = false,
NullableFlowState flowState = NullableFlowState.None,
CancellationToken cancellationToken = default)
Copy link
Member

Choose a reason for hiding this comment

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

should cancellation token just be required?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will do.

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Auto-approval

@ghost ghost merged commit 1e94706 into dotnet:main Mar 24, 2021
@ghost ghost added this to the Next milestone Mar 24, 2021
@CyrusNajmabadi CyrusNajmabadi deleted the extractQI branch March 24, 2021 05:38
@allisonchou allisonchou modified the milestones: Next, 16.10.P2 Mar 29, 2021
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants