Commit graph

5349 commits

Author SHA1 Message Date
Florian Diebold
d9c77c5453 Handle visibility for path completion (not in all cases yet) 2020-03-08 10:51:40 +01:00
Florian Diebold
734e68da4c Handle visibility in method call completion 2020-03-07 23:03:56 +01:00
Edwin Cheng
18f88ad10b Prevent include! macro include itself 2020-03-07 19:08:42 +08:00
Edwin Cheng
2e178b5475 Fix test and add more comment 2020-03-07 13:02:54 +08:00
Edwin Cheng
36c7684687 Use a not so dummy implementation of env macro 2020-03-07 12:53:40 +08:00
Aleksey Kladov
9abf0d9659 Normalize waiting queries names 2020-03-07 00:18:04 +01:00
Florian Diebold
9ce30281f6 Don't reuse the Chalk solver
This slows down analysis-stats a bit (~5% in my measurement), but improves
incremental checking a lot because we can reuse trait solve results.
2020-03-06 23:04:14 +01:00
bors[bot]
26ae35c62e
Merge #3499
3499: Resolve `Self::AssocTy` in impls r=matklad a=flodiebold

To do this we need to carry around the original resolution a bit, because `Self`
gets resolved to the actual type immediately, but you're not allowed to write
the equivalent type in a projection. (I tried just comparing the projection base
type with the impl self type, but that seemed too dirty.) This is basically how
rustc does it as well.

Fixes #3249.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-03-06 19:50:55 +00:00
Aleksey Kladov
80909f7698 Don't creat public APIs with typos 2020-03-06 18:38:56 +01:00
Aleksey Kladov
95a2755aa8 Concise mode for parameter hints
This works around VS Code bug where it tries to cram everything in a
tiny popup, and brings experience closer to Intellij.
2020-03-06 18:35:30 +01:00
Florian Diebold
d17c5416af Resolve Self::AssocTy in impls
To do this we need to carry around the original resolution a bit, because `Self`
gets resolved to the actual type immediately, but you're not allowed to write
the equivalent type in a projection. (I tried just comparing the projection base
type with the impl self type, but that seemed too dirty.) This is basically how
rustc does it as well.

Fixes #3249.
2020-03-06 18:14:39 +01:00
Aleksey Kladov
3ff170d658 Trigger parameter info automatically
See https://github.com/Microsoft/vscode/issues/64023
2020-03-06 18:00:06 +01:00
Aleksey Kladov
4e7f6c2354 Feature flag for arg snippets 2020-03-06 17:51:10 +01:00
Aleksey Kladov
21f40f2b8f Fix comment order 2020-03-06 17:44:30 +01:00
Aleksey Kladov
b33b843f40 Allow specifying additional info on call to profile 2020-03-06 17:36:51 +01:00
Aleksey Kladov
59f91f2f9b Less confusing profile names 2020-03-06 16:40:38 +01:00
bors[bot]
aa82b5915d
Merge #3494
3494: Implement include macro r=matklad a=edwin0cheng

This PR implement builtin `include` macro.

* It does not support include as expression yet.
* It doesn't consider `env!("OUT_DIR")` yet.


Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-03-06 15:08:41 +00:00
Edwin Cheng
0a06c7e6e6 Implment include macro 2020-03-06 22:58:45 +08:00
bors[bot]
4173645a71
Merge #3493
3493: make::use_item r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-06 14:56:52 +00:00
Aleksey Kladov
1f84c3b18f make::use_item 2020-03-06 15:56:25 +01:00
bors[bot]
995a92814f
Merge #3490
3490: Support aliases and Self in struct literals r=matklad a=flodiebold

