Commit Graph

311408 Commits

Author SHA1 Message Date
Lukas Wirth c414fc5bee fix: Do not try to connect via postcard to proc-macro-srv 2025-11-26 09:03:00 +01:00
Lukas Wirth e5058c437f minor: Rename proc-macro-srv protocol flags 2025-11-26 09:03:00 +01:00
Lukas Wirth 20fa8ab327 Merge pull request #21131 from Veykril/push-rxrmsylwoowm
completions: Fix completions disregarding snippet capabilities
2025-11-26 07:18:43 +00:00
Lukas Wirth b0d1c9a7e7 completions: Fix completions disregarding snippet capabilities 2025-11-26 08:01:52 +01:00
Laurențiu Nicola 5c82106f5a Merge pull request #21027 from ColinFinck/msvc-crt-static
Build releases with static CRT for `-windows-msvc` targets.
2025-11-25 19:29:10 +00:00
Laurențiu Nicola ad952c0730 Merge pull request #21126 from A4-Tacks/arglist-nr-error-comma
fix: fix parameter info with missing arguments
2025-11-25 12:50:22 +00:00
Colin Finck 416d88b31b Build releases with static CRT for -windows-msvc targets.
This increases the binary size of `rust-analyzer.exe` from 42.4 MB to 42.6 MB.
Which should be acceptable for eliminating 7 DLL dependencies.
2025-11-25 13:48:01 +01:00
A4-Tacks a54b1950f3 Fix invalid completion arg nr
Example
---
```rust
fn foo() { bar(, $0); }
fn bar(x: u32, y: i32) {}
```

**Before this PR**

```text
ty: u32, name: x
```

**After this PR**

```text
ty: i32, name: y
```
2025-11-25 16:13:59 +08:00
Chayim Refael Friedman 16f4c86e85 Merge pull request #21121 from Zalathar/derive-macro
Basic support for declarative attribute/derive macros
2025-11-24 21:02:28 +00:00
Lukas Wirth 8a19d584a1 Merge pull request #20986 from Shourya742/2025-11-07-add-support-for-postcard
Integrate postcard support into proc-macro server CLI
2025-11-24 18:52:26 +00:00
bit-aloo ddefc4b7b4 add codec and framing to abstract encoding and decoding logic from run 2025-11-24 21:44:13 +05:30
Chayim Refael Friedman 84d774cb24 Merge pull request #21123 from Natural-selection1/test
minor: add regression tests for add_missing_impl_members
2025-11-24 15:16:23 +00:00
Hegui Dai d73c941d8c add regression tests for add_missing_impl_members 2025-11-24 22:38:23 +08:00
Chayim Refael Friedman af36027236 Merge pull request #20125 from nicolas-guichard/push-pypzwzspzznu
Use inferred type in “extract type as type alias” assist and display inferred type placeholder `_` inlay hints
2025-11-24 12:41:21 +00:00
Nicolas Guichard 93de020afd Show inlay hints for type placeholders
With the extra InferenceResult that maps type placeholders to their
inferred type, we can now easily display inlay hints for them.
2025-11-24 11:52:58 +01:00
Nicolas Guichard b331c523a8 extract_type_alias assist extracts inferred type when possible
When met with types with placeholders, this ensures this assist
extracts the inferred type instead of the type with placeholders.

For instance, when met with this code:
```
fn main() {
    let vec: Vec<_> = vec![4];
}
```
selecting Vec<_> and extracting an alias will now yield `Vec<i32>`
instead of `Vec<_>`.
2025-11-24 11:52:58 +01:00
Nicolas Guichard eb5401efe4 Use inferred type in SourceAnalyzer::type_of_type
This uses the new InferenceResult::type_of_type_placeholder data to
turn type references into completely resolved types instead of just
returning the lexical type.
2025-11-24 11:52:58 +01:00
Nicolas Guichard 09cf06733e Record inferred type for type placeholders
This adds a type_of_type_placeholder arena to InferenceResult to record
which type a given type placeholder gets inferred to.
2025-11-24 11:52:58 +01:00
Zalathar 0ce6a0614e Basic support for declarative attribute/derive macros 2025-11-24 21:50:56 +11:00
Zalathar 35e056e80a Inline macro sub-namespace lookup into sub_namespace_match 2025-11-24 21:24:21 +11:00
bit-aloo c3708c7b43 add review suggestions 2025-11-24 15:28:28 +05:30
bit-aloo aea45c3961 add postcard abstraction inside Message trait 2025-11-24 15:28:28 +05:30
bit-aloo 4284804eb5 add postcard related methods to proc-macro-apo 2025-11-24 15:28:27 +05:30
bit-aloo 83edf8fa09 make postcard first class member of proc-macro-srv-cli 2025-11-24 15:28:14 +05:30
Lukas Wirth 59dafb3896 Merge pull request #21097 from Veykril/push-zpqupukpkrts
proc-macro-srv: Reimplement token trees via immutable trees
2025-11-24 09:09:16 +00:00
Lukas Wirth bb89b62ed5 Couple more tests 2025-11-24 09:59:07 +01:00
Chayim Refael Friedman 320c881baa Merge pull request #21116 from xdBronch/push-okwnouotntqt
add deprecated semantic token for extern crate shorthand
2025-11-24 07:51:21 +00:00
Shoyu Vanilla (Flint) 0289ce4c65 Merge pull request #20937 from A4-Tacks/duplicate-raw-const
Fix duplicate `const` complete after `raw`
2025-11-24 05:53:56 +00:00
A4-Tacks aecab3493b Fix duplicate const complete after raw
Example
---
```rust
fn main() { let _ = &raw $0 }
```

