Commit graph

153451 commits

Author SHA1 Message Date
MoskalykA
510090f774 Start using Option::is_none_or 2024-10-26 09:39:04 +03:00
Laurențiu Nicola
fe425cd549 Turn Remove dbg into a quick fix for better prioritization 2024-10-26 09:06:10 +03:00
Lukas Wirth
c6d1f78fa3 Only construct a resolver in macro descension when needed 2024-10-25 10:23:59 +02:00
Lukas Wirth
e37c6dc03e
Merge pull request #18408 from Veykril/veykril/push-ulxyznwzokut
fix: Don't compute diagnostics for non local files
2024-10-25 05:55:32 +00:00
Lukas Wirth
bf77cf7f90 Add server cancellation support to pull diagnostic handler 2024-10-25 07:39:28 +02:00
Lukas Wirth
1613548cdb Don't compute diagnostics for non local files 2024-10-25 07:28:29 +02:00
HackerVole
183796ed0e editors/code: Add md for walkthrough setup example
Add a separate markdown file containing the settings.json snippet from
the "Useful Setup Tips". This fixes the rendering and also makes the
text selectable.

Also use double-backticks for `code` rendering.
2024-10-24 23:20:40 -04:00
Laurențiu Nicola
9832131fd5 Update changelog generation for merge queues 2024-10-24 20:40:57 +03:00
Lukas Wirth
0a8ebdf6a7
Merge pull request #18404 from Veykril/veykril/push-swpmkoqqxrvu
feat: Implement diagnostics pull model
2024-10-24 15:22:49 +00:00
Lukas Wirth
c5a1bd9342 feat: Implement diagnostics pull model 2024-10-24 17:09:43 +02:00
Lukas Wirth
bada8ba83a
Merge pull request #18402 from Veykril/veykril/push-wrvtystlszlr
internal: Improve proc-macro error msg for failed build scripts
2024-10-24 12:01:29 +00:00
Lukas Wirth
7e67a18c74
Merge pull request #18401 from Veykril/veykril/push-ulpowvsymyys
minor: Remove intermediate allocations
2024-10-24 11:48:27 +00:00
Lukas Wirth
e789a77003 internal: Improve proc-macro error msg for failed build scripts 2024-10-24 13:45:11 +02:00
Lukas Wirth
38e9da2068 minor: Remove intermediate allocations 2024-10-24 13:34:32 +02:00
Lukas Wirth
3c75b4a017
Merge pull request #18399 from Veykril/veykril/push-nnsoxqrwqkmv
Fix diagnostic enable config being ignored
2024-10-24 10:01:22 +00:00
Lukas Wirth
39881f5720 Fix diagnostic enable config being ignored 2024-10-24 11:47:12 +02:00
Lukas Wirth
981ea1955c
Merge pull request #18390 from ShoyuVanilla/issue-18308
fix: Prevent public re-export of private item
2024-10-24 09:25:06 +00:00
Laurențiu Nicola
97eb4c7135 Bump smol_str 2024-10-24 10:08:31 +03:00
Laurențiu Nicola
f3d97841a3 Hide default config in Debug impl 2024-10-24 10:07:54 +03:00
Lukas Wirth
582f1a67d8
Merge pull request #18395 from Wilfred/missing_cfg_for_core
fix: Add missing cfg flags for `core` crate
2024-10-24 06:14:17 +00:00
Lukas Wirth
5b0821f1b7
Merge pull request #18394 from Wilfred/pretty_print_status
internal: Pretty-print Config in status command
2024-10-24 06:12:19 +00:00
Wilfred Hughes
c93514b67c fix: Add missing cfg flags for core crate
Some types in `core` are conditionally compiled based on
`target_has_atomic` or `target_has_atomic_load_store` without an
argument, for example `AtomicU64`.

This is less noticeable in Cargo projects, where rust-analyzer adds
the output `RUSTC_BOOTSTRAP=1 cargo rustc --print cfg` so it gets the
full set of cfg flags.

