Commit Graph

7175 Commits

Author SHA1 Message Date
bors[bot]
c486f8477a
Merge #2228
2228: Update Crates r=matklad a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-11-13 13:30:50 +00:00
Jeremy Kolb
1e40b395ed Update Crates 2019-11-13 08:25:37 -05:00
bors[bot]
d523366299
Merge #2226
2226: Use strongly-typed ast building for early-return assist r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-13 08:59:48 +00:00
Aleksey Kladov
4cea6bb6f1 Make make:: builders slightly more convenient 2019-11-13 11:59:18 +03:00
Aleksey Kladov
e177c65e36 Use strongly-typed ast building for early-return assist 2019-11-13 11:54:21 +03:00
Aleksey Kladov
2a69d584d6 Add a bit of types 2019-11-13 10:54:50 +03:00
Aleksey Kladov
018255efe3 Minor cleanup 2019-11-13 10:32:53 +03:00
bors[bot]
6ca0d79cff
Merge #2225
2225: Reduce duplication between uncertain floats & ints r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-13 06:57:13 +00:00
Aleksey Kladov
70dd70b1fc Reduce duplication between uncertain floats & ints 2019-11-13 09:56:33 +03:00
Seivan Heidari
0525778a3a Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes 2019-11-12 19:04:54 +01:00
bors[bot]
3322d65add
Merge #2223
2223: Move expression lowering to hir_def r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-12 15:53:55 +00:00
Aleksey Kladov
fe5e74e083 Add helpful pointer to module docs 2019-11-12 18:53:26 +03:00
Aleksey Kladov
1c0a3a1a30 Drop obsolete comment 2019-11-12 18:51:37 +03:00
Aleksey Kladov
1a90ad5802 Move expression lowering to hir_def 2019-11-12 18:46:57 +03:00
bors[bot]
2549be750e
Merge #2217
2217: Implement FromStr for enum Edition r=matklad a=clemarescx

Just did this as I came across the comment in the code asking for implementing `std::str::FromStr` for `input::Edition`.
Not sure what was meant by "proper error handling" though, `panic!` with a descriptive message might not be it 😅 

Co-authored-by: Metabaron <metabaron@tuta.io>
2019-11-12 15:30:36 +00:00
bors[bot]
55f3ff241a
Merge #2222
2222: Remove owner from Body r=matklad a=matklad

cc @flodiebold 

I do this so that it's easier to move lowering code to another crate (owner is the only thing that tethers Body to the rest of the code), but it's interesting that this is a net reduction of lines. I think this might be considered an evidence that it's a good idea to not add "parent pointers" / parent ids to data structures, and instead add them to `ctx` objects which are used when building data structures

bors r+

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-12 13:52:30 +00:00
Aleksey Kladov
fe00db72b9 Remove owner from Body 2019-11-12 16:46:27 +03:00
bors[bot]
6149ee30ef
Merge #2221
2221: Disallow regressing crate docs r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-12 12:41:55 +00:00
Aleksey Kladov
30bf7e43db Disallow regressing crate docs 2019-11-12 15:41:02 +03:00
Aleksey Kladov
d09e5a3d9e Move definition of exprs to hir_def 2019-11-12 15:09:25 +03:00
Metabaron
dae087656a Fix unused import 2019-11-12 12:01:13 +01:00
Metabaron
53b9c1c8d8 return Error instead of panicking in from_cargo_metadata 2019-11-12 12:01:13 +01:00
Metabaron
b69738590c Implement FromStr for enum Edition 2019-11-12 12:01:13 +01:00
Aleksey Kladov
f5e1b0f97c Minor refactoring 2019-11-12 12:07:47 +03:00
Aleksey Kladov
fc055281a5 Minor cleanup 2019-11-12 11:49:16 +03:00
Seivan Heidari
11755f3eff Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes 2019-11-12 09:46:35 +01:00
bors[bot]
aa0646be29
Merge #2216
2216: Implement postfix completions feature flag r=matklad a=chmln

Resolves #2186 

Co-authored-by: Greg <gregory.mkv@gmail.com>
2019-11-12 05:37:15 +00:00
Greg
088e5e1721
fix typo 2019-11-11 22:56:39 -05:00
Greg
eb72156094
Implement postfix completions feature flag 2019-11-11 22:55:10 -05:00
Seivan Heidari
e847822cec Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes 2019-11-12 02:17:52 +01:00
bors[bot]
602f11f27b
Merge #2214
2214: Fix snap missing node path r=matklad a=mkucijan

#2045 

Co-authored-by: mkucijan <mkucijan@gmail.com>
2019-11-11 20:00:14 +00:00
mkucijan
d67157c0f1 Add '--scripts-prepend-node-pat' to npm run package 2019-11-11 20:51:07 +01:00
bors[bot]
f742803c6a
Merge #2213
2213: Hir generic param r=flodiebold a=matklad

r? @flodiebold 

This should make the life of IDE easier: before, it got `GenericParam(u32)` which was of questionable utility. Now, it's a proper code_model type, so it can gain `source`, `name`, `module` and all the other hir methods, should the IDE need them. Moreover, IDE now doesn't care about internal representation of generic param, which seems like a long-term win. 

The problem is, of course, that we now have to types named `GenericParam` in hir: this code_model type, and an internal type with an index which doesn't know about the parent. I think it's fine for the time being, but, after we finish cratefication of hir, this local `GenericParam` should move to `hir_def` or `hir_ty`, and *maybe* restrucured as `ParamId / PramData` pair. 

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-11 16:21:55 +00:00
Aleksey Kladov
c5a18c44e5 Introduce hir::GenericParam
Unlike existing hir::GenericParams, this is a global ID.
2019-11-11 17:36:27 +03:00
Aleksey Kladov
ff609cc497 Don't reexport generics from HIR 2019-11-11 17:22:06 +03:00
Seivan Heidari
68a5ff050f Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes 2019-11-11 14:31:09 +01:00
bors[bot]
a599147b42
Merge #2200
2200: Add variables to HIR r=matklad a=matklad

Introduce a `hir::Variable`, which should cover locals, parameters and `self`. Unlike `PatId`, variable knows it's owner so it is self-contained, and should be more convenient to use from `ra_ide_api`. 

The goal here is to hide more details about `Body` from hir, which should make it easier to move `Body` into `hir_def`. I don't think that `ra_ide_api` intrracts with bodies directly at the moment anyway, but the glue layer is based basically on `ast::BindPat`, which seems pretty brittle. 

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-11 11:48:02 +00:00
Aleksey Kladov
8b7f853cc1 Add hir::Local 2019-11-11 14:42:08 +03:00
bors[bot]
ef2a9aedb6
Merge #2205
2205: Implement bulitin line! macro r=matklad a=edwin0cheng

This PR implements bulitin macro `line!` and add basic infra-structure for other bulitin macros:

1. Extend `MacroDefId` to support builtin macros
2. Add a `quote!` macro for simple quasi quoting.

Note that for support others builtin macros, eager macro expansion have to be supported first, this PR not try to handle it. :)

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-11-11 10:53:24 +00:00
Edwin Cheng
4f7df2aac1 Add MacroDefKind 2019-11-11 18:48:16 +08:00
bors[bot]
5ac4ffbc12
Merge #2211
2211: Refactor highlighting to use classify_name r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-11 09:52:56 +00:00
Aleksey Kladov
ef70925f5f Refactor highlighting to use classify_name 2019-11-11 12:52:14 +03:00
bors[bot]
3dff405443
Merge #2210
2210: Introduce ToNav trait r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-11 09:20:20 +00:00
Aleksey Kladov
4deba88c33 Introduce ToNav trait 2019-11-11 12:19:57 +03:00
bors[bot]
2ccc45979c
Merge #2209
2209: impl fmt::Display for BuiltinType r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-11 09:00:27 +00:00
Aleksey Kladov
5bb92c2d1a impl fmt::Display for BuiltinType 2019-11-11 11:59:19 +03:00
bors[bot]
113d7e44b7
Merge #2203
2203: Hover for builtins r=matklad a=kjeremy

Fixes #2192 

Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2019-11-11 08:41:54 +00:00
bors[bot]
8f98f07303
Merge #2207
2207: Forbid visibility qualifiers in traits r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-11 08:27:38 +00:00
Aleksey Kladov
1860f9ab43 Forbid visibility qualifiers in traits 2019-11-11 11:26:57 +03:00
bors[bot]
a09b5b91ae
Merge #2206
2206: Disable debuginfo in dev builds r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-11-11 07:12:43 +00:00