Commit Graph

4196 Commits

Author SHA1 Message Date
Aleksey Kladov
8109ebb101 Add SourceRoot::is_library, in preparation for salsa's durability 2019-06-24 12:35:07 +03:00
ironyman
888157b52e fill_match_arm works with trivial arm 2019-06-23 21:05:50 -07:00
Kan-Ru Chen
bf7a35294d Add box postfix completion 2019-06-23 22:18:25 +09:00
bors[bot]
7d79be3280 Merge #1421
1421: Bump cargo_metadata, ena, flexi_logger r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-06-20 19:13:08 +00:00
kjeremy
f8f136e990 Bump cargo_metadata, ena, flexi_logger 2019-06-20 15:09:39 -04:00
bors[bot]
4adb0125f7 Merge #1420
1420: don' collect macros r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-06-20 13:48:39 +00:00
Aleksey Kladov
9ff872329a don' collect macros 2019-06-20 16:48:10 +03:00
bors[bot]
cd1ff2e2a1 Merge #1419
1419: Add firewall query to lang items r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-06-19 22:14:12 +00:00
Aleksey Kladov
bcff61257a Add firewall query to lang items
With an intermediate query, changing one module won't cause reparsing
of all modules
2019-06-19 23:46:50 +03:00
csmoe
d04473accb fix: specialization(with blindly parsing)
Change-Id: Ic5d2767e8781568d76d4d0013cd6081e95ae8a95
2019-06-19 18:37:38 +08:00
bors[bot]
363f2f394e Merge #1414
1414: fix: box_syntax/pattern r=matklad a=csmoe

Closes #1412 
r? @matklad 

Co-authored-by: csmoe <csmoe@msn.com>
2019-06-19 10:07:37 +00:00
bors[bot]
09864b3b21 Merge #1418
1418: rename XSignature -> XData r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-06-19 09:54:16 +00:00
bors[bot]
78494b3c74 Merge #1417
1417: ⬆️ ra_vfs r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-06-19 09:41:25 +00:00
Aleksey Kladov
889d72c2c8 ⬆️ ra_vfs 2019-06-19 12:40:59 +03:00
csmoe
d6533994e4 fix: box_pattern
Change-Id: I45a856d74fb616d3bce33050f9e69d327186bd59
2019-06-19 14:28:50 +08:00
Aleksey Kladov
0caec7d250 rename XSignature -> XData 2019-06-18 20:20:08 +03:00
bors[bot]
f7da575a98 Merge #1413
1413: More details on how to set up coc r=matklad a=mark-i-m

I spent ~1 hour trying to figure this out. It's all pretty simple stuff, but very annoying...

