+
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.

🐛 Rome VSCode extension crashes for closure function passing itself as an argument #3697

@LunaTK

Description

@LunaTK

Environment information

yarn run v1.22.11
$ /Users/lunatk/Devsisters/rome-crash/node_modules/.bin/rome rage
CLI:
  Version:              10.0.1
  Color support:        true

Platform:
  CPU Architecture:     aarch64
  OS:                   macos

Environment:
  ROME_LOG_DIR:         unset
  NO_COLOR:             unset
  TERM:                 "xterm-256color"

Rome Configuration:
  Status:               loaded
  Formatter disabled:   false
  Linter disabled:      false

Workspace:
  Open Documents:       0

Discovering running Rome servers...

Running Rome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i The client isn't connected to any server but rage discovered this running Rome server.

Server:
  Version:              10.0.1
  Name:                 rome_lsp
  CPU Architecture:     aarch64
  OS:                   macos

Workspace:
  Open Documents:       0

Rome Server Log:

! Please review the content of the log file before sharing it publicly as it may contain sensitive information:
  * Path names that may reveal your name, a project name, or the name of your employer.
  * Source code

... trimmed

  • Device : MacBook Air (M1, 2020)

    • OS : macOS Monterey 12.4
    • Memory : 8GB
  • Visual Studio Code

    Version: 1.72.2 (Universal)
    Commit: d045a5eda657f4d7b676dedbfa7aab8207f8a075
    Date: 2022-10-12T22:16:30.254Z (1 mo ago)
    Electron: 19.0.17
    Chromium: 102.0.5005.167
    Node.js: 16.14.2
    V8: 10.2.154.15-electron.0
    OS: Darwin arm64 21.5.0
    Sandboxed: No
    
  • Rome VSCode Extension

    • Identifier: "rome.rome"
    • Version: v0.18.1 (Preview)

What happened?

Reproduction repo : https://github.com/LunaTK/rome-crash-reproduction

The following TypeScript code makes Rome VSCode extension crash.

type Func = (callback: Func) => void;

const romeKiller = () => {
  const fn = (callback: Func) => {
    callback(fn);
  };
};

image

If fn stays in the top level, it doesn't kill Rome.

const fn = (callback: Func) => {
  callback(fn); // no problem
};

Expected result

Rome VSCode extension should not die.

Code of Conduct

  • I agree to follow Rome's Code of Conduct

Metadata

Metadata

Assignees

Labels

A-LinterArea: linterS-Bug: confirmedStatus: report has been confirmed as a valid bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载