Commit Graph

434 Commits

Author SHA1 Message Date
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
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
Aleksey Kladov
2f02e1a8ba collect macro queries 2019-06-02 18:58:49 +03:00
Aleksey Kladov
5af9e475f4 add AstDatabase 2019-06-02 12:27:36 +03:00
Aleksey Kladov
011599df27 collect types and bodies 2019-06-01 22:47:20 +03:00
Aleksey Kladov
f7d3a87305 collect impl source maps 2019-06-01 22:31:22 +03:00
Aleksey Kladov
d7a2a9171e don't cache ast_id_to_node 2019-06-01 22:14:42 +03:00
Aleksey Kladov
37e80c5297 show macro expanded trees in the stats as well 2019-06-01 22:13:24 +03:00
Edwin Cheng
371961be0e Improve goto definition for MBE 2019-06-01 19:34:19 +08:00
Laurențiu Nicola
be15541b03 Sort hover results in tests 2019-05-30 21:20:17 +03:00
Aleksey Kladov
b6a854e161 update ra_ide_api to use builtins 2019-05-30 16:10:07 +03:00
Aleksey Kladov
18ed351747 ⬆️ parking_lot 2019-05-30 12:02:30 +03:00
Aleksey Kladov
0ee5bd16c9 cancel salsa's validation
This small fix should improve rust-analyzer resopnsivness for
real-time operations like onEnter handling.

Turns out, salsa's validation can take hundreds of milliseconds, and,
in case no changes were made, it won't be triggering any queries.

Because we check for cancellation in queries, that means that
validation is not cancellable!

What this PR does is injecting check_canceled checks into validation,
by using salsa's event API, which wasn't meant to be used like this,
but, hey, it works!

Here's the onEnter handling before and after this change:

https://youtu.be/7-ffPzgvH7o
2019-05-30 10:06:02 +03:00
Laurențiu Nicola
b1e59cb095 Highlight primitive types 2019-05-29 21:54:22 +03:00
bors[bot]
7a1cae59ac Merge #1337
1337: Move syntax errors our of syntax tree r=matklad a=matklad

I am not really sure if it's a good idea, but `SyntaxError` do not really belong to a `SyntaxTree`. So let's just store them on the side?

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-05-29 06:40:39 +00:00
Laurențiu Nicola
9146a64386 Highlight type names correctly 2019-05-29 08:30:53 +03:00
Aleksey Kladov
80a1725147 fix todo 2019-05-28 18:50:53 +03:00
Aleksey Kladov
61e1474ab3 fix typos in mbe tests 2019-05-28 18:46:11 +03:00
bors[bot]
b2bf41b2ba Merge #1334
1334: check for cancellation during macro expansion r=matklad a=matklad

closes #1331

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-05-27 11:45:41 +00:00
Aleksey Kladov
0d2f97e83e specifically profile cancellation 2019-05-27 14:27:05 +03:00
Pascal Hertleif
5abcca516d
make it build again 2019-05-27 11:26:35 +02:00
Pascal Hertleif
2b200f6e1a
Disable broken struct field rainbowing 2019-05-27 11:26:35 +02:00
Pascal Hertleif
43d5a49653
More clever highlighting, incl draft for structs 2019-05-27 11:26:35 +02:00
Pascal Hertleif
ed89b0638b
Hash based on binding name and shadow counter 2019-05-27 11:26:35 +02:00
Pascal Hertleif
5bf3e949e8
Semantic highlighting spike
Very simple approach: For each identifier, set the hash of the range
where it's defined as its 'id' and use it in the VSCode extension to
generate unique colors.

Thus, the generated colors are per-file. They are also quite fragile,
and I'm not entirely sure why. Looks like we need to make sure the
same ranges aren't overwritten by a later request?
2019-05-27 11:26:33 +02:00
Aleksey Kladov
c6e905a79f Colorize Rust code as HTML 2019-05-25 13:42:34 +03:00
Aleksey Kladov
53ae63835d ⬆️ rustc 2019-05-24 01:46:23 +03:00
Aleksey Kladov
f6d2c3f9d5 profile highlighting 2019-05-23 21:19:54 +03:00
Aleksey Kladov
5d54aa6781 add union to code_model 2019-05-23 20:18:47 +03:00
Laurențiu Nicola
f1ec88cc56 Improve highlighting of name refs 2019-05-23 15:31:35 +03:00
Laurențiu Nicola
444e52e519 Move NameRef classification logic out of reference_definition 2019-05-23 12:32:47 +03:00
bors[bot]
51e82fe6d2 Merge #1299
1299: Use ThemeColor and add support for light themes r=matklad a=lnicola

Part of #1294.

- switch to `ThemeColor`
- add light and high contrast theme definitions
- highlight control flow keywords and `unsafe`


Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2019-05-21 13:58:42 +00:00
Laurențiu Nicola
b08362f6d2 Address feedback 2019-05-21 16:28:10 +03:00
Laurențiu Nicola
9ade271a67 Use ThemeColor and add support for light themes 2019-05-21 14:19:08 +03:00
Aleksey Kladov
507c97a18c ⬆️ insta 2019-05-21 13:21:54 +03:00
Sergey Parilin
993abedd77 apply T! macro where it is possible 2019-05-15 15:35:47 +03:00
Aleksey Kladov
16c7405262 expand to syntax node 2019-05-14 09:03:43 +03:00
Aleksey Kladov
549728bba8 make AstId untyped 2019-05-13 19:39:06 +03:00
bors[bot]
033a32f349 Merge #1257
1257: Implemented tkn! macro for syntax kinds r=matklad a=pasa

Implementation of #1248

Co-authored-by: Sergey Parilin <sergey.parilin@fxdd.com>
2019-05-13 13:49:14 +00:00
Sergey Parilin
57bb618fd3 Implemented T! macro for syntax kinds 2019-05-13 15:19:57 +03:00
Aleksey Kladov
9cba67b2ad simplify 2019-05-12 23:03:37 +03:00
Sergey Parilin
26ed925685 fill struct fields diagnostic 2019-05-06 17:16:11 +03:00
Marco Groppo
7e7ea0e79d Profile diagnostics. 2019-05-05 16:32:53 +02:00