Skip to content

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Apr 20, 2024

r? @ghost

lnicola and 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"
		}
	]
}
```

Fixes rust-lang#16943 rust-lang#16949
…Veykril

feat: Add `rust-analyzer.cargo.allTargets` to configure passing `--all-targets` to cargo invocations

Closes rust-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.
internal: Fix new nightly clippy lints
fix: silence mismatches involving unresolved projections

fix rust-lang#16801
Veykril and others added 14 commits April 19, 2024 13:22
fix: handle escaped chars in doc comments

fix rust-lang#16980.

For `ast::LiteralKind::String`, store the original string value.
internal: Cleanup cfg and env handling in project-model

Fixes rust-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`

fixes rust-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.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 20, 2024
@rustbot
Copy link
Collaborator

rustbot commented Apr 20, 2024

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
Member Author

lnicola commented Apr 20, 2024

@bors r+ p=1 subtree sync

@bors
Copy link
Collaborator

bors commented Apr 20, 2024

📌 Commit b0a18da has been approved by lnicola

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 20, 2024
@bors
Copy link
Collaborator

bors commented Apr 20, 2024

⌛ Testing commit b0a18da with merge 54692c3...

@bors
Copy link
Collaborator

bors commented Apr 20, 2024

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing 54692c3 to master...

1 similar comment
@bors
Copy link
Collaborator

bors commented Apr 20, 2024

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing 54692c3 to master...

@bors bors added merged-by-bors This PR was explicitly merged by bors. labels Apr 20, 2024
@bors bors merged commit 54692c3 into rust-lang:master Apr 20, 2024
@rustbot rustbot added this to the 1.79.0 milestone Apr 20, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (54692c3): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
4.1% [4.1%, 4.1%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.7% [-0.8%, 4.1%] 2

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 672.886s -> 671.454s (-0.21%)
Artifact size: 315.23 MiB -> 315.20 MiB (-0.01%)

@lnicola lnicola deleted the sync-from-ra branch April 21, 2024 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.