-
Notifications
You must be signed in to change notification settings - Fork 36
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
Port @eclipse-che/theia-activity-tracker #65
Conversation
This PR is for eclipse-che/che#21513 |
@@ -23,7 +23,8 @@ fi | |||
ls -la /checode/ | |||
|
|||
# Start the machine-exec component in background | |||
nohup /checode/bin/machine-exec --url '0.0.0.0:3333' & | |||
export MACHINE_EXEC_PORT=3333 |
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.
This was done so that the VS Code extension could determine the machine exec port
Pull Request images published ✨ |
3 similar comments
Pull Request images published ✨ |
Pull Request images published ✨ |
Pull Request images published ✨ |
code/extensions/che-activity-tracker/src/activity-tracker-service.ts
Outdated
Show resolved
Hide resolved
code/extensions/che-activity-tracker/src/activity-tracker-service.ts
Outdated
Show resolved
Hide resolved
code/extensions/che-activity-tracker/src/activity-tracker-service.ts
Outdated
Show resolved
Hide resolved
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.
Signed-off-by: David Kwon <[email protected]>
Thank you for the review @azatsarynnyy , I've made the changes |
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 @dkwon17 for this contribution.
Pull Request images published ✨ |
@dkwon17 Thank you for your explanation. "devEnvironments.secondsOfInactivityBeforeIdling" is right. my bad... If che-code built-in extension checks "Activity", Another IDE cannot be applied by this option? ex) IntelliJ In my exprience, Intellij is also applied this option and it stopped Intellij workspace after the seconds. In IntelliJ IDE, Is it implemented a diffrent way? |
Hi @top1436 |
@azatsarynnyy hi! |
@top1436 correct, if I haven't missed anything ) |
@azatsarynnyy |
There're no plans to invest in the current (Projector-based) implementation of JetBrains editors for Che. |
This PR ports eclipse-che-theia-activity-tracker to che-code.
There were two main differences with https://github.com/eclipse-che/che-theia/tree/main/extensions/eclipse-che-theia-activity-tracker and the VS Code plugin introduced in this PR:
Tracking
Instead of front-end tracking like in che-theia, this PR tracks the following VS Code events using the extension API:
vscode.workspace.onDidChangeTextDocument
vscode.window.onDidChangeActiveTextEditor
vscode.window.onDidChangeTextEditorSelection
vscode.window.onDidChangeTextEditorViewColumn
vscode.window.onDidChangeWindowState
vscode.window.onDidChangeTerminalState
vscode.window.onDidChangeActiveTerminal
Determining the che-machine-exec url
Instead using an
EndpointService
to determine the machine-exec port like for che-theia, this PR relies on an environment variable set byentrypoint-volume.sh
which executes the machine-exec binary. The environment variable is read here.This was done because for Che-code, because for che-code, che-machine-exec is not running in its own container.To test this PR:
Since there is no idling set up for Che-code at the moment, to test this PR, create a workspace with this che-code image:
quay.io/dkwon17/che-code:idle
. Here is the editor devfile v2: https://gist.githubusercontent.com/dkwon17/1a96b69643260c9af23553f740132157/raw/72fb81012aa03618490b91cf887ff6a5cd12a889/gistfile1.txt.For example, to start a golang che sample workspace, go to:
When the workspace is running, the
tools
container of the workspace pod should log/activity/tick
POST
messages when interacting with the che-code editor. Requests are sent once a minute at most to che-machine-exec:Signed-off-by: David Kwon [email protected]