about summary refs log tree commit diff
path: root/tests/debuginfo/enum-thinlto.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-04 08:17:22 +0000
committerbors <bors@rust-lang.org>2023-03-04 08:17:22 +0000
commit4b330f52f6afe46839c5e24b4324969b06c3f439 (patch)
treef7de617eeef1bb9112a3253077cb6ec971aff216 /tests/debuginfo/enum-thinlto.rs
parent73e2505cfa8be6838f5151b272f1d24869b2a3d6 (diff)
parent2e465d18f23f71f71f9c826087f78546e5aea529 (diff)
downloadrust-4b330f52f6afe46839c5e24b4324969b06c3f439.tar.gz
rust-4b330f52f6afe46839c5e24b4324969b06c3f439.zip
Auto merge of #14247 - pascalkuthe:master, r=Veykril
generate correct completion edits for missing macro arguments

Fixes #14246

rust-analyzer used the token at the cursor after macro expansion to decide whether to replace the token at the cursor before macro expansion. In most cases these two are the same but in some cases these can mismatch which can lead to incorrect replacements.

For example if an ident/expr macro argument is missing rust-analyzer generates a "missing" identifier as a placeholder, there is only a brace at the cursor. Therefore, rust-analyzer will incorrectly replace the macro brace with the completion in that case leading to #14246.

Using the expanded token type was intentional. However, this doesn't seem to ever be desirable (this is supported by the fact that there were no tests that relied on this behavior) since the type of edit to perform should always be determined by the token it's actually applied to. Therefore this PR simply switches the relevant match to use the unexpanded token instead
Diffstat (limited to 'tests/debuginfo/enum-thinlto.rs')
0 files changed, 0 insertions, 0 deletions