Skip to content

Add inlay hints support - #42089

Merged
Jesse Trinity (jessetrinity) merged 57 commits into
microsoft:mainfrom
Kingwl:signature_arguments_labels_support
Jun 25, 2021
Merged

Add inlay hints support#42089
Jesse Trinity (jessetrinity) merged 57 commits into
microsoft:mainfrom
Kingwl:signature_arguments_labels_support

Conversation

@Kingwl

@Kingwl Wenlu Wang (Kingwl) commented Dec 23, 2020

Copy link
Copy Markdown
Contributor

Fixes #42073

Features:

  • Parameter name hint for arguments
  • Type hint for parameter
  • Type hint for variable
  • Type hint for field
  • Type hint for return type
  • Type hint for call chains
  • Value hint for numerical enums
  • Control to show parameter name hint for non-literal arguments or not
  • Control to show type hints for require assigned variable.
  • Control to show parameter name if arguments is the same as parameter name

Something need to consider:

  • Truncated: For now. I have truncate the hints with hard code 30.
  • Preference: We have many options to specified the behavior. Currently we pass them by UserPreferences.
  • Complex types: Many types may very very long after serialization (function like, complex object, etc.). Should we handle them?
  • Type Parameter: The root cause is we could inference type from type node or type. Which one should we take? I think type is better.

Thanks!

@typescript-bot

Copy link
Copy Markdown
Contributor

Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping Sheetal Nandi (@sheetalkamat), Andrew Casey (@amcasey), Matt Bierner (@mjbvz), Mine Starks (@minestarks) for you. Feel free to loop in other consumers/maintainers if necessary

@typescript-bot TypeScript Bot (typescript-bot) added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 23, 2020
@Kingwl

Copy link
Copy Markdown
Contributor Author

Matt Bierner (@mjbvz)
Please take a look about protocol or naming.
Thanks!

@Kingwl

Copy link
Copy Markdown
Contributor Author

image

Basically work like this.