-
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
Refactor to hide VS Code interfaces behind core services #9727
Refactor to hide VS Code interfaces behind core services #9727
Conversation
@@ -14,6 +14,8 @@ | |||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | |||
********************************************************************************/ | |||
|
|||
const { QuickPickItem } = require('@theia/core/lib/browser'); |
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.
@tsmaeder I believe it should be inside the describe('file-search')
, line 26.
protected readonly quickAccessRegistry: QuickAccessRegistry; | ||
|
||
constructor(@inject(KeybindingRegistry) protected readonly keybindingRegistry: KeybindingRegistry) { | ||
} |
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.
do we really need an empty constructor?
can we use the property injection here instead?
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.
No we don't.
super(); | ||
this.initContainer(); | ||
this.initController(); | ||
this.monacoService = new MonacoQuickInputImplementation(this.contextKeyService); |
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.
Shouldn't we use inversify to inject the instance instead?
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 idea was that this is an implementation detail of the MonacoQuickInputService, but since we're using the same class over in MonacoEditorProvider, that is not true anyway.
The VS Code code can handle multiple instances no problem, but we don't need more than one instance, so using the one from the container seems the right thing.
9a1f71e
to
dfbc685
Compare
Addressed review comments and rebased. Now (desperately ;-)) seeking for approval. 🥺 |
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.
@tsmaeder do you mind rebasing the pull-request, I'd be happy to perform another review so we can benefit from the cleanup following the upgrade 👍
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder <tmader@redhat.com>
595fa37
to
70393dc
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.
The changes look good to me, I verified the different quick-input menus we have (seen with the ?
prefix).
hideItem(label: string): void { } | ||
showItem(label: string): void { } | ||
|
||
readonly prefix = 'view '; |
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.
Leftover? We have QuickViewService.PREFIX
.
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.
Looks good to me as well:
- Every quick input prefix is working correctly ✔️
- Command history is working correctly ✔️
- Quick input icons are correctly displayed ✔️
Signed-off-by: Thomas Mäder <tmader@redhat.com>
…ia#9727) Refactor to hide VS Code interfaces behind core services Signed-off-by: Thomas Mäder <tmader@redhat.com>
Signed-off-by: Thomas Mäder tmader@redhat.com
What it does
This PR refactors the
QuickInput
andQuickAccess
services introduced in #9154 in order to completely hide the types imported from VS Code.In particular, this allows to write the all the related contributions in terms of a single implementation of quick access and quick input. Also, the quick access registry implementation allows to use dependency injection in the regular Theia way.
This refactoring was deferred from the original PR in order to facilitate merging it earlier.
How to test
We should do the same testing as for #9154
Review checklist
Reminder for reviewers