-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
rust-analyzer subtree update
#151751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
rust-analyzer subtree update
#151751
Conversation
Fix not applicable in statement when exist else block
Example
---
```rust
fn main() {
some_statements();
if$0 let Ok(x) = Err(92) {
foo(x);
} else {
return;
}
some_statements();
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
fn main() {
some_statements();
let Ok(x) = Err(92) else {
return;
};
foo(x);
some_statements();
}
```
Add proper line/column resolution for proc-macro spans via a callback mechanism. Previously these methods returned hardcoded 1 values. The implementation adds: - SubRequest::LineColumn and SubResponse::LineColumnResult to the bidirectional protocol - ProcMacroClientInterface::line_column() method - Callback handling in load-cargo using LineIndex - Server implementation in RaSpanServer that uses the callback - a test for Span::line() and Span::column() in proc-macro server Add fn_like_span_line_column test proc-macro that exercises the new line/column API, and a corresponding test with a mock callback.
Implement Span::line() and Span::column() for proc-macro server
perf: Re-use scratch allocations for `try_evaluate_obligations`
Example
---
```rust
fn main() {
let cond = true;
match 92 {
3 => true,
x if cond => if x $0> 10 {
false
} else if x > 5 {
true
} else if x > 4 || x < -2 {
false
} else {
true
},
}
}
```
**Before this PR**
```rust
fn main() {
let cond = true;
match 92 {
3 => true,
x if x > 10 => false,
x if x > 5 => true,
x if x > 4 || x < -2 => false,
x => true,
}
}
```
**After this PR**
```rust
fn main() {
let cond = true;
match 92 {
3 => true,
x if cond && x > 10 => false,
x if cond && x > 5 => true,
x if cond && (x > 4 || x < -2) => false,
x if cond => true,
}
}
```
fix: Suggest traits other than ones in the environment crate
Needed to support flychecking in a later diff
Needed for all_workspace_dependencies_for_package implementation.
This exited the whole loop instead of having continue semantics and continuing to find workspaces. So wrap in find_map.
You should be able to flycheck a ProjectJson crate based on its build label. This paves the way for that. Context: I don't think this has been working for some time. It used to be that we would use cargo to build ProjectJson crates. Support for ProjectJson seems to have been somewhat steamrolled in PR 18845 (e4bf6e1bc36e4cbc8a36d7911788176eb9fac76e).
We need to distinguish from RunnableKind::Check, which is human-readable.
This adds a substitution helper to get the right behaviour re {label} and $saved_file.
… rust-project.json
This requires us to add $saved_file / {saved_file} interpolation back to restart_for_package.
Otherwise we break existing users of $saved_file. No grand reason why we can't delete saved_file
later, although I would just leave it because sometimes a build system might really know better
which target(s) to build, including multiple targets.
…run in a notification
…roject.json runnable For JSON / override users, pretty-print the custom flycheck command with fewer quote characters Better debug logging in flycheck
Because (1) it is what we use when there is no relevant config
(2) we automatically use either rust-project.json's flycheck, or cargo
This also puts check_command config into CargoOptions. It's a cargo option, after all.
It was pretty useless without this.
Previously:
Parsing target pattern `{label}`
Caused by:
Invalid target name `{label}`. (...)
Build ID: 6dab5942-d81c-4430-83b0-5ba523999050
Network: Up: 0B Down: 0B
Command: run.
Time elapsed: 0.3s
BUILD FAILED
* The terminal process "buck2 'run', '{label}'" terminated with exit code: 3.
rust-project requires {arg} these days. No good giving people bad information
even if it's not crucial to documenting this.
I am not familiar with this code at allso just doing what I can to unblock.
Pull recent changes from https://github.com/rust-lang/rust via Josh. Upstream ref: 94a0cd1 Filtered ref: 1b46aa0fdb1e825363174ce509e40466cc0af416 Upstream diff: rust-lang/rust@004d710...94a0cd1 This merge was created using https://github.com/rust-lang/josh-sync.
minor: Sync from downstream
|
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
|
@bors r+ p=1 subtree sync |
This comment has been minimized.
This comment has been minimized.
|
@bors r- |
|
Commit 2c0a0bb has been unapproved. |
|
@bors r+ |
`rust-analyzer` subtree update Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@40cda2f. Created using https://github.com/rust-lang/josh-sync. r? @ghost
Rollup of 6 pull requests Successful merges: - #151751 (`rust-analyzer` subtree update) - #150893 (offload: move (un)register lib into global_ctors) - #151013 (Add some clarifications and fixes for fmt syntax) - #151666 (compiler: Rename several types/traits for per-query vtables) - #151738 (Add `extern crate core` to diagnostic tests) - #151759 (Update `browser-ui-test` version to `0.23.3`)
|
⌛ Testing commit d400dca with merge d990861... Workflow: https://github.com/rust-lang/rust/actions/runs/21416826796 |
`rust-analyzer` subtree update Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@40cda2f. Created using https://github.com/rust-lang/josh-sync. r? @ghost
|
Commit d400dca has been unapproved. Auto build cancelled due to unapproval. Cancelled workflows: |
Subtree update of
rust-analyzerto rust-lang/rust-analyzer@40cda2f.Created using https://github.com/rust-lang/josh-sync.
r? @ghost