aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge #1411bors[bot]2019-06-169-81/+245
|\ | | | | | | | | | | | | | | 1411: add analysis-bench to benchmark incremental analysis r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * add analysis-bench to benchmark incremental analysisAleksey Kladov2019-06-169-81/+245
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Merge #1408bors[bot]2019-06-1619-70/+454
|\ | | | | | | | | | | | | | | | | | | 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 <[email protected]>
| * Add test for autoderef infinite recursionFlorian Diebold2019-06-161-0/+25
| |
| * Simplifications / cleanup from reviewFlorian Diebold2019-06-167-38/+31
| |
| * Some more cleanupFlorian Diebold2019-06-151-4/+4
| |
| * Check that Deref has the right number of parametersFlorian Diebold2019-06-151-2/+7
| |
| * Somewhat handle variables in the derefed type, and add another testFlorian Diebold2019-06-153-5/+61
| |
| * Implement * operation using Deref traitFlorian Diebold2019-06-151-3/+5
| |
| * Implement autoderef using the Deref traitFlorian Diebold2019-06-1511-47/+152
| | | | | | | | - add support for other lang item targets, since we need the Deref lang item
| * Add basic infrastructure for assoc type projectionFlorian Diebold2019-06-159-21/+190
| |
| * Add test for DerefFlorian Diebold2019-06-151-0/+29
| |
* | Merge #1406bors[bot]2019-06-166-108/+89
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 <[email protected]>
| * | reuse AnalysisHost in batch analysisAleksey Kladov2019-06-156-108/+89
| |/
* | Merge #1407bors[bot]2019-06-161-2/+13
|\ \ | |/ |/| | | | | | | | | | | 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](https://github.com/rust-lang/rust/blob/9ebf47851a357faa4cd97f4b1dc7835f6376e639/src/test/run-pass/proc-macro/attr-stmt-expr.rs#L22-L25). Co-authored-by: Shotaro Yamada <[email protected]>
| * Fix formattingShotaro Yamada2019-06-151-7/+3
| |
| * Skip attrs in `Literal::token`Shotaro Yamada2019-06-151-2/+17
|/
* Merge #1405bors[bot]2019-06-151-2/+1
|\ | | | | | | | | | | | | | | 1405: re-enable backtraces on panic r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * re-enable backtraces on panicAleksey Kladov2019-06-151-2/+1
|/
* Merge #1404bors[bot]2019-06-1521-78/+61
|\ | | | | | | | | | | | | | | | | | | 1404: Fight down failures! r=matklad a=mominul issue #1400 Now only `ra_tools` crate depends on `failure`, should I also fight those? :grin: Co-authored-by: Muhammad Mominul Huque <[email protected]>
| * CleanupMuhammad Mominul Huque2019-06-151-1/+1
| |
| * Fix a doc testMuhammad Mominul Huque2019-06-151-2/+3
| |
| * cargo formatMuhammad Mominul Huque2019-06-154-12/+4
| |
| * Get rid of failure: ra_batch ra_cliMuhammad Mominul Huque2019-06-157-13/+7
| |
| * Get rid of failure: ra_lsp_server & ra_project_modelMuhammad Mominul Huque2019-06-1410-36/+32
| |
| * Get rid of failure: gen_lsp_serverMuhammad Mominul Huque2019-06-147-21/+21
| |
* | Merge #1403bors[bot]2019-06-142-1/+6
|\ \ | |/ |/| | | | | | | | | | | | | 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 <[email protected]> Co-authored-by: Florian Diebold <[email protected]>
| * ra-emacs-lsp: Fix company-lsp snippet handler overrideFlorian Diebold2019-06-141-1/+1
| |
| * Add alloc -> core dependencyFlorian Diebold2019-06-131-0/+5
| |
* | Merge #1401bors[bot]2019-06-131-1/+2
|\ \ | |/ |/| | | | | | | | | | | 1401: Temp fix for slow onEnter issue r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * Temp fix for slow onEnter issueAleksey Kladov2019-06-131-1/+2
|/ | | | | | | | | | The issue was windows specific -- cancellation caused collection of bracktraces at some point, and that was slow on windows. The proper fix here is to make sure that we don't collect bracktraces unnecessary (which we currently do due to failure), but, as a temporary fix, let's just not force their collection in the first place!
* Merge #1398bors[bot]2019-06-125-6/+6
|\ | | | | | | | | | | | | | | 1398: check for cancellation when executing queries r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * check for cancellation when executing queriesAleksey Kladov2019-06-125-6/+6
|/ | | | | | | Note that we can't just remove CheckCanceled trait altogether: sometimes it's useful to check for cancellation while the query is running! We do this, for example, in the name resolution fixed-point loop.
* Merge #1393bors[bot]2019-06-127-6/+53
|\ | | | | | | | | | | | | | | | | 1393: fix: support existential type r=matklad a=csmoe Closes https://github.com/rust-analyzer/rust-analyzer/issues/1387 r? @matklad Co-authored-by: csmoe <[email protected]>
| * fix: support existential typecsmoe2019-06-127-6/+53
| |
* | Merge #1382bors[bot]2019-06-1213-15/+63
|\ \ | | | | | | | | | | | | | | | | | | | | | 1382: use salsa's LRU for syntax trees r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | make LRU cache configurableAleksey Kladov2019-06-128-11/+48
| | |
| * | make LRU_CAP configurable for batch dbAleksey Kladov2019-06-123-4/+11
| | |
| * | use salsa's LRU for syntax treesAleksey Kladov2019-06-125-7/+11
| | |
* | | Merge #1396bors[bot]2019-06-121-4/+4
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1396: fixed wrong links again r=matklad a=zbelial Hi Sorry about that I didn't check all links in my previous PR and two of them were incorrectly fixed. I think they are all proporly fixed this time :) Co-authored-by: zjy <[email protected]>
| * | | fixed wrong links againzjy2019-06-121-4/+4
|/ / /
* | | Merge #1394bors[bot]2019-06-111-6/+23
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1394: Fix hover for pat that shadows items r=matklad a=sinkuu ```rust fn x() {} fn y() { let x = 0i32; x; // hover on `x` is expected to be `i32`, but the actual result was `fn x()` } ``` This was because: if [`res.is_empty()`](https://github.com/sinkuu/rust-analyzer/blob/656a0fa9f99298123d7dcee8c65a8a5ed7043bc4/crates/ra_ide_api/src/hover.rs#L205), it fallbacks to "index based approach" and adds `fn x()` to `res`, which makes [`res.extend(type_of)` below](https://github.com/sinkuu/rust-analyzer/blob/656a0fa9f99298123d7dcee8c65a8a5ed7043bc4/crates/ra_ide_api/src/hover.rs#L260-L266) not happen. Co-authored-by: Shotaro Yamada <[email protected]>
| * | Fix hover for pat that shadows itemsShotaro Yamada2019-06-111-6/+23
| | |
* | | Merge #1395bors[bot]2019-06-1125-449/+324
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | 1395: move docs under code model r=matklad a=matklad Co-authored-by: Aleksey Kladov <[email protected]>
| * | move docs under code modelAleksey Kladov2019-06-116-14/+10
| | |
| * | fix compilationAleksey Kladov2019-06-112-5/+5
| | |
| * | minor formattingAleksey Kladov2019-06-111-4/+0
| | |
| * | remove unneded From(..) implAleksey Kladov2019-06-114-37/+21
| | |
| * | move source to a seaparate fileAleksey Kladov2019-06-113-121/+125
| | |
| * | remove inherent source implsAleksey Kladov2019-06-1115-67/+22
| | |