This fixes go-to-definition on `std::sync::atomic::AtomicU64` in
non-cargo projects.
2024-10-23 16:43:08 -07:00
Wilfred Hughes
2204724a86 internal: Pretty-print Config in status command
Config can become very big, even for relatively small rust project,
and printing everything on one line makes reading the output in VS Code
harder.
2024-10-23 15:18:43 -07:00
Lukas Wirth
8cf856e476
Merge pull request #18392 from Veykril/veykril/push-wktpkuklnzot
Swap query call order in `file_item_tree_query`
2024-10-23 20:31:49 +00:00
Lukas Wirth
c8ce15050c Swap query call order in file_item_tree_query 2024-10-23 22:17:37 +02:00
David Barsky
4d541f7cf3 internal: log original syntax on panic 2024-10-23 12:56:00 -07:00
Shoyu Vanilla
eee4037ddf fix: Prevent public reexport of private item 2024-10-24 04:26:17 +09:00
Jason Boatman
bc6b2ec10e Rewrite label_details_support condition to be consistent with other parts of the codebase. 2024-10-23 13:19:53 -05:00
Jason Boatman
d7f137ea7a Fix checking for false labelDetailsSupport value. 2024-10-23 12:57:11 -05:00
Wilfred Hughes
33f27d135e fix: Handle missing time offsets gracefully
The tracing_subscribe docs state that missing offsets likely mean
that we're in a multithreaded context:
https://docs.rs/tracing-subscriber/latest/tracing_subscriber/fmt/time/struct.OffsetTime.html#method.local_rfc_3339

We're not in a multithreaded context at this point, but some platforms
(e.g. OpenBSD) still don't have time offsets available.

Since this is only a rust-analyzer debugging convenience, just use
system time logging in this situation.

Fixes #18384
2024-10-23 09:57:57 -07:00
Lukas Wirth
1fbaccd893
Merge pull request #18264 from ChayimFriedman2/semi-transparent
fix: Implement mixed site hygiene
2024-10-23 12:33:50 +00:00
usamoi
ac3db41b39 fix dyn incompatible hint message 2024-10-23 18:10:14 +08:00
Lukas Wirth
bde2000a98
Merge pull request #18376 from Veykril/veykril/push-ptmnsoqzsmqk
feat: Add text edits to more inlay hints
2024-10-23 08:39:25 +00:00
Lukas Wirth
4fdc63ce38 Don't emit edits for postfix adjustment hints 2024-10-23 10:24:58 +02:00
Lukas Wirth
41fc1fbaab Add text edit to implicit 'static hints 2024-10-23 09:58:20 +02:00
Lukas Wirth
49322a176f Add text edit to discriminant hints 2024-10-23 09:57:00 +02:00
Lukas Wirth
c92f76d7d7 Add text edit to binding mode hints 2024-10-23 09:52:03 +02:00
Lukas Wirth
cb816ad4f0 Add text edit to adjustment hints 2024-10-23 09:30:36 +02:00
Chayim Refael Friedman
8f36d1c94a Correctly resolve variables and labels from before macro definition in macro expansion
E.g.:
```rust
let v;
macro_rules! m { () => { v }; }
```

This was an existing bug, but it was less severe because unless the variable was shadowed it would be correctly resolved. With hygiene however, without this fix the variable is never resolved.
2024-10-22 21:49:17 +03:00
Chayim Refael Friedman
7ee25a0d70 Implement semitransparent hygiene
Or macro_rules hygiene, or mixed site hygiene. In other words, hygiene for variables and labels but not items.

The realization that made me implement this was that while "full" hygiene (aka. def site hygiene) is really hard for us to implement, and will likely involve intrusive changes and performance losses, since every `Name` will have to carry hygiene, mixed site hygiene is very local: it applies only to bodies, and we very well can save it in a side map with minor losses.

This fixes one diagnostic in r-a that was about `izip!()` using hygiene (yay!) but it introduces a huge number of others, because of #18262. Up until now this issue wasn't a major problem because it only affected few cases, but with hygiene identifiers referred by macros like that are not resolved at all. The next commit will fix that.
2024-10-22 21:26:56 +03:00
Lukas Wirth
fa59a76762
Merge pull request #18254 from ChayimFriedman2/fix-mut
fix: Nail destructuring assignment once and for all
2024-10-22 17:40:52 +00:00
Chayim Refael Friedman
983383f957 Add test for tuple struct destructuring assignment where the path comes from a macro 2024-10-22 20:27:09 +03:00
Lukas Wirth
770df7ffbb Merge binding_mode inlay hints into one 2024-10-22 17:12:16 +02:00
Lukas Wirth
7c29f8c5b7 Merge adjustment inlay hints into one 2024-10-22 16:56:13 +02:00
Lukas Wirth
7aad1a2c4e Merge closure capture inlay hints into one 2024-10-22 16:29:15 +02:00
Marco Ieni
548224782c
Merge pull request #18372 from Kobzol/ci-merge-queue
Switch CI from bors to merge queues
2024-10-22 12:57:57 +00:00
bors
408f924758 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
7cad4da1ab 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
Jakub Beránek
7c315cfbe6 Switch CI from bors to merge queues 2024-10-22 14:04:24 +02:00
bors
0b906b6e3d 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