Commit Graph

27278 Commits

Author SHA1 Message Date
David Barsky
251b14f2c5 internal: don't panic in debug_pat 2024-01-31 13:00:30 -05:00
David Barsky
17d2e8d910 internal: remove tracing/mod.rs 2024-01-30 13:37:27 -05:00
bors
d923d620f2 Auto merge of #16394 - davidbarsky:david/add-more-tracing-spans, r=Veykril
internal: add some `tracing` to {Request, Notification}Dispatch

Some of the tracing config would need to be changed in order to benefit more from this (especially `.with_span_events(FmtSpan::CLOSE)`), which provides span events like the following:

```
2024-01-18T02:41:06.675779Z  INFO request{method="textDocument/codeLens" request_id=RequestId(I32(17))}: rust_analyzer::dispatch: close time.busy=61.8µs time.idle=5.29µs
```

I dunno if y'all need `LoggerFormatter` in here, but if you don't, I'd be happy to yeet it out of rust-analyzer. In any case, this provided a pretty decent amount of information in the logs, and I can expand this as needed or we can land this PR and expand later.
2024-01-30 17:42:47 +00:00
David Barsky
e1ea7c8844 internal: switch to tracing from log
This commit also adds `tracing` to NotificationDispatcher/RequestDispatcher,
bumps `rust-analyzer-salsa` to 0.17.0-pre.6, `always-assert` to 0.2, and
removes the homegrown `hprof` implementation in favor of a vendored
tracing-span-tree.
2024-01-30 12:27:31 -05:00
bors
63123ab408 Auto merge of #16417 - davidsemakula:normalize-use-trees, r=Veykril
feat: "Normalize import" assist and utilities for normalizing use trees

- Add import/use tree normalization utilities
- Add "normalize import" assist
- Update "merge imports" assist to always apply to the covering use item except for nested use tree selections
- Update "merge imports" assist to avoid adding unnecessary braces when merging nested use tree selections

See [this discussion](https://github.com/rust-lang/rust-analyzer/pull/16372#discussion_r1457244321) for the motivation for the new "normalize import" assist and changes to the "merge imports" assist.
2024-01-30 14:55:08 +00:00
bors
da4d5f8f29 Auto merge of #16413 - Urhengulas:clippy-ci, r=Veykril
internal: Add `clippy` to CI

Follow-up to #16401
2024-01-30 14:41:43 +00:00
Johann Hemmann
43b1ae0446 cargo clippy --fix 2024-01-30 14:50:21 +01:00
Johann Hemmann
628f70156e CI: Don't deny clippy warnings
We configure that in the lint table in `Cargo.toml`.
2024-01-30 14:44:44 +01:00
Johann Hemmann
73c7c729c5 CI: add clippy 2024-01-30 14:44:44 +01:00
Johann Hemmann
75a42f1a09 collapsible_if 2024-01-30 14:44:44 +01:00
davidsemakula
dba3fc4425 style: remove unnecessary macro 2024-01-30 16:15:15 +03:00
bors
11b401d0b4 Auto merge of #16447 - Veykril:mir-errors, r=Veykril
intenral: Cleanup error variants in MIR code a bit
2024-01-30 11:38:41 +00:00
bors
22b6f9679d Auto merge of #16439 - wasd96040501:feat/gotodef3, r=Veykril
feat: Support for GOTO def from *inside* files included with include! macro

close #14937
Try to implement goto def from *inside* files included with include! macro.
This implementation has two limitations:
1. Only **one** file which calls include! will be tracked. (I think multiple file be included is a rare case and we may let it go for now)
2. Mapping token from included file to macro call file (semantics.rs:646~658) works fine but I am not sure is this the correct way to implement.
2024-01-30 11:27:18 +00:00
Lukas Wirth
5860763f18 Cleanup error variants in MIR code slightly 2024-01-30 09:53:39 +01:00
bors
d13951f25c Auto merge of #15730 - Alainx277:let-else-postfix, r=Veykril
Add postfix completion for let else

Adds a postfix completion for let else syntax, similar to the if let postfix.
2024-01-29 14:57:38 +00:00
davidsemakula
84e13145ff add more tests for normalize import assist 2024-01-28 11:55:01 +03:00
davidsemakula
fc00602723 merge imports assist avoids adding unnecessary braces when merging nested use tree selections 2024-01-28 11:55:01 +03:00
davidsemakula
b241593f36 merge imports assist always applies to covering use item except for nested use tree selections 2024-01-28 11:55:01 +03:00
davidsemakula
a8a18f3ccf add normalize import assist 2024-01-28 11:55:01 +03:00
davidsemakula
81d713ea9f remove ordered insert logic from recursive merge function 2024-01-28 11:55:01 +03:00
davidsemakula
8fab92feb2 normalize use trees when merging imports 2024-01-28 11:55:01 +03:00
YangzeLuo
b22e772cab feat: Support for GOTO def from *inside* files included with include! macro 2024-01-27 23:36:01 +08:00
Alain Siegrist
7ec32d091a Remove letelse control flow snippets 2024-01-27 14:35:22 +01:00
Alain Siegrist
51d57b9bb6 Make return a snippet 2024-01-27 14:35:22 +01:00
Alain Siegrist
57934ac47a Add postfix completion for let else 2024-01-27 14:35:22 +01:00
davidsemakula
da798bccf7 make ast::UseTree::wrap_in_tree_list more robust 2024-01-27 14:22:16 +03:00
bors
7219414e81 Auto merge of #16427 - Young-Flash:fix_no_such_field_diagnostics, r=Veykril
fix: filter out cfg disabled filed when lowering `RecordPat`

we should filter out field with disabled cfg when lowering ast `RecordPat` to hir.

close https://github.com/rust-lang/rust-analyzer/issues/16169
2024-01-27 10:52:36 +00:00
bors
27c3ed9de8 Auto merge of #16434 - Veykril:things, r=Veykril
internal: Restructure and cleanup hir-expand a bit
2024-01-27 10:16:35 +00:00
Lukas Wirth
8a5829cf28 Re-order mod declarations 2024-01-27 11:02:34 +01:00
bors
4a23744d7d Auto merge of #16435 - SomeoneToIgnore:less_resolve_data, r=lnicola
Do not return code lens data after resolving
2024-01-27 07:20:31 +00:00
Kirill Bulatov
ad5e2cfa3b Do not return code lens data after resolving 2024-01-27 02:03:15 +02:00
Lukas Wirth
6cf7b5f8d7 Don't parse intra doc links as syntax trees 2024-01-26 20:00:47 +01:00
bors
596e5c77cf Auto merge of #16431 - Ar4ys:fix-E0107-error-range-in-proc-macro, r=Veykril
Replaced adjusted_display_range with adjusted_display_range_new in mismatched_arg_count

For detailed description - see related issue.

Fixes: #16407
2024-01-26 18:53:03 +00:00
Lukas Wirth
5a343415e8 Add some size assertions 2024-01-26 19:28:39 +01:00
Lukas Wirth
d8ef6c24cc Cleanup convert_path 2024-01-26 19:28:39 +01:00
Lukas Wirth
880baa9e56 Shuffle hir-expand things around 2024-01-26 19:28:39 +01:00
Lukas Wirth
e320004dad Remove tt -> ast -> tt round trips in attrs lowering 2024-01-26 19:28:39 +01:00
bors
f09020567e Auto merge of #16415 - Waqar144:work/make-try-to-nav-pub, r=Veykril
internal: Make TryToNav trait public

Currently there is no proper way to get a target FileRange for a given Definition.
2024-01-26 07:48:37 +00:00
Ar4ys
8f05e7ce55 Replaced adjusted_display_range with it's new version in mismatched_arg_count 2024-01-25 20:15:46 +01:00
Young-Flash
1374bc8c93 test: ensure no_such_field diagnostic don't work for field with disabled cfg 2024-01-25 19:30:04 +08:00
Young-Flash
4505f03fbf fix: filter out cfg disabled filed when lowering RecordPat 2024-01-25 19:27:37 +08:00
bors
38f7a3498e Auto merge of #16426 - lnicola:bump-rustc, r=lnicola
minor: Bump rustc crates

This also reverts the earlier revert.
2024-01-25 04:49:36 +00:00
Laurențiu Nicola
ea94c10db0 Bump rustc_index and rustc_abi 2024-01-25 06:44:13 +02:00
Laurențiu Nicola
b1b99cbcf9 Bump rustc_lexer and rustc_parse_format 2024-01-25 06:42:48 +02:00
Laurențiu Nicola
b1b6e0c41a Reapply "Detect NulInCStr error earlier."
This reverts commit 0ea056552a.
2024-01-25 06:40:07 +02:00
bors
0d52934d19 Auto merge of #16420 - Nadrieril:use-upstream-pattern-analysis, r=Veykril
Use upstream exhaustiveness checker!

Because it has been librarified!

The extra `Apache-2.0 WITH LLVM-exception` license is for `rustc_apfloat`. Also this duplicates `rustc_index` because the other upstream deps are still on an earlier version. They should be bumpable now though. Good thing is that we don't need this new crate to be synchronized with the others, which will make our lives easier.
2024-01-24 14:34:42 +00:00
Nadrieril
2370b70f25 Replace local copy of exhaustiveness checking with upstream librarified version 2024-01-23 15:54:00 +01:00
Waqar Ahmed
231f730e87 internal: Make TryToNav trait public
Currently there is no proper way to get a target FileRange for a given
Definition.
2024-01-22 15:20:58 +05:00
bors
d410d4a2ba Auto merge of #16412 - lnicola:sync-from-rust, r=lnicola
internal: Sync from downstream
2024-01-21 19:22:25 +00:00
Laurențiu Nicola
56077149df Format code 2024-01-21 21:16:53 +02:00