Skip to content

Commit 247faf2

Browse files
bors[bot]Veykril
andauthored
Merge #9027
9027: feat: Attribute completion is context aware r=Veykril a=Veykril This splits off the `lint` and `derive` completions into their own submodules of `attribute`. The idea is to create a lazy global hashmap that maps `SyntaxKind` to attribute names(`&[&str]`) in which we index with the syntax kind of the "thing" we are attributing giving us the attributes back that are valid for this kind. Then we use this name to do a binary search on the attribute list to fetch and build the corresponding completion item. Co-authored-by: Lukas Wirth <[email protected]>
2 parents 7869b01 + c9f0f47 commit 247faf2

File tree

6 files changed

+860
-359
lines changed

6 files changed

+860
-359
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/ide_completion/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ itertools = "0.10.0"
1515
log = "0.4.8"
1616
rustc-hash = "1.1.0"
1717
either = "1.6.1"
18+
once_cell = "1.7"
1819

1920
stdx = { path = "../stdx", version = "0.0.0" }
2021
syntax = { path = "../syntax", version = "0.0.0" }

0 commit comments

Comments
 (0)