Skip to content

Conversation

@andrewbranch
Copy link
Member

Fixes #36213

*
* Relevant symbols are stored in the captured 'symbols' variable.
*
* @returns true if 'symbols' was successfully populated; false otherwise.
Copy link
Member Author

Choose a reason for hiding this comment

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

This was a lie

verify.completions({
marker: "",
exact: ["T"]
});
Copy link
Member

@sheetalkamat sheetalkamat Mar 25, 2020

Choose a reason for hiding this comment

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

Can you also add tests for export { a, /*here*/}, export { a/*here*/ as /*here*/}, export { a as b, /*here*/ }

Copy link
Member Author

Choose a reason for hiding this comment

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

This brings up a good point: I was filtering out symbols that were already exported, but it’s valid to export the same thing several times if you rename:

export { T, T as T2, T as T3, T as T4, ... }

Do you think I should eliminate the filtering?

Copy link
Member

Choose a reason for hiding this comment

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

I think instead of filtering you should sort text of those at lower priority ?

Copy link
Member

Choose a reason for hiding this comment

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

I don't know how practical it is, but another option might be to include the as the second time it's committed.

Copy link
Member Author

Choose a reason for hiding this comment

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

@sheetalkamat how would you set the sort text here? It defaults to LocationPriority, and the other enum member names aren’t accurate, even though the values are just "1", "2", etc... IIRC adding/changing SortText required changes elsewhere. Is it ok to use OptionalMember here for names that have already been included?

Copy link
Member

Choose a reason for hiding this comment

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

symbolToSortTextMap[getSymbolId(symbol)] = SortText./whatever you want to set/;

Copy link
Member Author

Choose a reason for hiding this comment

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

That’s what I currently have, it’s just that none of the existing SortText members describe the scenario, and I think I recall that adding a new one messed something up for @uniqueiniquity one time, but he can correct me if that’s wrong.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I would prefer you didn't add new ones.... especially new ones above GlobalsOrKeywords. The other issue we had (i.e. the value for JavaScriptIdentifiers kept changing) is resolved now.

Copy link
Member Author

Choose a reason for hiding this comment

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

I’m currently just using OptionalMember which is incorrect if introspecting by enum member name, but ultimately is just "1".

Copy link
Contributor

@orta orta left a comment

Choose a reason for hiding this comment

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

Sheetal's feedback all looks great, so consider this a 👍 for the overall PR when they're addressed

Copy link
Member

@amcasey amcasey left a comment

Choose a reason for hiding this comment

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

Seems sane, but I will also defer to Sheetal.

@andrewbranch andrewbranch merged commit 0f3a9d4 into microsoft:master Mar 27, 2020
@andrewbranch andrewbranch deleted the bug/36213 branch March 27, 2020 17:47
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Offer completions in export lists

6 participants