Commit graph

9875 commits

Author SHA1 Message Date
veetaha
8d4c11625a Remove an equals sign from ConstArg (this probably pertains only to ConstParam)
(As per matklad)
2020-05-12 23:57:04 +03:00
veetaha
b31475d316 Remove a comment on NameRefToken as per matklad 2020-05-12 23:55:46 +03:00
veetaha
fcd11dd1a8 Convert TODO to a FIXME as per matklad 2020-05-12 23:54:40 +03:00
veetaha
51edfbaffe Convert TODO to a Note(matklad) 2020-05-12 23:50:52 +03:00
veetaha
65b380fa8d Convert to TODOs to FIXMEs as per matklad 2020-05-12 23:48:04 +03:00
veetaha
55a29982c0 Revert "Remove MacroStmts as per edwin0cheng" (cc @edwin0cheng) and add a fixme to document it.
This reverts commit 7a49165f5d.
MacroStmts ast node is not used by itself, but it pertains
to SyntaxNodeKind MACRO_STMTS that is used by ra_paser, so
even tho the node itself is not used, it is better to keep it
with a FIXME to actually add a doc comment when it becomes useful.
2020-05-12 23:45:29 +03:00
veetaha
24b27abf9f Add a doc comment on the difference between Name and NameRef ast nodes 2020-05-12 23:31:37 +03:00
veetaha
2a5ab9f5dd Resolve TODO about macro 2.0 def 2020-05-10 22:08:06 +03:00
veetaha
73c6bc4dbd Fix typo 2020-05-10 21:59:15 +03:00
veetaha
33f240960d Carify on a semicolon in macro call 2020-05-10 21:57:49 +03:00
veetaha
a1dc28f236 Resolve TODO about curly-braced constructions in expression statement 2020-05-10 21:51:53 +03:00
veetaha
1677f35ef1 Remove TODO about Block since it was removed 2020-05-10 21:46:26 +03:00
veetaha
8a298eed7a Resolve todos about refs and empty statements 2020-05-10 21:44:14 +03:00
veetaha
f5e2e02aa9 Converted TODO about MacroItems to FIXME as per edwin0cheng 2020-05-10 21:06:12 +03:00
veetaha
71f2be968b Verified ConstArg example, waiting for response on what = sign pertains to 2020-05-10 21:02:21 +03:00
veetaha
f6fd4c4a74 Correcy use tree and type args docs 2020-05-10 20:52:25 +03:00
veetaha
9a82ee0de2 Fix "show syntax tree" command
@matlkad please don't forget to keep it up-to-date!
2020-05-10 20:43:48 +03:00
veetaha
2af6b4b67e Correct use cannot have type args as per flodiebold 2020-05-10 20:23:29 +03:00
veetaha
a19b164661 Correct path docs and add colon2 token to Path ast node 2020-05-10 20:21:46 +03:00
veetaha
eedf11ae88 Add example with const in TypeBound as per flodiebold 2020-05-10 19:24:06 +03:00
veetaha
5707c2d7a6 Remove todo comment about arg vs param difference as per clarification from flodiebold 2020-05-10 19:19:56 +03:00
veetaha
09c438b47e Properly document const impl as per flodiebold 2020-05-10 19:17:46 +03:00
veetaha
80c529d1dc Remove on TypeAliasDef as per flodiebold 2020-05-10 19:15:04 +03:00
veetaha
7a49165f5d Remove MacroStmts as per edwin0cheng 2020-05-10 19:11:22 +03:00
veetaha
258a3461b4 Add proper docs for TokenTree as per edwin0cheng 2020-05-10 19:09:36 +03:00
veetaha
3554866d67 Run codegen of ast types with documentation 2020-05-10 19:06:28 +03:00
veetaha
e0e384a34a Add ast docs to codegen script 2020-05-10 19:05:51 +03:00
bors[bot]
225f353aa2
Merge #4412
4412: infer: Make expected rhs type for plain assign the lhs type r=flodiebold a=kiljacken

This fixes an issue where the following code sample would fail to infer
the type contained in the option:
```rust
fn main() {
    let mut end = None; // Was Option<{unknown}>, is now Option<bool>
    loop {
        end = Some(true);
    }
}
```

