Commit graph

475 commits

Author SHA1 Message Date
Aleksey Kladov b8cae2cf8f check for cancellation when executing queries
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.
2019-06-12 18:47:55 +03:00
bors[bot] 03645c5576 Merge #1382
1382: use salsa's LRU for syntax trees r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-06-12 10:36:47 +00:00
Aleksey Kladov fed52706de make LRU cache configurable 2019-06-12 13:36:24 +03:00
Aleksey Kladov 15668119de make LRU_CAP configurable for batch db 2019-06-12 13:25:30 +03:00
Aleksey Kladov fc2658b074 use salsa's LRU for syntax trees 2019-06-12 13:25:30 +03:00
bors[bot] 98020ef2f3 Merge #1394
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()`](656a0fa9f9/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](656a0fa9f9/crates/ra_ide_api/src/hover.rs (L260-L266)) not happen.

Co-authored-by: Shotaro Yamada <sinkuu@sinkuu.xyz>
2019-06-11 17:24:28 +00:00
Aleksey Kladov ff6f6b3a52 move docs under code model 2019-06-11 18:28:51 +03:00
Aleksey Kladov c4512fadb1 remove inherent source impls 2019-06-11 18:28:51 +03:00
Aleksey Kladov dd63f17027 use Source for module, part 2 2019-06-11 18:28:51 +03:00
Aleksey Kladov 0145d06515 use Source for module, part 1 2019-06-11 18:28:51 +03:00
Aleksey Kladov 178d8e96b5 use Source for StructField 2019-06-11 18:28:51 +03:00
Aleksey Kladov 8b94b429e5 use Source for MacroDef 2019-06-11 18:28:51 +03:00
Aleksey Kladov a6e339e822 use Source for impl block 2019-06-11 18:28:51 +03:00
Aleksey Kladov f411c2988d use Source for Trait 2019-06-11 18:28:51 +03:00
Aleksey Kladov 5e6213b516 simplify 2019-06-11 18:28:51 +03:00
Aleksey Kladov f2ccc54468 use Source for TypeAlias 2019-06-11 18:28:51 +03:00
Aleksey Kladov 647c8f3df8 reduce duplication in hover 2019-06-11 18:28:51 +03:00
Aleksey Kladov 46bc8675ed use Source for statics and consts 2019-06-11 18:28:51 +03:00
Aleksey Kladov 4f94af3c4a use Source for Function 2019-06-11 18:28:51 +03:00
Aleksey Kladov 36865adcb9 Introduce HasSource trait 2019-06-11 18:28:51 +03:00
Aleksey Kladov 2a1fe26b6d use Source more 2019-06-11 18:28:51 +03:00
Aleksey Kladov 91c120ccea introduce Source struct 2019-06-11 18:28:51 +03:00
Shotaro Yamada acafbd66f8 Fix hover for pat that shadows items 2019-06-11 23:46:33 +09:00
Edwin Cheng 656a0fa9f9 Simpliy hover on ast::name 2019-06-11 01:18:32 +08:00
Edwin Cheng 34322ea9a3 Use classify_name_ref in hover 2019-06-11 00:34:43 +08:00
Edwin Cheng 60938ff73e Remove incorrect FIXME 2019-06-10 03:41:21 +08:00
Edwin Cheng 9ded8d2eab Formating 2019-06-10 03:39:42 +08:00
Edwin Cheng e91bf0bba4 Use &str instread of Option<String> 2019-06-10 03:37:34 +08:00
Edwin Cheng fc70275fed Rename "string" to "buf" 2019-06-10 03:30:03 +08:00
Edwin Cheng 41cb3fd758 Rename Description to ShortLabel 2019-06-10 03:28:53 +08:00
Edwin Cheng 358ad0efca Make description_from_symbol depends on symbol 2019-06-10 00:20:49 +08:00
Edwin Cheng 4db0f0ccaf Rename description funcs 2019-06-10 00:09:19 +08:00
Edwin Cheng e9848b2e6c Change docs and description to getter method 2019-06-10 00:04:03 +08:00
Edwin Cheng aacc894134 Add display::Description 2019-06-09 23:59:59 +08:00
Edwin Cheng 2acf1e16fc Construct doc individually 2019-06-09 03:27:01 +08:00
Edwin Cheng d46278d320 Remove node function in NavTarget 2019-06-08 22:27:11 +08:00
Aleksey Kladov 1b783e33e9 one macro def should be enough 2019-06-08 14:48:56 +03:00
bors[bot] 8ba5617613 Merge #1377
1377: Use inline snapshots in complete_keyword r=matklad a=sbihel

Relates to #1127

Co-authored-by: Simon Bihel <simon.bihel@ens-rennes.fr>
2019-06-06 13:10:46 +00:00
Alan Du b28ca32db2 Fix clippy::or_fun_call 2019-06-04 18:05:07 -04:00
Alan Du 40424d4222 Fix clippy::identity_conversion 2019-06-04 18:05:07 -04:00
Alan Du 682bf04bf4 Fix clippy::new_without_default 2019-06-04 18:05:07 -04:00
Alan Du 6939011b27 Fix clippy::assign_op_pattern 2019-06-04 18:05:07 -04:00
Alan Du 21d7964bc3 Fix clippy::useless_format 2019-06-04 18:05:07 -04:00
Alan Du fb592d76aa Fix clippy::into_iter_on_ref 2019-06-04 18:05:07 -04:00
Alan Du 619a615298 Fix clippy::len_zero 2019-06-04 18:05:07 -04:00
Alan Du fafca4cb11 Fix clippy::ptr_arg 2019-06-04 18:05:07 -04:00
Alan Du b9af1d7c42 Fix clippy::match_ref_pats 2019-06-04 18:05:07 -04:00
Alan Du ecd420636e Fix clippy::single_match 2019-06-04 18:05:07 -04:00
Simon Bihel ec31f475ca
Use inline snapshots in complete_keyword 2019-06-04 21:26:12 +01:00
Aleksey Kladov 8b7f58976b don't cache parses twice
Before this commit, `Parse`s for original file ended up two times in
salsa's db: first, when we parse original file, and second, when we
parse macro or a file.

Given that parse trees are the worst ofenders in terms of memory, it
makes sense to make sure we store them only once.
2019-06-02 20:15:10 +03:00