Commit Graph

26733 Commits

Author SHA1 Message Date
bors
96f660813c Auto merge of #16125 - HKalbasi:rustc-tests, r=HKalbasi
Run rust-analyzer on rustc tests in metrics

fix #15947
2023-12-14 22:42:05 +00:00
hkalbasi
7b9595a5ab Run rust-analyzer on rustc tests in metrics 2023-12-15 02:10:25 +03:30
bors
35e2f13b5c Auto merge of #16121 - Veykril:assert-messages, r=Veykril
minor: Add messages to some asserts for better debugging

cc https://github.com/rust-lang/rust-analyzer/issues/16118
2023-12-14 09:27:14 +00:00
Lukas Wirth
070cd4e8b0 minor: Add messages to some asserts for better debugging 2023-12-14 10:24:41 +01:00
bors
dd07f1f2fb Auto merge of #15887 - jinohkang-theori:fix/ide-assists/convert_tuple_struct_to_named_struct/handle_refs_inside_macro_invocations, r=Veykril
Fix incorrectly replacing references in macro invocation in "Convert to named struct" assist

Fixes #15630.

Complements #13647 (same assist but missed this one), #14920 (inverse action assist).
2023-12-13 21:30:18 +00:00
bors
f81bd0cc71 Auto merge of #16115 - HKalbasi:rustc-tests-fixup, r=lnicola
Update builtin attrs from rustc

Fix #16105

r? `@lnicola` since you did this last time.
2023-12-13 17:55:04 +00:00
hkalbasi
6a40400c13 Update builtin attrs from rustc 2023-12-13 21:18:24 +03:30
bors
94af6c63b7 Auto merge of #16061 - Veykril:vec-completion, r=Veykril
fix: Fix fragment parser replacing matches with dummies on incomplete parses

Notably, this caused some completions in the `vec!` macro to no longer work. Fixes https://github.com/rust-lang/rust-analyzer/issues/15016
2023-12-13 09:59:13 +00:00
bors
b3af1916cc Auto merge of #16107 - Veykril:rev-16101, r=Veykril
internal: Partially revert #16101

https://github.com/rust-lang/rust-analyzer/pull/16101 has severe perf regressions unfortunately, so this reverts the part that fixed the issues for now.
2023-12-12 21:55:01 +00:00
Lukas Wirth
7cc6b0f2e9 Partially revert #16101 2023-12-12 22:53:40 +01:00
bors
5d7453ccd6 Auto merge of #16106 - Veykril:fix-lifetime-span-split, r=Veykril
fix: Fix syntax bridge assigning invalid span to lifetime tokens

Fixes https://github.com/rust-lang/rust-analyzer/issues/16097
Fixes https://github.com/rust-lang/rust-analyzer/issues/16103
2023-12-12 21:08:52 +00:00
Lukas Wirth
c209b5f97c fix: Fix syntax bridge assigning invalid span to lifetime tokens 2023-12-12 22:05:21 +01:00
bors
98a8053143 Auto merge of #16104 - lnicola:bump-line-index, r=lnicola
internal: Bump line-index

Let's try out that sweet SIMD code path!
2023-12-12 15:20:53 +00:00
Laurențiu Nicola
3b23e9aacc Bump line-index 2023-12-12 17:18:08 +02:00
bors
785bccb184 Auto merge of #16102 - lnicola:publish-libs, r=lnicola
Publish `line-index`
2023-12-12 15:02:52 +00:00
Laurențiu Nicola
c30fd42685 Publish line-index 2023-12-12 16:57:44 +02:00
bors
dd42c1457d Auto merge of #16101 - Veykril:search-depedencies-fix, r=Veykril
fix: Fix `import_map::search_dependencies` getting confused by assoc and non assoc items with the same name

No test case as creating one is kind of tricky... Ideally the code should be restructured such that this collision wouldn't matter in the first place, its kind of a mess.

