Commit Graph

24709 Commits

Author SHA1 Message Date
hkalbasi
c26b12d01c Desugar async fn completely 2023-04-04 23:07:38 +03:30
Lukas Wirth
235c909b5b Also panic on status warnings 2023-04-04 19:25:57 +02:00
Lukas Wirth
25635adc00 Show proc-macro spawn errors as status notification warnings 2023-04-04 19:24:50 +02:00
Lukas Wirth
6644fe3441 Error out slow-tests when server loading errors 2023-04-04 19:12:10 +02:00
Lukas Wirth
1d085cf03b Adjust default config for slow-tests 2023-04-04 19:02:10 +02:00
bors
a6464392c1 Auto merge of #14483 - jhgg:fix/generate-delegate-methods-autoderef, r=Veykril
assist: autoderef in generate delegate methods

fixes #14438
2023-04-04 09:35:56 +00:00
Jake Heinz
f6b0c19c56 dedupe by name 2023-04-04 06:57:02 +00:00
Jake Heinz
50b427c0d1 use crate from autoderef ty 2023-04-04 06:54:26 +00:00
Jake Heinz
94e6a6642c assist: autoderef in generate delegate methods 2023-04-04 06:50:20 +00:00
bors
e871540171 Auto merge of #14482 - Veykril:vscode-linking-popup, r=Veykril
fix: Fix relative path creation using the wrong path accessor

This should hopefully fix the other errors with paths people seem to be getting
2023-04-04 06:21:34 +00:00
Lukas Wirth
7989a94391 fix: Fix relative path creation using the wrong path accessor 2023-04-04 08:20:35 +02:00
bors
f070093462 Auto merge of #14481 - Veykril:vscode-linking-popup, r=Veykril
fix: Fix vscode project linking popup buttons being swapped

closes https://github.com/rust-lang/rust-analyzer/issues/14480
2023-04-04 05:55:57 +00:00
Lukas Wirth
4243eeeb2b fix: Fix vscode project linking popup buttons being swapped 2023-04-04 07:55:09 +02:00
hecatia-elegua
170822b018
Add note for future me or others 2023-04-02 16:03:42 +02:00
bors
236576227a Auto merge of #14468 - lowr:patch/expand-macro-bang, r=Veykril
Expand Macro Recursively: don't append "!" to non-bang macro name

When we run `Expand Macro Recursively`, we prepend a comment "Recursive expansion of foo! macro" to the expansion result. I've noticed we unconditionally render the macro name with "!" and, while super subtle, I feel a bit awkward when the macro is either a derive or attribute macro.
2023-04-02 11:36:47 +00:00
Ryo Yoshida
613e008593
Don't append "!" to non-bang macro name 2023-04-02 20:13:34 +09:00
bors
1ebac28f0d Auto merge of #14465 - tamasfe:feat/rtn-syntax, r=Veykril
Limited syntax support for return type notations (RTN)

Experimental RTN bound support was recently merged into rustc (https://github.com/rust-lang/rust/issues/109417), the goal of this PR is to allow experimentation without syntax errors everywhere.

The parsing implemented currently aligns with the state of the tracking issue, it only supports the form `T<foo(..): Bounds>`. The parser always checks for the presence of `..` to disambiguate from `Fn*()` types, this is not ideal but I didn't want to spend too much time as it is an experimental feature.
2023-04-01 16:44:11 +00:00
tamasfe
25910bcde6
chore: replace TODO comment with FIXME 2023-04-01 16:31:16 +02:00
tamasfe
0b9c0c5088
feat(syntax): RTN in bounds
Limited syntactic support for experimental return type notations.
https://github.com/rust-lang/rust/issues/109417
2023-04-01 15:26:03 +02:00
bors
1ce25f114d Auto merge of #14464 - HKalbasi:dev, r=HKalbasi
lower adjusts in simple index except the last one

fix #14463
2023-04-01 13:21:44 +00:00
hkalbasi
d7fe4e2fa8 lower adjusts in simple index except the last one 2023-04-01 16:49:32 +03:30
bors
ffb04ae32d Auto merge of #14461 - HKalbasi:dev, r=Veykril
Use async block in async fn type inference

fix #14456

At some point we should probably go further and completely desugar async fn in hir lowering.
2023-04-01 05:19:36 +00:00
hkalbasi
8a6ca86247 Use async block in async fn type inference 2023-04-01 04:35:28 +03:30
DropDemBits
0a144f7fff
Use bind by-move to get the parent from the match 2023-03-31 17:48:59 -04:00
DropDemBits
afe3dcd3ff
Use retain_mut in CommentBlock::extract 2023-03-31 17:41:40 -04:00
DropDemBits
d689fd30bc
Remove outdated comment in sourcegen
`CommentBlock::extract` does handle blank lines in comment blocks
2023-03-31 14:43:24 -04:00
bors
853fb44a24 Auto merge of #14458 - Veykril:crate-origins, r=Veykril
Cleanup crate_graph construction
2023-03-31 13:01:20 +00:00
Lukas Wirth
b3919ea80d Cleanup crate_graph construction 2023-03-31 14:14:04 +02:00
Jonas Platte
d01a38ce3f
Address second round of review comments 2023-03-31 13:53:57 +02:00
bors
419d59f6e7 Auto merge of #14454 - Veykril:crate-origins, r=Veykril
internal: Refine CrateOrigin variants
2023-03-31 11:19:33 +00:00
Jonas Platte
0e11d507e1
Address review comment 2023-03-31 12:20:08 +02:00
Mathew Horner
3973d1aaa7
Add assist to convert nested function to closure 2023-03-31 12:16:49 +02:00
Lukas Wirth
31db1fc75f internal: Refine CrateOrigin variants 2023-03-31 10:36:13 +02:00
Lukas Wirth
af0d548b66 Fix proc-macro server spawning behavior when the server is r-a itself 2023-03-30 18:59:03 +02:00
bors
42d671fcb7 Auto merge of #14451 - Veykril:bumo-smol-str, r=Veykril
minor: Bump smol_str

Should slightly improve compile times by it now not depending on serde (rowan and syntax in turn not either)
2023-03-30 15:45:16 +00:00
Lukas Wirth
f1c5cb7e48 Bump smol_str 2023-03-30 17:44:12 +02:00
hecatia-elegua
c469936aac Address review comments part 1 2023-03-30 17:35:57 +02:00
bors
d3b129f04f Auto merge of #14444 - zapkub:runable-debug-env-is-not-passing-properly, r=Veykril
Missing runnable env on debug target

Fix bug in Rust Analyzer VSCode where runnable debugging did not pass
environment variable from configuration to child process of Cargo on binary build stage

There is a missing env passing along to `cargo` in debug target which give an in-consistent result from debug and run target

For example
```json
{
    "rust-analyzer.runnableEnv": {
        "OUT_DIR": "/test/path2"
    }
}
```

## run
![image](https://user-images.githubusercontent.com/4373581/228749503-fa55f62c-13d3-4d3c-bee6-1cfbe042bdd0.png)
## debug
compiling binary is failed. Missing env
![image](https://user-images.githubusercontent.com/4373581/228749688-3fe42efb-b5ca-41be-862d-f2d97ecab7be.png)

## debug (after fix)
![image](https://user-images.githubusercontent.com/4373581/228750057-1db60051-3465-47db-8b18-4159ec58cfdb.png)
2023-03-30 13:38:36 +00:00
bors
562477b4da Auto merge of #14439 - Veykril:proc-mac-attr-durability, r=Veykril
internal: Set Durability to HIGH for enable_proc_attr_macros input
2023-03-30 13:21:49 +00:00
Lukas Wirth
e244942209 internal: Set Durability to HIGH for enable_proc_attr_macros input 2023-03-30 15:11:22 +02:00
bors
5c6a38abde Auto merge of #14449 - Veykril:parser-vis-recov, r=Veykril
fix: Recover from `pub()` visibility modifier
2023-03-30 13:08:14 +00:00
bors
5390949c11 Auto merge of #14448 - Veykril:infer-table, r=Veykril
internal: Don't expose InferenceTable outside of hir-ty
2023-03-30 12:49:23 +00:00
bors
02ea92fecb Auto merge of #14445 - Veykril:adt-flags, r=Veykril
internal: Introduce StructFlags
2023-03-30 12:34:37 +00:00
bors
fc8c5139fa Auto merge of #14410 - Veykril:query-lru-capacities, r=Veykril
internal: Add config to specifiy lru capacities for all queries

Might help figuring out what queries should be limited by LRU by default, as currently we only limit `parse`, `parse_macro_expansion` and `macro_expand`.
2023-03-30 12:20:24 +00:00
Lukas Wirth
cb546390da fix: Recover from pub() visibility modifier 2023-03-30 13:42:15 +02:00
Lukas Wirth
fc840dbb2d internal: Don't expose InferenceTable outside of hir-ty 2023-03-30 13:27:10 +02:00
Lukas Wirth
5616d91b73 internal: Add config to specifiy lru capacities for all queries 2023-03-30 12:52:28 +02:00
Lukas Wirth
33b6012827 Introduce StructFlags 2023-03-30 12:49:08 +02:00
bors
b915eb32fa Auto merge of #14427 - davidbarsky:davidbarsky/allow-subsequent-workspaces-to-have-proc-macros, r=Veykril
fix: allow new, subsequent `rust-project.json`-based workspaces to get proc macro expansion

As detailed in https://github.com/rust-lang/rust-analyzer/issues/14417#issuecomment-1485336174, `rust-project.json` workspaces added after the initial `rust-project.json`-based workspace was already indexed by rust-analyzer would not receive procedural macro expansion despite `config.expand_proc_macros` returning true. To fix this issue:
1. I changed `reload.rs` to check which workspaces are newly added.
2. Spawned new procedural macro expansion servers based on the _new_ workspaces.
    1. This is to prevent spawning duplicate procedural macro expansion servers for already existing workspaces. While the overall memory usage of duplicate procedural macro servers is minimal, this is more about the _principle_ of not leaking processes 😅.
3. Launched procedural macro expansion if any workspaces are `rust-project.json`-based _or_ `same_workspaces` is true. `same_workspaces` being true (and reachable) indicates that that build scripts have finished building (in Cargo-based projects), while the build scripts in `rust-project.json`-based projects have _already been built_ by the build system that produced the `rust-project.json`.

I couldn't really think of structuring this code in a better way without engaging with https://github.com/rust-lang/rust-analyzer/issues/7444.
2023-03-30 07:50:27 +00:00
bors
ef7756cb9e Auto merge of #14441 - Veykril:simplify, r=Veykril
minor: Simplify
2023-03-30 07:36:57 +00:00