Lukas Wirth
1e1113cf5f
Correctly set and mark the proc-macro spans
2023-12-21 10:51:54 +01:00
Lukas Wirth
7d762d18ed
Record macro def site spans
2023-12-21 09:54:47 +01:00
Lukas Wirth
51a9e7831a
Rename some things and turn macro to macro def into a query
2023-12-21 09:18:25 +01:00
Lukas Wirth
071fe4e4e9
Move Intern and Lookup traits to hir-expand
2023-12-20 21:24:20 +01:00
Lukas Wirth
f211a40f1f
Remove SyntaxContext trait
2023-12-20 14:02:40 +01:00
Lukas Wirth
7b804552a5
Remove Delimiter::DUMMY_INVISIBLE
2023-12-20 14:00:14 +01:00
Lukas Wirth
2c6ce480e3
Remove Delimier::dummy_invisible
2023-12-20 13:06:46 +01:00
Lukas Wirth
4ec81230db
Remove usages of Span::DUMMY
2023-12-20 12:53:46 +01:00
Lukas Wirth
f48ecb6e09
Try to support pre and post-change metavars
2023-12-19 20:45:12 +01:00
Lukas Wirth
8753ca5360
fix: Update metavariable expression implementation
2023-12-19 11:55:00 +01:00
Lukas Wirth
002e611d09
fix: Deduplicate annotations
2023-12-19 08:49:00 +01:00
bors
ae2c3223b0
Auto merge of #16150 - Veykril:text-fixture, r=Veykril
...
internal: Move out `WithFixture` into dev-dep only crate
2023-12-18 14:26:51 +00:00
Lukas Wirth
f49a2fed3f
internal: Move out WithFixture
into dev-dep only crate
2023-12-18 15:24:08 +01:00
bors
bd03f92579
Auto merge of #16147 - lnicola:no-ap-sourcegen, r=lnicola
...
minor: Don't auto-publish sourcegen
Closes #16029
2023-12-18 14:03:38 +00:00
Laurențiu Nicola
66fa1c965e
Don't auto-publish sourcegen
2023-12-18 15:54:01 +02:00
Lukas Wirth
ec6162308e
Move the SpanMap definition into the span crate
2023-12-18 14:50:48 +01:00
Lukas Wirth
66e29be1bd
internal: Split out a span crate
2023-12-18 14:08:33 +01:00
bors
cfc959d73a
Auto merge of #16143 - Veykril:base-db-no-proc-macros, r=lnicola
...
internal: Move proc-macro knowledge out of base-db into hir-expand
It does not make much sense to me to have that live in base-db, additionally, it kind of conflicts with moving span things out into a separate crate
2023-12-18 12:18:24 +00:00
Laurențiu Nicola
e628f1715e
Merge branch 'master' into sync-from-rust
2023-12-18 14:02:12 +02:00
Lukas Wirth
35620306a6
internal: Move proc-macro knowledge out of base-db
2023-12-18 12:37:18 +01:00
Laurențiu Nicola
e37cf75791
Merge commit '21b06c1beb9bb59369ffd652f5d617bcf6952e05' into sync-from-ra
2023-12-18 09:21:55 +02:00
bors
cac74d98f6
Auto merge of #118830 - GuillaumeGomez:env-tracked_env, r=Nilstrieb
...
Add support for `--env` on `tracked_env::var`
Follow-up of https://github.com/rust-lang/rust/pull/118368 .
Part of Part of https://github.com/rust-lang/rust/issues/80792 .
It adds support of the `--env` option for proc-macros through `tracked_env::var`.
r? `@Nilstrieb`
2023-12-17 04:23:08 +00:00
bors
21b06c1beb
Auto merge of #16131 - HKalbasi:rustc-tests-fixup, r=HKalbasi
...
Fix false positive type mismatch in const reference patterns
2023-12-15 15:42:00 +00:00
hkalbasi
4f722165b6
Fix false positive type mismatch in const reference patterns
2023-12-15 19:09:07 +03:30
bors
a7764198b1
Auto merge of #16123 - Veykril:simplify, r=Veykril
...
internal: Remove `ModuleId` from `TypeOwnerId`
It only exists due to the IDE layer, but we can encode this temporary hack more cleanly
2023-12-15 13:10:17 +00:00
Lukas Wirth
4c45d23948
fix: Syntax fixup now removes subtrees with fake spans
2023-12-15 13:52:49 +01:00
hkalbasi
7b9595a5ab
Run rust-analyzer on rustc tests in metrics
2023-12-15 02:10:25 +03:30
Lukas Wirth
9083017c9d
Remove ModuleId
from TypeOwnerId
2023-12-14 14:11:57 +01:00
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
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
Lukas Wirth
7cc6b0f2e9
Partially revert #16101
2023-12-12 22:53:40 +01:00
Lukas Wirth
c209b5f97c
fix: Fix syntax bridge assigning invalid span to lifetime tokens
2023-12-12 22:05:21 +01: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
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
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
Guillaume Gomez
6adb21a408
Update rust-analyzer to support new injected_env_var
function
2023-12-11 16:44:33 +01:00
Kirill Bulatov
8ae42b55e7
Search for parent blocks and items when resolving inlay hints
2023-12-11 15:16:55 +02:00