diff --git a/crates/ide/Cargo.toml b/crates/ide/Cargo.toml index 02eb46333be..d09b4a0dafe 100644 --- a/crates/ide/Cargo.toml +++ b/crates/ide/Cargo.toml @@ -32,12 +32,14 @@ ide_assists = { path = "../ide_assists", version = "0.0.0" } ide_diagnostics = { path = "../ide_diagnostics", version = "0.0.0" } ide_ssr = { path = "../ide_ssr", version = "0.0.0" } ide_completion = { path = "../ide_completion", version = "0.0.0" } -toolchain = { path = "../toolchain", version = "0.0.0" } # ide should depend only on the top-level `hir` package. if you need # something from some `hir_xxx` subpackage, reexport the API via `hir`. hir = { path = "../hir", version = "0.0.0" } +[target.'cfg(not(any(target_arch = "wasm32", target_os = "emscripten")))'.dependencies] +toolchain = { path = "../toolchain", version = "0.0.0" } + [dev-dependencies] test_utils = { path = "../test_utils" } expect-test = "1.2.2" diff --git a/crates/ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs index c93d0561a87..e4061016e60 100644 --- a/crates/ide/src/expand_macro.rs +++ b/crates/ide/src/expand_macro.rs @@ -141,7 +141,7 @@ fn format(db: &RootDatabase, kind: SyntaxKind, file_id: FileId, expanded: Syntax _format(db, kind, file_id, &expansion).unwrap_or(expansion) } -#[cfg(test)] +#[cfg(any(test, target_arch = "wasm32", target_os = "emscripten"))] fn _format( _db: &RootDatabase, _kind: SyntaxKind, @@ -151,7 +151,7 @@ fn _format( None } -#[cfg(not(test))] +#[cfg(not(any(test, target_arch = "wasm32", target_os = "emscripten")))] fn _format( db: &RootDatabase, kind: SyntaxKind,