Young-Flash
a2d142b9f2
internal: add test case for inlay hint support for block expr with lifetime label
2024-07-20 09:33:23 +08:00
Young-Flash
0416dec50a
feat: add inlay hint support for block expr with lifetime label
2024-07-20 09:33:23 +08:00
bors
b333f85a9d
Auto merge of #17639 - Veykril:salsa-perf, r=Veykril
...
Some more small salsa memory improvements
This does limit our lru limits to 2^16 but if you want to set them higher than that you might as well not set them at all. Also makes `LRU` opt-in per query now, allowing us to drop all the unnecessary LRU stuff for most queries
2024-07-19 18:45:16 +00:00
Yuri Astrakhan
cc1aded86c
Avoid ref when using format! in compiler
...
Clean up a few minor refs in `format!` macro, as it has a performance cost. Apparently the compiler is unable to inline `format!("{}", &variable)`, and does a run-time double-reference instead (format macro already does one level referencing). Inlining format args prevents accidental `&` misuse.
2024-07-19 14:41:59 -04:00
Lukas Wirth
09ef75c717
Add back equality check that went missing
2024-07-19 20:39:09 +02:00
bors
2c2b6c9bcc
Auto merge of #17640 - Veykril:parse-dyn, r=Veykril
...
Parse contextual dyn keyword properly in edition 2015
Turns out this is more important than I thought it would be given the metrics :)
2024-07-19 18:31:08 +00:00
Lukas Wirth
92f5e806f1
Fix edition used for include macro parsing
2024-07-19 20:29:53 +02:00
Lukas Wirth
f4199f786e
Parse contextual dyn keyword properly in edition 2015
2024-07-19 20:20:30 +02:00
roife
f027a46d94
internal: move NavigationTarget::from_expr to goto_definition
2024-07-20 01:58:51 +08:00
roife
1b59cf2d52
fix: sort references in tests
2024-07-20 01:55:55 +08:00
roife
55cd8ab904
fix: handle highlightings inside macro calls & only highlight kws in current file
2024-07-20 01:45:51 +08:00
roife
d94dcfa841
fix: ensure that highlight_related works for macro_expr
2024-07-20 01:42:52 +08:00
roife
ae6e8d56d4
use token_ancestors_with_macros to simplify goto-def on kw
2024-07-20 01:42:52 +08:00
roife
22c5924080
fix: navigate to label directly when perform 'goto-def' on control-flow kw
...
See https://github.com/rust-lang/rust-analyzer/pull/17542#discussion_r1667656190
2024-07-20 01:42:52 +08:00
roife
07570bac66
feat: find references on control-flow kws
2024-07-20 01:42:52 +08:00
roife
3650b40714
fix: keyword highlighting in macro expansion
2024-07-20 01:42:52 +08:00
roife
1bca00d1bc
fix: incorrect highlighting of try blocks with control flow kws
2024-07-20 01:42:51 +08:00
roife
a93a7c2403
fix: ensure that goto-def works on fn/try/async kw
2024-07-20 01:41:01 +08:00
roife
37085d9dcd
feat: goto-def on keywords
2024-07-20 01:41:00 +08:00
Lukas Wirth
a324e46b0b
Drop an unnecessary Arc::clone
2024-07-19 18:53:52 +02:00
Lukas Wirth
89bcc79b5d
Regenerate files
2024-07-19 18:39:42 +02:00
Lukas Wirth
6d4989b3c7
Make LRU opt-in
2024-07-19 18:38:08 +02:00
Lukas Wirth
7fcac48023
Remove duplicate information from interned::Slot
2024-07-19 17:52:49 +02:00
bors
9fd6c695da
Auto merge of #17638 - Veykril:salsa-perf, r=Veykril
...
perf: Reduce memory usage of salsa slots by 8 bytes
2024-07-19 15:48:57 +00:00
Lukas Wirth
8e3133f118
Reduce maximum LRU size to 2^16 entries, reducing memory footprint of LRU entries
2024-07-19 17:48:12 +02:00
Lukas Wirth
4691ca97f1
perf: Reduce memory usage of salsa slots by 8 bytes
2024-07-19 17:34:48 +02:00
bors
9b1b29ca7a
Auto merge of #17637 - jjoeldaniel:master, r=Veykril
...
internal: remove rust-analyzer.openFAQ
Removed no longer functional `rust-analyzer.openFAQ` command created in #17508
2024-07-19 15:34:43 +00:00
bors
aa4768f7be
Auto merge of #17622 - roife:fix-issue-17602, r=Veykril
...
fix: handle synonymous imports with different renaming in 'merge imports'
fix #17602
2024-07-19 15:16:02 +00:00
Joel Daniel Rico
430768064f
remove rust-analyzer.openFAQ
2024-07-19 08:11:16 -07:00
bors
fa3dd33c27
Auto merge of #17620 - Veykril:edition-aware-parser, r=Veykril
...
Edition aware parser
Fixes https://github.com/rust-lang/rust-analyzer/issues/16324 by allowing us to properly thread through the edition to the parser
2024-07-19 14:56:56 +00:00
Lukas Wirth
546eb6b530
Test macros doing edition dependent parsing
2024-07-19 16:43:58 +02:00
Lukas Wirth
2c32ee7cfa
Prevent generated runner module from being format checked
2024-07-19 16:01:47 +02:00
Lukas Wirth
d235d09bf9
Parse try
as a keyword only in edition 2018 and up
2024-07-19 15:43:20 +02:00
Lukas Wirth
713c47f25b
Add basic edition inline parser test support
2024-07-19 15:19:43 +02:00
bors
71c78167e8
Auto merge of #17634 - lnicola:fix-xtask-install, r=lnicola
...
minor: Make xtask install work again
CC https://github.com/rust-lang/rust-analyzer/pull/17559#issuecomment-2234052939
2024-07-19 06:15:00 +00:00
Laurențiu Nicola
89d089f547
Make xtask install work again
2024-07-19 09:11:26 +03:00
bors
52143a5ac0
Auto merge of #17246 - davidbarsky:david/move-rust-project-generation-to-server, r=Veykril
...
feature: teach rust-analyzer to discover `linked_projects`
This PR's been a long-time coming, but like the title says, it introduces server-side project discovery and removes the extension hooks I previously introduced. I don't think this PR is ready to land, but here are the things I'm feeling squishy about:
- I don't think I like the idea of introducing the `cargo-metadata` command-but-for-everything-else in the `flycheck` module, but the progress reporting infrastructure was too convenient to pass up. Happy to move it elsewhere.
Here are the things I _know_ I need to change:
- For progress reporting, I'm extracting from a `serde_json::Value` that corresponds to `tracing_subsciber::fmt::Layer`'s JSON output. I'd like to make this a bit more structured/documented than the current nonsense I wrote.
- The progress reporting currently hardcodes "Buck"; it should be deriving that from the previously mentioned more-structured-output.
- This doesn't handle *reloading* when a corresponding buildfile is changed. It should be doing that.
<details>
<summary>Anyway, here's a video of rust-analyzer discovering a Buck target.</summary>
https://github.com/rust-lang/rust-analyzer/assets/2067774/be6cd9b9-2c9a-402d-847f-05f860a91df1
</details>
2024-07-18 16:15:31 +00:00
David Barsky
db43a5a6e9
feature: move linked_projects
discovery to the rust-analyzer server
2024-07-18 12:01:27 -04:00
Lukas Wirth
7a5bf92b89
Rewrite inline parser test infra to generated proper rust test cases
2024-07-18 10:03:19 +02:00
Lukas Wirth
ef462ca88e
Update test fixtures
2024-07-18 09:09:31 +02:00
Lukas Wirth
5264f86242
Encode edition within FileId in the hir layer
2024-07-18 08:49:10 +02:00
roife
87a3ab4658
fix: handle synonymous imports in 'merge imports'
2024-07-18 05:01:58 +08:00
bors
a62ea0a59e
Auto merge of #17618 - Veykril:rustc_skip_during_method_dispatch, r=Veykril
...
Support rustc_skip_during_method_dispatch
Fixes https://github.com/rust-lang/rust-analyzer/issues/17256
2024-07-17 09:48:18 +00:00
Lukas Wirth
92268627a8
Support rustc_skip_during_method_dispatch
2024-07-17 11:46:36 +02:00
bors
b78cc87b1b
Auto merge of #17617 - Veykril:grammar-kind-gen, r=Veykril
...
Derive kinds information from ungrammar file
This reduces the need to touch more files when adding a new grammar rule
2024-07-17 09:27:03 +00:00
Lukas Wirth
b8cac1bb6b
string is not a keyword
2024-07-17 11:11:57 +02:00
Lukas Wirth
7011094685
Add always disabled gen parse support
2024-07-17 10:49:12 +02:00
Lukas Wirth
983c9c122e
Derive kinds information from ungrammar file
2024-07-17 10:04:45 +02:00
bors
3fa78e113b
Auto merge of #17616 - Veykril:config-param-hints, r=Veykril
...
Fix incorrect generic parameter hint defaults
Missed this in the review but we should show const param hints, not lifetime param hints by default
2024-07-17 06:54:06 +00:00
Lukas Wirth
8f044d9681
Fix incorrect generic parameter hint defaults
2024-07-17 08:52:23 +02:00