Commit graph

1897 commits

Author SHA1 Message Date
Jacob Pratt
307f1609e9
Rollup merge of #135354 - Walnut356:msvc_lldb, r=wesleywiser
[Debuginfo] Add MSVC Synthetic and Summary providers to LLDB

Adds handling for `tuple$<>`, `ref$<slice$2<>`, `ref$<str$>` and `enum2$<>`.

Also fixes a bug in MSVC vec/string handling where the script was unable to determine the element's type due to LLDB ignoring template arg debug information

<details>
<summary>Sample code</summary>

```rust
pub enum Number {
    One = 57,
    Two = 99,
}

#[repr(u8)]
pub enum Container {
    First(u32),
    Second { val: u64, val2: i8 },
    Third,
}

...
    let u8_val = b'a';
    let float = 42.78000000000001;

    let tuple = (u8_val, float);

    let str_val = "eef";
    let mut string = "freef".to_owned();
    let mut_str = string.as_mut_str();
    let array: [u8; 4] = [1, 2, 3, 4];
    let ref_array = array.as_slice();
    let mut array2: [u32; 4] = [1, 2, 3, 4];
    let mut_array = array2.as_mut_slice();
    let enum_val = Number::One;
    let mut enum_val2 = Number::Two;
    let sum_val = Container::First(15);
    let sum_val_2 = Container::Second { val: 0, val2: 0 };
    let sum_val_3 = Container::Third;
    let non_zero = NonZeroU128::new(100).unwrap();
    let large_discr = NonZeroU128::new(255);
```
</details>

Before:

![image](https://github.com/user-attachments/assets/19fd0881-a4c3-4c68-b28f-769a67d95e35)

After:

![image](https://github.com/user-attachments/assets/d0479035-17ed-4584-8eb4-71d1314f8f7c)

try-job: aarch64-apple
try-job: x86_64-msvc-1
try-job: i686-msvc-1
try-job: x86_64-mingw-1
try-job: i686-mingw
try-job: aarch64-gnu
2025-02-23 02:44:16 -05:00
Chai T. Rex
d9f125dcf2 Add support for the Zed IDE to ./x setup 2025-02-15 17:30:20 -05:00
Walnut
d6f5d34744 fix string and tuple struct formatting 2025-02-12 01:30:09 -06:00
Walnut
0819c1638c Fix import/attribute errors related to SBTypeStaticField 2025-02-07 20:41:57 -06:00
Jakub Beránek
22e44919c5 Update bootstrap completions 2025-02-05 15:33:40 +01:00
Jacob Pratt
e730dfc097
Rollup merge of #135812 - Walnut356:gdb_osstring, r=Mark-Simulacrum
Fix GDB `OsString` provider on Windows

It would throw an exception due to trying to look up `Wtf8Buf.__0`. The field it actually wants is called [`bytes`](b605c65b6e/library/std/src/sys_common/wtf8.rs (L134)).
2025-01-26 01:51:15 -05:00
Walnut
a9495e0118 change lookup from OsString.inner.inner.0 -> OsString.inner.inner.bytes 2025-01-21 03:23:01 -06:00
Urgau
8e61502484 core: add #![warn(unreachable_pub)] 2025-01-20 18:35:32 +01:00
Walnut
0f12b8cf12 slots fix 2025-01-18 21:12:23 -06:00
Walnut
e8c5e09e4f doc comment for get_template_args 2025-01-11 19:09:08 -06:00
Walnut
2be88129f9 tidy 2025-01-11 03:40:07 -06:00
Walnut
a3adcd24db add alternate inner type lookup for hashmap/set when template args missing 2025-01-11 03:33:41 -06:00
Walnut
0bf0817dd5 More robust sequence formatter 2025-01-11 00:38:48 -06:00
Walnut
f725ad7f1d more robust tuple summary 2025-01-10 22:21:49 -06:00
Walnut
4f595334f5 add alternate inner type lookup for vec/string for missing template args 2025-01-10 22:02:45 -06:00
Walnut
2b8ff7534a add MSVC str providers 2025-01-10 21:47:27 -06:00
Walnut
009994a849 organize lldb_commands 2025-01-10 21:21:44 -06:00
Walnut
c425660858 add msvc enum providers 2025-01-10 21:13:52 -06:00
Walnut
71b6d49282 add MSVC slice providers 2025-01-10 02:02:01 -06:00
Walnut
8b14227aa9 add MSVC tuple providers 2025-01-10 01:53:25 -06:00
Pietro Albini
ee2b8eee38
Revert "fix missing rustfmt and clippy for msi"
This reverts commit f5577a8174.
2025-01-08 14:44:01 +01:00
Jacob Pratt
f3d404a7be
Rollup merge of #134291 - Walnut356:type_annots, r=tgross35
Use python built in type annotations in LLDB visualizer scripts

Replaces type annotation comments with python's built-in type annotations.

Built-in type annotations were added in python 3.5. LLDB [currently recommends (and as of LLVM 21, will enforce)](https://github.com/llvm/llvm-project/pull/114807) a minimum python version of 3.8. Rust's test suite also requires python 3.10.
2024-12-31 03:38:02 -05:00
Walnut
693a0d5dcc use python built in type annotations 2024-12-31 00:53:59 -06:00
ericlehong
a0b3452fb5 Fix typos
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-30 21:43:22 +08:00
clubby789
4fd3baaf70 Add --no-capture as a bootstrap argument 2024-12-27 11:52:01 +00:00
Ryan Mehri
bc1737b279 Generate shell completions for x as well 2024-12-17 14:13:05 -07:00
bors
4d669fb34e Auto merge of #133134 - Walnut356:synth_prov, r=Mark-Simulacrum
Don't use a SyntheticProvider for literally every type

Replaces a glob regex with individualized imports for each standard library type. This improves debugger performance by quite a bit when populating lots of values with lots of fields

With the glob, afaik every single value of every single type that the debugger renders is run through a python function that does quite a few string comparisons (i plan to fix those next) to determine the SyntheticProvider to use.  It looks like DefaultSyntheticProvider's functions internally call the liblldb c++ functions, which ends up with identical behavior to not using a SyntheticProvider at all, except you have extra python round trips slowing things down.

These sample vidoes were run on x86-64-pc-windows-gnu. `vect` is a 1000 element `Vec<Big>`, `Big` contains a dozen or so `Small`, and `Small` contains a dozen or so `[i32; 5]`

Before:

https://github.com/user-attachments/assets/07c31fe7-e126-4c2e-8ae9-cfe36e351d3f

After:

https://github.com/user-attachments/assets/6c0d1a45-1ffe-46de-95a0-5dbe59a173b5

---

try-job: aarch64-apple
2024-12-08 19:30:33 +00:00
Jakub Beránek
536516f949
Reformat Python code with ruff 2024-12-04 23:03:44 +01:00
Ralf Jung
fd13717815 rust_analyzer_settings: force use of 'nightly' toolchain 2024-12-01 22:54:08 +01:00
Walnut
9b4a247190 add explicit synthetic lookup for tuples 2024-11-29 19:19:12 -06:00
Walnut
8ecac88d7a force expanded formatting for non-synthetic types 2024-11-28 08:09:45 -06:00
Matthias Krüger
0b0fda9c96
Rollup merge of #132803 - wangjingcun:master, r=Mark-Simulacrum
Fix broken url
2024-11-25 07:01:40 +01:00
Walnut
673b3d380f restrict synthetic types to standard library types 2024-11-17 09:18:42 -06:00
clubby789
ee877c3265 Bump bootstrap deps 2024-11-13 17:58:04 +00:00
wangjingcun
5e4b33f2b8 Fix broken url
Signed-off-by: wangjingcun <wangjingcun@aliyun.com>
2024-11-11 17:25:29 +08:00
Maybe Lapkin
22069682ed Use a separate dir for r-a builds consistently in helix config 2024-11-09 01:27:29 +01:00
Matthias Krüger
4b7bfaaf69
Rollup merge of #132333 - tshepang:patch-4, r=workingjubilee
rust_analyzer_helix.toml: add library/ manifest
2024-11-02 08:33:11 +01:00
yukang
b6a49d8969 Remove unncessary option for default rust-analyzer setting 2024-11-01 13:11:51 +08:00
Tshepang Mbambo
ee4b0445d3 rust_analyzer_helix.toml: add library/ manifest
Also, sort list
2024-10-29 23:57:52 +02:00
Zalathar
6f82a95298 Rename command-list.rs to directive-list.rs 2024-10-29 17:39:13 +11:00
jyn
d792e1f50a remove dead code in CGREP script 2024-10-27 21:23:28 -04:00
Matthias Krüger
17ac4c8fb5
Rollup merge of #131365 - heiseish:fix-issue-101993, r=Mark-Simulacrum
Fix missing rustfmt in msi installer #101993

# Context
- Fixed missing `rustfmt`, `clippy`, `miri` and `rust-analyzer` in msi installer
- Fixed missing `rustfmt` for apple darwin installer
- Closes #101993

r​? `@jyn514`
- Please let me know if I should request from someone else instead. I divided the changes into 3 separate commits for the ease of review. The refactoring commit `fbdfd5c03c3c979bcf105ccdd05ff4ab9f37a763` is a bit more involved, but I think it helps in the long term for readability and to avoid bugs.
- I changed `build-manifest` to `build_manifest` in order to invoke it as a library. Not sure if this is gonna break any upstream processes. I checked `generate-manifest-list` and `generate-release` but didn't find any obvious reference
- Will push fixes for linting later
2024-10-20 16:54:09 +02:00
Giang Dao
f5577a8174 fix missing rustfmt and clippy for msi 2024-10-15 23:53:24 +08:00
Jonathan Dönszelmann
0a9c87b1f5
rename RcBox in other places too 2024-10-11 10:04:22 +02:00
Kajetan Puchalski
456be106b7
bootstrap: Consolidate editor LSP setup
Consolidate LSP setup for different editors into one `./x setup editor`.
2024-10-03 15:22:44 +01:00
Kajetan Puchalski
9b24fae0be
bootstrap: Add support for ./x setup vim 2024-10-01 12:59:57 +01:00
Kajetan Puchalski
dfc7e396a6
bootstrap: Add support for ./x setup helix 2024-10-01 12:59:55 +01:00
Kajetan Puchalski
c53d4c78ad
bootstrap: Add support for ./x setup emacs
Add support for automatically setting up the recommended
LSP config for Emacs.

Additionally, refactor setup.rs to make it easier to add support
for more editors in the future.
2024-10-01 12:59:52 +01:00
Matthias Krüger
243c6d67ff
Rollup merge of #130932 - mrkajetanp:editors, r=jieyouxu
etc: Add sample rust-analyzer configs for eglot & helix

LSP configuration in editors like Emacs (eglot) and helix does not
use the same JSON format as vscode and vim do. It is not obvious
how to set up LSP for rustc in those editors and the dev guide currently
does not cover them. Adding sample configuration files for those editors
alongside the currently existing JSON one would be helpful.

I figured having those included in the repo like the JSON one might save
someone some time and frustration otherwise spent on trying to get the
more niche editors' LSP to work properly. I'll add a section in the dev
guide too.
2024-09-27 21:35:10 +02:00
Kajetan Puchalski
6453f7e514
etc: Add rust-analyzer configs for eglot & helix
LSP configuration in editors like Emacs (eglot) and helix does not
use the same JSON format as vscode and vim do. It is not obvious
how to set up LSP for rustc in those editors and the dev guide currently
does not cover them. Adding sample configuration files for those editors
alongside the currently existing JSON one would be helpful.
2024-09-27 17:28:19 +01:00