Skip to content
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

[Plugin-API] Apply window.createQuickPick() #5012

Merged
merged 1 commit into from
May 14, 2019
Merged

[Plugin-API] Apply window.createQuickPick() #5012

merged 1 commit into from
May 14, 2019

Conversation

vinokurig
Copy link
Contributor

Apply window.createQuickPick() plugin API function. The function wraps QuickOpenExtImpl to set and show a QuickPick menu. Other functionality is not implemented because it require a lot of changes in the Theia quick-open model.
Is needed for #4266
fixes #4987

@benoitf
Copy link
Contributor

benoitf commented Apr 26, 2019

@akosyakov
Copy link
Member

akosyakov commented Apr 26, 2019

Other functionality is not implemented because it require a lot of changes in the Theia quick-open model.

Could you please open an issue to list everything what should be implemented? that it does not get lost in the code... or don't declare what is not implemented if it does no cause runtime issues

@vinokurig
Copy link
Contributor Author

@akosyakov

Could you please open an issue to list everything what should be implemented? that it does not get lost in the code... or don't declare what is not implemented if it does no cause runtime issues

Opened related issue for missing functionality: #5059

@vinokurig
Copy link
Contributor Author

@benoitf

Hi @vinokurig do you have run https://github.com/Microsoft/vscode/blob/master/extensions/vscode-api-tests/src/singlefolder-tests/quickInput.test.ts against this ?

Those are VsCode tests, they will probably fail because we have related issues for not implemented functionality: #5059

@akosyakov
Copy link
Member

I'm trying to test with https://github.com/Microsoft/vscode-extension-samples/tree/master/quickinput-sample

but plugin host process cannot start for me with this PR:

root INFO Theia app listening on http://localhost:3000.
root INFO PluginTheiaDirectoryHandler: accepting plugin with path /workspace/theia/plugins/quickinput-sample
root INFO Resolved "quickinput-sample" to a VS Code extension "quickinput-sample@0.0.1" with engines: { vscode: '^1.26.0' }
root INFO Deploying backend plugin "quickinput-sample@0.0.1" from "/workspace/theia/plugins/quickinput-sample/out/extension.js"
root WARN Collided keybinding is ignored;  {"command":"terminal:new:active:workspace","keybinding":"ctrl+`"}  collided with  {"command":"terminal:new","keybinding":"ctrl+shift+`"}
root WARN Could not register keybinding:
  {"command":"terminal:new:active:workspace","keybinding":"ctrl+`"}
Error: "ctrl+`" is in collision with something else [scope:0]
root WARN LanguagesFrontendContribution.onStart is slow, took: 121.40500009991229 ms
root INFO Using Git [2.19.1] from the PATH. (/usr/bin/git)
root INFO [nsfw-watcher: 7716] Started watching: /home/gitpod/.theia
root ERROR [hosted-plugin: 7731] /workspace/theia/node_modules/inversify/lib/annotation/decorator_utils.js:22
    if (Reflect.hasOwnMetadata(metadataKey, annotationTarget)) {
                ^

TypeError: Reflect.hasOwnMetadata is not a function
    at _tagParameterOrProperty (/workspace/theia/node_modules/inversify/lib/annotation/decorator_utils.js:22:17)
    at Object.tagParameter (/workspace/theia/node_modules/inversify/lib/annotation/decorator_utils.js:7:5)
    at /workspace/theia/node_modules/inversify/lib/annotation/named.js:10:31
    at /workspace/theia/packages/core/lib/common/command.js:27:37
    at __decorate (/workspace/theia/packages/core/lib/common/command.js:20:95)
    at /workspace/theia/packages/core/lib/common/command.js:386:23
    at Object.<anonymous> (/workspace/theia/packages/core/lib/common/command.js:392:2)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)

@akosyakov
Copy link
Member

@vinokurig How can I test it?

@vinokurig
Copy link
Contributor Author

@akosyakov Fixed the error, now you can test it with the sample plugin

this.onDidAcceptEmitter.fire(undefined);
this.onDidChangeSelectionEmitter.fire([item]);
this.onDidHideEmitter.fire(undefined);
this.dispose();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not it be done by a client? Can a client call show several items on the same instance of quick open?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sens

@akosyakov
Copy link
Member

I'm getting errors in the backend console trying different combinations from the sample extension:

root ERROR [hosted-plugin: 4427] TypeError: vscode_1.window.createInputBox is not a function
    at Promise (/workspace/theia/plugins/quickinput-sample/out/multiStepInput.js:233:51)
    at new Promise (<anonymous>)
    at MultiStepInput.<anonymous> (/workspace/theia/plugins/quickinput-sample/out/multiStepInput.js:232:30)
    at Generator.next (<anonymous>)
    at /workspace/theia/plugins/quickinput-sample/out/multiStepInput.js:11:71
    at new Promise (<anonymous>)
    at __awaiter (/workspace/theia/plugins/quickinput-sample/out/multiStepInput.js:7:12)
    at MultiStepInput.showInputBox (/workspace/theia/plugins/quickinput-sample/out/multiStepInput.js:229:16)
    at /workspace/theia/plugins/quickinput-sample/out/multiStepInput.js:80:42
    at Generator.next (<anonymous>)

root ERROR [hosted-plugin: 4427] TypeError: Cannot read property 'map' of undefined
    at QuickPickExt.show (/workspace/theia/packages/plugin-ext/lib/plugin/quick-open.js:225:49)
    at Promise (/workspace/theia/plugins/quickinput-sample/out/quickOpen.js:105:23)
    at new Promise (<anonymous>)
    at /workspace/theia/plugins/quickinput-sample/out/quickOpen.js:56:26
    at Generator.next (<anonymous>)
    at /workspace/theia/plugins/quickinput-sample/out/quickOpen.js:11:71
    at new Promise (<anonymous>)
    at __awaiter (/workspace/theia/plugins/quickinput-sample/out/quickOpen.js:7:12)
    at pickFile (/workspace/theia/plugins/quickinput-sample/out/quickOpen.js:53:12)
    at Object.<anonymous> (/workspace/theia/plugins/quickinput-sample/out/quickOpen.js:27:27)

@vinokurig
Copy link
Contributor Author

vinokurig commented May 3, 2019

@akosyakov

I'm getting errors in the backend console trying different combinations from the sample extension:
root ERROR [hosted-plugin: 4427] TypeError: vscode_1.window.createInputBox is not a function

That's because window.createInputBox API method is not implemented yet

@akosyakov
Copy link
Member

@vinokurig and the second error? i thought the quick open is already implemented. Is it a bug in the implementation, please open an issue.

Copy link
Member

@akosyakov akosyakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not happy with stubbing stuff, but in this case it seems to cause runtime errors for methods/events. I hope we can implement them soon.

cc @benoitf

@vinokurig
Copy link
Contributor Author

@akosyakov Fixed the second error in the PR

@vinokurig
Copy link
Contributor Author

@benoitf Can we go with current state?

@benoitf
Copy link
Contributor

benoitf commented May 14, 2019

@vinokurig yes, please check first that commits are Signed (DCO and eca checks are failing)

Signed-off-by: Igor Vinokur <ivinokur@redhat.com>
@vinokurig vinokurig merged commit 126ac74 into master May 14, 2019
@vinokurig vinokurig deleted the theia-4987 branch May 14, 2019 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Plugin-API] Apply window.createQuickPick() function
3 participants