rome / tools

Unified developer tools for JavaScript, TypeScript, and the web
https://docs.rome.tools/
MIT License
23.75k stars 660 forks source link

πŸ› Rome VS Code Extension crashes by inputting Japanese #3872

Closed n73s closed 1 year ago

n73s commented 1 year ago

Environment information

CLI:
  Version:              10.0.1
  Color support:        true

Platform:
  CPU Architecture:     aarch64
  OS:                   macos

Environment:
  ROME_LOG_DIR:         unset
  NO_COLOR:             unset
  TERM:                 "screen-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

Other Active Server Workspaces:

Workspace:
  Open Documents:       1
  Client Name:          Visual Studio Code
  Client Version:       1.73.1

===
"Rome Server Log" contains sensitive information, so omitting it.

What happened?

https://github.com/n73s/rome-vscode-crash-by-inputting-jp

Visit this repository.

Expected result

No crashes.

Code of Conduct

nissy-dev commented 1 year ago

I could reproduce this issue. The log rome rage shows is here. The log said tower_lsp failed encoding response.

β”œβ”€385415ms INFO rome_lsp::server Starting Rome Language Server...
┐rome_cli::commands::daemon::Running Server{pid=13245}
β”œβ”€50ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€53ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€54ms INFO rome_lsp::server Attempting to load the configuration from 'rome.json' file
β”œβ”€54ms INFO rome_service::configuration Attempting to load the configuration file at path "/Users/nissy-dev/code/github.com/n73s/rome-vscode-crash-by-inputting-jp/rome.json"
β”œβ”€β”rome_fs::fs::os::OsFile::read_to_string{}
β”œβ”€β”˜
β”œβ”€54ms INFO rome_lsp::session Configuration found, and it is valid!
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€β”rome_lsp::session::update_workspace_settings{}
β”‚ β”œβ”€β”rome_service::workspace::server::update_settings{params=UpdateSettingsParams { configuration: Configuration { files: None, formatter: None, linter: Some(LinterConfiguration { enabled: true, rules: Some(Rules { recommended: Some(true), a11y: None, complexity: None, correctness: None, nursery: None, security: None, style: None }), ignore: None }), javascript: None } }}
β”‚ β”‚ β”œβ”€β”rome_service::settings::merge_with_configuration{configuration=Configuration { files: None, formatter: None, linter: Some(LinterConfiguration { enabled: true, rules: Some(Rules { recommended: Some(true), a11y: None, complexity: None, correctness: None, nursery: None, security: None, style: None }), ignore: None }), javascript: None }}
β”‚ β”‚ β”œβ”€β”˜
β”‚ β”œβ”€β”˜
β”œβ”€β”˜
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€1081ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
ematipico commented 1 year ago

This might have been fixed by https://github.com/rome/tools/pull/1907

@n73s you could try installing the latest pre-release version of the extension and check it's actually fixed.

n73s commented 1 year ago

@ematipico I've tried "v0.19.20221125"(re-install the extension, stop the Rome Server process, and reload VS Code window), but the issue still remains.

ematipico commented 1 year ago

@leops You may want to look a this

leops commented 1 year ago

I can't reproduce the issue on version 0.19.20221125 of the extension if it is using its bundled instance of the language server (displayed as Rome 10.0.1-nightly.b7eb6fd in the status bar). However recent versions of the extension will pick up their version of Rome from the workspace, so after running npm install the version being used by the extension becomes Rome 10.0.1 as specified in the package.json of the provided project, and as this version predates the fix it does reproduce the issue.

n73s commented 1 year ago

Thanks all.

https://github.com/n73s/rome-vscode-crash-by-inputting-jp/tree/issue-fixed After upgrading to 10.0.1-nightly.00f5dfe, no crash.