Commit Graph

600 Commits

Author SHA1 Message Date
Aleksey Kladov
ef2b84ddf1 introduce hir debugging infra
This is to make debugging rust-analyzer easier.

The idea is that `dbg!(krate.debug(db))` will print the actual, fuzzy
crate name, instead of precise ID. Debug printing infra is a separate
thing, to make sure that the actual hir doesn't have access to global
information.

Do not use `.debug` for `log::` logging: debugging executes queries,
and might introduce unneded dependencies to the crate graph
2019-09-09 12:32:16 +03:00
Aleksey Kladov
6c11935712 simplify 2019-09-06 21:57:11 +03:00
Aleksey Kladov
9ae455ea52 make source_root API more abstract 2019-09-06 14:21:11 +03:00
Aleksey Kladov
33965f0f3e fix renaming of modules 2019-09-05 21:36:40 +03:00
Aleksey Kladov
8b8a11ded7 always use \n newlines 2019-09-05 17:50:39 +03:00
Florian Diebold
b8c1e402fa Make type walking infrastructure a bit nicer
If/when we switch to using Chalk's Ty, we'll need to replace this by its `Fold`
trait, but I didn't want to import the whole thing just yet.
2019-09-03 14:00:35 +02:00
Aleksey Kladov
e94587e315 fix assists 2019-09-02 21:52:06 +03:00
Aleksey Kladov
5e3f291195 fix hir for new block syntax 2019-09-02 21:23:19 +03:00
Aleksey Kladov
0f6c048ce1 ⬆️ insta 2019-08-29 17:04:01 +03:00
Phil Ellison
14a23d1bde Strip indents and empty lines in check_apply_diagnostic_fix_from_position 2019-08-25 12:56:23 +03:00
Phil Ellison
59dd30402b Specify cursor position in ok-wrapping tests, and switch to using analysis_and_position function 2019-08-25 12:56:23 +03:00
Phil Ellison
6620949cae Simplify checking return type, add new test 2019-08-25 12:56:23 +03:00
Phil Ellison
4f6f3933ec cargo format 2019-08-25 12:55:56 +03:00
Phil Ellison
456e72c4e4 Change test to not rely on trait inference 2019-08-25 12:55:56 +03:00
Phil Ellison
a40e390860 Check type rather than just name in ok-wrapping diagnostic. Add test for handling generic functions (which currently fails) 2019-08-25 12:55:56 +03:00
Phil Ellison
62c2002e2b Add test that ok-wrapping handles type aliases 2019-08-25 12:55:55 +03:00
Phil Ellison
d025016f92 Mock std String and Result types in tests for ok-wrapping diagnostic 2019-08-25 12:55:55 +03:00
Phil Ellison
d00a285fa7 Initial implementation of Ok-wrapping 2019-08-25 12:55:55 +03:00
Aleksey Kladov
5b18a4eef9 rename struct -> record, pos -> tuple 2019-08-23 16:59:50 +03:00
bors[bot]
0a612fad02
Merge #1715
1715: Feature flags r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-08-22 12:17:21 +00:00
Aleksey Kladov
69bbe79c50 implement feature flags 2019-08-22 15:07:31 +03:00
cynecx
1d87f85441 Update snapshots/highlighting.html to use correct highlighting 2019-08-22 01:08:07 +02:00
cynecx
5534167f58 Fix syntax-highlighting for fields (NAMED_FIELD_DEF) 2019-08-22 00:39:18 +02:00
Aleksey Kladov
db84437d6f qualify ast types with ast::
By convention, ast nodes should always be used as `ast::FnDef`. This
is to avoid confusion with similarly-named hir types.
2019-08-19 14:27:15 +03:00
Aleksey Kladov
df6dce23a7 remove ast::*Kind from ra_ide_api 2019-08-19 14:13:58 +03:00
bors[bot]
cd24349997
Merge #1691
1691: Show inherent and trait impls of structs and enums r=viorina a=viorina



Co-authored-by: Ekaterina Babshukova <ekaterina.babshukova@yandex.ru>
2019-08-16 14:24:51 +00:00
Ekaterina Babshukova
35a04ec066 show inherent and trait impls of structs and enums 2019-08-16 17:07:45 +03:00
Aleksey Kladov
343463c824 implement durability 2019-08-15 15:27:00 +03:00
Evgenii P
475a93097f Use Source in Diagnostic and implement 2019-08-12 23:06:08 +07:00
Aleksey Kladov
6efc79b89d implement while let desugaring 2019-08-07 15:14:22 +02:00
Kirill Bulatov
3fb6462d54 Style and test fixes 2019-08-05 01:02:36 +03:00
Kirill Bulatov
15411d4474 Use proper inlay kinds 2019-08-05 00:28:36 +03:00
bors[bot]
4912cc35af Merge #1634
1634: Implement .await completion for futures r=flodiebold a=eupn

Closes #1263 with completion for `.await` syntax for types that are implementing `std::future::Future` trait.

r? @flodiebold 

Co-authored-by: Evgenii P <eupn@protonmail.com>
2019-08-04 09:42:17 +00:00
Laurențiu Nicola
5153001889 Bump deps 2019-08-04 10:43:51 +03:00
Evgenii P
d610adfc2b Employ early return pattern more 2019-08-04 08:03:17 +07:00
Evgenii P
6a94f203fc Use std::future::Future trait from stdlib 2019-08-03 17:07:20 +07:00
Evgenii P
957de26a1d do fixup: remove unused imports in complete_dot.rs 2019-08-03 02:48:36 +07:00
Evgenii P
40facb559a Change postfix completion to keyword completion 2019-08-03 02:40:59 +07:00
Evgenii P
ab7774545c Use future lang item instead of hardcoded std::future::Future 2019-08-03 01:53:51 +07:00
Evgenii P
30bc3b93be rustfmt 2019-08-03 01:16:20 +07:00
Evgenii P
c417b98f02 Implement completion for the .await syntax 2019-08-03 01:15:43 +07:00
kjeremy
8d2068cf32 Update insta to 0.9.0 and cargo update 2019-07-31 10:05:00 -04:00
bors[bot]
359b3376b3 Merge #1601
1601: Inline snapshots for tests r=matklad a=theotherphil

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/1127.

The "cargo format" commits are required to get the formatting tests to pass. However, they actually mess up the formatting.

Co-authored-by: Phil Ellison <phil.j.ellison@gmail.com>
2019-07-29 12:54:40 +00:00
Kirill Bulatov
b8f95f42e1 Support destructuring patterns 2019-07-29 00:33:10 +03:00
Phil Ellison
67e75ca126 Rerun cargo format, to make tests pass and formatting incorrect 2019-07-28 12:45:01 +01:00
Phil Ellison
44b2642900 Remove vertical ellipses in references.cs 2019-07-28 12:37:03 +01:00
Phil Ellison
1b74eed8ca Remove vertical ellipses from tests in complete_snippet.rs and presentation.rs 2019-07-28 12:33:21 +01:00
Phil Ellison
46c07ed578 Remove vertical ellipses from tests in complete_scope.rs 2019-07-28 12:28:14 +01:00
Phil Ellison
5c4df97996 cargo format 2019-07-28 12:08:06 +01:00
Phil Ellison
9f6909c0ce Inline snapshot for test_file_structure (less clear that this one is a good idea) 2019-07-28 12:01:28 +01:00