Skip to content

Conversation

@lnicola
Copy link
Member

@lnicola lnicola commented Dec 1, 2025

Subtree update of rust-analyzer to rust-lang/rust-analyzer@d646b23.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost

ChayimFriedman2 and others added 30 commits July 10, 2025 01:22
Instead of the hygiene what happens to be in the same fake range.
Because, as it turns out, this is necessary to determine the correct edition (it is not global).

The next commits will make use of it.
Example
---
```rust
let arg_list = make::arg_list([make::expr_literal("1").into(), make::expr_literal("2").into()]);
let mut editor = SyntaxEditor::new(arg_list.syntax().clone());
let target_expr = make::expr_literal("3").clone_for_update();

for arg in arg_list.args() {
    editor.replace(arg.syntax(), target_expr.syntax());
}

let edit = editor.finish();
let expect = expect![["(3, 3)"]];
expect.assert_eq(&edit.new_root.to_string());
```

**Before this PR**

```text
(, )3
```

**After this PR**

```text
(3, 3)
```
Previously we didn't set the enclosing position on definitions, so
SCIP consumers didn't know the position of the entire definition that
provides the symbol.
Example
---
```rust
extern "C" $0
```

**Before this PR**

Can't be completion

**After this PR**

```text
kw async
kw const
kw enum
kw fn
kw impl
kw impl for
kw mod
kw pub
kw pub(crate)
kw pub(super)
kw static
kw struct
kw trait
kw type
kw union
kw unsafe
kw use
```

---

```rust
extern $0
```

**Before this PR**

Can't be completion

**After this PR**

```rust
extern crate $0;
```
Via separate methods.

This is both more clear, shorter, and will be required for the next commit.
Lang items rarely change, so putting a query for each doesn't give us anything. On the other hand, putting them behind only one query not only saves memory, it also has a giant benefit: we can store the struct with all lang items in the interner, making access to them very cheap. That basically means that anything in the hot path can avoid a *very common* query, and exchange it for a simple field access.
…-crate-comp

Fix complete after `extern`, add `crate` completion
feature: Set enclosing_range field on SCIP output
What a single operator precedence can do :)
fix: Don't run cache priming when disabled in settings
…ken-edition

fix: Use per-token, not global, edition in the parser
…hygiene

fix: Use root hygiene for speculative resolution
…rules

This was hard to do because of the separation between `mbe` and `hir-expand`, but became possible by the Salsa migration, as now `SyntaxContext` doesn't require `ExpandDatabase`, `salsa::Database` is enough.
It tests the opposite of the correct behavior.
fix: Pass the correct per-token (not global) edition when expanding macro_rules
proc-macro-srv: Fix unnecessary subtree wrapping in protocol
…ate-changed

Fix syntax_editor duplicated changed element
VS Code only offers a dropdown if a the toplevel property description
is `enum`. For `anyOf` (a JSON schema feature), we don't get that
helpful UI.

Whilst the previous version marked `preserve` as deprecated, the VS
Code UI didn't do anything special when users chose that value.

Instead, use an enum so we get the helpful dropdown, and just use the
description to highlight the deprecated value.

Relevant docs:

https://code.visualstudio.com/api/references/contribution-points#:~:text=The%20enumDescriptions%20property%20provides%20a,will%20be%20parsed%20as%20Markdown.

https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-01#section-10.2.1.2
fix Display scope inlay hints after closing brace for more types of blocks rust-lang#18833
…ropdown

fix: rust-analyzer.imports.granularity.group should get a dropdown UI
ChayimFriedman2 and others added 15 commits November 29, 2025 18:52
Turns out, we need to elaborate supertrait projections, and the logic isn't trivial either!
…feature

fix: Support multiple `enable` in `#[target_feature]`
…ctions

fix: Rewrite dyn trait lowering to follow rustc
Turns out we're not using it anymore.
internal: Remove the block from `DbInterner`
I missed a ["__0"] to access the str in the Static case.

Also, simplify the code to rely on the pretty printer for str
rather than accessing data_ptr/length directly. This makes it
more robust against changes in str.

Output before: "<SmolStr Static error: There is no member named data_ptr.>"
Output after: "preferred-width"
gdb pretty printer: fix printing when using Repr::Static
internal: Ensure proc-macro-api version check works with postcard across protocol versions
@rustbot
Copy link
Collaborator

rustbot commented Dec 1, 2025

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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. labels Dec 1, 2025
@lnicola
Copy link
Member Author

lnicola commented Dec 1, 2025

@bors r+ p=2 help some proc macro server changes catch the train

@bors
Copy link
Collaborator

bors commented Dec 1, 2025

📌 Commit b35a995 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 Dec 1, 2025
@lnicola
Copy link
Member Author

lnicola commented Dec 1, 2025

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 1, 2025
@rust-log-analyzer

This comment has been minimized.

@lnicola lnicola closed this Dec 1, 2025
@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Dec 1, 2025
@lnicola lnicola deleted the sync-from-ra branch December 1, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.