Commit graph

15645 commits

Author SHA1 Message Date
Lukas Wirth
6bf674c8e4 fix: Fix incorrect token pick rankings 2022-08-05 14:59:26 +02:00
bors
0fe3bcfd35 Auto merge of #12808 - Veykril:check-workspace, r=Veykril
feat: Only flycheck workspace that belongs to saved file

Supercedes https://github.com/rust-lang/rust-analyzer/pull/11038

There is still the problem that all the diagnostics are cleared, only clearing diagnostics of the relevant workspace isn't easily doable though I think, will have to dig into that
2022-08-04 12:57:04 +00:00
Lukas Wirth
df7f755e3b Don't flycheck while the workspace is being loaded 2022-08-04 14:56:44 +02:00
Jean santos
5698e51027 tidy formatting 2022-08-04 09:28:34 -03:00
Lukas Wirth
df9d3db82f Trigger flycheck on all transitive dependencies as well 2022-08-04 13:22:15 +02:00
Jean santos
49dac4070c on hover fallback error, adds ast::type as possible node 2022-08-03 17:37:11 -03:00
bors
2bc9a2d9e0 Auto merge of #12933 - Veykril:proc-ignored, r=Veykril
Use an empty expander for ignored non-attribute proc-macros

Identity is the wrong behaviour for anything that's not an attribute here
2022-08-03 16:11:08 +00:00
Lukas Wirth
a8a6c160be Use an empty expander for ignored non-attribute proc-macros 2022-08-03 18:10:15 +02:00
Dorian Scheidt
1980c1192c Support PathPat paths in generate_enum_variant 2022-08-02 14:37:12 -04:00
Dorian Scheidt
111694d85b Be more strict about supported Paths in generate_enum_variant
PathType path parents don't support this assist
2022-08-02 14:37:12 -04:00
Dorian Scheidt
e4638def7a Support record fields in generate_enum_variant 2022-08-02 14:37:12 -04:00
Dorian Scheidt
15d8049fa9 Support tuple fields in generate_enum_variant 2022-08-02 14:37:12 -04:00
Dorian Scheidt
bea1fec7a2 convert generate_enum_variant to use add_variant 2022-08-02 14:37:12 -04:00
Dorian Scheidt
405dd77d30 Support adding variants via structural editing 2022-08-02 14:37:12 -04:00
bors
113f1dbc91 Auto merge of #12880 - palango:while-fixup, r=Veykril
Add syntax fixup for while loops

Part of https://github.com/rust-lang/rust-analyzer/issues/12777

This is a first iteration to gather some feedback. In particular I'm not sure if the curly braces should be added here, but I couldn't get the test to work without them. Any hints welcome!
2022-08-02 14:08:56 +00:00
Jonas Schievink
bd7dfac5eb Fix r-a spelling in some places 2022-08-01 13:47:09 +02:00
Ryo Yoshida
d40ab66186
fix: remove whitespaces from doctest names 2022-08-01 17:57:47 +09:00
bors
af646621de Auto merge of #12916 - Veykril:nits, r=Veykril
minor: Properly cfg the `max` field of Limit
2022-07-31 17:42:10 +00:00
Lukas Wirth
3b2ecf44a0 Give variables more descriptive names 2022-07-31 19:27:34 +02:00
Lukas Wirth
d31f3605ce Properly cfg the max field of Limit 2022-07-31 19:27:20 +02:00
bors
e0ff4befda Auto merge of #12913 - Veykril:attr-merge, r=Veykril
fix: Fix ast-id up when merging raw attributes

Fixes https://github.com/rust-lang/rust-analyzer/issues/12912
2022-07-30 07:53:48 +00:00
Lukas Wirth
618cfd792c fix: Fix ast-id up when merging raw attributes 2022-07-30 09:43:30 +02:00
cynecx
902fd6ddcd fix: complete path of existing record expr 2022-07-29 17:24:05 +02:00
Laurențiu Nicola
11ef494b37 Be more explicit when filtering built-in completions 2022-07-28 21:45:47 +03:00
Laurențiu Nicola
948c9afc73 Only run rainbow highlighting test on 64-bit Unix 2022-07-28 21:03:59 +03:00
bors
b8763fe224 Auto merge of #12902 - Veykril:item-scope, r=Veykril
fix: Order ItemScope::entries results
2022-07-28 17:38:59 +00:00
Lukas Wirth
f867ddc621 fix: Order ItemScope::entries results 2022-07-28 19:28:56 +02:00
bors
32e640e2ba Auto merge of #12901 - Veykril:completion-trait-expr, r=Veykril
fix: Don't complete marker traits in expression position