Fixes #3306.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-03-06 14:46:03 +00:00
Florian Diebold
073a1ef834 Support aliases and Self in struct literals
Fixes #3306.
2020-03-06 15:43:14 +01:00
bors[bot]
13879afdd5
Merge #3492
3492: Simplify creation of `T[,]` r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-06 14:39:20 +00:00
Aleksey Kladov
85e2346b74 Simplify creation of T[,] 2020-03-06 15:38:48 +01:00
Aleksey Kladov
57da3df99a Explicitly remember desugard pats 2020-03-06 15:17:48 +01:00
Aleksey Kladov
5ffddc4b92 Explicitly remember desugard exprs 2020-03-06 15:11:05 +01:00
Aleksey Kladov
fb5891c433 Source map returns a result
cc #2236
2020-03-06 14:44:44 +01:00
Aleksey Kladov
ea0c124219 Rerail split_import API onto AST
The code is more verbose and less efficient now, but should be
reusable in add_import context as well
2020-03-06 14:08:43 +01:00
bors[bot]
d75577fcee
Merge #3483
3483: Unfold groups with single assists into plain assists r=matklad a=SomeoneToIgnore

A follow-up of https://github.com/rust-analyzer/rust-analyzer/pull/3120/files#r378788698 , made to show more detailed label when the assist group contains a single element

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-03-06 10:10:16 +00:00
bors[bot]
670895a49c
Merge #3482
3482: Fix regression from #3451 r=matklad a=edwin0cheng

There is a regression from #3451 such that the following code has failed to parse in raw item collecting phase:

```rust
macro_rules! with_std { 
 	($($i:item)*) => ($(#[cfg(feature = "std")]$i)*) 
}

with_std! {
	mod macros;
	mod others;
}
```

### Rationale

We always assume the last token of an statement will not end with a whitespace, which is true. It is because in parsing phase,  we always emit `SyntaxNode` before any whitespace. Such that in various parts of RA code, we solely check the semi-colon by using `SyntaxNode::last_child_token() == ";"` . 

However, in #3451, we insert some whitespaces between puncts such that we broke above assumption. This PR fixed this bug by make sure we don't add any whitespace if it is a semicolon.


Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-03-06 10:03:54 +00:00
Kirill Bulatov
0ff8c55246 Unfold groups with single assists into plain assists 2020-03-06 00:17:26 +02:00
Edwin Cheng
0563cc8291 fix regression from #3451 2020-03-06 04:32:08 +08:00
Aleksey Kladov
381ace587e Add with_use_tree 2020-03-05 18:38:52 +01:00
Aleksey Kladov
b96da48809 Add profiling calls 2020-03-05 14:22:31 +01:00
bors[bot]
f3f39b4327
Merge #3475
3475: Fix options for analysis-bench r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-05 12:58:41 +00:00
Aleksey Kladov
17876d79e4 Fix options for analysis-bench 2020-03-05 13:58:11 +01:00
Aleksey Kladov
fc970d188e Prime open files on load 2020-03-05 13:40:53 +01:00
Aleksey Kladov
b6819c2595
Merge pull request #3451 from edwin0cheng/fix-mbe-composited
Fix mbe composited token bug
2020-03-05 11:16:45 +01:00
Aleksey Kladov
7d873fcfa1 Move PathResolution 2020-03-05 11:08:31 +01:00
Aleksey Kladov
7b6716e50e Remove dead code 2020-03-05 11:06:23 +01:00
Edwin Cheng
0c79e1d304 Add comment for parents logging 2020-03-05 03:02:51 +08:00
Edwin Cheng
c7b0c72dd7 Fix whitespace in tests 2020-03-05 00:12:39 +08:00
Edwin Cheng
6794d50a9b Fixed whitespace bug 2020-03-04 23:41:14 +08:00
Edwin Cheng
028595548b Fix #3436 2020-03-04 23:41:14 +08:00
Edwin Cheng
e76dddd610 Add more log 2020-03-04 23:41:04 +08:00
Aleksey Kladov
c21babc58b Minor cleanup 2020-03-04 14:39:51 +01:00
Aleksey Kladov
f57682c0b3 Remove old find refs infra 2020-03-04 14:25:22 +01:00
bors[bot]
94189d0a1c
Merge #3442
3442: Skip self param when completing methods r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-03-04 12:02:06 +00:00
Aleksey Kladov
7d2ddfd3c8 Skip self param when completing methods 2020-03-04 13:01:16 +01:00
Aleksey Kladov
4f50a37187 Fix docs 2020-03-04 12:48:50 +01:00