Skip to content
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

⬆️ rust-analyzer #114003

Merged
merged 34 commits into from
Jul 24, 2023
Merged

⬆️ rust-analyzer #114003

merged 34 commits into from
Jul 24, 2023

Conversation

lnicola
Copy link
Member

@lnicola lnicola commented Jul 24, 2023

r? @ghost

lowr and others added 30 commits July 16, 2023 00:01
Currently non-UTF8 escape sequences in byte strings and any escape
sequences in byte literals are ignored.
Use `.kind(Interner)` instead of `.data(Interner).kind`
…cola

internal: remove `crate` visibility modifier

This PR removes `crate` as a now-unaccepted experimental visibility modifier from our parser. This feature has been [unaccepted] and [removed] from rustc more than a year ago, so I don't think this removal affects anyone.

[unaccepted]: rust-lang#53120 (comment)
[removed]: rust-lang#97239
…-follow-up, r=lnicola

Don't follow raw pointer derefs when considering method receiver candidates

In rust-lang/rust-analyzer#15118, I enabled following raw pointer derefs when considering self type candidates. However, I also inadvertently enabled it for receiver type candidates, which is invalid and causes false positives (see new test).
Pass `TraitEnvironment` into `layout_ty` and `const_eval`

We need to do either this or get rid of trait environment in `normalize_ty`. Let's go with this for now.
docs: Add example on how to change configuration options in Kate

closes rust-lang#15305
Lookup super traits in `is_dyn_method`
…extension, r=lnicola

editor/code: [DX] Use notification command links for debugger installation

This PR improves DX (developer experience) when installing the VS Code extension for the first time. When doing so and trying to debug a Rust file, we get an error notification that either CodeLLDB or C++ extension/debugger should be installed (see image below).

<div align="center">
	<img src="https://github.com/rust-lang/rust-analyzer/assets/20957750/e8ebeb1e-85f4-44e2-b79f-c48cf52e5f36" alt="Rust, prompt to install debug extension">
</div>

The PR enhances the links in the given notification and upon clicking instead of opening the Web page of the extension it installs the extension immediately, without the need to leave the editor.

Note: the feature needs to be refined, maybe an "install in progress" message or something similar, I left that for you guys to decide and implement. I think it also possible to first open the sidebar, open the Extensions tab, then run the extension installation command which would make it more user-friendly.

P.S. it is also possible to open the extension's details in VS Code directly via the same links and then the user would have to manually click on the Install button - if installation is not the desired behavior.

Happy coding! 🎉
…r-items, r=HKalbasi

Report `incorrect-ident-case` for inner items

Fixes rust-lang#15319

Although we have been collecting the diagnostics for inner items within function bodies, we were discarding them and never reported to the users. This PR makes sure that they are all reported and additionally collects the diagnostics for inner items within const bodies, static bodies, and enum variant bodies.
We don't need to allocate a `Vec`, nor do we need sorting.
internal: optimize `DepKindInfo` -> `DepKind` conversion

We don't need to allocate a `Vec`, nor do we need sorting.
Normalize expected ty in call arguments

fix rust-lang#15321

I'm not sure if we should do this, or add a normalize in the beginning of `infer_expr_inner`, or somewhere else. r? `@lowr`
limit `change_visibility` assist to applicable items

this pr limits the `change_visibility` assist to applicable items. top level items in this context means items that are not nested within `fn`s or `trait`s.

now
```rs
fn foo {
    // assists on this `struct` keyword won't include `change_visibility`
    struct Bar {}
}

trait Foo {
   // same with the `fn` here
   fn bar();
}
```
To do this change, we reorganize npm-script.

| previous           | after                                  |
|--------------------|----------------------------------------|
| `npm run lint`     | `npm run lint && npm run format:check` |
| `npm run fix`      | `npm run lint:fix && npm run format`   |

The previous `npm run fix` sometimes does not complete fix automatically
because ESLint's autofix doees not follow prettier's formatting.
So we need to run `npm run lint:fix && npm run format` by this order.
bors and others added 4 commits July 22, 2023 16:53
…cola

editor/code: Break down CI steps to know what is failing easily

This do the thing I mentioned in rust-lang/rust-analyzer#15265 (comment)

This aims to improve CI status check more readable.

I tried to use [`jobs.<job_id>.if`](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif) to make the configuration
more shortly once.

But it could not fire the `end-success` or `end-failure` status if some jobs in the workflow were skipped. This causes an integration problem with bors.

By their reasons, this patch still uses `jobs.<job_id>.steps[*].if`.

---

To do this change, we reorganize npm-script.

| previous           | after                                  |
|--------------------|----------------------------------------|
| `npm run lint`     | `npm run lint && npm run format:check` |
| `npm run fix`      | `npm run lint:fix && npm run format`   |

The previous `npm run fix` sometimes does not complete fix automatically because ESLint's autofix doees not follow prettier's formatting. So we need to run `npm run lint:fix && npm run format` by this order.
…lowr

Fix highlighting of byte escape sequences

Currently non-UTF8 escape sequences in byte strings and any escape sequences in byte literals are ignored.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 24, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jul 24, 2023

Some changes occurred in src/tools/rust-analyzer

cc @rust-lang/rust-analyzer

@lnicola
Copy link
Member Author

lnicola commented Jul 24, 2023

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Jul 24, 2023

📌 Commit 6a94418 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 Jul 24, 2023
@bors
Copy link
Contributor

bors commented Jul 24, 2023

⌛ Testing commit 6a94418 with merge ced592a...

@bors
Copy link
Contributor

bors commented Jul 24, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 24, 2023
@bors bors merged commit ced592a into rust-lang:master Jul 24, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 24, 2023
@lnicola lnicola deleted the sync-from-ra branch July 24, 2023 11:30
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ced592a): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.3% [-0.3%, -0.2%] 2
All ❌✅ (primary) - - 0

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

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: 652.237s -> 650.993s (-0.19%)

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.