-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Using @eclipse-che/plugin gives error #20259
Comments
so you can't just take this plug-in without adding as well the whole che-theia plug-in ext module |
@benoitf Thanks for your answer! If i understand you correctly, your response is about the code in the relevant information section. |
it works only in che-theia because |
Is there any other foreseen way to access Che (devfile and API) from within a custom Theia editor that is not Che-Theia? Is it conceptionally possible to refactor the che/plugin in a way that it can be included into custom Theia editors that are not Che-theia, e.g. by reorganizing the dependencies? |
@benoitf does it make sense to npm-publish the API, but not the implementations? |
we publish the API provided by che-theia, so if you want to use "che-theia programming model' you need to use che-theia. Devfile API is accessible by che-server Rest API or through a mounted file in case of DevWorkspace. So you can access these information without CheTheia custom namespace. |
But why do we publish the @eclipse-che/plugin package to npm if it can't be used by anyone outside the che-theia source tree anyway? |
we publish to npmjs because you can develop vscode Extensions / Theia plug-ins to be installed in CheTheia by depending only on this package, not depending on the implementation. |
also the API exposed by our That said, this is why to not having to re-implement some logic in all editors that we moved the clone operation at an earlier step in the DevWorkspace. ( #15973 ) And that IDE plug-ins are not part of the Devfile v2 but are part of the project source code. And we also want to have commands of the devfile being exposed by shell aliases as well so in the end you can easily plug other editors without having to handle clone or commands of the devfile, etc but still interact with your workspace definition. |
Thanks a lot @benoitf ! This sounds exactly what we would need for the custom editor use case. I see this is on the roadmap for the next months, which is great. If we can help and or test anything, please let us know anytime. |
The provisioning of the API as a Theia plugin namespace is tied to the underlying Theia version (although unless the API provisioning SPI changes, you should be good), but nothing keeps us from making a library that can provide access to the dev workspace (from the che server or devworkspace operator) and publishing that for use of third-party editors. Another idea would be to run a "proxy" inside the workspace that provides the API and dispatches to che server or devworkspace operator depending on the setup. It could provide a http API accessible from any language. |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
Summary
I am trying to read out the devfile in a custom theia editor, which i want to use in a Che workspace. I am following these instuctions: https://www.eclipse.org/che/docs/che-7/contributor-guide/che-theia-plug-in-api/. If i understand it correctly this should work with the
@eclipse-che/plugin
package. However when i create a theia plugin (or vscode extension) consuming this package and useawait che.workspace.getCurrentWorkspace();
in theactivate()
function, the plugin cannot be build. I was able to workaround the build failure, but then the same error happens when the plugin is activated:Is there something i am missing with the
@eclipse-che/plugin
package? Is it only usable inside of Che-Theia or does it have any other constraints?Thanks in advance.
UPDATE:
The problem above seems to not occur using the following theia plugin: https://github.com/sgraband/che-plugin-test.
However, the plugin can still not be activated due to 'che' not being define:
Activating extension '*' failed: che is not defined
Relevant information
I also tried it with this code:
But this results in
Not running inside Eclipse Che, not displaying any user information
, when running the editor in Che.The text was updated successfully, but these errors were encountered: