Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subtree update of rust-analyzer #137921

Merged
merged 78 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
d1fb18e
Calculate drop glue and show it on hover
ChayimFriedman2 Jan 20, 2025
629fa76
feat: update insta inline snapshot when clicks 'Update Test' runnable
andylokandy Feb 21, 2025
2b6ea13
fix
andylokandy Feb 21, 2025
a0c69fd
Allow "package/feature" format feature flag
kazatsuyu Feb 22, 2025
4ab9329
Include private items in completions for local crates
Timmmm Feb 21, 2025
e2a7731
Downgrade to ubuntu-22.04 for aarch64-unknown-linux-gnu and arm-unkno…
lnicola Feb 24, 2025
5397431
Fix event_name check in workflows
lnicola Feb 24, 2025
dac3460
Merge pull request #19216 from lnicola/ubuntu-22.04
lnicola Feb 24, 2025
af83f2f
Merge pull request #19217 from lnicola/event-name
lnicola Feb 24, 2025
7bba76e
Disable incremental on release builds
Veykril Feb 24, 2025
d761f9b
Vendor always-assert
Veykril Feb 24, 2025
a4bd32c
Merge pull request #19218 from Veykril/push-vqsronpuvrnx
Veykril Feb 24, 2025
49116c6
Merge pull request #19197 from andylokandy/insta
Veykril Feb 24, 2025
6e2abbf
Merge pull request #19211 from Timmmm/user/timh/import_private
Veykril Feb 24, 2025
18c6f22
Merge pull request #19219 from Veykril/push-rvosplwpwqqt
Veykril Feb 24, 2025
67a99a3
Migrate some leftovers in `add_missing_match_arms`
ShoyuVanilla Feb 17, 2025
756f213
Migrate `apply_demorgan` to `SyntaxEditor`
ShoyuVanilla Feb 17, 2025
1c2225b
Add `take()` method to `SyntaxEditor`
ShoyuVanilla Feb 18, 2025
32e4049
Merge pull request #18987 from ChayimFriedman2/drop-glue
Veykril Feb 24, 2025
a9dbd49
Merge pull request #19171 from ShoyuVanilla/migrate-de-morgan-assist
Veykril Feb 24, 2025
1ff2593
minor: Add tabstop to impl body in `generate_trait_impl` assist
Giga-Bowser Feb 24, 2025
e6bb047
Merge pull request #19221 from Giga-Bowser/generate-trait-impl-tabstop
lnicola Feb 24, 2025
91ff420
doc: remove nit from setup.md
Shourya742 Feb 24, 2025
d5a85af
Support target features implications in target_feature 1.1
ChayimFriedman2 Feb 25, 2025
5c654dc
Disable typos checker for the target feature names
ChayimFriedman2 Feb 25, 2025
16402de
Merge pull request #19223 from ChayimFriedman2/implied-target-feature
Veykril Feb 25, 2025
f7adafc
internal: Improve reporting of intersecting changes
Giga-Bowser Jan 10, 2025
cac5153
internal: Migrate `remove_mut` assist to `SyntaxEditor`
Giga-Bowser Nov 30, 2024
8036e84
internal: Migrate `remove_parentheses` assist to `SyntaxEditor`
Giga-Bowser Dec 5, 2024
1d5f831
fix: Properly handle removals in `SyntaxEditor`
Giga-Bowser Dec 5, 2024
6e6e7e9
internal: Migrate `remove_unused_param` assist to `SyntaxEditor`
Giga-Bowser Dec 5, 2024
3b4e268
Merge pull request #19204 from kazatsuyu/allow-package-specific-feature
ChayimFriedman2 Feb 26, 2025
aa32933
Merge pull request #19225 from Giga-Bowser/remove-assists
Veykril Feb 26, 2025
fae88f2
Use cargo zigbuild for releases
lnicola Feb 26, 2025
444ce09
Merge pull request #19220 from Shourya742/2025-02-24-nit-setup-doc
lnicola Feb 26, 2025
faaba55
Allow rust-project.json to specify sysroot workspace
darichey Feb 4, 2025
5109c0b
Drop support for stitched sysroot
darichey Feb 6, 2025
dae664d
Cofigurate out ohos target to avoid compilation crashes
LuuuXXX Feb 27, 2025
230ce20
Merge pull request #19239 from LuuuXXX/add-support-for-ohos
lnicola Feb 27, 2025
e162475
Merge pull request #19096 from darichey/rust-project-sysroot
Veykril Feb 27, 2025
d4b92f4
Merge pull request #19230 from lnicola/zig
lnicola Feb 27, 2025
cabb08d
Fix sysroot crate-graph construction not mapping crate-ids for proc-m…
Veykril Feb 27, 2025
494192b
Merge pull request #19241 from Veykril/push-lqumoruvuyvo
Veykril Feb 27, 2025
8c16ded
enable doctest
BenjaminBrienen Feb 26, 2025
df903a5
fix doc tests
BenjaminBrienen Feb 26, 2025
0404156
ignore doc test that only fails on windows
BenjaminBrienen Feb 27, 2025
1b6c4b7
ignore another test that fails on windows
BenjaminBrienen Feb 27, 2025
239a686
Merge pull request #19237 from BenjaminBrienen/doc-tests
lnicola Feb 27, 2025
d6f5377
Update Node.js, vscode, and ts deps
BenjaminBrienen Feb 26, 2025
13eb834
Merge pull request #19194 from BenjaminBrienen/node
lnicola Feb 27, 2025
af0c8b7
Add anchor for intra-doc links to associated items
ncrothers Feb 27, 2025
7348844
Avoid suggesting redundant borrowing in completion results
Shourya742 Feb 26, 2025
2071cc2
add test
Shourya742 Feb 26, 2025
bd8b58d
Merge pull request #19246 from ncrothers/add-anchor-for-associated-items
Veykril Feb 28, 2025
637dbe5
Fix prefix adjustment hints unnecessarily introducing parens
Veykril Feb 28, 2025
fd1f2e3
Merge pull request #19249 from Veykril/push-noosrywrsuvn
Veykril Feb 28, 2025
ff7de58
Have inline_local_variable use precedence calculation for parentheses
Veykril Feb 28, 2025
e862daf
Merge pull request #19250 from Veykril/push-tmrnrlotwtmr
Veykril Feb 28, 2025
dfb2e35
Migrate `convert_bool_then` to `SyntaxEditor`
ShoyuVanilla Feb 28, 2025
08eeb8f
Cleanup highlighting macro-def handling
Veykril Mar 1, 2025
b0e3526
More precise macro modifiers for syntax highlighting
Veykril Mar 1, 2025
497f140
Cleanup string handling in syntax highlighting
Veykril Mar 1, 2025
28a5eeb
Fix `test_keyword_highlighting` test
Veykril Mar 1, 2025
629baf2
Remove syntax editing from parenthesis computation
Veykril Feb 28, 2025
a565f7f
Merge pull request #19257 from Veykril/push-myvwxskworsn
Veykril Mar 1, 2025
e6a0fc5
Merge pull request #19251 from Veykril/push-tkmpqtzxynxk
Veykril Mar 1, 2025
1b85bef
Add flip or-pattern assist
Veykril Mar 2, 2025
7d8e958
Merge pull request #19253 from ShoyuVanilla/migrate-convert-bool-then
Veykril Mar 2, 2025
768749f
Merge pull request #19259 from Veykril/push-skmvrmtorqso
Veykril Mar 2, 2025
6c1e5b4
Fix transparent diagnostics
lnicola Mar 2, 2025
5c124a3
Merge pull request #19264 from lnicola/theme-color
lnicola Mar 2, 2025
1c00d8f
Add `identifier` to pull diagnostic LSP capabilities
the-mikedavis Mar 2, 2025
a43a5f9
Merge pull request #19266 from the-mikedavis/lsp-pull-diagnostics-ide…
lnicola Mar 2, 2025
c6a7251
Merge pull request #19226 from Shourya742/2025-02-25-fix-completion-r…
ChayimFriedman2 Mar 3, 2025
969868b
Preparing for merge from rust-lang/rust
lnicola Mar 3, 2025
dd3a5f9
Merge from rust-lang/rust
lnicola Mar 3, 2025
24c480e
Bump rustc crates
lnicola Mar 3, 2025
015e81d
Merge pull request #19269 from lnicola/sync-from-rust
lnicola Mar 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/.github/workflows/autopublish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
publish:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
name: publish
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ jobs:
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: 18
node-version: 22
if: needs.changes.outputs.typescript == 'true'

- name: Install xvfb
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/.github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:

jobs:
rust:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
name: Rust
runs-on: ubuntu-latest
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
publish-libs:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
name: publish
runs-on: ubuntu-latest
steps:
Expand Down
59 changes: 27 additions & 32 deletions src/tools/rust-analyzer/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ env:
RUSTUP_MAX_RETRIES: 10
FETCH_DEPTH: 0 # pull in the tags for the version string
MACOSX_DEPLOYMENT_TARGET: 13.0
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc
ZIG_VERSION: 0.13.0
ZIGBUILD_VERSION: 0.19.8

jobs:
dist:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
include:
Expand All @@ -36,13 +36,15 @@ jobs:
code-target: win32-arm64
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
zig_target: x86_64-unknown-linux-gnu.2.28
code-target: linux-x64
container: rockylinux:8
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
zig_target: aarch64-unknown-linux-gnu.2.28
code-target: linux-arm64
- os: ubuntu-latest
target: arm-unknown-linux-gnueabihf
zig_target: arm-unknown-linux-gnueabihf.2.28
code-target: linux-armhf
- os: macos-13
target: x86_64-apple-darwin
Expand All @@ -64,40 +66,33 @@ jobs:
with:
fetch-depth: ${{ env.FETCH_DEPTH }}

- name: Install toolchain dependencies
if: matrix.container == 'rockylinux:8'
shell: bash
run: |
dnf install -y gcc
curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
- name: Install Node.js toolchain
uses: actions/setup-node@v4
with:
node-version: 22

- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
rustup target add ${{ matrix.target }}
rustup component add rust-src
rustup target add ${{ matrix.target }}

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Update apt repositories
if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'
run: sudo apt-get update

- name: Install AArch64 target toolchain
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: sudo apt-get install gcc-aarch64-linux-gnu

- name: Install ARM target toolchain
if: matrix.target == 'arm-unknown-linux-gnueabihf'
run: sudo apt-get install gcc-arm-linux-gnueabihf
- name: Install Zig toolchain
if: ${{ matrix.zig_target }}
run: |
which cargo
curl -L "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz" | sudo tar JxC /usr/local
sudo ln -s "/usr/local/zig-linux-$(uname -m)-${ZIG_VERSION}/zig" /usr/local/bin/zig
curl -L "https://github.com/rust-cross/cargo-zigbuild/releases/download/v${ZIGBUILD_VERSION}/cargo-zigbuild-v${ZIGBUILD_VERSION}.x86_64-unknown-linux-musl.tar.gz" | tar zxC ~/.cargo/bin

- name: Dist
- name: Dist (plain)
if: ${{ !matrix.zig_target }}
run: cargo xtask dist --client-patch-version ${{ github.run_number }}

- name: Dist (using zigbuild)
if: ${{ matrix.zig_target }}
run: RA_TARGET=${{ matrix.zig_target}} cargo xtask dist --client-patch-version ${{ github.run_number }} --zig

- run: npm ci
working-directory: editors/code

Expand Down Expand Up @@ -139,7 +134,7 @@ jobs:
path: ./dist

dist-x86_64-unknown-linux-musl:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
name: dist (x86_64-unknown-linux-musl)
runs-on: ubuntu-latest
env:
Expand Down Expand Up @@ -185,15 +180,15 @@ jobs:
path: ./dist

publish:
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event.action == 'workflow_dispatch' }}
if: ${{ github.repository == 'rust-lang/rust-analyzer' || github.event_name == 'workflow_dispatch' }}
name: publish
runs-on: ubuntu-latest
needs: ["dist", "dist-x86_64-unknown-linux-musl"]
steps:
- name: Install Nodejs
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22

- run: echo "TAG=$(date --iso -u)" >> $GITHUB_ENV
if: github.ref == 'refs/heads/release'
Expand Down
2 changes: 2 additions & 0 deletions src/tools/rust-analyzer/.typos.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ extend-ignore-re = [
"INOUT",
"optin",
"=Pn",
# ignore `// spellchecker:off` until `// spellchecker:on`
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on",
]

[default.extend-words]
Expand Down
33 changes: 15 additions & 18 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ name = "always-assert"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1078fa1ce1e34b1872d8611ad921196d76bdd7027e949fbe31231abde201892"
dependencies = [
"tracing",
]

[[package]]
name = "anyhow"
Expand Down Expand Up @@ -1507,9 +1504,9 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_abi"
version = "0.97.0"
version = "0.98.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3829c3355d1681ffeaf1450ec71edcdace6820fe2e86469d8fc1ad45e2c96460"
checksum = "4b42cccfff8091a4c3397736518774dbad619e82f8def6f70d8e46dbbe396007"
dependencies = [
"bitflags 2.7.0",
"ra-ap-rustc_hashes",
Expand All @@ -1519,28 +1516,28 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_hashes"
version = "0.97.0"
version = "0.98.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bd4d6d4c434bec08e02370a4f64a4985312097215a62e82d0f757f3a98e502e"
checksum = "46d8bd34ed6552c8cac1764106ef5adbeef3e5c7700e0ceb4c83a47a631894fe"
dependencies = [
"rustc-stable-hash",
]

[[package]]
name = "ra-ap-rustc_index"
version = "0.97.0"
version = "0.98.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bad6fc4bd7522e31096e2de5b0351144fe0684b608791ee26c842bf2da1b19ae"
checksum = "93799e4dccbbd47f8b66bc0aa42effc1b7077aaee09d8a40b86b8d659b80c7b7"
dependencies = [
"ra-ap-rustc_index_macros",
"smallvec",
]

[[package]]
name = "ra-ap-rustc_index_macros"
version = "0.97.0"
version = "0.98.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cfb234e1f84b92be45276c3025bee18789e9bc95bec8789bec961e78edb01c52"
checksum = "30baa5d00f94ba437a9dcaf7ae074ebe4f367bb05a4c2835e0aa2e7af3463aac"
dependencies = [
"proc-macro2",
"quote",
Expand All @@ -1549,9 +1546,9 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_lexer"
version = "0.97.0"
version = "0.98.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a3a40bd11dc43d1cb110e730b80620cf8102f4cca8920a02b65954da0ed931f"
checksum = "3004d1d1b50afe3e1f9cdd428a282da7ffbf5f26dd8bf04af0d651d44e4873d8"
dependencies = [
"memchr",
"unicode-properties",
Expand All @@ -1560,19 +1557,19 @@ dependencies = [

[[package]]
name = "ra-ap-rustc_parse_format"
version = "0.97.0"
version = "0.98.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5feb877478994cb4c0c0c7a5116a352eefc0634aefc8636feb00a893fa5b7135"
checksum = "cb57e5124a64aaaf92c06130fbc1b8e1d547b5a2a96081f1f848e31c211df5d2"
dependencies = [
"ra-ap-rustc_index",
"ra-ap-rustc_lexer",
]

[[package]]
name = "ra-ap-rustc_pattern_analysis"
version = "0.97.0"
version = "0.98.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a76774d35934d464c4115908cde16f76a4f7e540fe1eea6b79336c556e37bdd3"
checksum = "e427c3d30e4bdff28abd6b0ef3e6f4dfab44acd9468a4954eeff8717d8df8819"
dependencies = [
"ra-ap-rustc_index",
"rustc-hash 2.0.0",
Expand Down Expand Up @@ -1940,13 +1937,13 @@ dependencies = [
name = "stdx"
version = "0.0.0"
dependencies = [
"always-assert",
"backtrace",
"crossbeam-channel",
"itertools",
"jod-thread",
"libc",
"miow",
"tracing",
"windows-sys 0.59.0",
]

Expand Down
13 changes: 6 additions & 7 deletions src/tools/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ salsa.opt-level = 3
miniz_oxide.opt-level = 3

[profile.release]
incremental = true
# Set this to 1 or 2 to get more useful backtraces in debugger.
debug = 0

Expand Down Expand Up @@ -86,12 +85,12 @@ vfs-notify = { path = "./crates/vfs-notify", version = "0.0.0" }
vfs = { path = "./crates/vfs", version = "0.0.0" }
edition = { path = "./crates/edition", version = "0.0.0" }

ra-ap-rustc_hashes = { version = "0.97", default-features = false }
ra-ap-rustc_lexer = { version = "0.97", default-features = false }
ra-ap-rustc_parse_format = { version = "0.97", default-features = false }
ra-ap-rustc_index = { version = "0.97", default-features = false }
ra-ap-rustc_abi = { version = "0.97", default-features = false }
ra-ap-rustc_pattern_analysis = { version = "0.97", default-features = false }
ra-ap-rustc_hashes = { version = "0.98", default-features = false }
ra-ap-rustc_lexer = { version = "0.98", default-features = false }
ra-ap-rustc_parse_format = { version = "0.98", default-features = false }
ra-ap-rustc_index = { version = "0.98", default-features = false }
ra-ap-rustc_abi = { version = "0.98", default-features = false }
ra-ap-rustc_pattern_analysis = { version = "0.98", default-features = false }

# local crates that aren't published to crates.io. These should not have versions.

Expand Down
1 change: 0 additions & 1 deletion src/tools/rust-analyzer/crates/base-db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ license.workspace = true
rust-version.workspace = true

[lib]
doctest = false

[dependencies]
lz4_flex = { version = "0.11", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion src/tools/rust-analyzer/crates/cfg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ license.workspace = true
rust-version.workspace = true

[lib]
doctest = false

[dependencies]
rustc-hash.workspace = true
Expand Down
1 change: 0 additions & 1 deletion src/tools/rust-analyzer/crates/hir-def/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ license.workspace = true
rust-version.workspace = true

[lib]
doctest = false

[dependencies]
arrayvec.workspace = true
Expand Down
4 changes: 3 additions & 1 deletion src/tools/rust-analyzer/crates/hir-def/src/dyn_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
//!
//! It is used like this:
//!
//! ```
//! ```ignore
//! # use hir_def::dyn_map::DynMap;
//! # use hir_def::dyn_map::Key;
//! // keys define submaps of a `DynMap`
//! const STRING_TO_U32: Key<String, u32> = Key::new();
//! const U32_TO_VEC: Key<u32, Vec<bool>> = Key::new();
Expand Down
6 changes: 3 additions & 3 deletions src/tools/rust-analyzer/crates/hir-def/src/item_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -883,20 +883,20 @@ pub struct UseTree {

#[derive(Debug, Clone, Eq, PartialEq)]
pub enum UseTreeKind {
/// ```
/// ```ignore
/// use path::to::Item;
/// use path::to::Item as Renamed;
/// use path::to::Trait as _;
/// ```
Single { path: Interned<ModPath>, alias: Option<ImportAlias> },

/// ```
/// ```ignore
/// use *; // (invalid, but can occur in nested tree)
/// use path::*;
/// ```
Glob { path: Option<Interned<ModPath>> },

/// ```
/// ```ignore
/// use prefix::{self, Item, ...};
/// ```
Prefixed { prefix: Option<Interned<ModPath>>, list: Box<[UseTree]> },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use hir_expand::{
db::ExpandDatabase,
proc_macro::{ProcMacro, ProcMacroExpander, ProcMacroExpansionError, ProcMacroKind},
span_map::SpanMapRef,
InFile, MacroCallKind, MacroFileId, MacroFileIdExt,
InFile, MacroCallKind, MacroFileId, MacroFileIdExt, MacroKind,
};
use intern::Symbol;
use itertools::Itertools;
Expand Down Expand Up @@ -211,7 +211,11 @@ pub fn identity_when_valid(_attr: TokenStream, item: TokenStream) -> TokenStream

if let Some(src) = src {
if let Some(file_id) = src.file_id.macro_file() {
if file_id.is_attr_macro(&db) || file_id.is_custom_derive(&db) {
if let MacroKind::Derive
| MacroKind::DeriveBuiltIn
| MacroKind::Attr
| MacroKind::AttrBuiltIn = file_id.kind(&db)
{
let call = file_id.call_node(&db);
let mut show_spans = false;
let mut show_ctxt = false;
Expand All @@ -236,7 +240,7 @@ pub fn identity_when_valid(_attr: TokenStream, item: TokenStream) -> TokenStream
for impl_id in def_map[local_id].scope.impls() {
let src = impl_id.lookup(&db).source(&db);
if let Some(macro_file) = src.file_id.macro_file() {
if macro_file.is_builtin_derive(&db) {
if let MacroKind::DeriveBuiltIn | MacroKind::Derive = macro_file.kind(&db) {
let pp = pretty_print_macro_expansion(
src.value.syntax().clone(),
db.span_map(macro_file.into()).as_ref(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl DirPath {
/// So this is the case which doesn't really work I think if we try to be
/// 100% platform agnostic:
///
/// ```
/// ```ignore
/// mod a {
/// #[path="C://sad/face"]
/// mod b { mod c; }
Expand Down
Loading
Loading