Commit Graph

27009 Commits

Author SHA1 Message Date
Lukas Wirth
e1c67485bf fix: Differentiate between vfs config load and file changed events 2024-01-09 10:30:16 +01:00
bors
f5f7ddae23 Auto merge of #16317 - lnicola:sync-from-rust, r=Veykril
internal: sync from downstream
2024-01-09 08:36:57 +00:00
Laurențiu Nicola
4413aeb9e8 Temporarily disable resolve_proc_macro test 2024-01-09 10:27:36 +02:00
Laurențiu Nicola
b0b2b1c5f1 Fix allow(dead_code) 2024-01-09 10:00:57 +02:00
Laurențiu Nicola
0ae73738ad Try to fix feature gates 2024-01-09 09:52:58 +02:00
Laurențiu Nicola
f52f2f9c3c Merge branch 'master' into sync-from-rust 2024-01-09 08:46:16 +02:00
Laurențiu Nicola
c6a02e375b Merge branch 'release' into sync-from-rust 2024-01-09 08:45:49 +02:00
bors
12e7aa3132 Auto merge of #16313 - Urhengulas:tidy-syntax-docs, r=lnicola
minor: Remove newline and add dot in syntax docs

While reading through the docs I came across these two small typos.
2024-01-08 17:21:48 +00:00
Johann Hemmann
d94f572fe2 Remove newline and add dot 2024-01-08 18:10:48 +01:00
bors
598511b4e8 Auto merge of #16308 - Veykril:builtin-macro-hygiene, r=lnicola
Builtin derives are hygienic

Closes https://github.com/rust-lang/rust-analyzer/issues/16295
2024-01-08 17:10:32 +00:00
bors
c1c242180e Auto merge of #16307 - Veykril:vfs2, r=lnicola
internal: VFS no longer stores all source files in memory

Turns out there is no need to keep the files around. We either upload them to salsa once processed, or we need to keep them around for the `DidChangeTextDocumentNotification`, but that notification is only valid for opened documents, so instead we can just keep the files around in the `MemDocs`!

Fixes https://github.com/rust-lang/rust-analyzer/issues/16301
2024-01-08 16:56:44 +00:00
Lukas Wirth
1c40ac79c8 VFS no longer stores all source files in memory 2024-01-08 12:51:16 +01:00
Lukas Wirth
7dd9f20ce3 Builtin derives are hygienic 2024-01-08 12:50:11 +01:00
Laurențiu Nicola
3afeb24198 Merge commit 'af40101841c45aa75b56f4e9ca745369da8fb4ba' into sync-from-ra 2024-01-08 11:29:25 +02:00
bors
af40101841 Auto merge of #16302 - homersimpsons:patch-1, r=lnicola
line-index: Create README.md

Fixes #16180
2024-01-07 14:41:45 +00:00
homersimpsons
0f69276e60
line-index: Update README.md with suggestions
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
2024-01-07 15:38:40 +01:00
homersimpsons
747fa7dd6e
line-index: Create README.md 2024-01-07 14:25:42 +01:00
bors
6ce3f44597 Auto merge of #16298 - riverbl:exclusive-range-hint, r=Veykril
feat: Add inlay hint for exclusive ranges

Adds an inlay hint containing a '<' character to exclusive range expressions and patterns that specify an upper bound.

![2024-01-07-095056_257x415_scrot](https://github.com/rust-lang/rust-analyzer/assets/94326797/d6bbc0de-52a5-4af4-b53c-a034749b6cab)

Inspired by [this comment](https://github.com/rust-lang/rust/issues/37854#issuecomment-1865124907) noting that IntelliJ Rust has this feature.
2024-01-07 10:21:39 +00:00
bors
1c5fa447d9 Auto merge of #16294 - matthiaskrgr:less_alloc, r=Veykril
minor: some minor clippy::perf fixes

can be read commit by commit if you want 🤷
2024-01-07 10:02:38 +00:00
riverbl
3c378b9c70 Add inlay hint for exclusive ranges
Adds an inlay hint containing a '<' character to exclusive range expressions and patterns that specify an upper bound.
2024-01-07 09:33:56 +00:00
Matthias Krüger
3fb2cd2002 autofix remaining perf findings 2024-01-07 01:20:20 +01:00
Matthias Krüger
196650dfaf don't to_string() format args 2024-01-07 01:11:57 +01:00
Matthias Krüger
b22bd36f6e remove more redundant clones manually 2024-01-07 00:26:49 +01:00
Matthias Krüger
476e10e961 remove redundant clones 2024-01-07 00:17:48 +01:00
bors
f595e60b6d Auto merge of #16290 - Veykril:chalk, r=Veykril
internal: Reduce vec cloning in mir lowering/eval
2024-01-06 22:13:09 +00:00
bors
e9ae0b7ab4 Auto merge of #16285 - lnicola:repr-packed-unaligned, r=Veykril
fix: Fix panic on unaligned packed attribute

Closes #16284
2024-01-06 20:35:56 +00:00
Lukas Wirth
5ac0c14384 Remove some vec clones in const-eval 2024-01-06 21:33:47 +01:00
Laurențiu Nicola
d17156a774 Add some repr(packed) tests 2024-01-06 21:24:01 +02:00
bors
f8eab9b7d2 Auto merge of #16279 - Veykril:ide-tuple-fields, r=Veykril
feat: IDE features for primitive tuple fields

Fixes https://github.com/rust-lang/rust-analyzer/issues/13018
2024-01-06 18:30:10 +00:00
Laurențiu Nicola
30e17e377c Fix panic on unaligned packed attribute 2024-01-06 19:54:57 +02:00
Lukas Wirth
5125063a21 Remove unnecessary cloning 2024-01-06 17:48:07 +01:00
Lukas Wirth
c9c4053eed More aliases 2024-01-06 16:58:15 +01:00
Lukas Wirth
963568b46f feat: IDE features for primitive tuple fields 2024-01-06 15:04:58 +01:00
bors
e53792b7cb Auto merge of #16256 - Urhengulas:ide-runnables-assert_eq, r=Veykril
internal: Only compare relevant parts in  `ide::{runnables,inlay_hints}` tests

This PR limits the data being compared. Therefore the tests should be more readable, as well as being more robust to changes to the data structure.

Part of https://github.com/rust-lang/rust-analyzer/issues/14268.
2024-01-05 13:49:30 +00:00
bors
2271b82007 Auto merge of #16264 - roife:refactor/refactor-generate-delegate-trait, r=Veykril
internal: clean and enhance readability for `generate_delegate_trait`

Continue from #16112

This PR primarily involves some cleanup and simple refactoring work, including:

- Adding numerous comments to layer the code and explain the behavior of each step.
- Renaming some variables to make them more sensible.
- Simplify certain operations using a more elegant approach.

The goal is to make this intricate implementation clearer and facilitate future maintenance.

In addition to this, the PR also removes redundant `path_transform` operations for `type_gen_args`.
Taking the example of `impl Trait<T1> for S<S1>`, where `S1` is considered. The struct `S` must be in the file where the user triggers code actions, so there's no need for the `path_transform`. Furthermore, before performing the transform, we've already renamed `S1`, ensuring it won't clash with existing generics parameters. Therefore, there's no need to transform it.
2024-01-05 13:37:54 +00:00
bors
59457091bb Auto merge of #16199 - Young-Flash:extract_struct_with_Self, r=Veykril
fix: `extract_struct_from_enum_variant` assist should resolve Self generic arg

close https://github.com/rust-lang/rust-analyzer/issues/16197
2024-01-05 13:26:34 +00:00
bors
2980d54160 Auto merge of #16223 - Young-Flash:quickfix_redundant_assoc_item, r=Veykril
feat: add quickfix for redundant_assoc_item diagnostic

Happy New Year 😊

follow up https://github.com/rust-lang/rust-analyzer/pull/15990, now it's time to close https://github.com/rust-lang/rust-analyzer/issues/15958, closes https://github.com/rust-lang/rust-analyzer/issues/16269

![demo](https://github.com/rust-lang/rust-analyzer/assets/71162630/74022c52-1566-49a0-9be8-03b82f3e730f)

EDIT: add a demo.git would be more illustrated when making release change log.
2024-01-05 13:15:01 +00:00
bors
1c6755cad0 Auto merge of #16213 - davidsemakula:guide-typos-urls, r=lnicola
chore: update docs/dev/guide.md based on 2024-01-01 release

Updates dev guide based on 2024-01-01 release
2024-01-05 13:03:41 +00:00
bors
af102bab0e Auto merge of #16270 - Veykril:flyimport-perf, r=Veykril
internal: Speed up import searching some more

Pushes the sorting to the caller, meaning additional filtering can be done pre-sorting. Similarly a collect call was pushed to the caller for allowing some other filters to run pre-collecting.
2024-01-05 12:03:02 +00:00
Lukas Wirth
cc2b79feeb internal: Speed up import searching some more 2024-01-05 12:58:20 +01:00
bors
dc31cef5fc Auto merge of #16268 - Veykril:method-trait-completion-limit, r=Veykril
Remove completion limit for trait importing method completions

Fixes https://github.com/rust-lang/rust-analyzer/issues/16075

The < 3 char limit never applied to methods and the amount of completions generated due this is not absolutely massive as not all traits in a project are ever applicable so there is little reason to employ the limit here. Especially as it limits the number of traits we consider, not items (after my changes yesterday), and the number of traits is not the slowing factor here. Tested this in r-a where we have ~800 traits project wide and even when ~260 are applicable there was no noticable slow down from it.
2024-01-05 11:14:37 +00:00
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
bors
28e4a9a205 Auto merge of #16262 - paul-jewell:gentoo-instruction-tuneup, r=lnicola
Further tuning of the Gentoo installation instructions.

Based on feedback from the Gentoo repository maintainer, addition of the possibility to install rust-analyzer via rustup.
2024-01-05 10:32:33 +00:00
Laurențiu Nicola
03ec0087a0 Tweak wording a little more 2024-01-05 10:24:39 +02: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
davidsemakula
7c259a0300 fix typos and update descriptions 2024-01-05 01:56:06 +03:00
Paul Jewell
443787fe6a Added reference to the binaries available from GitHub.
In addition to installing from source.
2024-01-04 21:37:07 +00:00