Co-authored-by: Emil Lauridsen <mine809@gmail.com>
2020-05-10 14:48:04 +00:00
Emil Lauridsen
85d44cad45 infer: Make expected rhs type for plain assign the lhs type
This fixes an issue where the following code sample would fail to infer
the type contained in the option:
```rust
fn main() {
    let mut end = None; // TODO: Fix inference for this in RA
    loop {
        end = Some(true);
    }
}
```
2020-05-10 16:24:04 +02:00
bors[bot]
4578154b60
Merge #4409
4409: Hot fix panic for function_signature r=edwin0cheng a=edwin0cheng

I am totally agree this comment: 

f1cb5b8a29/crates/ra_ide/src/display/function_signature.rs (L3-L4)

But let hot fix all panic for right now, it is so disturbing when browsing code...


Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-05-10 10:04:44 +00:00
Edwin Cheng
a3375c1a88 Remove dbg 2020-05-10 18:03:44 +08:00
Edwin Cheng
9405116d51 Hot fix panic for function_signature 2020-05-10 16:27:31 +08:00
bors[bot]
f1cb5b8a29
Merge #4392
4392: Add From should not move the cursor r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-09 14:22:06 +00:00
Aleksey Kladov
d9828a57fc Add From should not move the cursor 2020-05-09 16:21:10 +02:00
bors[bot]
77d2eaba16
Merge #4389
4389: Ascribe more correct types r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-09 13:58:22 +00:00
Aleksey Kladov
e201e7834d Ascribe more correct types 2020-05-09 15:57:53 +02:00
bors[bot]
c5c07c2a0a
Merge #4388
4388: unindent -> dedent r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-09 12:49:18 +00:00
Aleksey Kladov
5c04d8544c unindent -> dedent 2020-05-09 14:48:43 +02:00
bors[bot]
5af66e5486
Merge #4387
4387: More fluent indent API r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-05-09 12:40:45 +00:00
Aleksey Kladov
231fddab54 More fluent indent API 2020-05-09 14:40:11 +02:00
Aleksey Kladov
c6334285e3 Fix visibility 2020-05-09 13:59:25 +02:00
bors[bot]
25e37e2c93
Merge #4175
4175: Introduce HirDisplay method for rendering source code & use it in add_function assist r=flodiebold a=TimoFreiberg

Next feature for #3639.

So far the only change in the new `HirDisplay` method is that paths are qualified, but more changes will be necessary (omitting the function name from function types, returning an error instead of printing `"{unknown}"`, probably more).

Is that approach okay?

Co-authored-by: Timo Freiberg <timo.freiberg@gmail.com>
2020-05-09 09:29:11 +00:00
bors[bot]
d7a0b0ff91
Merge #4381
4381: Simplify r=matklad a=Veetaha



Co-authored-by: veetaha <veetaha2@gmail.com>
2020-05-09 08:42:24 +00:00
veetaha
e83a2912b8 Simpify project discovery 2020-05-09 02:51:59 +03:00
veetaha
aca9aa8b7e Simplify 2020-05-09 02:27:44 +03:00
bors[bot]
1acb556907
Merge #4379
4379: Handle coercing function types to function pointers in match r=matklad a=flodiebold

E.g. in
```rust
match x {
    1 => function1,
    2 => function2,
}
```
we need to try coercing both to pointers. Turns out this is a special case in
rustc as well (see the link in the comment).

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-05-08 20:37:14 +00:00
Florian Diebold
a3d866e776 Handle coercing function types to function pointers in match
E.g. in
```rust
match x {
    1 => function1,
    2 => function2,
}
```
we need to try coercing both to pointers. Turns out this is a special case in
rustc as well (see the link in the comment).
2020-05-08 22:14:01 +02:00
bors[bot]
f9ec7cebef
Merge #4377
4377: Implement better handling of divergence r=matklad a=flodiebold

Divergence here means that for some reason, the end of a block will not be reached. We tried to model this just using the never type, but that doesn't work fully (e.g. in `let x = { loop {}; "foo" };` x should still have type `&str`); so this introduces a `diverges` flag that the type checker keeps track of, like rustc does. We also add some checking for `break`, but no support for break-with-value or labeled breaks yet.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-05-08 18:09:25 +00:00
Florian Diebold
d0129c4ddb Add diagnostic for break outside of loop 2020-05-08 19:48:03 +02:00
Florian Diebold
f8bf94a4b9 Use matches! 2020-05-08 19:30:02 +02:00