Commit Graph

24327 Commits

Author SHA1 Message Date
Lukas Wirth
1c2292e5c6 fix: Fix proc-macro-server incorrectly stripping delimiters 2023-02-13 12:07:31 +01:00
Lukas Wirth
244a48d13d Cleanup signature help a bit 2023-02-13 11:25:45 +01:00
Ryo Yoshida
57f0e9c100
Disallow invalid raw ident names 2023-02-13 18:45:19 +09:00
Ryo Yoshida
9b0daf20c9
fix: don't include r# prefix in filesystem changes 2023-02-13 18:44:53 +09:00
Ryo Yoshida
92fdfb548e
Make is_raw_identifier() public util function 2023-02-13 18:43:59 +09:00
Lukas Wirth
9738f97f8c Fix active parameter analysis once more 2023-02-12 17:32:11 +01:00
bors
646f973857 Auto merge of #14134 - lnicola:clippy-manual, r=Veykril
feat: Add clippy configuration section to the manual and update some old keys

Closes #14132

I don't think this is supposed to be under `Diagnostics`, but it does make sense in a way 🤷 (it's probably where someone might look).
2023-02-12 09:53:15 +00:00
Lukas Wirth
d2cf8c234a Make else autocompletion work in more places 2023-02-12 10:49:57 +01:00
Laurențiu Nicola
8f617b55ce Update some old checkOnSave references 2023-02-12 11:35:44 +02:00
Laurențiu Nicola
cfeec8a705 Add clippy configuration section to the manual 2023-02-12 11:34:52 +02:00
Lukas Wirth
33cacde04b Fix active parameter analysis 2023-02-12 10:26:19 +01:00
bors
a14a1520a3 Auto merge of #14135 - lnicola:manual-lapce, r=lnicola
feat: Add Lapce section to the manual
2023-02-12 09:12:48 +00:00
Laurențiu Nicola
9d85161f30 Add Lapce section to the manual 2023-02-12 11:12:05 +02:00
bors
5ef76da835 Auto merge of #14133 - lnicola:changelog-version, r=lnicola
minor: Add version placeholder to changelog template

Closes #13967

This isn't great because we need to fill it in manually, but getting the version number from GitHub Actions is a bit annoying.
2023-02-12 08:57:08 +00:00
Laurențiu Nicola
240b6f7f8d Add version placeholder to changelog template 2023-02-12 10:55:49 +02:00
Lukas Wirth
1be24e0899 internal: Improve parser recovery a bunch 2023-02-11 20:28:36 +01:00
bors
c29a00457a Auto merge of #14127 - lnicola:windows-x86, r=lnicola
feat: Build `i686-pc-windows-msvc` binaries

These have been requested a couple of times, so let's build them.
2023-02-11 16:23:56 +00:00
Laurențiu Nicola
87d6107f19 Build i686-pc-windows-msvc binaries 2023-02-11 17:50:48 +02:00
bors
d78a0be9b0 Auto merge of #14125 - Veykril:inlay-fix, r=Veykril
fix: Fix bind pat inlay hints rendering for constant patterns

Fixes https://github.com/rust-lang/rust-analyzer/issues/14124
2023-02-11 15:30:46 +00:00
Lukas Wirth
5fdf640fb3 fix: Fix bind pat inlay hints rendering for constant patterns 2023-02-11 16:29:54 +01:00
Duong Quoc Khanh
e1396bde73
Don't trigger postfix completion if block which has an else block
Discard postfix completion if the next_non_trivia_sibling of dot_token
is an ELSE_KW.
2023-02-11 21:26:00 +09:00
Ryo Yoshida
ae7e62c50f
Don't expand macros in the same expansion tree after overflow 2023-02-11 18:19:08 +09:00
bors
8011029d3a Auto merge of #13975 - DropDemBits:on-enter-after-dot-chains, r=DropDemBits
fix: Suppress extra indent after the end of field and function chains

