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

Command Palette isn't opened after closing a workspace #5887

Closed
azatsarynnyy opened this issue Aug 8, 2019 · 10 comments · Fixed by #5888
Closed

Command Palette isn't opened after closing a workspace #5887

azatsarynnyy opened this issue Aug 8, 2019 · 10 comments · Fixed by #5888
Labels
bug bugs found in the application shell issues related to the core shell

Comments

@azatsarynnyy
Copy link
Member

azatsarynnyy commented Aug 8, 2019

Description

Nothing happens when I'm trying to open Command Palette in Theia with no workspace is opened.

Reproduction Steps

Make sure no workspace is opened and press F1 to open Command Palette.

OS and Theia version:
Theia 0.9.0
Commit id 0953ba7

Diagnostics:

In browser's dev console:

Uncaught (in promise) TypeError: Cannot read property 'uri' of undefined
    at CppBuildConfigurationManagerImpl.push.../../packages/cpp/lib/browser/cpp-build-configurations.js.CppBuildConfigurationManagerImpl.getActiveConfig (cpp-build-configurations.ts:274)
    at Object.isVisible (cpp-build-configurations-ui.ts:211)
    at CommandRegistry.../../packages/core/lib/common/command.js.CommandRegistry.getVisibleHandler (command.ts:300)
    at CommandRegistry.../../packages/core/lib/common/command.js.CommandRegistry.isVisible (command.ts:255)
    at quick-command-service.ts:163
    at Array.filter (<anonymous>)
    at QuickCommandService.../../packages/core/lib/browser/quick-open/quick-command-service.js.QuickCommandService.normalize (quick-command-service.ts:163)
    at QuickCommandService.../../packages/core/lib/browser/quick-open/quick-command-service.js.QuickCommandService.getCommands (quick-command-service.ts:149)
    at QuickCommandService.../../packages/core/lib/browser/quick-open/quick-command-service.js.QuickCommandService.init (quick-command-service.ts:64)
    at PrefixQuickOpenService.<anonymous> (prefix-quick-open-service.ts:178)
@azatsarynnyy azatsarynnyy added the bug bugs found in the application label Aug 8, 2019
@akosyakov
Copy link
Member

akosyakov commented Aug 8, 2019

@azatsarynnyy I've just tried on master and F1 works for me. Do you have anything special in your setup?

@akosyakov
Copy link
Member

We've merged enhancements to the quick palette yesterday: d47d42e Could you try before this commit?

If it is reproducible, then it is critical regression and has to be tackled today/tomorrow or reverted.

@akosyakov akosyakov added the shell issues related to the core shell label Aug 8, 2019
@azatsarynnyy
Copy link
Member Author

@akosyakov I've built Theia from the commit 62fe752 and everything works well.
So, most likely the problem has appeared after the #4603

@azatsarynnyy
Copy link
Member Author

@akosyakov it's weird that it works well on your side. I've also tried in Chrome incognito mode and in FF - the same error.

@RomanNikitenko
Copy link
Contributor

RomanNikitenko commented Aug 8, 2019

I can reproduce the issue when I don't have opened workspace

bug_f1

@azatsarynnyy
Copy link
Member Author

yep, it's reproducible with closed workspace only. Thanks, @RomanNikitenko for checking this out!

@azatsarynnyy
Copy link
Member Author

BTW after closing a workspace, one more error is reported

