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

Commit

Permalink
fix(rome_cli): fix regression for rome lsp-proxy command
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed May 16, 2023
1 parent 77b328d commit c37d4a8
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
## [Unreleased]

### CLI

#### Other changes

- Fix regression where the command `lsp-proxy` was renamed `lsp_proxy` [#4489](https://github.com/rome/tools/issues/4489)


### Configuration
### Editors
### Formatter
Expand Down
2 changes: 1 addition & 1 deletion crates/rome_cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub enum RomeCommand {
#[bpaf(command)]
Init,
/// Acts as a server for the Language Server Protocol over stdin/stdout
#[bpaf(command)]
#[bpaf(command("lsp-proxy"))]
LspProxy,
/// It updates the configuration when there are breaking changes
#[bpaf(command)]
Expand Down
28 changes: 28 additions & 0 deletions crates/rome_cli/tests/commands/lsp_proxy.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
use crate::run_cli;
use crate::snap_test::{assert_cli_snapshot, SnapshotPayload};
use bpaf::Args;
use rome_console::BufferConsole;
use rome_fs::MemoryFileSystem;
use rome_service::DynRef;

#[test]
fn lsp_proxy_help() {
let mut fs = MemoryFileSystem::default();
let mut console = BufferConsole::default();

let result = run_cli(
DynRef::Borrowed(&mut fs),
&mut console,
Args::from(&[("lsp-proxy"), "--help"]),
);

assert!(result.is_ok(), "run_cli returned {result:?}");

assert_cli_snapshot(SnapshotPayload::new(
module_path!(),
"lsp_proxy_help",
fs,
console,
result,
));
}
1 change: 1 addition & 0 deletions crates/rome_cli/tests/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod check;
mod ci;
mod format;
mod init;
mod lsp_proxy;
mod migrate;
mod rage;
mod version;
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
source: crates/rome_cli/tests/snap_test.rs
expression: content
---
# Emitted Messages

```block
Acts as a server for the Language Server Protocol over stdin/stdout
Available options:
-h, --help Prints help information
```


0 comments on commit c37d4a8

Please sign in to comment.