(spurred on by <https://github.com/rust-lang/rust-analyzer/issues/4182#issuecomment-671275652>)

Caveat that this doesn't work for after tail expressions, although there shouldn't be anything after those anyways.

This also complicates when to reload the language configuration by nature of now always having a language configuration applicable.

Examples of indentation fixes:

```rs
fn main() {
    println!("Hello!"); // < enter here!
    // ... indents down here

    fs::read_to_string("soup") // < enter here!
    // ... still indents down here :(
        .map(|_| ())
        .map(|_| ()) // < enter here!
        // ... still indents down here :D
        .map_err(|_| ())
        .unwrap(); // < enter here!
    // ... indents down here :D

    // ... and subsequent enters stay at the same indent

    0.0f64
        .to_radians()
        .to_radians()
        .to_radians() // force semi on a new line
        ; // < enter here!
    // ... indents down here :D
}

fn tail_end() -> i32 {
    0i32.wrapping_abs()
        .wrapping_abs()
        .wrapping_abs()
        .wrapping_abs() // < enter here!
        // ... still indents here 🤷
}
```
2023-02-10 20:10:54 +00:00
DropDemBits
c7bd3c682f
Always reload onEnter configuration
Configuration reload doesn't happen often anyway,
and there will always be a set of onEnter rules to load
2023-02-10 14:55:17 -05:00
bors
d9c020d426 Auto merge of #14120 - Veykril:castable, r=Veykril
internal: Revert castable expectation and simplify

Unfixes https://github.com/rust-lang/rust-analyzer/issues/11571, the PR for that introduced some regressions (tried fixing them but doing what rustc does there specifically does not help, probably because something else affects it as well there)
2023-02-10 15:44:04 +00:00
Lukas Wirth
7677f41f41 Preallocate some vecs 2023-02-10 16:42:09 +01:00
bors
a28f53646d Auto merge of #14119 - Veykril:miniopt, r=Veykril
internal: Remove a few allocations in hir-ty::utils
2023-02-10 15:18:46 +00:00
Lukas Wirth
79492cb8ae internal: Revert castable expectation and simplify 2023-02-10 16:08:47 +01:00
Lukas Wirth
8f5deb4ff2 Remove a few allocations in hir-ty::utils 2023-02-10 14:57:03 +01:00
bors
f11cff8976 Auto merge of #14116 - Veykril:inlay-hints-disc, r=Veykril
Render discriminant inlay hints for mixed variants if at least one discriminant is specified
2023-02-10 08:59:17 +00:00
Lukas Wirth
557aa1e378 Render discriminant inlay hints for mixed variants if at least one discriminant is specified 2023-02-10 09:57:03 +01:00
bors
e2b868c534 Auto merge of #14114 - lh123:insert-ws-when-inline-macro, r=lnicola
fix: Insert spaces when inlining macros

Fixes https://github.com/rust-lang/rust-analyzer/issues/14108
2023-02-10 07:14:50 +00:00
lh123
626dc651ff fix: Insert spaces when inlining macros 2023-02-10 14:22:56 +08:00
bors
c468e39b5a Auto merge of #14112 - Veykril:vscode-untrusted, r=lnicola
minor: Explicitly disable the rust-analyzer extension in untrusted workspaces

This is the default, but its always better to be explicit here + we can add a small note as to why.
2023-02-09 18:46:11 +00:00
Lukas Wirth
7fc0f8985d Explicitly disable the rust-analyzer extension in unstrusted workspaces 2023-02-09 17:34:21 +01:00
bors
7e17b98d17 Auto merge of #14111 - lnicola:squash-proc-macro-server-warning, r=Veykril
fix: Hide proc macro server version detection errors

These are harmless, but users tend to blame other things on them.
2023-02-09 10:29:28 +00:00
Laurențiu Nicola
8828f3494e Hide proc macro server version detection errors 2023-02-09 10:46:36 +02:00
bors
313a48057a Auto merge of #14110 - dqkqd:auto-completion-for-missing-body, r=Veykril
Add completion for function without body

Fix #13802
2023-02-09 08:45:18 +00:00
Duong Quoc Khanh
74cd8ecc7e
Add completion without body.
Add completion for Fn, Const, TypeAlias without body.
2023-02-09 17:37:11 +09:00
Duong Quoc Khanh
58136b01ba
Add more tests for completion without body.
Add tests for Fn, Const, TypeAlias without body inside Trait.
2023-02-09 17:32:55 +09:00
bors
eaed19c539 Auto merge of #14104 - Veykril:castable-expect, r=Veykril
fix: Implement Expactation::Castable and add a test case for it

Fixes https://github.com/rust-lang/rust-analyzer/issues/11571
2023-02-08 12:08:15 +00:00
Lukas Wirth
f8f1cb93e0 fix: Implement Expactation::Castable and add a test case for it 2023-02-08 13:07:59 +01:00
bors
5341a6fa7f Auto merge of #14103 - Veykril:typing-semi, r=Veykril
fix: Don't insert a semicolon when typing = if parse errors are encountered

Fixes https://github.com/rust-lang/rust-analyzer/issues/11005
2023-02-08 11:14:58 +00:00
Lukas Wirth
5e6208b1df fix: Don't insert a semicolon when typing = if parse errors are encountered 2023-02-08 12:06:35 +01:00
bors
885c1ad578 Auto merge of #14102 - Veykril:bump-lexer, r=Veykril
minor: Bump `rustc-ap-rustc_lexer`

Closes https://github.com/rust-lang/rust-analyzer/issues/9554
2023-02-08 11:01:32 +00:00
Lukas Wirth
4788c7a056 Bump rustc-ap-rustc_lexer 2023-02-08 11:42:14 +01:00
bors
512a93ac94 Auto merge of #14100 - Veykril:load_cargo-proc-macro-srv-config, r=Veykril
Allow specifying what proc-macro server to run in rust_analyzer::load_cargo API

Closes https://github.com/rust-lang/rust-analyzer/issues/10516
2023-02-08 10:12:31 +00:00
Lukas Wirth
f03fb262f7 Allow specifying what proc-macro server to run in rust_analyzer::load_cargo API 2023-02-08 11:05:34 +01:00
bors
6effb26062 Auto merge of #14095 - dqkqd:master, r=Veykril
Add postfix completion for `unsafe`.

Fix #13779.

Hi, this is my first PR. Please tell me if there is anything I should do.
2023-02-08 09:44:22 +00:00
bors
a05ce5a3e7 Auto merge of #13986 - MariaSolOs:limit-completions, r=Veykril
Add setting for limiting number of completions

For #13911.
2023-02-08 09:31:35 +00:00