Lukas Wirth
4f75e0f910
Remove completion limit for trait importing method completions
2024-01-05 12:03:08 +01:00
bors
11b0126679
Auto merge of #16267 - Veykril:import-map-fix, r=Veykril
...
internal: Deduplicate some code
2024-01-05 10:43:52 +00:00
Lukas Wirth
d60638e5e6
Deduplicate some code
2024-01-05 11:34:18 +01:00
roife
fbdc59c54a
internal: remove unnecessary path_tranform on type_gen_args in generate_delegate_trait.
2024-01-05 13:59:44 +08:00
roife
bf0c4acef4
internal: refactor generate_delegate_trait and add comments
2024-01-05 13:59:34 +08:00
bors
c84352a346
Auto merge of #16261 - Veykril:import-map-fix, r=Veykril
...
internal: Move query limits to the caller
Prior we calculated up to `limit` entries from a query, then filtered from that leaving us with less entries than the limit in some cases (which might give odd completion behavior due to items disappearing). This changes it so we filter before checking the limit.
2024-01-04 18:27:38 +00:00
Lukas Wirth
2666349392
Remove limit from symbol_index::Query
2024-01-04 19:20:10 +01:00
Lukas Wirth
0af780ea3e
Fix symbol_index::Query::search_maps not adhering to case-sensitivity correctly
2024-01-04 19:12:56 +01:00
Johann Hemmann
f8ff4fb75b
Conditionally include use_name_in_title and cfg
2024-01-04 18:47:08 +01:00
bors
a795f4836c
Auto merge of #16260 - Urhengulas:ide-diagnostics-refactor-tests, r=lnicola
...
internal: Replace only occurence of `check_expect` with `check_diagnostics`
Part of https://github.com/rust-lang/rust-analyzer/issues/14268 .
2024-01-04 17:24:57 +00:00
Johann Hemmann
03b1ecd90d
Replace only occurence of check_expect with check_diagnostics
2024-01-04 18:20:38 +01:00
Lukas Wirth
c3a29e5528
Remove limit from import_map::Query
2024-01-04 18:12:25 +01:00
Johann Hemmann
61b552124a
Move check_expect and check_expect_clear_loc to inlayhints::chaining
2024-01-04 17:32:16 +01:00
bors
e88788ea70
Auto merge of #16258 - Veykril:import-map-fix, r=Veykril
...
internal: Rewrite `ImportMap::search_dependencies`
Second attempt, this time with a lot of perf improvements
Fixes https://github.com/rust-lang/rust-analyzer/issues/16080
Fixes https://github.com/rust-lang/rust-analyzer/issues/16074
Fixes https://github.com/rust-lang/rust-analyzer/issues/15845
The main bottleneck for flyimport completions are now import path calculation and completion item rendering.
2024-01-04 16:29:25 +00:00
Johann Hemmann
594e0a5de6
Only compare range and label
2024-01-04 17:29:20 +01:00
Lukas Wirth
9b3052104c
internal: Rewrite ImportMap::search_dependencies
2024-01-04 17:26:00 +01:00
Johann Hemmann
dbeb27e05d
Refactor check
2024-01-04 16:10:34 +01:00
Johann Hemmann
971fc1b3e8
Also compare navigation targets for tests
2024-01-04 15:21:57 +01:00
Johann Hemmann
9bc005a3bf
Only iterate through runnables once
2024-01-04 15:14:05 +01:00
Johann Hemmann
3f8083fc81
Only compare navigation targets
2024-01-04 15:14:05 +01:00
Johann Hemmann
f3770c14cf
Compare test ids instead of names, seems more robust
2024-01-04 15:14:05 +01:00
Johann Hemmann
e9632bd48b
Only compare test name
2024-01-04 15:14:05 +01:00
Lukas Wirth
79fa976864
Set proc-macro-test/sysroot-abi with proc-macro-srv/sysroot-abi
2024-01-04 15:12:57 +01:00
bors
a2aab001a7
Auto merge of #16241 - Nilstrieb:sysrooting, r=Veykril
...
Give a userful error when rustc cannot be found in explicit sysroot
Somehow r-a believed that my sysroot was something weird with no rustc. Probably a me issue, but it was impossible to diagnose since r-a just gave me a plain "No such file or directory". Adding this error makes it clear what happened and allows diagnosing the problem.
2024-01-04 14:10:57 +00:00
Johann Hemmann
656ac104c9
Do not extract FileId for file_system_edits
2024-01-04 14:29:41 +01:00
Johann Hemmann
ea675ab888
Insert newline at the end
2024-01-04 14:01:03 +01:00
Johann Hemmann
f2b872a3c5
Switch to Vec, because we do want to have duplicate keys
2024-01-04 14:01:03 +01:00
Johann Hemmann
dea149d733
Switch to BTreeMap for stable ordering
2024-01-04 14:01:03 +01:00
Johann Hemmann
05a3c2ff20
Make filtering a function
2024-01-04 14:01:03 +01:00
Johann Hemmann
d1f4171bb6
Refactor to iterators
2024-01-04 14:01:03 +01:00
Johann Hemmann
084acc287a
Extract relevant information into hashmaps
2024-01-04 14:01:02 +01:00
Laurențiu Nicola
688911757e
Add description to span crate manifest
2024-01-04 13:27:32 +02:00
bors
95e047e4ac
Auto merge of #16248 - Veykril:proc-macro-test, r=lnicola
...
internal: Add proc-macro-test crate back to the main workspace
Should fix https://github.com/rust-lang/rust-analyzer/issues/16194
2024-01-04 11:00:33 +00:00
Laurențiu Nicola
a66777cc71
Merge branch 'master' into sync-from-rust
2024-01-04 12:44:34 +02:00
Laurențiu Nicola
adf052c2ba
Merge commit '426d2842c1f0e5cc5e34bb37c7ac3ee0945f9746' into sync-from-rust
2024-01-04 12:44:20 +02:00
Lukas Wirth
751d9d11e0
Add proc-macro-test crate back to the main workspace
2024-01-04 11:09:45 +01:00
Lukas Wirth
8390d2aca3
Set sysroot-abi flag for proc-macro-cli when in-rust-tree is set
2024-01-04 11:02:23 +01:00
Lukas Wirth
d480525ce8
Add extern crate rustc_driver to proc-macro-srv-cli
2024-01-04 11:02:23 +01:00
Lukas Wirth
ab2286935d
Imply sysroot-abi feature when in-rust-tree is set
2024-01-04 11:02:23 +01:00
Lukas Wirth
b83f487d10
Set the in-rust-tree
` feature for all rust-analyzer{-proc-macro-srv} steps
2024-01-04 11:02:20 +01:00
Nilstrieb
f0f74486bf
Give a userful error when rustc cannot be found in explicit sysroot
...
Somehow r-a believed that my sysroot was something weird with no rustc.
Probably a me issue, but it was impossible to diagnose since r-a just
gave me a plain "No such file or directory". Adding this error makes it
clear what happened and allows diagnosing the problem.
2024-01-03 21:01:06 +01:00
bors
9279c6566b
Auto merge of #16237 - Veykril:expand-arc-alloc, r=Veykril
...
internal: Remove unnecessary `Arc` allocations in `macro_expand`
2024-01-03 14:40:10 +00:00
bors
c3c07c66d3
Auto merge of #15933 - 71:inherent-items-in-docs, r=Veykril
...
feat: resolve inherent and implemented associated items in docs
This partially fixes #9694 .
Supported:
- Trait methods and constants.
* Due to resolution differences pointed out during the review of the PR, trait associated types are _not_ supported.
- Inherent methods, constants and associated types.
* Inherent associated types are a [nightly feature](https://github.com/rust-lang/rust/issues/8995 ), and are supported with no additional work in this PR.
Screenshot of VS Code running with the change:
<img width="513" alt="image" src="https://github.com/rust-lang/rust-analyzer/assets/7189784/c37ed8b7-b572-4684-8e81-2a817b0027c4 ">
You can see that the items are resolved (excl. trait associated types) since they are semantically highlighted in the doc comment.
2024-01-03 14:28:38 +00:00
Lukas Wirth
3fc043ce9b
internal: Remove unnecessary Arc allocations in macro_expand
2024-01-03 15:21:18 +01:00
bors
3fe6ff74cf
Auto merge of #16085 - Austaras:master, r=Veykril
...
fix: try obligation of `IndexMut` when infer
Closes #15842 .
This issue arises because `K` is ambiguous if only inferred from `Index` trait, but is unique if inferred from `IndexMut`, but r-a doesn't use this info.
2024-01-03 14:18:13 +00:00
Young-Flash
c5c1360f7b
fix: make diagnostic range accommodate for macros
2024-01-03 22:05:30 +08:00
Grégoire Geis
fe6f931ac2
hir: resolve associated items in docs (excl. type aliases)
2024-01-03 23:04:24 +09:00
bors
078183231b
Auto merge of #16179 - nicolas-guichard:scip/new_fields, r=Veykril
...
SCIP: populate new SymbolInformation fields
Fixes #15919
2024-01-03 12:56:47 +00:00
Young-Flash
1a9b1b8ccc
test: add test case for TupleField
2024-01-03 20:07:53 +08:00
Young-Flash
099c3204a2
fix: use PathTransform to resolve GenericArg
2024-01-03 20:07:29 +08:00