-
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
[vscode] basic support of activation events #5622
Conversation
@evidolob Could you assign someone to help with the review? |
private frontendExtManagerProxy: PluginManagerExt; | ||
private backendExtManagerProxy: PluginManagerExt; | ||
|
||
protected readonly managers: PluginManagerExt[] = []; |
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.
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 think refactoring and new feature should be separate commits or separate PR
moving from constructor injection to property injection is not directly linked to that PR so it makes a lot of extra changes for nothing.
I think this is kind of PR that I dislike the more when there is one change that is important but it's flooded by tons of cleanup/style/user preferences that should be just for that.
It's like something can't be added without changing all the code which usually is not so true.
BTW 'properly' is not meaningful. You should describe why it was limited and how you've removed that limitation so that people using that class are able to see what was the goal. This is more meaningful for me that a checklist of 100 items which are not describing the why, how and what.
besides that it's a great feature and I'm ok with the refactoring. But breaking change doesn't mean to mix enhancement/bugfixes with code cleanup/rewrite for its own style preference, etc the class in one step. It's so inconvenient to review.
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 think refactoring and new feature should be separate commits or separate PR
moving from constructor injection to property injection is not directly linked to that PR so it makes a lot of extra changes for nothing.
I think this is kind of PR that I dislike the more when there is one change that is important but it's flooded by tons of cleanup/style/user preferences that should be just for that.
It's like something can't be added without changing all the code which usually is not so true.
Generally agree that PRs should be to the point. Not sure about refactoring PRs itself. It is fine if there is good set of regression tests, but if there are not it is an extra effort to test again. I would try to make additional explicit commits for refactoring next time or better to look in the test infrastructure next weeks.
BTW 'properly' is not meaningful. You should describe why it was limited and how you've removed that limitation so that people using that class are able to see what was the goal. This is more meaningful for me that a checklist of 100 items which are not describing the why, how and what.
To be fair I've tried to describe it with: Before one backend manager will receive events from the frontend.
. Maybe it was not clear: now all remote plugin host processes get notified about updated storage path and activation events. Agree that i had to put it in the description.
packages/plugin-ext/src/hosted/browser/plugin-activation-event-service.ts
Outdated
Show resolved
Hide resolved
d6a0467
to
cf111db
Compare
Great preparation for a review @akosyakov! 🥇 |
cf111db
to
9a93def
Compare
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
9a93def
to
fea1750
Compare
I've pushed support of |
@akosyakov, your last commit seems to broke the build: https://github.com/theia-ide/theia/pull/5622/files#diff-ab6e2d4c57658cf60e550cfe9ba87eacR291 |
fea1750
to
0d53466
Compare
@kittaakos pushed again, should be good now |
@akosyakov I've modified your extension here https://github.com/akosyakov/command-activation-event/blob/master/src/extension.ts#L20 to call another command
instead of showing a message. Then I've forked your extension and slightly modified it So, calling
|
Fixed I got this after installing the
|
[out-of-scope?]: I do not know if this is a bug or the desired behavior, but I put all three above-mentioned plug-ins into the
I wonder why do we log the same things three times. |
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 read through the code, added a few remarks here and there. I also tried it with the command, language, and the "wildcard" activation. They've worked. 🎉 Let's improve the documentation for the new command API.
packages/core/src/common/command.ts
Outdated
/** | ||
* An event is emmited when a command is about to be executed. | ||
* | ||
* It can be used to install or active a command handler. |
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.
typo: or activate
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.
done
packages/plugin-ext/src/main/browser/plugin-contribution-handler.ts
Outdated
Show resolved
Hide resolved
@kittaakos could you file an issue for #5622 (comment)? I don't know either. |
0d53466
to
1ca8d99
Compare
@azatsarynnyy it cannot work, since command declaration is missing, It is mandatory in VS Code. I will verify it. |
@azatsarynnyy oh, actually it does work in VS Code 😄 |
1ca8d99
to
45a4578
Compare
@azatsarynnyy could you try again? I've adjusted logic how we register commands for vscode namespace, now only if a command is presented in the metadata it will be registered as a handler, otherwise like a command and handler. See https://github.com/theia-ide/theia/pull/5622/files#diff-66cd2825aa616ad9a26b1f62e1b21e5b Super simple and good test btw. It verified theia plugins and found new and existing bugs :) |
@kittaakos Can you try again #5622 (comment)? I cannot reproduce it in Gitpod, will try locally. But probably it is fixed by #5622 (comment) as well |
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
45a4578
to
6e63ef7
Compare
No errors this time 👍 |
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 have verified it once more locally. I have checked the followings:
go
extension,- activation by
language
, and - activation by
command
.
It worked. I did not see any errors in the logs. Very nice 👍
PS: Thank you for adding the empty lines 😊
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.
@akosyakov I've tested it again with two plugins and plugin activation works 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.
tested with one che-theia example
What it does
*
onLanguage
activation eventonCommand
activation eventHow to test
onLanguage
event: deploy https://github.com/akosyakov/lang-activation-event/blob/master/lang-activation-event-0.0.1.vsix and test thatHello World
notification appears only when typescript file is openedonCommand
event: deploy https://github.com/akosyakov/command-activation-event/blob/master/command-activation-event-0.0.1.vsix and test thatHello World
command is available without a plugin activation and that it showsHello World
notification on the executionSee how to deploy vscode extension here: https://github.com/theia-ide/theia/wiki/Testing-VS-Code-Extensions
Review Checklist
git pull -r
orgit fetch && git rebase
to pick up changes from the mastereach new file has a proper copyright with the current year and the name of contributing entity (individual or company)new dependendencies are justified and verifiedcopied code is justified and approved via a CQ