logger-protocol.ts:112 root ERROR TypeError: Cannot read property 'className' of undefined
    at SearchInWorkspaceWidget.push.../../packages/search-in-workspace/lib/browser/search-in-workspace-widget.js.SearchInWorkspaceWidget.renderOptionElement (http://localhost:3000/88.bundle.js:2475:61)
    at SearchInWorkspaceWidget.push.../../packages/search-in-workspace/lib/browser/search-in-workspace-widget.js.SearchInWorkspaceWidget.renderOptionContainer (http://localhost:3000/88.bundle.js:2463:36)
    at SearchInWorkspaceWidget.push.../../packages/search-in-workspace/lib/browser/search-in-workspace-widget.js.SearchInWorkspaceWidget.renderSearchField (http://localhost:3000/88.bundle.js:2428:36)
    at SearchInWorkspaceWidget.push.../../packages/search-in-workspace/lib/browser/search-in-workspace-widget.js.SearchInWorkspaceWidget.renderSearchAndReplace (http://localhost:3000/88.bundle.js:2377:32)
    at SearchInWorkspaceWidget.push.../../packages/search-in-workspace/lib/browser/search-in-workspace-widget.js.SearchInWorkspaceWidget.renderSearchHeader (http://localhost:3000/88.bundle.js:2369:46)
    at SearchInWorkspaceWidget.push.../../packages/search-in-workspace/lib/browser/search-in-workspace-widget.js.SearchInWorkspaceWidget.onUpdateRequest (http://localhost:3000/88.bundle.js:2339:22)
    at SearchInWorkspaceWidget.../../node_modules/@phosphor/widgets/lib/widget.js.Widget.processMessage (http://localhost:3000/bundle.js:23628:22)
    at invokeHandler (http://localhost:3000/bundle.js:7614:21)
    at sendMessage (http://localhost:3000/bundle.js:7350:13)
    at runMessageLoop (http://localhost:3000/bundle.js:7664:17)

@azatsarynnyy azatsarynnyy changed the title Command Palette isn't opened Command Palette isn't opened after closing a workspace Aug 8, 2019
@azatsarynnyy
Copy link
Member Author

the title/description has been updated with the details

vince-fugnitto added a commit that referenced this issue Aug 8, 2019
Fixes #5887

- fixes issue where the command palette can not be opened when
there is no workspace set. (caused by changes made in the 'cpp-build-configuration#getActiveConfig')
- if no workspace is present, return `undefined` instead of attempting to get the activeConfig
for the workspace root.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
@azatsarynnyy
Copy link
Member Author

FYI, I filed the issue #5889 related to another error reported on closing a workspace.

vince-fugnitto added a commit that referenced this issue Aug 8, 2019
Fixes #5887

- fixes issue where the command palette can not be opened when
there is no workspace set. (caused by changes made in the 'cpp-build-configuration#getActiveConfig')
- if no workspace is present, return `undefined` instead of attempting to get the activeConfig
for the workspace root.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
paul-marechal pushed a commit that referenced this issue Aug 8, 2019
Fixes #5887

- fixes issue where the command palette can not be opened when
there is no workspace set. (caused by changes made in the 'cpp-build-configuration#getActiveConfig')
- if no workspace is present, return `undefined` instead of attempting to get the activeConfig
for the workspace root.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
paul-marechal pushed a commit that referenced this issue Aug 8, 2019
Fixes #5887

- fixes issue where the command palette can not be opened when
there is no workspace set. (caused by changes made in the 'cpp-build-configuration#getActiveConfig')
- if no workspace is present, return `undefined` instead of attempting to get the activeConfig
for the workspace root.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
paul-marechal pushed a commit that referenced this issue Aug 8, 2019
Fixes #5887

- fixes issue where the command palette can not be opened when
there is no workspace set. (caused by changes made in the 'cpp-build-configuration#getActiveConfig')
- if no workspace is present, return `undefined` instead of attempting to get the activeConfig
for the workspace root.
- fix frozen object access by working on a deep-cloned copy.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
vince-fugnitto added a commit that referenced this issue Aug 8, 2019
Fixes #5887

- fixes issue where the command palette can not be opened when
there is no workspace set. (caused by changes made in the 'cpp-build-configuration#getActiveConfig')
- if no workspace is present, return `undefined` instead of attempting to get the activeConfig
for the workspace root.
- fix frozen object access by working on a deep-cloned copy.

Signed-off-by: Vincent Fugnitto <vincent.fugnitto@ericsson.com>
@paul-marechal
Copy link
Member

@akosyakov should we catch errors when executing contribution code?

This issue seems to have happened because somehow the isVisible method was throwing and stopped the whole contribution iteration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application shell issues related to the core shell
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants