Commit graph

20908 commits

Author SHA1 Message Date
bors
d509449d7e Auto merge of #18370 - duncpro:goto-def-ranges, r=Veykril
feat: resolve range patterns to their structs

Closes #18367
2024-10-22 12:24:25 +00:00
bors
4c4f186e23 Auto merge of #18368 - Veykril:test-lsif_contains_generated_macros, r=lnicola
tests: Add `lsif_contains_generated_constant` test

Closes https://github.com/rust-lang/rust-analyzer/pull/18309
2024-10-22 12:10:07 +00:00
bors
eddab6e98c Auto merge of #18349 - dqkqd:issue-18344, r=Veykril
feat: render docs from aliased type when type has no docs

Trying to close #18344

- [x] ~Find the docs by traversing upwards if the type itself has none but aliasing for another type that might have.~
- [x] Show docs from aliased type.
- [x] Showing description that we are displaying documentation for different definition in hover box.

![image](https://github.com/user-attachments/assets/820d6f97-aa2c-4dc4-8a25-75746e32d950)
2024-10-22 11:56:16 +00:00
bors
c58427ff94 Auto merge of #18371 - Veykril:veykril/push-kwttrusywysp, r=Veykril
fix: Fix incorrect parsing of use bounds

Fixes https://github.com/rust-lang/rust-analyzer/issues/18357
2024-10-22 11:42:11 +00:00
Lukas Wirth
95298a2e61 fix: Fix incorrect parsing of use bounds
Also lower them a bit more
2024-10-22 13:34:26 +02:00
Khanh Duong Quoc
44e48d75dd
feat: render docs from aliased type when docs are missing 2024-10-22 20:27:05 +09:00
Duncan Proctor
4fd471c571 tidy 2024-10-22 06:54:44 -04:00
Duncan Proctor
2e0fae3579 tidy 2024-10-22 06:37:12 -04:00
Duncan Proctor
c679551d6b remove duplicate test 2024-10-22 06:25:13 -04:00
Duncan Proctor
271f64f94d resolve range patterns to the their struct types 2024-10-22 06:20:16 -04:00
Lukas Wirth
6c23f25e7f Fix new nightly lints 2024-10-22 11:48:41 +02:00
Johann Hemmann
505c9c9fb3 tests: Add lsif_contains_generated_constant test 2024-10-22 11:38:54 +02:00
Lukas Wirth
232432411e Cleanup file structure proto handling 2024-10-22 10:51:08 +02:00
bors
17055aaca9 Auto merge of #18362 - duncpro:goto-def-ranges, r=Veykril
feat: goto definition on range operators

Closes #18342
2024-10-22 07:49:18 +00:00
Duncan Proctor
2f6923b844 tidy 2024-10-22 03:19:47 -04:00
Laurențiu Nicola
a32039278f Replace some LayoutError variants with the rustc_abi errors 2024-10-22 10:19:25 +03:00
Laurențiu Nicola
250bf98d58 Merge from rust-lang/rust 2024-10-22 10:12:22 +03:00
Duncan Proctor
f54a863965 goto definition on RangeFrom, RangeFull, RangeTo, and RangeToInclusive links to respective struct 2024-10-22 03:11:23 -04:00
duncanproctor
c7a8be110d Move explicit range handling out of goto_definition, use OperatorClass instead 2024-10-21 20:07:07 -04:00
bors
de2ff17bc5 Auto merge of #18360 - roife:safe-kw-3, r=Veykril
feat: better completions for extern blcoks

This PR refactors `add_keywords` (making it much clearer!) and enhances completion for `extern` blocks.

It is recommended to reviewing the changes in order of the commits:

- The first commit (f3c4dde0a4) doesn’t change any logic but refactors parts of the `add_keywords` function and adds detailed comments.
- The second commit (5dcc1ab649) improves completion for `extern` kw and extern blocks.
2024-10-21 17:59:05 +00:00
roife
cf3544a0ec minor: refactor completions in item_list 2024-10-22 01:31:57 +08:00
duncanproctor
3bc6e27993 GotoDefinition on a Range or InclusiveRange operator will link to the struct definition 2024-10-21 11:29:05 -04:00
bors
487152b90f Auto merge of #18361 - Veykril:veykril/push-uzsokssoyznx, r=Veykril
fix: Fix token downmapping failing for include! inputs

Supercedes https://github.com/rust-lang/rust-analyzer/pull/18325

Fixes https://github.com/rust-lang/rust-analyzer/pull/18325
Fixes https://github.com/rust-lang/rust-analyzer/issues/18313
Fixes https://github.com/rust-lang/rust-analyzer/issues/18314
2024-10-21 15:27:42 +00:00
Lukas Wirth
d878b8caad fix: Fix token downmapping failing for include! inputs 2024-10-21 17:22:18 +02:00
roife
5dcc1ab649 feat: better completions for extern blcoks 2024-10-21 22:23:16 +08:00
roife
f3c4dde0a4 refactor add_keywords in ide-completions for clarity 2024-10-21 22:23:01 +08:00
bors
546da8a5ad Auto merge of #18294 - Giga-Bowser:master, r=Veykril
Add wrap/unwrap return type in Option

I pretty much just copied over the code and tests for wrapping/unwrapping return types in `Result` and then did a bunch of find and replace changes.

I handled unwrapping statements returning `None` by just replacing `None` with the unit type, but I'm open to suggestions for more intuitive behavior here.
2024-10-21 13:56:01 +00:00
bors
dc2a348bdd Auto merge of #18337 - dqkqd:issue-18287, r=Veykril
fix: private items are shown in completions for modules in fn body

Close: #18287
2024-10-21 13:41:27 +00:00
Khanh Duong Quoc
5fdcbdddfa
fix: private items are shown in completions for modules in fn body 2024-10-21 21:42:46 +09:00
Lukas Wirth
02e189dcb5 fix: FIx mbe bench tests being iteration order dependent 2024-10-21 11:54:49 +02:00
Lukas Wirth
70d0b57cf0 Update ide tests 2024-10-21 11:28:19 +02:00
Lukas Wirth
1cdc34fa4a Fix recursive_adt fixture 2024-10-21 11:28:18 +02:00
Noratrieb
6a2b8270c9 Update rustc-hash to version 2
This brings in the new optimized algorithm that was shown to have small performance benefits for
rustc.
2024-10-21 11:28:18 +02:00
roife
834ccbffba fix: classify safe as a contextual kw 2024-10-21 02:56:21 +08:00
roife
002f6ad6f1 fix: do not emit unsafe diagnositcs for safe statics in extern blocks 2024-10-20 19:49:57 +08:00
roife
9f1e450c4f feat: initial support for safe_kw in extern blocks 2024-10-20 17:12:52 +08:00
Stuart Cook
d6350f60f7
Rollup merge of #131942 - workingjubilee:reduce-haruspicy, r=lukas-code,lnicola
compiler: Adopt rust-analyzer impls for `LayoutCalculatorError`

We're about to massively churn the internals of `rustc_abi`. To minimize the immediate and future impact on rust-analyzer, as a subtree that depends on this crate, grow some API on `LayoutCalculatorError` that reflects their uses of it. This way we can nest the type in theirs, and they can just call functions on it without having to inspect and flatten-out its innards.
2024-10-20 14:06:04 +11:00
Jubilee Young
90ec8053c2 rust-analyzer: Nest LayoutCalculatorError in hir_ty::LayoutError 2024-10-19 11:09:24 -07:00
Giga Bowser
2c823865c6 Combine entry points for wrapping/unwrapping return types 2024-10-19 11:59:52 -04:00
Wei Xu
cfa5df107a
Increase TOKEN_LIMIT for hir-expand 2024-10-18 17:36:24 -07:00
Johannes Altmanninger
94a4c3abaa Clamp Position::character to line length
LSP says about Position::character

> If the character value is greater than the line length it defaults back to the line length.

but from_proto::offset() doesn't implement this.

A client might for example request code actions for a whole line by sending
Position::character=99999.  I don't think there is ever a reason (besides laziness) why the
client can't specify the line length instead but I guess we should not crash but follow protocol.

Technically it should be a warning, not an error but warning is not shown by default so keep
it at error I guess.

Fixes #18240
2024-10-18 15:07:13 +02:00
bors
a40c399a3f Auto merge of #18331 - Veykril:veykril/push-tsolukqqyllz, r=Veykril
internal: Add more trivially `Sized` types to `is_sized` check
2024-10-18 10:55:51 +00:00
Lukas Wirth
c11b45a6bd internal: Add more trivially Sized types to is_sized check 2024-10-18 12:41:14 +02:00
Lukas Wirth
e5af3ae427 fix: Fix CI running analysis-stats incorrectly against the standard libraries 2024-10-18 12:34:55 +02:00
Giga Bowser
c5b4fcebcc Re-use code for wrapping/unwrapping return types 2024-10-17 10:04:28 -04:00
Laurențiu Nicola
2fe603efe7 Bump rustc crates 2024-10-17 13:11:12 +02:00
Laurențiu Nicola
7ae97c1ef1 Merge from rust-lang/rust 2024-10-17 10:04:49 +03:00
Varun Gandhi
6db78a82d4 Bump version of scip crate 2024-10-17 13:19:48 +08:00
Wilfred Hughes
36b9f09917 internal: Use local time when formatting logs
When debugging rust-analyzer and looking at logs, it's much easier to read
when the timestamp is in the local timezone.

Before:

    2024-08-28T20:55:38.792321Z  INFO ParseQuery: invoked at R18460

After:

    2024-08-28T13:55:38.792321-07:00  INFO ParseQuery: invoked at R18460
2024-10-16 15:22:57 -07:00
bors
418c1365ec Auto merge of #18278 - ShoyuVanilla:never-place, r=Veykril
Do not consider match/let/ref of place that evaluates to ! to diverge, disallow coercions from them too

Resolves #18237
2024-10-15 07:29:55 +00:00