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

ProblemsView context menu only shows 'Collapse All' #12250

Closed
eneufeld opened this issue Mar 2, 2023 · 0 comments · Fixed by #12259
Closed

ProblemsView context menu only shows 'Collapse All' #12250

eneufeld opened this issue Mar 2, 2023 · 0 comments · Fixed by #12259
Labels
problems issues related to the problems widget

Comments

@eneufeld
Copy link
Contributor

eneufeld commented Mar 2, 2023

Bug Description:

After the update to Theia 1.34 the problems view only shows one context entry: Collapse All
ProblemsView

Furthermore the following stack trace is logged:

2023-03-02T11:59:52.043Z root ERROR TypeError: Cannot use 'in' operator to search for 'kind' in undefined
    at Object.is (http://localhost:3000/packages_markers_lib_browser_problem_problem-manager_js.js:296:23)
    at Object.is (http://localhost:3000/packages_markers_lib_browser_problem_problem-widget_js.js:409:78)
    at CommandHandler.toSelection (http://localhost:3000/packages_markers_lib_browser_problem_problem-widget_js.js:414:61)
    at CommandHandler.getSelection (http://localhost:3000/packages_filesystem_lib_browser_breadcrumbs_filepath-breadcrumb_js-packages_filesystem_lib_br-eff824.js:50:52)
    at CommandHandler.isVisible (http://localhost:3000/packages_filesystem_lib_browser_breadcrumbs_filepath-breadcrumb_js-packages_filesystem_lib_br-eff824.js:39:32)
    at CommandRegistry.getVisibleHandler (http://localhost:3000/bundle.js:139171:55)
    at CommandRegistry.isVisible (http://localhost:3000/bundle.js:139133:28)
    at MenuCommandExecutorImpl.delegate (http://localhost:3000/bundle.js:142270:43)
    at MenuCommandExecutorImpl.isVisible (http://localhost:3000/bundle.js:142258:21)
    at SampleMenuCommandRegistry.registerCommand (http://localhost:3000/packages_core_lib_browser_menu_browser-menu-plugin_js.js:435:41)

The reason for this is most likely this change: 83b726e#diff-af21beb4f671b6cf6cd72962b340942cd675026547f91ccc93c4e96b732fb2c5R28

The problem-selection.ts does not check anymore that a marker property exists. The problem-marker.ts needs to have an isObject check.

Steps to Reproduce:

  1. Create a file that produces an error, eg a javascript file with:
const a = () {
    let b = 'x';
};
  1. Open the problems view
  2. right click on any entry
  3. By default there should be 3 entries: Copy, Copy Message and Collapse All

Additional Information

  • Operating System: Linux
  • Theia Version: 1.34 tested on commit f7ef6b56471926d30809e56de946fe61dddefb64
eneufeld added a commit to eneufeld/theia that referenced this issue Mar 2, 2023
The `in` operator does not work on undefined objects.
So in order to check the node kind we need to make sure,
that the node is an object.

Contributed on behalf of STMicroelectronics

Fixes eclipse-theia#12250
eneufeld added a commit to eneufeld/theia that referenced this issue Mar 2, 2023
The `in` operator does not work on undefined objects.
So in order to check the node kind we need to make sure,
that the node is an object.

Contributed on behalf of STMicroelectronics

Fixes eclipse-theia#12250
@vince-fugnitto vince-fugnitto added the problems issues related to the problems widget label Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problems issues related to the problems widget
Projects
None yet
2 participants