Fixes https://github.com/rust-lang/rust-analyzer/issues/16074
Fixes https://github.com/rust-lang/rust-analyzer/issues/16080
Fixes https://github.com/rust-lang/rust-analyzer/issues/15845
2023-12-12 14:51:25 +00:00
Lukas Wirth
ca995d765d fix: Fix import_map::search_dependencies getting confused by assoc and non assoc items with the same name 2023-12-12 15:45:42 +01:00
bors
d4accf8e96 Auto merge of #16099 - Veykril:flyimport, r=Veykril
internal: Improve import asset perf a bit

And bump the query limit from 40 to 100
2023-12-12 14:37:38 +00:00
Lukas Wirth
1604ad1a6d Bump DEFAULT_QUERY_SEARCH_LIMIT from 40 to 100 2023-12-12 15:36:22 +01:00
Lukas Wirth
34ec665ba1 Simplify and improve perf of import_assets::import_for_item 2023-12-12 11:35:34 +01:00
bors
e004a5d6d5 Auto merge of #16098 - lnicola:sync-from-rust, r=lnicola
minor: sync from downstream
2023-12-12 10:30:06 +00:00
Laurențiu Nicola
13d4609f50 Merge remote-tracking branch 'upstream/master' into sync-from-rust 2023-12-12 12:26:15 +02:00
Laurențiu Nicola
54acf874a6 Fix formatting 2023-12-12 12:26:01 +02:00
Laurențiu Nicola
df7b4289cb Merge branch 'master' into sync-from-rust 2023-12-12 12:25:31 +02:00
bors
be035e80e8 Auto merge of #118817 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2023-12-12 08:22:37 +00:00
Matthias Krüger
a254cc5bde Rollup merge of #118445 - ferrocene:jp-support-reuse-in-submodules, r=Mark-Simulacrum
Let `reuse` look inside git submodules

Changes `collect-license-metadata` and `generate-copyright` so they can now look at the git submodules.

Unfortunately `reuse` chokes on the LLVM submodule - it finds the word "Copyright" or the unicode copyright symbol in all kinds of places, including UTF-8 test cases. The `reuse` tool expressly won't let you ignore folders, so we let it scan everything and then strip out the LLVM sub-folder in post. Instead, we add in a hand-curated list of copyright information gleaned by reading the LLVM codebase carefully, which is stored in `.reuse/dep5` in Debian format where `reuse` can find and use it.

The `.reuse/dep5` continues to track copyright info for files in the tree that do not have SPDX metadata in them (i.e. all of them)
2023-12-12 06:52:49 +01:00
bors
8c3e28e3e2 Auto merge of #16094 - HKalbasi:rustc-tests-fixup, r=HKalbasi
Replace `doc_comments_and_attrs` with `collect_attrs`, 2nd round

I didn't understand why the one in the semantics is different. Please tell me if it needs special action.

r? `@Veykril`
2023-12-11 19:28:32 +00:00
hkalbasi
801c0ea478 Replace doc_comments_and_attrs with collect_attrs, 2nd round 2023-12-11 22:56:50 +03:30
Lukas Wirth
18591ae5c8 Always render the path to be imported in the completion detail 2023-12-11 18:37:12 +01:00
bors
4e82988aa2 Auto merge of #118344 - saethlin:rmeta-header-pos, r=WaffleLapkin
Use a u64 for the rmeta root position

Waffle noticed this in https://github.com/rust-lang/rust/pull/117301#discussion_r1405410174

We've upgraded the other file offsets to u64, and this one only costs 4 bytes per file. Also the way the truncation was being done before was extremely easy to miss, I sure missed it! It's not clear to me if not having this change effectively made the other upgrades from u32 to u64 ineffective, but we can have it now.

r? `@WaffleLapkin`
2023-12-11 17:21:14 +00:00
bors
3aa6306728 Auto merge of #16089 - SomeoneToIgnore:fix-parameter-inlay-hints-resolution, r=Veykril
Query for nearest parent block around the hint to resolve

This way, parameter hints will be found for resolution and https://github.com/rust-lang/rust-analyzer/pull/15522#issuecomment-1835896335 will be fixed

