Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

馃悰 crash on unclosed constructor #4504

Open
1 task done
sonnyp opened this issue May 17, 2023 · 0 comments
Open
1 task done

馃悰 crash on unclosed constructor #4504

sonnyp opened this issue May 17, 2023 · 0 comments
Labels
S-To triage Status: user report of a possible bug that needs to be triaged

Comments

@sonnyp
Copy link

sonnyp commented May 17, 2023

Environment information

Rome 12.1.1 running in https://github.com/sonnyp/Workbench/


bash-5.1$ /app/bin/rome rage
CLI:
  Version:                      12.1.1
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  ROME_LOG_DIR:                 unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           unset
  JS_RUNTIME_NAME:              unset
  NODE_PACKAGE_MANAGER:         unset

Rome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true
  VCS disabled:                 false

Workspace:
  Open Documents:               0

Discovering running Rome servers...

What happened?

The server crashed when typing constructor(){. See snippet below.

Rome encountered an unexpected error

This is a bug in Rome, not an error in your code, and we would appreciate it if you could report it to https://github.com/rome/tools/issues/ along with the following information to help us fixing the issue:

Source Location: /home/runner/work/tools/tools/crates/rome_js_semantic/src/semantic_model/model.rs:332:19
Thread Name: tokio-runtime-worker
Message: no entry found for key

The snippet:

import GObject from "gi://GObject";
import Gtk from "gi://Gtk?version=4.0";

Gtk.init();

const AwesomeButton = GObject.registerClass(
  {
    GTypeName: "AwesomeButton",
    Template: workbench.template,
  },
  class AwesomeButton extends Gtk.Button {
    constructor(){ // server crash when I type the `{`
    onclicked() {
      console.log("Clicked");
    }
  },
);

const container = new Gtk.FlowBox({
  hexpand: true,
});

for (let i = 0; i < 100; i++) {
  const widget = new AwesomeButton();
  container.append(widget);
}

workbench.preview(container);

Expected result

The LSP really shouldn't crash when the user type something.

These issues are very hard to debug, specially when they happen to end-users. LSP clients don't show stderr.

Is there no safeguard you can put in place?

Code of Conduct

  • I agree to follow Rome's Code of Conduct
@sonnyp sonnyp added the S-To triage Status: user report of a possible bug that needs to be triaged label May 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
S-To triage Status: user report of a possible bug that needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant