Skip to content

Subtree update of rust-analyzer - #124199

Closed
lnicola wants to merge 156 commits into
rust-lang:masterfrom
lnicola:sync-from-ra
Closed

Subtree update of rust-analyzer#124199
lnicola wants to merge 156 commits into
rust-lang:masterfrom
lnicola:sync-from-ra

Conversation

@lnicola

Copy link
Copy Markdown
Member

lnicolaand others added 30 commits January 4, 2024 18:31
update: add editor/extension information to bug report template
When attempting to reproduce issues, I encounter difficulties due to differences in versions of LSP clients and editors (such as rust-lang#16985, rust-lang#16867, and more)
This sometimes consumes a lot of efforts from contributors to communicate the details about LSP client information. Therefore, I believe adding editor/extension information to the issue template would be helpful for problem reproduction.
Fix tasks in tasks.json
rust-lang#16839 refactored the representation of tasks inside the VS Code extension. However, this data type is exposed to users, who can define their own tasks in the same format in `tasks.json` or `.code-workspace`.
Revert the data type to have a `command` field rather than a `program` field, and document the different fields. This code is also a little complex, so split out a `cargoToExecution` to handle the Task to Execution conversion logic.
After this change, any tasks.json with a `command` field works again. For example, the following tasks.json works as expected:
```
{
"version": "2.0.0",
"tasks": [
{
"type": "cargo",
"command": "build",
"problemMatcher": [
"$rustc"
],
"group": "build",
"label": "my example cargo build task"
}
]
}
```
Fixesrust-lang#16943rust-lang#16949
…Veykril
feat: Add `rust-analyzer.cargo.allTargets` to configure passing `--all-targets` to cargo invocations
Closesrust-lang#16859
## Unresolved question:
Should this be a setting for build scripts only ? All the other `--all-targets` I found where already covered by `checkOnSave.allTargets`
Fix crate IDs when multiple workspaces are loaded
Previously, we assumed that the crate numbers in a `rust-project.json` always matched the `CrateId` values in the crate graph. This isn't true when there are multiple workspaces, because the crate graphs are merged and the `CrateId` values in the merged graph are different.
This broke flycheck (see first commit), because we were unable to find the workspace when a file changed, so we every single flycheck, producing duplicate compilation errors.
Instead, use the crate root module path to look up the relevant flycheck. This makes `ProjectWorkspace::Json` consistenet with `ProjectWorkspace::Cargo`.
Also, define a separate JSON crate number type, to prevent bugs like this happening again.
pattern analysis: Use contiguous indices for enum variants
The main blocker to using the in-tree version of the `pattern_analysis` crate is that rustc requires enum indices to be contiguous because it uses `IndexVec`/`BitSet` for performance. Currently we swap these out for `FxHashMap`/`FxHashSet` when the `rustc` feature is off, but we can't do that if we use the in-tree crate.
This PR solves the problem by using contiguous indices on the r-a side too.
fix: silence mismatches involving unresolved projections
fixrust-lang#16801
Veykriland others added 19 commits April 19, 2024 09:27
…=Veykril
feat: Add convert From to TryFrom assist
Adds a new code assist to convert a `From` impl into a `TryFrom` impl.
This is useful in situations where it turns out after or halfway through writing a `From` implementation that the conversion is actually fallible.
## Example
https://github.com/rust-lang/rust-analyzer/assets/26360861/872ec7c4-c9ff-451c-9453-4baaaad47326
fix: handle escaped chars in doc comments
fixrust-lang#16980.
For `ast::LiteralKind::String`, store the original string value.
internal: Cleanup cfg and env handling in project-model
Fixesrust-lang/rust-analyzer#16122 (comment)
`miri` and `debug_assertions` are now enabled via the `cargo.cfgs` config by default, allowing them to be disabled by overwriting the config.
…rsion-of-node-in-metrics-yml, r=lnicola
fix: usage of `deprecated` version of `Node.js`
fixesrust-lang#17103.
Cargo script mvp
Based on rust-lang/rust-analyzer#15456,
As the original PR stated, detached files are still horrendous to work with.
@rustbotrustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 20, 2024
@rustbot

Copy link
Copy Markdown
Collaborator

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

@lnicola

Copy link
Copy Markdown
MemberAuthor

CC @RalfJung

@rust-log-analyzer

This comment has been minimized.

@lnicola

Copy link
Copy Markdown
MemberAuthor

I'm a bit worried about the extra commit causing issues, I'll wait for rust-lang/rust-analyzer#17114.

@lnicolalnicola closed this Apr 20, 2024
bors added a commit to rust-lang/rust-analyzer that referenced this pull request Apr 20, 2024
@RalfJung

RalfJung commented Apr 20, 2024 via email

Copy link
Copy Markdown
Member

@lnicola

Copy link
Copy Markdown
MemberAuthor

Never had issues with these and git-subtree (it's indeed just an extra commit), but it feels safer this way.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

20 participants

@lnicola@rustbot@rust-log-analyzer@RalfJung@wyatt-herkamp@poliorcetics@Wilfred@bors@roife@Nadrieril@Veykril@mrnossiom@krobelus@hkalbasi@ShoyuVanilla@ColinKinloch@Kohei316@Urhengulas@davidsemakula@alibektas