-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Views: Support contributing welcome-views to empty tree view #8678
Conversation
a1fb1ee
to
cc058f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can perform a comprehensive review after the next release (tomorrow) 👍
packages/plugin-ext/src/main/browser/view/plugin-view-welcome.tsx
Outdated
Show resolved
Hide resolved
cc058f2
to
82a93c7
Compare
3d9e3ce
to
a03e2fe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it with a VS Code extension, and it works perfectly. I look forward to seeing this feature in Theia. Nice job, @EstherPerelman 👍
@@ -33,7 +33,7 @@ export const DIR_NODE_CLASS = 'theia-DirNode'; | |||
export const FILE_STAT_ICON_CLASS = 'theia-FileStatIcon'; | |||
|
|||
@injectable() | |||
export class FileTreeWidget extends TreeWidget { | |||
export class FileTreeWidget extends TreeViewWelcomeWidget { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we enable the welcome-support in all other trees as well? It isn't FS specific. What do you think, @akosyakov?
bf52574
to
9372a7a
Compare
@kittaakos @vince-fugnitto Can you continue reviewing the code? |
9372a7a
to
d9f8a02
Compare
@kittaakos @vince-fugnitto other then the CQ (which is approved now) do you have more comments? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good to me, I verified with the simple extension but not the additional configuration as I do not have the source code.
I'm wondering about the following https://github.com/eclipse-theia/theia/pull/8678/files#r515101313 however. I'll add reviewers who are more familiar with the plugin-system to see if they have any comments as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/plugin-ext/src/main/browser/view/plugin-view-registry.ts
Outdated
Show resolved
Hide resolved
@amiramw What do you think? |
It should be supported when there is no opened workspace. At least in vscode it is with vscode builtin git support. Did you test with builtin git extension? |
3399afd
to
f4ec5a6
Compare
@kittaakos Thanks for reviewing! I updated the code accordingly |
@kittaakos are there any more comments or can we merge? (after CI is working and release is over) |
I haven't had time to look into the updates, probably it is good to merge if all remarks have been addressed, but we need to restore the CI first. |
f4ec5a6
to
eddb30c
Compare
Signed-off-by: Esther Perelman <[email protected]>
eddb30c
to
e45de40
Compare
@kittaakos PR is rebased and build passed. could you give final approval? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @EstherPerelman. Nice feature👍
@amiramw, please help with the merging. I've checked and tried the changeset twice already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Went over the code again and tested successfully
Signed-off-by: Esther Perelman [email protected]
Welcome-views can be contributed by extensions in order to be applied to empty tree views, A view is considered empty if the tree has no children.
see vscode doc: vs-code-contributes.viewsWelcome
What it does
Partially solves #7178 #8667 (For now supports contributing to custom-views and 'explorer' view but not the other built-in views: 'scm', 'debugger', 'test').
How to test
When opening it from the left menu - you should see the contributed welcome-view:
2. You can now contribute more welcome-views to the run-configuration view by adding a viewWelcome to any extension package.json under "contributes" key, For example:
"viewsWelcome": [{
"view": runConfigurations,
"contents": "In order to use git features, you can open a folder containing a git repository or clone from a URL.\nOpen Folder\nClone Repository\nTo learn more about how to use git and source control in VS Code read our docs.",
}]
Now it should look like this:
You can play around... (add when clause etc...)
The contentns are rendered like this:
'/n' - for new line.
'[here goes the label](here goes a command or a link)' - If there's only a command/link in a line without any other text - it will be displayed as a button, Otherwise as a link.
Review checklist
Reminder for reviewers