Skip to content

Subtree update of rust-analyzer #131832

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

Merged
merged 59 commits into from
Oct 17, 2024
Merged

Subtree update of rust-analyzer #131832

merged 59 commits into from
Oct 17, 2024

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Oct 17, 2024

r? @ghost

CryZe and others added 30 commits September 19, 2024 22:00
Async blocks act similar to async functions in that the await keywords
are related, but also act like functions where the exit points are
related.
Just like we don't check for types containing unknown.
When providing a custom rustfmt command, join it with the project
root instead of the workspace root. This fixes rust-analyzer
getting the wrong invocation path in projects containing subprojects.

This makes the behaviour consistent with how a custom path provided
in rust-analyzer.procMacro.server behaves already.

Resolves issue rust-lang#18222
before, when formatting struct constructor for `struct S(usize, usize)` it would format as:

    extern "rust-call" S(usize, usize) -> S

but after this change, we'll format as:

    fn S(usize, usize) -> S
This ensures that when being on an `await` token, it still only
highlights the yield points and not the exit points.
…-formatting, r=flodiebold

hir-ty: change struct + enum variant constructor formatting.

before, when formatting struct constructor for `struct S(usize, usize)` it would format as:

    extern "rust-call" S(usize, usize) -> S

but after this change, we'll format as:

    fn S(usize, usize) -> S

likewise the second commit, also makes this uniform for enum variants as well.

fixes rust-lang#18259
fix: Fix `prettify_macro_expansion()` when the node isn't the whole file

Fixes rust-lang#18238.
…Veykril

lsp: fix completion_item something_to_resolve not being a latch to true

while looking at rust-lang#18245 i noticed that `something_to_resolve` could technically flap between true -> false if some subsequent fields that were requested to be resolved were empty.

this fixes that by using `|=` instead of `=` when assigning to `something_to_resolve` which will prevent it from going back to false once set.

although some cases it's simply assigning to `true` i opted to continue to use `|=` there for uniformity sake. but happy to change those back to `=`'s.

cc `@SomeoneToIgnore`
fix: include description in label details when detail field is marked for …

Fixes rust-lang/rust-analyzer#18231.

When omitting the autocomplete detail field, the autocomplete label details can still be returned. Currently the label details are missing the description field if the detail field is included in resolveSupport since it is being overwritten as None and opted to be sent with `completionItem/resolve`.

Example completion capabilities.
```
completion = {
    completionItem = {
        commitCharactersSupport = true,
        deprecatedSupport = true,
        documentationFormat = { "markdown", "plaintext" },
        insertReplaceSupport = true,
        insertTextModeSupport = {
            valueSet = { 1, 2 }
        },
        labelDetailsSupport = true,
        preselectSupport = true,
        resolveSupport = {
            properties = { "documentation", "detail", "additionalTextEdits", "sortText", "filterText", "insertText", "textEdit", "insertTextFormat", "insertTextMode" }
        },
        snippetSupport = true,
        tagSupport = {
            valueSet = { 1 }
        }
}
```
…nicola

Fix panic when json project has relative buildfile paths

The `build_file` path may be relative to the workspace root.
Run subprocesses async in vscode extension

Extensions should not block the vscode extension host. Replace uses of `spawnSync` with `spawnAsync`, a convenience wrapper around `spawn`.

These `spawnSync`s are unlikely to cause a real issue in practice, because they spawn very short-lived processes, so we aren't blocking for very long. That said, blocking the extension host is poor practice, and if they _do_ block for too long for whatever reason, vscode becomes useless.
bors and others added 17 commits October 14, 2024 14:20
…puqv, r=davidbarsky

chore: rename `salsa` to `ra_salsa`

Laying some groundwork to start before I import the new Salsa crate. Here's why:
1. As part of the migration, `@darichey,` `@Wilfred,` and I will create new Salsa equivalents of the existing databases/query groups. We'll get them to compile crate-by-crate.
2. Once we wrote all equivalents of all queries, we'd start to refactor usage sites of the vendored Salsa to use the new Salsa databases.
3. Starting porting usage sites of old Salsa to the new Salsa.
4. Remove the vendored `ra_salsa`; declare victory.
feat: handle self-param outside of methods when renaming

close rust-lang#17427
…=davidbarsky

minor: `ra-salsa` in `profile.dev.package`

Since `ra-salsa`'s package name is actually `salsa` it makes the following warning in `cargo` commands;

```
warning: profile package spec `ra-salsa` in profile `dev` did not match any packages
```

and the opt level isn't applied to it.
fix: incorrect autofix for missing wrapped unit in return expr

fix rust-lang#18298.

We should insert `Ok(())` or `Some(())` instead of wrapping `return` with variants.
Do not consider match/let/ref of place that evaluates to ! to diverge, disallow coercions from them too

Resolves rust-lang#18237
When debugging rust-analyzer and looking at logs, it's much easier to read
when the timestamp is in the local timezone.

Before:

    2024-08-28T20:55:38.792321Z  INFO ParseQuery: invoked at R18460

After:

    2024-08-28T13:55:38.792321-07:00  INFO ParseQuery: invoked at R18460
internal: Use local time when formatting logs

When debugging rust-analyzer and looking at logs, it's much easier to read when the timestamp is in the local timezone.

Before:

    2024-08-28T20:55:38.792321Z  INFO ParseQuery: invoked at R18460

After:

    2024-08-28T13:55:38.792321-07:00  INFO ParseQuery: invoked at R18460
Bump version of scip crate

Follow up to sourcegraph/scip#284

Manually verified that SCIP generation works OK for rust-analyzer itself.

cc `@RalfJung`
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 17, 2024
@rustbot
Copy link
Collaborator

rustbot commented Oct 17, 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 Oct 17, 2024

@bors r+ p=1 subtree update

@bors
Copy link
Collaborator

bors commented Oct 17, 2024

📌 Commit e09bf4c 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 Oct 17, 2024
@bors
Copy link
Collaborator

bors commented Oct 17, 2024

⌛ Testing commit e09bf4c with merge 3a85d3f...

@bors
Copy link
Collaborator

bors commented Oct 17, 2024

☀️ Test successful - checks-actions
Approved by: lnicola
Pushing 3a85d3f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Oct 17, 2024
@bors bors merged commit 3a85d3f into rust-lang:master Oct 17, 2024
7 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Oct 17, 2024
@lnicola lnicola deleted the sync-from-ra branch October 17, 2024 17:15
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3a85d3f): 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 (secondary 2.7%)

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.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 781.303s -> 782.574s (0.16%)
Artifact size: 333.79 MiB -> 333.74 MiB (-0.02%)

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.