{{ message }}
Add label details to completion entry#48429
Merged
Conversation
Collaborator
andrewbranch
approved these changes
Mar 28, 2022
Member
andrewbranch
left a comment
There was a problem hiding this comment.
Agree with Daniel about the name, but otherwise looks good to me. Thanks for taking this up!
amcasey
approved these changes
Mar 28, 2022
Member
amcasey
left a comment
There was a problem hiding this comment.
Am I correct in understanding that we never set description?
Member
4c028fd to
41db01c
Compare
sidharthv96
added a commit
to sidharthv96/TypeScript
that referenced
this pull request
Apr 1, 2022
* upstream/main: (473 commits) Correct node used for isDefinition calculation (microsoft#48499) fix(48405): emit dummy members from a mapped type (microsoft#48481) CFA for dependent parameters typed by generic constraints (microsoft#48411) No contextual typing from return types for boolean literals (microsoft#48380) fix(47733): omit JSDoc comment template suggestion on node with existing JSDoc (microsoft#47748) Ensure that we copy empty NodeArrays during transform (microsoft#48490) Add a new compiler option `moduleSuffixes` to expand the node module resolver's search algorithm (microsoft#48189) feat(27615): Add missing member fix should work for type literals (microsoft#47212) Add label details to completion entry (microsoft#48429) Enable method signature completion for object literals (microsoft#48168) Fix string literal completions when a partially-typed string fixes inference to a type parameter (microsoft#48410) fix(48445): show errors on type-only import/export specifiers in JavaScript files (microsoft#48449) Fix newline inserted in empty block at end of formatting range (microsoft#48463) Prevent looking up symbol for as const from triggering an error (microsoft#48464) Revise accessor resolution logic and error reporting (microsoft#48459) fix(48166): skip checking module.exports in a truthiness call expression (microsoft#48337) LEGO: Merge pull request 48450 LEGO: Merge pull request 48436 fix(48031): show circularity error for self referential get accessor annotations (microsoft#48050) Revert "Fix contextual discrimination for omitted members (microsoft#43937)" (microsoft#48426) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Follow-up to #48168, as per this comment.
This PR adds label details in our completion entry type.
Since not all editors support this (vscode does, I think VS doesn't, or at least the TS extension in VS doesn't yet), there is also a new flag in
UserPreferencesthat should be used by editors to indicate if they support this new property.I've also changed the way object literal method snippet completions work to use label details, if they are available.
If they're not available, then we emulate it by modifying the name of the completion entry to be the full signature instead of just the name of the method (e.g. name:
foobecomes name:foo(x: number): number.Examples for what it looks like in vscode:

With label details:
Without label details:
