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

Commit

Permalink
Merge branch 'main' into jsx-comment-breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser authored Nov 14, 2022
2 parents 5f01e6f + 9abf20d commit 295ff31
Show file tree
Hide file tree
Showing 371 changed files with 12,470 additions and 11,311 deletions.
94 changes: 0 additions & 94 deletions .github/workflows/deploy_playground.yml

This file was deleted.

50 changes: 0 additions & 50 deletions .github/workflows/deploy_playground_on_main.yml

This file was deleted.

8 changes: 4 additions & 4 deletions .github/workflows/pull_request_js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,13 @@ jobs:
with:
version: 7
- name: Build WASM module for the web
run: wasm-pack build --out-dir ../../npm/wasm-web --target web --release --scope rometools crates/rome_wasm
run: wasm-pack build --out-dir ../../npm/wasm-web --target web --scope rometools crates/rome_wasm
- name: Install libraries
working-directory: website/playground
working-directory: website
run: pnpm i
- name: Build JS
working-directory: website/playground
working-directory: website
run: pnpm build:js
- name: Type check
working-directory: website/playground
working-directory: website
run: pnpm tsc
4 changes: 2 additions & 2 deletions .github/workflows/release_js_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:
working-directory: npm/js-api
run: |
pnpm i
pnpm build
pnpm build
- name: Upload JS API artifact
uses: actions/upload-artifact@v3
Expand All @@ -126,7 +126,7 @@ jobs:
uses: actions/download-artifact@v3
with:
name: js-api
path: npm
path: npm/js-api/dist

- name: Install Node.js
uses: actions/setup-node@v3
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Rome changelog

## 10.0.1

### CLI

- Respect the formatter / linter `enabled` flag from configuration ([#3591](https://github.com/rome/tools/issues/3591))
- Correctly account for diff diagnostics in the printed diagnostics count ([#3595](https://github.com/rome/tools/issues/3595))

### Formatter

- Do not insert a trailing comma in import expressions ([#3600](https://github.com/rome/tools/issues/3600))

### Linter

- Fixed false positives in `noUselessFragments`, `noArrayIndexKey`, `noChildrenProp`, `noUselessFragments`, `noVoidElementsWithChildren`, `noDangerouslySetInnerHtml`, `noDangerouslySetInnerHtmlWithChildren`, `useValidAnchor`, `noRenderReturnValue`, `noUnusedVariables` and `useKeyWithClickEvents`
([#3592](https://github.com/rome/tools/pull/3592), [#3619](https://github.com/rome/tools/pull/3619), [#3599](https://github.com/rome/tools/pull/3599), [#3626](https://github.com/rome/tools/pull/3626), [#3620](https://github.com/rome/tools/pull/3620) & [#3644](https://github.com/rome/tools/pull/3644))

### Editors

- Display the version of the language server in the status bar ([#3616](https://github.com/rome/tools/issues/3616))

## 10.0.0

### CLI
Expand Down
10 changes: 6 additions & 4 deletions crates/rome_cli/src/commands/daemon.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use crate::{

pub(crate) fn start(mut session: CliSession) -> Result<(), Termination> {
let rt = Runtime::new()?;
let did_spawn = rt.block_on(ensure_daemon())?;
let did_spawn = rt.block_on(ensure_daemon(false))?;

if did_spawn {
session.app.console.log(markup! {
Expand Down Expand Up @@ -60,11 +60,13 @@ pub(crate) fn stop(mut session: CliSession) -> Result<(), Termination> {
Ok(())
}

pub(crate) fn run_server() -> Result<(), Termination> {
pub(crate) fn run_server(mut session: CliSession) -> Result<(), Termination> {
setup_tracing_subscriber();

let stop_on_disconnect = session.args.contains("--stop-on-disconnect");

let rt = Runtime::new()?;
let factory = ServerFactory::default();
let factory = ServerFactory::new(stop_on_disconnect);
let cancellation = factory.cancellation();
let span = debug_span!("Running Server", pid = std::process::id());

Expand Down Expand Up @@ -101,7 +103,7 @@ pub(crate) fn lsp_proxy() -> Result<(), Termination> {
/// Receives a process via `stdin` and then copy the content to the LSP socket.
/// Copy to the process on `stdout` when the LSP responds to a message
async fn start_lsp_proxy(rt: &Runtime) -> Result<(), Termination> {
ensure_daemon().await?;
ensure_daemon(true).await?;

match open_socket().await? {
Some((mut owned_read_half, mut owned_write_half)) => {
Expand Down
74 changes: 54 additions & 20 deletions crates/rome_cli/src/commands/rage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::{env, io, ops::Deref};
use tokio::runtime::Runtime;

use crate::commands::daemon::read_most_recent_log_file;
use crate::service::enumerate_pipes;
use crate::{service, CliSession, Termination, VERSION};

/// Handler for the `rage` command
Expand Down Expand Up @@ -85,38 +86,71 @@ struct RunningRomeServer;

impl Display for RunningRomeServer {
fn fmt(&self, f: &mut Formatter) -> io::Result<()> {
let runtime = Runtime::new()?;

match service::open_transport(runtime) {
Ok(None) => {
return markup!(
{Section("Server")}
{KeyValuePair("Status", markup!(<Dim>"stopped"</Dim>))}
)
.fmt(f);
let versions = match enumerate_pipes() {
Ok(iter) => iter,
Err(err) => {
(markup! {<Error>"\u{2716} Enumerating Rome instances failed:"</Error>}).fmt(f)?;
return writeln!(f, " {err}");
}
Ok(Some(transport)) => {
markup!("\n"<Emphasis>"Running Rome Server:"</Emphasis>" "{HorizontalLine::new(78)}"
};

for version in versions {
if version == rome_service::VERSION {
let runtime = Runtime::new()?;
match service::open_transport(runtime) {
Ok(None) => {
markup!(
{Section("Server")}
{KeyValuePair("Status", markup!(<Dim>"stopped"</Dim>))}
)
.fmt(f)?;
continue;
}
Ok(Some(transport)) => {
markup!("\n"<Emphasis>"Running Rome Server:"</Emphasis>" "{HorizontalLine::new(78)}"
"<Info>"\u{2139} The client isn't connected to any server but rage discovered this running Rome server."</Info>"
")
.fmt(f)?;

match client(transport) {
Ok(client) => WorkspaceRage(client.deref()).fmt(f)?,
match client(transport) {
Ok(client) => WorkspaceRage(client.deref()).fmt(f)?,
Err(err) => {
markup!(<Error>"\u{2716} Failed to connect: "</Error>).fmt(f)?;
writeln!(f, "{err}")?;
}
}
}
Err(err) => {
markup!(<Error>"\u{2716} Failed to connect: "</Error>).fmt(f)?;
markup!("\n"<Error>"\u{2716} Failed to connect: "</Error>).fmt(f)?;
writeln!(f, "{err}")?;
}
}

RomeServerLog.fmt(f)?;
} else {
markup!("\n"<Emphasis>"Incompatible Rome Server:"</Emphasis>" "{HorizontalLine::new(78)}"
"<Info>"\u{2139} Rage discovered this running server using an incompatible version of Rome."</Info>"
")
.fmt(f)?;

// Version 10.0.0 and below did not include a service version in the pipe name
let version = if version.is_empty() {
"<=10.0.0"
} else {
version.as_str()
};

markup!(
{Section("Server")}
{KeyValuePair("Version", markup!({version}))}
)
.fmt(f)?;
}
Err(err) => {
markup!("\n"<Error>"\u{2716} Failed to connect: "</Error>).fmt(f)?;
writeln!(f, "{err}")?;
}
};
}

RomeServerLog.fmt(f)
Ok(())
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/rome_cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl<'app> CliSession<'app> {
Some("lsp-proxy") => commands::daemon::lsp_proxy(),

// Internal commands
Some("__run_server") => commands::daemon::run_server(),
Some("__run_server") => commands::daemon::run_server(self),
Some("__print_socket") => commands::daemon::print_socket(),

// Print the help for known commands called without any arguments, and exit with an error
Expand Down
10 changes: 6 additions & 4 deletions crates/rome_cli/src/service/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,16 @@ use tokio::{
#[cfg(windows)]
mod windows;
#[cfg(windows)]
pub(crate) use self::windows::{ensure_daemon, open_socket, print_socket, run_daemon};
pub(crate) use self::windows::{
ensure_daemon, enumerate_pipes, open_socket, print_socket, run_daemon,
};

#[cfg(unix)]
mod unix;
#[cfg(unix)]
pub(crate) use self::unix::open_socket;
#[cfg(unix)]
pub(crate) use self::unix::{ensure_daemon, print_socket, run_daemon};
pub(crate) use self::unix::{
ensure_daemon, enumerate_pipes, open_socket, print_socket, run_daemon,
};

/// Tries to open a connection to a running daemon instance, returning a
/// [WorkspaceTransport] instance if the socket is currently active
Expand Down
Loading

0 comments on commit 295ff31

Please sign in to comment.