**Before this PR**

```text
fn main() fn()
bt u32     u32
kw const
kw const
kw crate::
...
```

**After this PR**

```text
fn main() fn()
bt u32     u32
kw const
kw crate::
...
```
2025-11-24 10:18:01 +08:00
Shoyu Vanilla (Flint) 35ab21b294 Merge pull request #20967 from A4-Tacks/replace-eager-lazy-and-then
Fix not applicable on `and` for replace_method_eager_lazy
2025-11-24 01:49:11 +00:00
Shoyu Vanilla (Flint) a7d7fa6b4d Merge pull request #21115 from ChayimFriedman2/upgrade-rustc
internal: Upgrade rustc crates
2025-11-24 01:29:07 +00:00
xdBronch 834ee5f0e5 add deprecated semantic token for extern crate shorthand 2025-11-23 14:24:24 -05:00
Lukas Wirth 072aaa0b5a Merge pull request #21098 from Aditya-PS-05/fix/include-bin-targets-outside-pkg-root
fix: include all target types with paths outside package root
2025-11-23 18:02:36 +00:00
Chayim Refael Friedman 055f39a05e Merge pull request #21100 from xdBronch/deprecated-tokens
add semantic tokens for deprecated items
2025-11-23 15:24:13 +00:00
Aditya-PS-05 a028fbf641 fix: sort and dedup include paths to prevent VFS issues 2025-11-23 20:45:57 +05:30
xdBronch 03af855e78 add semantic tokens for deprecated items 2025-11-23 09:59:05 -05:00
Chayim Refael Friedman fe4e93622e Upgrade rustc crates
Major changes:

 - `GoalSource::InstantiateHigherRanked` was removed.
 - `Interner::UnevaluatedConstId` was introduced, allowing further simplifications due to better typing. Generally we don't represent unevaluated consts like we should, but it's still better.
 - `PatternKind::NotNull` was introduced.
2025-11-23 16:23:19 +02:00
Chayim Refael Friedman 7fb94ccad3 Merge pull request #21011 from dfaure-kdab/wip/dfaure/smolstr_pretty_printer
Provide a gdb pretty printer for smol_str::SmolStr
2025-11-23 14:04:07 +00:00
Chayim Refael Friedman 5dcba5774a Merge pull request #21114 from lmmx/no-unused-tracing-attributes-feat
fix: no unused `tracing/attributes` feature
2025-11-23 13:51:54 +00:00
David Faure a87db97854 Provide a gdb pretty printer for smol_str::SmolStr
Auto-loaded via the debugger_visualizer attribute.
Tested on smolstr's unittest:

$ RUSTFLAGS="-C debuginfo=2 -C opt-level=0" cargo test -p smol_str --no-run
$ rust-gdb target/debug/deps/test-a806b111557a7133
(gdb) break test::conversions
(gdb) run
(gdb) next
(gdb) print s
(and other locations in that file, to test the three cases: Inline,
Static and Heap)
2025-11-23 14:49:23 +01:00
Louis Maddox 674a44e120 fix: no unused tracing/attributes feature
- Discussed in https://github.com/rust-lang/rust-analyzer/issues/21107
- Avoids activating an `attributes` feature to crates that do not use it
- Updates the 6 crates that use attributes feature to specify it in
  their Cargo.toml: {hir,hir-def,hir-ty,ide-assists,ide-db,project-model}
2025-11-23 13:37:42 +00:00
Lukas Wirth 98797f0ce8 Merge pull request #21104 from Veykril/veykril/push-plqyyxsxvtyr
minor: Use `const_eval_static` query for statics
2025-11-23 13:06:52 +00:00
Lukas Wirth e796bd41f1 Move transitive_rev_deps from db trait away 2025-11-23 13:56:59 +01:00
Lukas Wirth 277dffe9d6 De-querify transitive_deps again 2025-11-23 13:48:53 +01:00
Lukas Wirth 6285836732 Merge pull request #21065 from A4-Tacks/refutable-in-pat-field
Fix always irrefutable in RecordPatField
2025-11-23 12:37:03 +00:00
Lukas Wirth b66ad113ec Merge pull request #20559 from A4-Tacks/pretty-num-explicit-enum-disc
Add pretty number for add_explicit_enum_discriminant
2025-11-23 12:35:22 +00:00
Lukas Wirth fa1e48b2d6 Merge pull request #21083 from A4-Tacks/cfg-pred-keyval-eq
feat: Completion ` = $0` after keyval cfg predicate
2025-11-23 12:33:05 +00:00
Lukas Wirth e9d97d1326 Merge pull request #21093 from Young-Flash/convert_char_literal
feat: add assist to convert char literal
2025-11-23 12:31:23 +00:00
Lukas Wirth 957f9c9973 Merge pull request #21111 from A4-Tacks/fill-guarded-match-arm
Fix not fill guarded match arm for add_missing_match_arms
2025-11-23 11:51:10 +00:00
Lukas Wirth be52a1e0da Merge pull request #21113 from ChayimFriedman2/byte-range
fix: Infer range patterns correctly
2025-11-23 11:36:20 +00:00