-
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
Support tasks presentation options received from plugins #9248
Support tasks presentation options received from plugins #9248
Conversation
cb0d6e7
to
9f4be4c
Compare
Never = 'never' | ||
Always = 1, | ||
Silent = 2, | ||
Never = 3 |
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.
String values were provided within https://github.com/eclipse-theia/theia/pull/7982/files
Alvaro, could you check that the changes do not lead to the bug described in the PR description #7982.
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.
Hi @RomanNikitenko,
Very good catch ! I was not aware of the previous issue,
I have left the Enums untouched to prevent compatibility issues and opted to use a maps to translate between config / DTO.
Comments are very welcome!
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.
Good catch on this, I tested this for regressions and it is working well for me, still getting the correct stringified values 👍
e067a30
to
efd6d33
Compare
import { TaskWatcher } from '@theia/task/lib/common/task-watcher'; | ||
import { TaskService } from '@theia/task/lib/browser/task-service'; | ||
import { TaskDefinitionRegistry } from '@theia/task/lib/browser'; | ||
|
||
const revealKindMap = new Map<number | string, string | number>( |
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.
Is it better to use number | RevealKind
here and number | PanelKind
below?
Maybe a better notation:
const revealKindMap: Map<number, RevealKind> & Map<RevealKind, number> = new Map([
[1, RevealKind.Always],
[2, RevealKind.Silent],
[3, RevealKind.Never],
[RevealKind.Always, 1],
[RevealKind.Silent, 2],
[RevealKind.Never, 3]
]);
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!, Thanks !
efd6d33
to
bb67b6b
Compare
Support tasks presentation options received from plugins This expands the functionality introduced in pull request eclipse-theia#6814 The following presentation options are now available for use by plugins: presentationOptions.reveal presentationOptions.focus presentationOptions.echo presentationOptions.showReuseMessage presentationOptions.panel presentationOptions.clear Signed-off-by: Alvaro Sanchez-Leon <alvaro.sanchez-leon@ericsson.com>
bb67b6b
to
fe32632
Compare
Tested with the example plugin and I am seeing the proper translation for PanelKind and RevealKind. I am also seeing the expected behavior of the presentation options |
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.
LGTM! I tested using your plugin and debugging, the data is correctly converted around.
Support tasks presentation options received from plugins
This expands the functionality introduced in pull request #6814
The following presentation options are now available for use by
plugins:
presentationOptions.reveal
presentationOptions.focus
presentationOptions.echo
presentationOptions.showReuseMessage
presentationOptions.panel
presentationOptions.clear
Fixes: #9239
Signed-off-by: Alvaro Sanchez-Leon alvaro.sanchez-leon@ericsson.com
What it does
How to test
plugin example , checkout branch: presentation-options
see Expected Output behaviour
Review checklist
Reminder for reviewers