]> git.lizzy.rs Git - rust.git/commit
Auto merge of #13611 - yue4u:fix/completion-after-colon, r=yue4u
authorbors <bors@rust-lang.org>
Sat, 26 Nov 2022 17:55:00 +0000 (17:55 +0000)
committerbors <bors@rust-lang.org>
Sat, 26 Nov 2022 17:55:00 +0000 (17:55 +0000)
commit34e2bc6a541cca670307cec94cfc5546016705d6
tree83d4abfb49a1cb1b93a1934fb330a7d4d7baac5a
parentd2281f0367ba85c34ee9bce07d3cca40e1424721
parent1ca5cb7ed9928fad4222cb26727da41ff9ac148f
Auto merge of #13611 - yue4u:fix/completion-after-colon, r=yue4u

fix: filter unnecessary completions after colon

close #13597
related: #10173

This PR also happens to fix two extra issues:

1. The test case in https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide-completion/src/tests/attribute.rs#L778-L801 was never triggered in previous behavior.

after:

https://user-images.githubusercontent.com/26110087/201476995-56adf955-0fa7-4f75-ab32-28a8e6cb9504.mp4

<del>
2. completions were triggered even in invalid paths, like

```rust
fn main() {
    core:::::$0
}
```

```rust
#[:::::$0]
struct X;
```

</del>

only `:::` is excluded as discussed in https://github.com/rust-lang/rust-analyzer/pull/13611#discussion_r1031845205