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

馃悰 crash on unclosed constructor聽#4504

Description

@sonnyp

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

Activity

  1. added
    S-To triageStatus: user report of a possible bug that needs to be triaged
    on May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-To triageStatus: user report of a possible bug that needs to be triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions