Commit Graph

1516 Commits

Author SHA1 Message Date
Lukas Wirth
93b09ca067 Update tidy ignore list 2022-03-06 19:18:40 +01:00
Lukas Wirth
ab21cf2f4f internal: Re-arrange ide_db modules 2022-03-06 19:04:04 +01:00
Lukas Wirth
5c0aee013e Fix highlighting of Self 2022-03-05 23:34:37 +01:00
bors[bot]
a2cc1d6b7b
Merge #11538
11538: feat: Make private editable completions configurable, disable by default r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10253
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/9885

This does disable these completions by default, as it seems that people find this behaviour surprising(due to other IDEs usually not doing this).

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-25 21:17:24 +00:00
Lukas Wirth
2a7793d912 feat: Make private editable completions configurable, disable by default 2022-02-25 22:16:40 +01:00
Florian Diebold
f807ccd6c0 Add CSV output to analysis-stats
For easy diffing.
2022-02-25 11:45:44 +01:00
bors[bot]
979b5b32bc
Merge #11455
11455: Handle proc-macro functions as the proc-macro they resolve to r=Veykril a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/11212

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-02-21 16:56:37 +00:00
bors[bot]
b0e293bf69
Merge #11424
11424: Pass required features to cargo when using run action r=Veykril a=WaffleLapkin

When using `F1`->`Rust Analyzer: Run` action on an `example`, pass its `required-features` to `cargo run`. This allows to run examples that were otherwise impossible to run with RA.

Co-authored-by: Maybe Waffle <waffle.lapkin@gmail.com>
2022-02-21 10:21:39 +00:00
Felicián Németh
2bcde5953a Fix a typo in server_capabilities.experimental 2022-02-19 10:58:10 +01:00
doki
94b6038657
correct the description of Struct GlobalState 2022-02-14 19:30:21 +08:00
Felicián Németh
27c4be6b4f fix: add missing experimental capabilities
Fix #11389 by extending server_capabilities.experimental with
matchingBrace, externalDocs, moveItems.  Also, sort entries
alphabetically.
2022-02-12 15:37:13 +01:00
Lukas Wirth
cef8a17ea5 Handle proc-macro functions as the proc-macro they resolve to 2022-02-11 22:06:03 +01:00
Laurențiu Nicola
50a1319f46 Bump lsp-types 2022-02-09 09:22:25 +02:00
Laurențiu Nicola
c8f056a6db Revert "Revert "Bump dashmap""
This reverts commit 39674cd350.
2022-02-09 09:19:57 +02:00
Moritz Vetter
482533ea9a add missing snake case attribute, update hash 2022-02-07 04:57:20 +01:00
Maybe Waffle
662dd7c27d Pass required features to cargo when using run action
When using `F1`->`Rust Analyzer: Run` action on an `example`, pass its
`required-features` to `cargo run`. This allows to run examples that
were otherwise impossible to run with RA.
2022-02-06 19:02:25 +03:00
bors[bot]
0808ade4e4
Merge #11182
11182: fix: don't panic on seeing an unexpected offset r=Veykril a=dimbleby

Intended as a fix, or at least a sticking plaster, for #11081.

I have arranged that [offset()](1ba9a924d7/crates/ide_db/src/line_index.rs (L105-L107)) returns `Option<TextSize>` instead of going out of bounds; other changes are the result of following the compiler after doing this.

Perhaps there's still an issue here - I suppose the server and client have gotten out of sync and that probably shouldn't happen in the first place?  I see that https://github.com/rust-analyzer/rust-analyzer/issues/10138#issuecomment-913727554 suggests what sounds like a more substantial fix which I think might be aimed in this direction.  So perhaps that one should be left open to cover such things?

Meanwhile, I hope that not-crashing is a good improvement: and I can confirm that it works out just fine in the repro I have at #11081.

Co-authored-by: David Hotham <david.hotham@metaswitch.com>
2022-01-31 11:16:22 +00:00
Jonas Schievink
3c51aaf065 Fix merge commit check for git 2.35 2022-01-26 19:10:39 +01:00
bors[bot]
2cb85c14b6
Merge #11281
11281: ide: parallel prime caches r=jonas-schievink a=jhgg

cache priming goes brrrr... the successor to #10149

---

this PR implements a parallel cache priming strategy that uses a topological work queue to feed a pool of worker threads the crates to index in parallel.

## todo
- [x] should we keep the old prime caches?
- [x] we should use num_cpus to detect how many cpus to use to prime caches. should we also expose a config for # of worker CPU threads to use?
- [x] something is wonky with cancellation, need to figure it out before this can merge. 

Co-authored-by: Jake Heinz <jh@discordapp.com>
2022-01-25 16:03:35 +00:00
bors[bot]
e6e72809e3
Merge #11287
11287: fix: rust-analyzer spamming overly error message when workspace not being loaded r=lnicola a=Milo123459

Fixes #10120

Co-authored-by: Milo <50248166+Milo123459@users.noreply.github.com>
2022-01-16 15:13:52 +00:00
Jake Heinz
25f67b6939 make it a config 2022-01-15 02:47:47 +00:00
Milo
e1fe930845 fix overly 2022-01-14 22:06:30 +00:00
Jake Heinz
f83c0166be cleanup + detect num cpus 2022-01-14 09:48:59 +00:00
Jake Heinz
3168148cc6 ide: parallel prime caches 2022-01-14 09:16:35 +00:00
Wang Ruochen
01b3ce3006
Fix documentation of snippet 2022-01-10 21:29:41 -08:00
bors[bot]
40009e07d0
Merge #11145
11145: feat: add config to use reasonable default expression instead of todo! when filling missing fields r=Veykril a=bnjjj

