-
Notifications
You must be signed in to change notification settings - Fork 111
feat(namespace): Export @eclipse-che/plugin namespace using VS Code extension mechanism #994
Conversation
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Single User on K8S (minikube v1.1.1)
|
Why would a plugin using that namespace not simply require the namespace at compilation time? |
@tsmaeder because it's not only 'compilation time' |
@benoitf I still don't get it. Can you give an example? |
@tsmaeder example is given in the attached issue. |
When testing this solution, I was able to properly identify Che user with the exposed API, for telemetry purposes |
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've tested it with the provided example. Everything works as described. 👍
@@ -18,6 +18,9 @@ | |||
"@theia/plugin": "next", | |||
"@theia/plugin-packager": "latest" | |||
}, | |||
"extensionDependencies": [ |
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.
Sorry, I didn't get why the Workspace Plug-in has to depend on it?
Could you please elaborate a bit?
If it's just for bootstrapping, isn't the *
activation event enough?
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.
It's to make sure that it's loaded as first plug-ins because there is no concept of optional dependency in VScode api
@@ -22,6 +22,7 @@ sources: | |||
- extensions/eclipse-che-theia-remote-impl-che-server | |||
plugins: | |||
- plugins/containers-plugin | |||
- plugins/ext-plugin |
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.
Maybe something more descriptive? E.g. che-api-export-plugin
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 name of the folder can be as long as you want (can change it easily) but for the name of the plug-in it looks a bit too long/verbose for consumers.
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.
Agree, it's important to have the name as short as possible here. I just forgot it's supposed to be used by the external VS Code extensions.
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.
If you've a better short name suggestion, I can rename it
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.
It's good. Nevermind )
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.
After inspecting the vsix provided by @fbricon I'm convinced the vsix is not properly packaged (see comment on the issue). Until we clear this up, I don't think we should merge a workaround.
1c5d5f7
to
31b73f5
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.
All my notes have been addressed. Thanks!
❌ E2E Happy path tests failed ❗ See Details
Tested with Eclipse Che Single User on K8S (minikube v1.1.1)
|
Please, see my comments on eclipse-che/che#18837 (comment) |
@tsmaeder this PR is not about fixing a bug or providing a workaround. About lacking of type checking at compilation time, while developers coming from Java world may like it, VS Code extensions may be written in javascript and not in typescript. And again we don't remove the current way of importing namespace. It's a free will for developers, they should have the choice. |
It's when I saw how people struggle on how to import a namespace that I added this improvement so that in a couple of seconds you have something that works immediately. Nothing to debug/understand. |
…xtension mechanism Change-Id: I4d8d6c49b6797bd98b76486127ec3e38f243e120 Signed-off-by: Florent Benoit <fbenoit@redhat.com>
Codecov Report
@@ Coverage Diff @@
## master #994 +/- ##
==========================================
+ Coverage 57.93% 58.02% +0.08%
==========================================
Files 45 46 +1
Lines 2028 2032 +4
Branches 333 333
==========================================
+ Hits 1175 1179 +4
Misses 843 843
Partials 10 10
Continue to review full report at Codecov.
|
✅ E2E Happy path tests succeed 🎉 See Details
Tested with Eclipse Che Single User on K8S (minikube v1.1.1)
|
✅ E2E Happy path tests succeed 🎉 See Details
Tested with Eclipse Che Single User on K8S (minikube v1.1.1)
|
Let's merge 👍 @benoitf please do us the honours |
doc PR merged, merging there. |
What does this PR do?
Export
@eclipse-che/plugin
namespace through export of VS Code extension export APIclients could lookup getExtension('@eclipse-che.ext-plugin') to grab this namespace
Screenshot/screencast of this PR
oxrKWYn0wV.mp4
What issues does this PR fix or reference?
eclipse-che/che#18837
How to test this PR?
Write an example using getExtension('@eclipse-che/ext-plugin') and then for example grab workspace details.
I've created a vscode extension doing this job
Here to try this VS Code extensionon che.openshift.io
https://che.openshift.io/f?url=https://gist.githubusercontent.com/benoitf/b646af9e1cb9aacc23e3e588e413af47/raw/1f42b0a67bc40ed927a4215e26252fc12c9a3e58/devfile.yaml
or workspaces.openshift.com
https://workspaces.openshift.com/f?url=https://gist.githubusercontent.com/benoitf/b646af9e1cb9aacc23e3e588e413af47/raw/1f42b0a67bc40ed927a4215e26252fc12c9a3e58/devfile.yaml
bring the command palette and search for a
Test
commandPR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or reference
andHow to test this PR
completedReviewers
Reviewers, please comment how you tested the PR when approving it.
Happy Path Channel
HAPPY_PATH_CHANNEL=next
Change-Id: I4d8d6c49b6797bd98b76486127ec3e38f243e120
Signed-off-by: Florent Benoit fbenoit@redhat.com