-
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
Provides @eclipse-che/plugin namespace to VS Code extensions #18837
Comments
I will set P1 feel free to change |
So I've tried this in a vscode extension: import { IdManager } from '@redhat-developer/vscode-redhat-telemetry/lib';
import { UUID } from '@redhat-developer/vscode-redhat-telemetry/lib/utils/uuid';
export class CheIdManager implements IdManager {
async getRedHatUUID(): Promise<string> {
try {
const che = require('@eclipse-che/plugin');
const user = await che.user.getCurrentUser();
return user.id;
} catch (error) {
console.log(`Failed to get user id from Che: ${error}`);
//fall back to generating a random UUID
return UUID.getRedHatUUID();
}
}
} But, when @benoitf tested it in Che, he got :
This is critical for us to get proper telemetry from vscode extensions running in Che |
I think this is a duplicate of #17609. Using Che API in remote plugin hosts. |
It's not related at all. |
Well: using Che api in remote plugin hosts does not work, that's why we get the "actor chetelemetry not found". That would explain why it's not working for @fbricon. Do you not agree? |
It would be easy to test: if we run it in the theia container and it works, my hypothesis is correct. |
vscode-commons was loaded in the theia container as it's a pure nodejs app and it failed (We tested with vscode-commons only). So your hypothesis is not correct. |
I checked the extension vsix @fbricon provided and it has a problem with packaging: it never calls |
@benoitf could you share your analysis of the problem? What's going wrong that prevents the plugin api from being loaded? I was able to debug successfully through a |
Analysis of the problem was pretty simple. It's Che-Theia that needs to fit VS Code extension model, not the opposite. |
@benoitf So there is no actual bug being solved here. About the Sorry, but I don't see a problem being fixed and I don't see an additional capability being added by this work. If code doesn't solve a problem, it should not exist. Again, I'm truly open to be convinced if you can point me to any scenario that is made possible or even easier by this effort. |
So, the argument here is about two different approaches.
I suppose the time is needed for applying the 1'st approach would be several hours for a not very experienced developer. So, why should a developer bother with It would be great to hear @fbricon's opinion on that. As he is the first consumer of this feature as I understand. |
No it's not. Node.js I object to this change because it duplicates existing functionality. Also: you'll get an |
Also, I'm not convinced that clients would even prefer the "getExtension()" way if the can import a typed API instead of an |
I don't think it worth spending so much time discussing such a minor thing. |
I've since talked to @fbricon and he kinda prefers not to have to add a line to his webpack config. So I guess one could construe that as a community request. I still think it's just code duplication, but I'll remove the block from the PR. |
@azatsarynnyy summarized it best. I can work with both solutions. #1 didn't work for me initially though, #2 worked immediately, so I'm totally OK with it |
merged in 7.27 |
Is your enhancement related to a problem? Please describe.
Today, VS Code extensions don't have access to
@eclipse-che/plugin
namespace and if they're linking to this module it may not be deployed easily on VS Code.Describe the solution you'd like
Export
@eclipse-che/plugin
namespace as a VS Code extension export through a Theia plug-in (that has access to the namespace for example)https://code.visualstudio.com/api/references/vscode-api#extensions
VS Code extensions wanting to use Che features could then do:
Describe alternatives you've considered
N/A
Additional context
Leverage VS Code extension paradigm
The text was updated successfully, but these errors were encountered: