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: Support TreeItemLabel in TreeItem and remove obsolete TreeItem2 #11288

Merged
merged 2 commits into from
Jun 13, 2022

Conversation

lucas-koehler
Copy link
Contributor

What it does

Fixes #11148

Support TreeItemLabel in TreeItem plugin API:

  • Add TreeItemLabel to theia.d.ts
  • Align TreeItem.label with VS Code API to support TreeItemLabel as a value
  • Extend plugin tree view implementation to support showing TreeItemLabel.highlights
    • Extend TreeViewNode to also extend DecoratedTreeNode
    • Set highlights in tree node's decoration data to displays them

Remove obsolete, proposed TreeItem2 and TreeItemLabel:

Remove TreeItem2 and TreeItemLabel from proposed plugin api because all properties are now supported and aligned with VS Code by TreeItem and TreeItemLabel in theia.d.ts.

Contributed on behalf of STMicroelectronics
Signed-off-by: Lucas Koehler [email protected]

How to test

  • Download the test extension here. For reference, the source code can be found here
  • Add extension to plugins and open Theia. In the Explorer view, you should see a TEST VIEW tree. Within the tree, the second and second to last letter of every entry with at least 2 letters should be highlighted. This is defined here in the extension's source
    image

Review checklist

Reminder for reviewers

@lucas-koehler lucas-koehler force-pushed the gh-11148-TreeItemLabel branch from 49bc418 to 48b7cd8 Compare June 13, 2022 08:45
@msujew msujew self-requested a review June 13, 2022 13:40
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.

Looks good to me 👍

  • Tree node labels (strings) are correctly displayed
  • Tree node labels ({ label, highlights }) are correctly displayed
  • The d.ts aligns to vscode correctly

* Add `TreeItemLabel` to theia.d.ts
* Align `TreeItem.label` with VS Code API to support `TreeItemLabel` as a value
* Extend plugin tree view implementation to support showing `TreeItemLabel.highlights`
  * Extend `TreeViewNode` to also extend `DecoratedTreeNode`
  * Set highlights in tree node's decoration data to displays them

Fixes eclipse-theia#11148

Contributed on behalf of STMicroelectronics

Signed-off-by: Lucas Koehler <[email protected]>
Remove `TreeItem2` and `TreeItemLabel` from proposed plugin api because all properties are now supported and aligned with VS Code by `TreeItem` and `TreeItemLabel` in `theia.d.ts`

Contributed on behalf of STMicroelectronics

Signed-off-by: Lucas Koehler <[email protected]>
@lucas-koehler lucas-koehler force-pushed the gh-11148-TreeItemLabel branch from 48b7cd8 to e37a269 Compare June 13, 2022 14:12
@lucas-koehler
Copy link
Contributor Author

Hi @msujew , thanks for the quick review :) I rebased the changes onto master and incorporated your suggestion with that.

@msujew msujew merged commit 369bf42 into eclipse-theia:master Jun 13, 2022
@vince-fugnitto vince-fugnitto added this to the 1.27.0 milestone Jun 30, 2022
@vince-fugnitto vince-fugnitto added the vscode issues related to VSCode compatibility label Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vscode issues related to VSCode compatibility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[vscode] Support TreeItemLabel in TreeItem
3 participants