Hopefully that also helps with whatever else (lifetimes', etc.) hints in
https://github.com/rust-lang/rust-analyzer/issues/13962

> hints are resolved by querying for textDocument/inlayHint with hint's position turned into a [position-1, position+1] range (instead of the original, much wider document range).
>
> This might lead to issues in the future, with e.g. lifetime hints (currently there's nothing to resolve for them and it's fine) that belong to a certain position, but need to have textDocument/inlayHint query for much bigger range than their position+/-1
2023-12-11 13:34:51 +00:00
Kirill Bulatov
8ae42b55e7 Search for parent blocks and items when resolving inlay hints 2023-12-11 15:16:55 +02:00
Kirill Bulatov
be6d34b810 Query for nearest parent block around the hint to resolve
This way, parameter hints will be found for resolution
2023-12-11 14:53:51 +02:00
Laurențiu Nicola
71d98c53bd Fix typo in cfg 2023-12-11 11:55:43 +02:00
Laurențiu Nicola
f532576ac5 Merge commit '457b966b171b09a7e57acb710fbca29a4b3526f0' into sync-from-ra 2023-12-11 11:16:01 +02:00
Ben Kimock
f9453e33c0 Apply suggestions from code review
Co-authored-by: Waffle Maybe <waffle.lapkin@gmail.com>
2023-12-10 23:26:40 -05:00
bors
457b966b17 Auto merge of #16039 - WaffleLapkin:don't-emit-missing-assoc-items-diagnostic-for-negative-impls, r=Veykril
fix: Don't emit "missing items" diagnostic for negative impls

Negative impls can't have items, so there is no reason for this diagnostic.

LMK if I should add a test somewhere. Also LMK if that's not how we usually check multiple things in an if in r-a.
2023-12-10 22:24:32 +00:00
Maybe Waffle
1630477985 fix: Don't emit "missing items" diagnostic for negative impls 2023-12-10 22:21:59 +00:00
bors
4e814e3f24 Auto merge of #16078 - Veykril:fix-view-ir, r=Veykril
fix: Fix view mir, hir and eval function not working when cursor is inside macros

I broke the view ones completely by inverting the macro check by accident a few days ago but we don't talk about that.
2023-12-10 13:46:58 +00:00
Lukas Wirth
306c907425 fix: Fix view mir, hir and eval function not working when cursor is inside macros 2023-12-10 14:44:40 +01:00
surechen
5285df4f6c remove redundant imports
detects redundant imports that can be eliminated.

for #117772 :

In order to facilitate review and modification, split the checking code and
removing redundant imports code into two PR.
2023-12-10 10:56:22 +08:00
bors
9d87a23cde Auto merge of #16073 - HKalbasi:rustc-tests-fixup, r=HKalbasi
Replace `doc_comments_and_attrs` with `collect_attrs`

fix #16063

I looked at the other usages of `doc_comments_and_attrs` and it seems all of them are prone to ignoring inner attributes. `@Veykril` should I replace all of those with `collect_attrs` and remove `doc_comments_and_attrs` (or even `HasDocComments`) entirely?
2023-12-09 20:24:50 +00:00
hkalbasi
9337519df5 Replace doc_comments_and_attrs with collect_attrs 2023-12-09 23:32:51 +03:30
bors
19387d3077 Auto merge of #16060 - Veykril:format-args-orphans, r=Veykril
fix: Fix completion failing in `format_args!` with invalid template
2023-12-08 19:39:44 +00:00
Lukas Wirth
5f957658c1 fix: Fix fragment parser replacing matches with dummies on incomplete parses 2023-12-08 20:39:16 +01:00
Lukas Wirth
cf083fefc4 fix: Fix completion failing in format_args! with invalid template 2023-12-08 20:35:33 +01:00
bors
03953288bf Auto merge of #16058 - Veykril:macro-diagnostics, r=Veykril
fix: Smaller spans for unresolved field and method diagnostics
2023-12-08 17:48:07 +00:00
Lukas Wirth
b1a8f83a0c fix: Smaller spans for unresolved field and method diagnostics 2023-12-08 18:46:36 +01:00
bors
9e82ab54e8 Auto merge of #16055 - Veykril:field-fallback-method, r=Veykril
Fallback to method resolution on unresolved field access with matching method name

Allows typing out a method name without having to add calling parentheses to do IDE things on it. The inverse of this we already have.
2023-12-08 15:39:42 +00:00