rome / tools

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

πŸ› VSCode extension `v0.18.0` rules don't match CLI `v10.0.0` #3604

Closed lgarron closed 1 year ago

lgarron commented 1 year ago

Environment information

CLI:
  Version:              10.0.0
  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.

Γ— Workspace rage failed: Method not found

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

β”œβ”€69202401ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€69202409ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€69202411ms INFO rome_lsp::server Attempting to load the configuration from 'rome.json' file
β”œβ”€69202411ms INFO rome_service::configuration Attempting to load the configuration file at path "/Users/lgarron/Code/git/github.com/mastodon/mastodon/rome.json"
β”œβ”€69202411ms ERROR rome_service::configuration Could not find the file configuration at "/Users/lgarron/Code/git/github.com/mastodon/mastodon/rome.json"
β”œβ”€69202411ms ERROR rome_service::configuration Reason: Os { code: 2, kind: NotFound, message: "No such file or directory" }
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(1)}
β”œβ”€β”˜
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(2)}
β”œβ”€β”˜
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(1)}
β”œβ”€β”˜
β”œβ”€β”rome_formatter::printer::Printer::print{}
β”œβ”€β”˜
β”œβ”€70450748ms WARN tower_lsp Got a textDocument/didSave notification, but it is not implemented
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(2)}
β”œβ”€β”˜
β”œβ”€70453443ms INFO tower_lsp::service::layers shutdown request received, shutting down
β”œβ”€70453443ms INFO tower_lsp::service::layers exit notification received, stopping
β”œβ”€70453485ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€70453488ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€70453489ms INFO rome_lsp::server Attempting to load the configuration from 'rome.json' file
β”œβ”€70453489ms INFO rome_service::configuration Attempting to load the configuration file at path "/Users/lgarron/Code/git/github.com/cubing/cubing.js/rome.json"
β”œβ”€β”rome_fs::fs::os::OsFile::read_to_string{}
β”œβ”€β”˜
β”œβ”€70453489ms INFO rome_lsp::session Configuration found, and it is valid!
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(1)}
β”œβ”€β”˜
β”œβ”€70467808ms INFO tower_lsp::service::layers shutdown request received, shutting down
β”œβ”€70467820ms INFO tower_lsp::service::layers exit notification received, stopping
β”œβ”€70469518ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€70469521ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€70469522ms INFO rome_lsp::server Attempting to load the configuration from 'rome.json' file
β”œβ”€70469522ms INFO rome_service::configuration Attempting to load the configuration file at path "/Users/lgarron/Code/git/github.com/cubing/cubing.js/rome.json"
β”œβ”€β”rome_fs::fs::os::OsFile::read_to_string{}
β”œβ”€β”˜
β”œβ”€70469522ms INFO rome_lsp::session Configuration found, and it is valid!
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(1)}
β”œβ”€β”˜
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(1)}
β”œβ”€β”˜
β”œβ”€β”rome_formatter::printer::Printer::print{}
β”œβ”€β”˜
β”œβ”€70610318ms WARN tower_lsp Got a textDocument/didSave notification, but it is not implemented
β”œβ”€70693757ms INFO tower_lsp::service::layers shutdown request received, shutting down
β”œβ”€70693771ms INFO tower_lsp::service::layers exit notification received, stopping
β”œβ”€70693831ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€70694546ms INFO tower_lsp::service::layers shutdown request received, shutting down
β”œβ”€70694556ms INFO tower_lsp::service::layers exit notification received, stopping
β”œβ”€70694889ms INFO tower_lsp::service::layers shutdown request received, shutting down
β”œβ”€70694901ms INFO tower_lsp::service::layers exit notification received, stopping
β”œβ”€70695585ms INFO tower_lsp::service::layers shutdown request received, shutting down
β”œβ”€70695593ms INFO tower_lsp::service::layers exit notification received, stopping
β”œβ”€70695602ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€70700672ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€70700682ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€70700718ms INFO rome_lsp::server Attempting to load the configuration from 'rome.json' file
β”œβ”€70700718ms INFO rome_service::configuration Attempting to load the configuration file at path "/Users/lgarron/Code/git/github.com/lgarron/trusted-types-playground/rome.json"
β”œβ”€70700718ms ERROR rome_service::configuration Could not find the file configuration at "/Users/lgarron/Code/git/github.com/lgarron/trusted-types-playground/rome.json"
β”œβ”€70700718ms ERROR rome_service::configuration Reason: Os { code: 2, kind: NotFound, message: "No such file or directory" }
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€70701052ms WARN tower_lsp::service::pending client asked to cancel request 1, but no such pending request exists, ignoring
β”œβ”€70701724ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€70701776ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€70701915ms INFO rome_lsp::server Attempting to load the configuration from 'rome.json' file
β”œβ”€70701915ms INFO rome_service::configuration Attempting to load the configuration file at path "/Users/lgarron/Code/git/github.com/cubing/timer/rome.json"
β”œβ”€β”rome_fs::fs::os::OsFile::read_to_string{}
β”œβ”€β”˜
β”œβ”€70701916ms INFO rome_lsp::session Configuration found, and it is valid!
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€70704351ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€70704372ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€70704394ms INFO rome_lsp::server Attempting to load the configuration from 'rome.json' file
β”œβ”€70704394ms INFO rome_service::configuration Attempting to load the configuration file at path "/Users/lgarron/Code/git/github.com/mastodon/mastodon/rome.json"
β”œβ”€70704394ms ERROR rome_service::configuration Could not find the file configuration at "/Users/lgarron/Code/git/github.com/mastodon/mastodon/rome.json"
β”œβ”€70704394ms ERROR rome_service::configuration Reason: Os { code: 2, kind: NotFound, message: "No such file or directory" }
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€70705148ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€70705153ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€70705159ms INFO rome_lsp::server Attempting to load the configuration from 'rome.json' file
β”œβ”€70705160ms INFO rome_service::configuration Attempting to load the configuration file at path "/Users/lgarron/Code/git/github.com/cubing/alg.cubing.net/rome.json"
β”œβ”€70705160ms ERROR rome_service::configuration Could not find the file configuration at "/Users/lgarron/Code/git/github.com/cubing/alg.cubing.net/rome.json"
β”œβ”€70705160ms ERROR rome_service::configuration Reason: Os { code: 2, kind: NotFound, message: "No such file or directory" }
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€70743407ms WARN tower_lsp::service::pending client asked to cancel request 1, but no such pending request exists, ignoring
β”œβ”€70743437ms WARN tower_lsp::service::pending client asked to cancel request 2, but no such pending request exists, ignoring
β”œβ”€70743455ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€70743455ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€70743468ms INFO rome_lsp::server Attempting to load the configuration from 'rome.json' file
β”œβ”€70743468ms INFO rome_service::configuration Attempting to load the configuration file at path "/Users/lgarron/Code/git/github.com/cubing/cubing.js/rome.json"
β”œβ”€β”rome_fs::fs::os::OsFile::read_to_string{}
β”œβ”€β”˜
β”œβ”€70743469ms INFO rome_lsp::session Configuration found, and it is valid!
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(0)}
β”œβ”€β”˜
β”œβ”€β”rome_js_parser::parse::parse{file_id=FileId(1)}
β”œβ”€β”˜
β”œβ”€70911321ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€70911322ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€70919313ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€70919314ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)

What happened?

git clone https://github.com/cubing/cubing.js && cd cubing.js
git checkout 0f0d36c7b88458e326f5754338ae01296dbe3383
npm install rome@latest
npx rome check ./script ./src

Now, the CLI halts on the following unknown rules:

Removing those from rome.json allows the CLI to run, but now it expects correctness/useTemplate to be called style/useTemplate on this line: https://github.com/cubing/cubing.js/blob/0f0d36c7b88458e326f5754338ae01296dbe3383/src/sites/experiments.cubing.net/cubing.js/speechcubing/index.ts#L39 However, changing that line to use // rome-ignore lint(style/useTemplate) now causes the Rome VSCode extension to make the rome-ignore comment rule as unknown, and the relevant code to be marked with an error.

Expected result

The CLI and the extension agree on rules.

Ideally, they would also do one of the following:

Alternatively, it would be nice to be able have the extension use the CLI from node_modules, so that they're always consistent: https://github.com/rome/tools/discussions/3218

Code of Conduct

lgarron commented 1 year ago

Accidental duplicate due to a GitHub bug. Closing this one in favor of #3603.