Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vscode: add support for inlay hints #11736

Merged
merged 1 commit into from
Oct 17, 2022
Merged

vscode: add support for inlay hints #11736

merged 1 commit into from
Oct 17, 2022

Conversation

vince-fugnitto
Copy link
Member

@vince-fugnitto vince-fugnitto commented Oct 5, 2022

What it does

Closes: #10978.

The pull-request adds support for inlay hints in the editor:

Screen Shot 2022-10-05 at 10 39 52 AM

How to test

In order to verify inlay hints, I build a newer version of the typescript builtins (v1.65.0) which included the feature.

  1. checkout the branch, and build the changes
  2. remove the plugins folder, and instead add the following extensions (typescript-builtins-1.65.0.zip)
  3. start the application using theia itself as a workspace
  4. ensure that the following preferences are turned on:
    "editor.inlayHints.enabled": "on"
    "typescript.inlayHints.enumMemberValues.enabled": true,
    "typescript.inlayHints.functionLikeReturnTypes.enabled": true,
    "typescript.inlayHints.parameterNames.enabled": "all",
    "typescript.inlayHints.parameterTypes.enabled": true,
    "typescript.inlayHints.propertyDeclarationTypes.enabled": true,
    "typescript.inlayHints.variableTypes.enabled": true,
  5. ensure that the workspace is using at least typescript@4.4.0 as a version which includes support for inlay hints
  6. open a typescript file and confirm that inlay hints are in fact present

Additional Information

Review checklist

Reminder for reviewers

Signed-off-by: vince-fugnitto vincent.fugnitto@ericsson.com

@vince-fugnitto vince-fugnitto added monaco issues related to monaco vscode issues related to VSCode compatibility CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) labels Oct 5, 2022
@vince-fugnitto vince-fugnitto self-assigned this Oct 5, 2022
@msujew msujew self-requested a review October 11, 2022 12:32
Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

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

Well done, that looks really good :)

I can confirm that the feature works as expected and provides support for the full inlay hints API (see below)

  • Inlay hints are provided by extensions as expected and work just like in vscode
  • They can be disabled using the preference. All entries of the preference work as indicated

I have a few minor improvements to the code, but I'll approve this already 👍

packages/plugin-ext/src/main/browser/languages-main.ts Outdated Show resolved Hide resolved
packages/plugin-ext/src/main/browser/languages-main.ts Outdated Show resolved Hide resolved
packages/plugin-ext/src/main/browser/languages-main.ts Outdated Show resolved Hide resolved
packages/plugin-ext/src/plugin/languages/inlay-hints.ts Outdated Show resolved Hide resolved
@vince-fugnitto
Copy link
Member Author

@msujew thank you for the detailed review, I updated the code with your suggestions.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
@JonasHelming
Copy link
Contributor

@vince-fugnitto CQ is approved, I guess we can merge this?

@vince-fugnitto vince-fugnitto merged commit 84d088c into master Oct 17, 2022
@vince-fugnitto vince-fugnitto deleted the vf/inlay-hint branch October 17, 2022 11:57
@github-actions github-actions bot added this to the 1.31.0 milestone Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CQ Required (deprecated) issues requiring a CQ (contributor questionnaire) monaco issues related to monaco vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

vscode: add support for inlay hints
3 participants