Co-authored-by: Who? Me?! <mark-i-m@users.noreply.github.com>
2019-06-18 14:33:24 +00:00
Who? Me?!
857f3e546c
More details on how to set up coc 2019-06-18 09:25:59 -05:00
csmoe
5999733ca6 fix: box_syntax(#1412)
Change-Id: I6e20e0163fa545de37226c1561b3b7103615626c
2019-06-18 21:46:47 +08:00
bors[bot]
1541b2d689 Merge #1409
1409: The Fall down of failures r=matklad a=mominul

😁
Replaced all the uses of `failure` crate with `std::error::Error`.

Closes #1400 
Depends on rust-analyzer/teraron#1

Co-authored-by: Muhammad Mominul Huque <mominul2082@gmail.com>
2019-06-16 19:58:33 +00:00
Muhammad Mominul Huque
d3e74bfd2c
Update teraron version 2019-06-17 00:07:31 +06:00
bors[bot]
924d4d7ca8 Merge #1411
1411: add analysis-bench to benchmark incremental analysis r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-06-16 16:45:30 +00:00
Aleksey Kladov
6314e62cfb add analysis-bench to benchmark incremental analysis
Can be used like this:

```
$ cargo run --release -p ra_cli -- \
  analysis-bench ../chalk/ \
  --complete ../chalk/chalk-engine/src/logic.rs:94:0

loading: 225.970093ms

from scratch:   8.492373325s
no change:      445.265µs
trivial change: 95.631242ms
```

Or like this:

```
$ cargo run --release -p ra_cli -- \
  analysis-bench ../chalk/ \
  --highlight ../chalk/chalk-engine/src/logic.rs

loading: 209.873484ms

from scratch:   9.504916942s
no change:      7.731119ms
trivial change: 124.984039ms
```

"from scratch" includes initial analysis of the relevant bits of the
project

"no change" just asks the same question for the second time. It
measures overhead on assembling the answer outside of salsa.

"trivial change" doesn't do an actual salsa change, it just advances
the revision. This test how fast is salsa at validating things.
2019-06-16 19:45:05 +03:00
bors[bot]
b81caed43f Merge #1408
1408: Associated type basics & Deref support r=matklad a=flodiebold

This adds the necessary Chalk integration to handle associated types and uses it to implement support for `Deref` in the `*` operator and autoderef; so e.g. dot completions through an `Arc` work now.

It doesn't yet implement resolution of associated types in paths, though. Also, there's a big FIXME about handling variables in the solution we get from Chalk correctly.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-06-16 12:00:41 +00:00
Florian Diebold
ad3673d8d8 Add test for autoderef infinite recursion 2019-06-16 12:25:04 +02:00
Florian Diebold
96c2b9c41d Simplifications / cleanup from review 2019-06-16 12:25:04 +02:00
bors[bot]
e6fbff3246 Merge #1406
1406: reuse AnalysisHost in batch analysis r=matklad a=matklad

We do some custom setup in `AnalysisHost`, like setting up LRU size. I figure it's a good idea to not duplicate this work in batch analysis, *if* we want to keep batch and non-batch close.

Long-term, I see a value in keeping batch a separate, lighter weight thing. However, because now we use batch to measure performance, keeping them closer makes more sense.

I'd also like to add ability to get completions by using batch analysis, and that will require ra_ide_api as well.

@flodiebold were there some reason why we haven't started with this approach from the start?

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-06-16 08:08:10 +00:00
bors[bot]
ce9ea0939a Merge #1407
1407: Skip attrs in `ast::Literal::token` r=matklad a=sinkuu

`ast::Literal::token` panics on literals containing attributes. rust-analyzer crashed on the `rust-lang/rust` repository by parsing [a test containing this](9ebf47851a/src/test/run-pass/proc-macro/attr-stmt-expr.rs (L22-L25)).

Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
2019-06-16 07:58:15 +00:00
Muhammad Mominul Huque
91510db6d8
Fall down of failures 2019-06-16 00:48:50 +06:00
Shotaro Yamada
774537fb01 Fix formatting 2019-06-16 01:45:38 +09:00
Florian Diebold
30647cd195 Some more cleanup 2019-06-15 18:36:58 +02:00
Florian Diebold
94a6aff9f8 Check that Deref has the right number of parameters 2019-06-15 18:33:30 +02:00
Florian Diebold
3e78a6e3e0 Somewhat handle variables in the derefed type, and add another test 2019-06-15 18:21:23 +02:00
Florian Diebold
ca5ed2307c Implement * operation using Deref trait 2019-06-15 18:21:23 +02:00
Florian Diebold
9c5e7dd849 Implement autoderef using the Deref trait
- add support for other lang item targets, since we need the Deref lang item
2019-06-15 18:21:23 +02:00
Florian Diebold
49489dc20c Add basic infrastructure for assoc type projection 2019-06-15 18:21:23 +02:00
Florian Diebold
6f946f9656 Add test for Deref 2019-06-15 18:21:23 +02:00
Shotaro Yamada
474a04615c Skip attrs in Literal::token 2019-06-15 23:36:12 +09:00
Aleksey Kladov
b0be4207d0 reuse AnalysisHost in batch analysis 2019-06-15 16:29:23 +03:00
bors[bot]
41c56c8a0d Merge #1405
1405: re-enable backtraces on panic r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-06-15 09:58:43 +00:00
Aleksey Kladov
24703acf26 re-enable backtraces on panic 2019-06-15 12:58:17 +03:00
bors[bot]
257a15b939 Merge #1404
1404: Fight down failures! r=matklad a=mominul

issue #1400 

Now only `ra_tools` crate depends on `failure`, should I also fight those? 😁

Co-authored-by: Muhammad Mominul Huque <mominul2082@gmail.com>
2019-06-15 09:45:55 +00:00
Muhammad Mominul Huque
408e173bb9
Cleanup 2019-06-15 14:04:26 +06:00
Muhammad Mominul Huque
125d6e74f7
Fix a doc test 2019-06-15 13:53:37 +06:00
Muhammad Mominul Huque
ebb40c7f87
cargo format 2019-06-15 13:37:15 +06:00
Muhammad Mominul Huque
f032eeb05f
Get rid of failure: ra_batch ra_cli 2019-06-15 13:24:02 +06:00
Muhammad Mominul Huque
9709bd39ca
Get rid of failure: ra_lsp_server & ra_project_model 2019-06-15 02:42:56 +06:00
bors[bot]
9dbf985df5 Merge #1403
1403: Add alloc -> core dependency r=matklad a=flodiebold

Also a small fix for the ra-emacs-lsp company fix.

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-06-14 19:34:51 +00:00
Muhammad Mominul Huque
a931fb1ef6
Get rid of failure: gen_lsp_server 2019-06-15 01:03:17 +06:00
Florian Diebold
882daf4245 ra-emacs-lsp: Fix company-lsp snippet handler override 2019-06-14 20:58:03 +02:00