Use `Default::default()` in struct fields when we ask to fill it instead of putting `todo!()` for every fields

before:

```rust
pub enum Other {
    One,
    Two,
}

pub struct Test {
    text: String,
    num: usize,
    other: Other,
}

fn t_test() {
    let test = Test {<|>};
}
``` 

after: 

```rust
pub enum Other {
    One,
    Two,
}

pub struct Test {
    text: String,
    num: usize,
    other: Other,
}

fn t_test() {
    let test = Test {
        text: String::new(),
        num: 0,
        other: todo!(),
    };
}
``` 



Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com>
2022-01-07 14:10:11 +00:00
Benjamin Coenen
8e0a05eb70 feat(diagnostics): use default expression instead of todo! when missing fields
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2022-01-07 15:01:37 +01:00
Benjamin Coenen
b60a29ca94 feat(diagnostics): use default expression instead of todo! when missing fields
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2022-01-07 14:13:34 +01:00
Coenen Benjamin
0a4239a815
Update crates/rust-analyzer/src/config.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2022-01-07 14:07:02 +01:00
Lukas Wirth
dd20a6f701 feat: poke user when supplying faulty configurations 2022-01-06 14:24:19 +01:00
Lukas Wirth
f6eba28ef8 Adjust config name 2022-01-06 13:50:35 +01:00
Lukas Wirth
dd4b53402d Regenrate docs and package.json 2022-01-06 13:50:24 +01:00
Lukas Wirth
aecf26d09b feat: Add config to replace specific proc-macros with dummy expanders 2022-01-06 13:50:18 +01:00
Benjamin Coenen
336c899a07 add better default behavior on fill struct fields diagnostic
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2022-01-04 15:59:00 +01:00
David Hotham
b7cabf1e44
fix: don't panic on seeing an unexpected offset 2022-01-03 14:49:47 +00:00
Lukas Wirth
3a525c831f internal: Handle macro calls better in highlighting 2022-01-02 19:10:10 +01:00
Laurențiu Nicola
53ddf48df4 Avoid collect_vec from itertools 2022-01-02 12:06:14 +02:00
Aleksey Kladov
a1c33c2e1a test: force client-side watching
The direct reason for this is to fix CI on windows, which seems to fail
for some reason after we fixed the watcher-selection logic which (I
think) changed the tests behavior to use notify rather than client.

But this patch seems to make sense in general -- file watching is
notoriously finicky, so controlling it explicitly leads to less fragile
tests.
2022-01-01 19:16:25 +03:00
Aleksey Kladov
0d1e23e968 better error message 2022-01-01 18:55:53 +03:00
Aleksey Kladov
b9417f3483 feat: correctly fallback to notify if the clinet-side file watching is not supported 2022-01-01 17:26:54 +03:00
Benjamin Coenen
df6fa50f92 feat(diagnostics): add new config to fill default expression
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
2021-12-31 16:29:08 +01:00
bors[bot]
c5722a66c5
Merge #11073
11073: fix: Fix windows not finding the pdb file r=lnicola a=Veykril

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/10371

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2021-12-20 18:20:08 +00:00
Lukas Wirth
4a5c8c6ad2 fix: Fix windows not finding the pdb file 2021-12-20 19:17:31 +01:00
bors[bot]
f46731a230
Merge #11028
11028: Bump MSRV (1.57) r=Veykril a=iDawer

This bumps MSRV on all crates to 1.57 except `la-arena`

#10986 requires >=1.57 

Co-authored-by: iDawer <ilnur.iskhakov.oss@outlook.com>
2021-12-20 13:45:35 +00:00
Lukas Wirth
9fe0f0d1d9 Add a few default snippets for VSCode 2021-12-17 16:24:29 +01:00
iDawer
676744be6e Bump MSRV (1.57) 2021-12-16 01:56:12 +05:00
Jonas Schievink
deb5c1426d internal: add "Shuffle Crate Graph" command 2021-12-07 16:37:19 +01:00
Laurențiu Nicola
3678cbd12e Bump tracing 2021-12-06 20:54:45 +02:00
Laurențiu Nicola
bff377c712 Clean up some unused cross-crate dependencies 2021-12-05 13:54:49 +02:00
bors[bot]
8a084e6aca
Merge #10902
10902: Handle multiple cargo check quick fix spans r=Veykril a=brandondong

Resolves https://github.com/rust-analyzer/rust-analyzer/issues/10705.

**Cause:**
- For a cargo check diagnostic with multiple spans, only a single quick fix action would be created at the location of `spans[0]`. Additionally, the hover window details would only show the location of `spans[0]` next to the message.

**Fix:**
- Allow cargo check quick fix actions to be triggerable from multiple selection ranges. Specifically, if the selection intersects with any of the replacement spans, the quick fix action is shown.
- No change in behavior for the hover window details. It's pretty minor and I think showing multiple locations next to the message may be more confusing anyways.

Co-authored-by: Brandon <brandondong604@hotmail.com>
2021-12-05 10:52:54 +00:00