Skip to content

Commit 3de9a42

Browse files
committed
Disable rustfmt for expand_macro on wasm platforms
1 parent 895a162 commit 3de9a42

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

crates/ide/Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ ide_assists = { path = "../ide_assists", version = "0.0.0" }
3232
ide_diagnostics = { path = "../ide_diagnostics", version = "0.0.0" }
3333
ide_ssr = { path = "../ide_ssr", version = "0.0.0" }
3434
ide_completion = { path = "../ide_completion", version = "0.0.0" }
35-
toolchain = { path = "../toolchain", version = "0.0.0" }
3635

3736
# ide should depend only on the top-level `hir` package. if you need
3837
# something from some `hir_xxx` subpackage, reexport the API via `hir`.
3938
hir = { path = "../hir", version = "0.0.0" }
4039

40+
[target.'cfg(not(any(target_arch = "wasm32", target_os = "emscripten")))'.dependencies]
41+
toolchain = { path = "../toolchain", version = "0.0.0" }
42+
4143
[dev-dependencies]
4244
test_utils = { path = "../test_utils" }
4345
expect-test = "1.2.2"

crates/ide/src/expand_macro.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fn format(db: &RootDatabase, kind: SyntaxKind, file_id: FileId, expanded: Syntax
141141
_format(db, kind, file_id, &expansion).unwrap_or(expansion)
142142
}
143143

144-
#[cfg(test)]
144+
#[cfg(any(test, target_arch = "wasm32", target_os = "emscripten"))]
145145
fn _format(
146146
_db: &RootDatabase,
147147
_kind: SyntaxKind,
@@ -151,7 +151,7 @@ fn _format(
151151
None
152152
}
153153

154-
#[cfg(not(test))]
154+
#[cfg(not(any(test, target_arch = "wasm32", target_os = "emscripten")))]
155155
fn _format(
156156
db: &RootDatabase,
157157
kind: SyntaxKind,

0 commit comments

Comments
 (0)