cc https://github.com/rust-lang/rust-analyzer/issues/12196
2022-07-28 15:51:30 +00:00
Lukas Wirth
ce7541260d fix: Don't complete marker traits in expression position 2022-07-28 17:50:49 +02:00
bors
5986d2190f Auto merge of #12899 - Veykril:compl-qualifier, r=Veykril
fix: Do completions in path qualifier position

Fixes https://github.com/rust-lang/rust-analyzer/issues/12566

Not too happy with the duplication needed for this, but it is what it is. Completions in path qualifiers will have to be filtered properly still, but its better to show too many completions for this than too few for now.
2022-07-28 15:11:24 +00:00
Lukas Wirth
74abd44a26 fix: Do completions in path qualifier position 2022-07-28 17:09:31 +02:00
bors
02c240ff81 Auto merge of #12898 - Veykril:compl-pat-brace, r=Veykril
fix: Fix pattern completions adding unnecessary braces

Fixes https://github.com/rust-lang/rust-analyzer/issues/12852
2022-07-28 13:48:12 +00:00
Lukas Wirth
7c59d7c75c fix: Fix pattern completions adding unnecessary braces 2022-07-28 15:47:46 +02:00
bors
02f9ec4be5 Auto merge of #12895 - Veykril:compl-anchor, r=Veykril
fix: Calculate completions after type anchors

Fixes https://github.com/rust-lang/rust-analyzer/issues/12892
2022-07-28 08:06:58 +00:00
Lukas Wirth
e782e59d3d fix: Calculate completions after type anchors 2022-07-28 10:06:36 +02:00
bors
40875353a5 Auto merge of #12891 - brennanvincent:expander_stack, r=lnicola
Use large stack on expander thread

I have verified that this fixes #12884 for me.

Hat tip to `@bjorn3` for identifying the cause of the issue.
2022-07-27 19:40:59 +00:00
Brennan Vincent
f83738e1d9 Use large stack on expander thread 2022-07-27 15:02:34 -04:00
Paul Lange
c16e4f260f Add syntax fixup for loop 2022-07-27 18:18:51 +02:00
Paul Lange
a969481952 Add syntax fixup for while loops 2022-07-27 18:16:58 +02:00
Lukas Wirth
bf893d59b5 internal: Assume condition/iterable is missing if there is only a BlockExpr 2022-07-27 17:29:51 +02:00
bors
b4d652aa40 Auto merge of #12830 - hi-rustin:rustin-patch-issue-12717-fix, r=Veykril
Find original ast node before compute ref match

ref https://github.com/rust-lang/rust-analyzer/issues/12717
2022-07-27 12:31:26 +00:00
hi-rustin
349dfc7e95 Find original ast node before compute ref match in fn render
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-07-27 20:18:00 +08:00
Lukas Wirth
1f8daa180f fix: Honor ref expressions for compute_ref_match completions 2022-07-27 13:48:26 +02:00
Lukas Wirth
6c379b9f4b fix: Fix Semantics::original_ast_node not caching the resulting file 2022-07-27 12:46:04 +02:00
bors
c2eebd7a50 Auto merge of #12877 - zachs18:inline-def-in-macro, r=zachs18
fix: Insert spaces when inlining a function defined in a macro.

(partially) fixes #12860.

This PR (only) addresses the whitespace issue when inlining functions defined in macros.

Additionally, the indentation/spacing is not ideal, but works, e.g.
```rs
macro_rules! define_function {
    () => { fn test_function_macro() {
        if let Some(3) = 3i32.checked_add(0) {
            println!("3 + 0 == 3");
        }
    } };
}
define_function!();
fn main() {
    test_function_macro();
}
// previously became
// ...
fn main() {
    ifletSome(3)=3i32.checked_add(0){println!("3 + 0 == 3");};
}
// now becomes
// ...
fn main() {
    if let Some(3) = 3i32.checked_add(0){
        println!("3 + 0 == 3");

      };
}
```

The `self` -> `this` problem[^this] is (probably?) a separate problem that I am also looking into.

[^this]: As mentioned in [my comment on the above issue](https://github.com/rust-lang/rust-analyzer/issues/12860#issuecomment-1193231766), inlining a method defined in a macro does not properly replace `self` with the new local `this`.
2022-07-26 16:14:51 +00:00
Zachary S
add33b65dd Remove FIXME comment for unreachable fallback. 2022-07-26 10:59:19 -05:00
Lukas Wirth
c8ff70e924 fix: Fix server panicking on project loading when proc-macros are disabled 2022-07-26 16:30:45 +02:00
Amos Wenger
b1e3daf14b Find standalone proc-macro-srv on windows too 2022-07-26 12:28:59 +02:00
Lukas Wirth
ddad2847ab Allow name querying for derive helpers 2022-07-26 09:27:22 +02:00
Lukas Wirth
aa1491ecde Record derive helper attributes, resolve them in IDE layer 2022-07-26 09:26:51 +02:00