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

plugin: add support for CompletionItemLabel #10929

Merged
merged 1 commit into from
Mar 29, 2022

Conversation

vince-fugnitto
Copy link
Member

What it does

The commit adds support for CompletionItemLabel for CompletionItem. The change also adjusts the styling of monaco suggestions to more closely resemble vscode (using monospaced fonts) and fixing an issue when rendering the detail due to a superflous line-height.

suggestions

How to test

  1. include the following test extension completions-sample-0.0.2.zip
  2. open a .txt file
  3. execute the command Trigger Suggest
  4. the quick-suggestion should appear (the detail and description)
  5. the styling of the suggestion should be correct (monospaced font, alignment)

Review checklist

Reminder for reviewers

Signed-off-by: vince-fugnitto [email protected]

The commit adds support for `CompletionItemLabel` for `CompletionItem`.
The change also adjusts the styling of monaco suggestions to more
closely resemble vscode (using monospaced fonts) and fixing an issue
when rendering the `detail` due to a superflous line-height.

Signed-off-by: vince-fugnitto <[email protected]>
@vince-fugnitto vince-fugnitto added monaco issues related to monaco vscode issues related to VSCode compatibility labels Mar 25, 2022
@vince-fugnitto vince-fugnitto self-assigned this Mar 25, 2022
Copy link
Contributor

@colin-grant-work colin-grant-work left a comment

Choose a reason for hiding this comment

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

The provided extension works as described and show styling identical to VSCode, and I see no regressions from the changes to CSS.

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.

I'm a bit confused by the missing margin between console and detail, but its the exact same behavior as in VSCode, so I guess it works as intended. LGTM!

@vince-fugnitto
Copy link
Member Author

I'm a bit confused by the missing margin between console and detail, but its the exact same behavior as in VSCode, so I guess it works as intended. LGTM!

Right! It’s the same in VS Code (not a huge fan of it) and is actually documented as such in the API:

        /**
          * An optional string which is rendered less prominently directly after {@link CompletionItemLabel.label label},
          * without any spacing. Should be used for function signatures or type annotations.
          */
         detail?: string;

@vince-fugnitto vince-fugnitto merged commit b206c6d into master Mar 29, 2022
@vince-fugnitto vince-fugnitto deleted the vf/completion-item-label branch March 29, 2022 13:55
@github-actions github-actions bot added this to the 1.24.0 milestone Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
monaco issues related to monaco vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants