]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoMerge #825
bors[bot] [Thu, 14 Feb 2019 09:35:08 +0000 (09:35 +0000)]
Merge #825

825: Remove call to canonicalize in BatchDatabase::load_cargo r=matklad a=vipentti

Instead of using canonicalize, we now join the given path to
`std::env::current_dir()`, which either replaces the path, if the given path is
absolute, or joins the paths.

This fixes #821.

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
5 years agoRemove call to canonicalize in BatchDatabase::load_cargo
Ville Penttinen [Thu, 14 Feb 2019 08:42:40 +0000 (10:42 +0200)]
Remove call to canonicalize in BatchDatabase::load_cargo

Instead of using canonicalize, we now join the given path to
`std::env::current_dir()`, which either replaces the path, if the given path is
absolute, or joins the paths.

This fixes #821.

5 years agoMerge #818
bors[bot] [Wed, 13 Feb 2019 21:33:31 +0000 (21:33 +0000)]
Merge #818

818: In `RootConfig::contains`, check against canonicalized version of root path r=matklad a=pnkfelix

In `RootConfig::contains`, check against canonicalized version of root path since OS may hand us data that uses the canonical form rather than the root as specified by the user.

This is a step towards a resolution of issue #734 but does not completely fix the problem there.

Co-authored-by: Felix S. Klock II <pnkfelix@pnkfx.org>
5 years agorustfmt
Felix S. Klock II [Wed, 13 Feb 2019 21:31:33 +0000 (22:31 +0100)]
rustfmt

5 years agoMerge #816
bors[bot] [Wed, 13 Feb 2019 20:14:39 +0000 (20:14 +0000)]
Merge #816

816: Prelude & Edition 2015 import resolution r=matklad a=flodiebold

I implemented the prelude import, but it turned out to be useless without being able to resolve any of the imports in the prelude :sweat_smile: So I had to add some edition handling and handle 2015-style imports (at least the simplified scheme proposed in rust-lang/rust#57745). So now finally `Option` resolves :smile:

One remaining problem is that we don't actually know the edition for sysroot crates. They're currently hardcoded to 2015, but there's already a bunch of PRs upgrading the editions of various rustc crates, so we'll have to detect the edition somehow, or just change the hardcoding to 2018 later, I guess...

~Also currently missing is completion for prelude names, though that shouldn't be hard to add. And `Vec` still doesn't resolve, so I need to look into that.~

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
5 years agoComplete names from prelude
Florian Diebold [Wed, 13 Feb 2019 19:53:42 +0000 (20:53 +0100)]
Complete names from prelude

5 years agoHandle extern crates better, so they work correctly in 2015 edition
Florian Diebold [Wed, 13 Feb 2019 19:42:43 +0000 (20:42 +0100)]
Handle extern crates better, so they work correctly in 2015 edition

(see the removed comment.)

5 years agoMake edition handling a bit nicer and allow specifying edition in crate_graph macro
Florian Diebold [Wed, 13 Feb 2019 19:31:27 +0000 (20:31 +0100)]
Make edition handling a bit nicer and allow specifying edition in crate_graph macro

5 years agoResolve 2015 style imports
Florian Diebold [Mon, 11 Feb 2019 22:11:12 +0000 (23:11 +0100)]
Resolve 2015 style imports

5 years agoKeep track of crate edition
Florian Diebold [Sun, 10 Feb 2019 21:34:29 +0000 (22:34 +0100)]
Keep track of crate edition

5 years agoImport the prelude
Florian Diebold [Sun, 10 Feb 2019 19:44:34 +0000 (20:44 +0100)]
Import the prelude

5 years agoMerge #813
bors[bot] [Wed, 13 Feb 2019 16:17:10 +0000 (16:17 +0000)]
Merge #813

813: Add support for container_name in workspace/symbol query r=matklad a=vipentti

Currently this does not fill in the container_info if a type is defined on the top level in a file.

e.g. `foo.rs`
```rust
enum Foo { }
```
`Foo` will have None as the container_name, however

```rust
mod foo_mod {
    enum Foo { }
}
```
`Foo` has `foo_mod` as the container_name.

This closes #559

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
5 years agoIn `RootConfig::contains`, check against canonicalized version of root
Felix S. Klock II [Wed, 13 Feb 2019 16:16:28 +0000 (17:16 +0100)]
In `RootConfig::contains`, check against canonicalized version of root
path since OS may hand us data that uses that rather than the root as
specified by the user.

5 years agoFix possible issue where unnamed is_symbol_def would pop stack wrongly
Ville Penttinen [Wed, 13 Feb 2019 16:02:18 +0000 (18:02 +0200)]
Fix possible issue where unnamed is_symbol_def would pop stack wrongly

This removes is_symbol_def as unnecessary.

5 years agoUse cloned over map + clone
Ville Penttinen [Wed, 13 Feb 2019 15:42:15 +0000 (17:42 +0200)]
Use cloned over map + clone

5 years agoUse clone directly rather than map + clone
Ville Penttinen [Wed, 13 Feb 2019 15:28:15 +0000 (17:28 +0200)]
Use clone directly rather than map + clone

5 years agoRemove unnecessary braces
Ville Penttinen [Wed, 13 Feb 2019 09:08:25 +0000 (11:08 +0200)]
Remove unnecessary braces

5 years agoMerge #814
bors[bot] [Wed, 13 Feb 2019 08:26:34 +0000 (08:26 +0000)]
Merge #814

814: auto_import: import in enclosing module by default r=matklad a=eulerdisk

Simpler version of #795

Co-authored-by: Andrea Pretto <eulerdisk@gmail.com>
5 years agoMerge #815
bors[bot] [Tue, 12 Feb 2019 21:05:09 +0000 (21:05 +0000)]
Merge #815

815: Fix another crash r=matklad a=flodiebold

Found while typechecking rustc with better name resolution...

`walk_mut` doing a preorder walk can lead to an infinite recursion when substituting type parameters; postorder is actually what we want.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
5 years agoFix another crash
Florian Diebold [Mon, 11 Feb 2019 22:01:52 +0000 (23:01 +0100)]
Fix another crash

5 years agoauto_import: import in enclosing module instead of file
Andrea Pretto [Tue, 12 Feb 2019 20:14:51 +0000 (21:14 +0100)]
auto_import: import in enclosing module instead of file

5 years agoauto_import: more tests and some refactorings
Andrea Pretto [Mon, 11 Feb 2019 20:57:38 +0000 (21:57 +0100)]
auto_import: more tests and some refactorings

5 years agoAdd support for container_name in workspace/symbol query
Ville Penttinen [Tue, 12 Feb 2019 19:47:51 +0000 (21:47 +0200)]
Add support for container_name in workspace/symbol query

5 years agoMerge #811
bors[bot] [Tue, 12 Feb 2019 19:31:22 +0000 (19:31 +0000)]
Merge #811

811: Filter attributes from the completion details/label r=kjeremy a=lnicola

Before:

![image](https://user-images.githubusercontent.com/308347/52657254-efba9a00-2f00-11e9-952f-901910cfc459.png)

After:

![image](https://user-images.githubusercontent.com/308347/52657278-fb0dc580-2f00-11e9-9267-8aff44c93447.png)

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
5 years agoFilter attributes from the completion details/label
Laurențiu Nicola [Tue, 12 Feb 2019 17:58:36 +0000 (19:58 +0200)]
Filter attributes from the completion details/label

5 years agoMerge #810
bors[bot] [Tue, 12 Feb 2019 17:57:39 +0000 (17:57 +0000)]
Merge #810

810: make token trees eq r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agomake token trees eq
Aleksey Kladov [Tue, 12 Feb 2019 17:57:13 +0000 (20:57 +0300)]
make token trees eq

5 years agoMerge #809
bors[bot] [Tue, 12 Feb 2019 16:11:19 +0000 (16:11 +0000)]
Merge #809

809: what goes bump in the night? r=kjeremy a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
5 years agoMerge #808
bors[bot] [Tue, 12 Feb 2019 16:03:47 +0000 (16:03 +0000)]
Merge #808

808: rename yellow -> syntax_node r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agowhat goes bump in the night?
kjeremy [Tue, 12 Feb 2019 16:03:28 +0000 (11:03 -0500)]
what goes bump in the night?

5 years agorename yellow -> syntax_node
Aleksey Kladov [Tue, 12 Feb 2019 15:41:57 +0000 (18:41 +0300)]
rename yellow -> syntax_node

why yellow in the first place? Its red + green.

5 years agoMerge #807
bors[bot] [Tue, 12 Feb 2019 15:33:02 +0000 (15:33 +0000)]
Merge #807

807: Specify vscode 1.31 r=matklad a=kjeremy

This is for #796

It doesn't seem to fix the problem if you manually install the extension but it is the "right thing to do".

Co-authored-by: kjeremy <kjeremy@gmail.com>
5 years agoSpecify vscode 1.31
kjeremy [Tue, 12 Feb 2019 15:31:11 +0000 (10:31 -0500)]
Specify vscode 1.31

5 years agomention no compatability gurantee
Aleksey Kladov [Tue, 12 Feb 2019 15:28:39 +0000 (18:28 +0300)]
mention no compatability gurantee

5 years agoupdate readme to point to the WG
Aleksey Kladov [Tue, 12 Feb 2019 14:55:02 +0000 (17:55 +0300)]
update readme to point to the WG

5 years agoMerge #804
bors[bot] [Tue, 12 Feb 2019 14:08:20 +0000 (14:08 +0000)]
Merge #804

804: Fix some typos r=killercup a=killercup

Cherry-picked and updated from my now-closed PR. All credit goes to [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker).

Co-authored-by: Pascal Hertleif <killercup@gmail.com>
5 years agoFix some typos
Pascal Hertleif [Mon, 11 Feb 2019 16:18:27 +0000 (17:18 +0100)]
Fix some typos

5 years agoMerge #805
bors[bot] [Tue, 12 Feb 2019 13:06:16 +0000 (13:06 +0000)]
Merge #805

805: don't distinguish Create and Write events in VFS r=pnkfelix a=matklad

r? @pnkfelix

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agodon't distinguish Create and Write events in VFS
Aleksey Kladov [Tue, 12 Feb 2019 12:45:44 +0000 (15:45 +0300)]
don't distinguish Create and Write events in VFS

5 years agoMerge #801
bors[bot] [Tue, 12 Feb 2019 11:07:21 +0000 (11:07 +0000)]
Merge #801

801: Implement completion for associated items r=matklad a=lnicola

Fixes #747.

r? @matklad

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
5 years agoImplement completion for associated items
Laurențiu Nicola [Tue, 12 Feb 2019 08:33:23 +0000 (10:33 +0200)]
Implement completion for associated items

5 years agoMerge #802
bors[bot] [Tue, 12 Feb 2019 10:33:17 +0000 (10:33 +0000)]
Merge #802

802: fix obsolete comment r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoreplace clone with copy
Aleksey Kladov [Tue, 12 Feb 2019 10:32:34 +0000 (13:32 +0300)]
replace clone with copy

5 years agofix obsolete comment
Aleksey Kladov [Tue, 12 Feb 2019 10:29:27 +0000 (13:29 +0300)]
fix obsolete comment

5 years agoMerge #794
bors[bot] [Mon, 11 Feb 2019 22:05:39 +0000 (22:05 +0000)]
Merge #794

794: fix regression in self-referential completion r=flodiebold a=matklad

r? @flodiebold

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agofix regression in self-referential completion
Aleksey Kladov [Mon, 11 Feb 2019 20:40:08 +0000 (23:40 +0300)]
fix regression in self-referential completion

5 years agoMerge #793
bors[bot] [Mon, 11 Feb 2019 19:25:26 +0000 (19:25 +0000)]
Merge #793

793: remove hard-coded query-group macro r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoremove hard-coded query-group macro
Aleksey Kladov [Mon, 11 Feb 2019 19:24:39 +0000 (22:24 +0300)]
remove hard-coded query-group macro

5 years agoMerge #791
bors[bot] [Mon, 11 Feb 2019 18:32:18 +0000 (18:32 +0000)]
Merge #791

791: docs r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agodocs
Aleksey Kladov [Mon, 11 Feb 2019 18:31:54 +0000 (21:31 +0300)]
docs

5 years agoassign ids when converting tt
Aleksey Kladov [Mon, 11 Feb 2019 18:12:06 +0000 (21:12 +0300)]
assign ids when converting tt

5 years agoassign ids to tokens
Aleksey Kladov [Mon, 11 Feb 2019 16:28:39 +0000 (19:28 +0300)]
assign ids to tokens

5 years agoMerge #781
bors[bot] [Mon, 11 Feb 2019 17:30:53 +0000 (17:30 +0000)]
Merge #781

781: Refactor to allow for multiple assists  r=matklad a=eulerdisk

This is necessary to allow assist "providers" (which currently are simple free function) to produce multiple assists. I'm not sure this is the best possible refactoring tough.

Co-authored-by: Andrea Pretto <eulerdisk@gmail.com>
5 years agora_assists: assist "providers" can produce multiple assists
Andrea Pretto [Mon, 11 Feb 2019 17:07:21 +0000 (18:07 +0100)]
ra_assists: assist "providers" can produce multiple assists

5 years agoMerge #790
bors[bot] [Mon, 11 Feb 2019 16:24:39 +0000 (16:24 +0000)]
Merge #790

790: make macro-rules eq r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agomake macro a NameOwner
Aleksey Kladov [Mon, 11 Feb 2019 16:23:13 +0000 (19:23 +0300)]
make macro a NameOwner

5 years agomake macro-rules eq
Aleksey Kladov [Mon, 11 Feb 2019 16:19:23 +0000 (19:19 +0300)]
make macro-rules eq

5 years agoMerge #789
bors[bot] [Mon, 11 Feb 2019 16:10:34 +0000 (16:10 +0000)]
Merge #789

789: remove useless hash r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agotypo
Aleksey Kladov [Mon, 11 Feb 2019 16:07:49 +0000 (19:07 +0300)]
typo

5 years agoremove useless hash
Aleksey Kladov [Mon, 11 Feb 2019 16:05:58 +0000 (19:05 +0300)]
remove useless hash

5 years agoMerge #788
bors[bot] [Mon, 11 Feb 2019 14:45:32 +0000 (14:45 +0000)]
Merge #788

788: remove query_definitions r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoremove query_definitions
Aleksey Kladov [Mon, 11 Feb 2019 14:44:54 +0000 (17:44 +0300)]
remove query_definitions

5 years agoMerge #787
bors[bot] [Mon, 11 Feb 2019 14:30:35 +0000 (14:30 +0000)]
Merge #787

787: rename combine -> or r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agorename combine -> or
Aleksey Kladov [Mon, 11 Feb 2019 14:29:20 +0000 (17:29 +0300)]
rename combine -> or

This way we match API of Option

https://doc.rust-lang.org/std/option/enum.Option.html#method.or

5 years agoMerge #785
bors[bot] [Mon, 11 Feb 2019 14:02:59 +0000 (14:02 +0000)]
Merge #785

785: Fix completion of paths r=flodiebold a=matklad

r? @flodiebold

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoMerge #786
bors[bot] [Mon, 11 Feb 2019 12:46:58 +0000 (12:46 +0000)]
Merge #786

786: :arrow_up: insta r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years ago:arrow_up: insta
Aleksey Kladov [Mon, 11 Feb 2019 12:46:35 +0000 (15:46 +0300)]
:arrow_up: insta

5 years agouse extern prelude in Resolver
Aleksey Kladov [Mon, 11 Feb 2019 12:39:26 +0000 (15:39 +0300)]
use extern prelude in Resolver

This fixes two bugs:

- completion for paths works again
- we handle extern prelude shadowing more correctly

5 years agoMerge #784
bors[bot] [Mon, 11 Feb 2019 10:54:27 +0000 (10:54 +0000)]
Merge #784

784: WIP: improve multi-crate fixtures r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoadd graph fixture
Aleksey Kladov [Mon, 11 Feb 2019 10:11:24 +0000 (13:11 +0300)]
add graph fixture

5 years agoHandle SourceRoots automatically in fixtures
Aleksey Kladov [Mon, 11 Feb 2019 09:53:10 +0000 (12:53 +0300)]
Handle SourceRoots automatically in fixtures

5 years agoMerge #783
bors[bot] [Mon, 11 Feb 2019 08:22:39 +0000 (08:22 +0000)]
Merge #783

783: Fix typo in Cargo.toml authors r=matklad a=vipentti

Fixes typo introduced in #782

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
5 years agoFix typo in Cargo.toml authors
Ville Penttinen [Mon, 11 Feb 2019 08:20:04 +0000 (10:20 +0200)]
Fix typo in Cargo.toml authors

Fixes typo introduced in #782

5 years agoMerge #782
bors[bot] [Mon, 11 Feb 2019 07:20:51 +0000 (07:20 +0000)]
Merge #782

782: Update authors field in Cargo.tomls to "rust-analyzer developers" r=matklad a=vipentti

This closes #777

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
5 years agoUpdate authors field in Cargo.tomls to "rust-analyzer developers"
Ville Penttinen [Mon, 11 Feb 2019 06:55:35 +0000 (08:55 +0200)]
Update authors field in Cargo.tomls to "rust-analyzer developers"

This closes #777

5 years agoMerge #780
bors[bot] [Sun, 10 Feb 2019 21:37:57 +0000 (21:37 +0000)]
Merge #780

780: Mention node.js requirement in readme r=DJMcNab a=Matthias247

I tried building rust-analyzer according to the instructions, but it failed with a very non-descriptive error:

> will run: npm ci
> Error: Os { code: 2, kind: NotFound, message: "No such file or directory" }

It took me a while to figure out I had an outdated node version installed, which didn't support `npm ci`. I think mentioning the requirement explicitly might prevent others from running into the same issue.

Co-authored-by: Matthias Einwag <matthias.einwag@live.com>
5 years agoMention node.js requirement in readme
Matthias Einwag [Sun, 10 Feb 2019 21:09:33 +0000 (13:09 -0800)]
Mention node.js requirement in readme

5 years agoMerge #778
bors[bot] [Sun, 10 Feb 2019 20:15:41 +0000 (20:15 +0000)]
Merge #778

778: Glob imports r=matklad a=flodiebold

This implements glob imports, completing #231 :)

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
5 years agoMerge #762
bors[bot] [Sun, 10 Feb 2019 19:00:36 +0000 (19:00 +0000)]
Merge #762

762: "Dumb" auto import assist r=matklad a=eulerdisk

This adds a new assist to "add xxx::yyy to the current file" when the cursor is on a PATH. It manages correctly nested imports,`self` keyword and creates new nested imports if necessary. [See the tests]
It doesn't use name resolution so in that sense is 'dumb', but I have plans to do that. That in the future will be useful to auto import trait names in autocompletion for example.

It can easily be extended to provide multiple actions to select in which scope to import. That's another thing I plan to do.

@matklad I copied some indentation code from `ide_light`, I don't know at the moment if/how you want to refactor that code. This assist was meant to be in `ide_light`.

Co-authored-by: Andrea Pretto <eulerdisk@gmail.com>
5 years agoImplement glob imports within the same crate
Florian Diebold [Sun, 10 Feb 2019 15:19:50 +0000 (16:19 +0100)]
Implement glob imports within the same crate

Fixes #231.

5 years agoImport glob imports from other crates
Florian Diebold [Sun, 10 Feb 2019 14:41:44 +0000 (15:41 +0100)]
Import glob imports from other crates

This is the easy part since we don't have to consider the fixpoint algorithm.

5 years agoImplement glob imports from enums
Florian Diebold [Sun, 10 Feb 2019 14:34:04 +0000 (15:34 +0100)]
Implement glob imports from enums

5 years agoAdd some tests
Florian Diebold [Sun, 10 Feb 2019 14:16:23 +0000 (15:16 +0100)]
Add some tests

5 years agoMerge #774
bors[bot] [Sun, 10 Feb 2019 11:42:42 +0000 (11:42 +0000)]
Merge #774

774: Batch crate & command r=matklad a=flodiebold

This adds a new crate, `ra_batch`, which is intended for scenarios where you're loading a workspace once and then running some analyses using the HIR API. Also, it adds a command to `ra_cli` which uses that to type-check all crates in a workspace and print some statistics:

E.g. in rust-analyzer:
```
> $ time target/release/ra_cli analysis-stats
Database loaded, 21 roots
Crates in this dir: 28
Total modules found: 231
Total declarations: 3694
Total functions: 2408
Total expressions: 47017
Expressions of unknown type: 19826 (42%)
Expressions of partially unknown type: 4482 (9%)
target/release/ra_cli analysis-stats  3,23s user 0,60s system 100% cpu 3,821 total
```

Or in rust-lang/rust:
```
> $ time ../opensource/rust-analyzer/target/release/ra_cli analysis-stats
Database loaded, 77 roots
Crates in this dir: 130
Total modules found: 1820
Total declarations: 35038
Total functions: 25914
Total expressions: 753678
Expressions of unknown type: 337975 (44%)
Expressions of partially unknown type: 92314 (12%)
../opensource/rust-analyzer/target/release/ra_cli analysis-stats  13,45s user 2,08s system 100% cpu 15,477 total
```

~This still needs a test. Type-checking all of rust-analyzer sadly takes almost a minute when compiled in debug mode :sweat_smile: So I'll need to add something simpler (maybe just looking at a few modules).~

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
5 years agoSpell cases explicitly in Ty::walk{_mut}
Florian Diebold [Sun, 10 Feb 2019 11:35:30 +0000 (12:35 +0100)]
Spell cases explicitly in Ty::walk{_mut}

5 years agoClean up a bit
Florian Diebold [Sun, 10 Feb 2019 10:48:59 +0000 (11:48 +0100)]
Clean up a bit

5 years agoAdd a smoke test for ra_batch
Florian Diebold [Sun, 10 Feb 2019 10:44:53 +0000 (11:44 +0100)]
Add a smoke test for ra_batch

5 years agoMerge #776
bors[bot] [Sun, 10 Feb 2019 10:33:35 +0000 (10:33 +0000)]
Merge #776

776: Add support for a seperate output channel for trace messages r=DJMcNab a=DJMcNab

See https://github.com/Microsoft/vscode-languageserver-node/pull/444

I am just working on testing this now, but I think it should work.

Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
5 years agoUpdate dependencies
DJMcNab [Sun, 10 Feb 2019 10:32:45 +0000 (10:32 +0000)]
Update dependencies

5 years agoFix trace and prettier
DJMcNab [Sun, 10 Feb 2019 10:30:16 +0000 (10:30 +0000)]
Fix trace and prettier

5 years agoAdd support for a seperate output channel for trace messages
DJMcNab [Sun, 10 Feb 2019 10:06:33 +0000 (10:06 +0000)]
Add support for a seperate output channel for trace messages

5 years agoAdd an ra_cli command that analyses all crates in the current workspace
Florian Diebold [Sat, 9 Feb 2019 17:27:11 +0000 (18:27 +0100)]
Add an ra_cli command that analyses all crates in the current workspace

... and prints various stats about how many expressions have a type etc.

5 years agoImplement BatchDatabase construction
Florian Diebold [Sat, 9 Feb 2019 12:06:12 +0000 (13:06 +0100)]
Implement BatchDatabase construction

5 years agoAdd new crate
Florian Diebold [Tue, 5 Feb 2019 21:54:17 +0000 (22:54 +0100)]
Add new crate

5 years agoMerge #770
bors[bot] [Sun, 10 Feb 2019 08:16:08 +0000 (08:16 +0000)]
Merge #770

770: Fix introduce var duplicating newlines r=matklad a=vipentti

This fixes #713.

If the block before the statement we want to use introduce var on, had empty
lines these empty lines would also be added between the let-statement and
the current line where the new variable is used.

This fixes that by trimming excess newlines from the start of the indent chunk
and simply adding a single newline (when the chunk had newlines) between the
let-statement and the current statement. If there were no newlines this
matches the previous behaviour.

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
5 years agoMerge #773
bors[bot] [Sun, 10 Feb 2019 08:04:49 +0000 (08:04 +0000)]
Merge #773

773: Crash fixes r=matklad a=flodiebold

This fixes a bunch of crashes found while running type inference on the whole rustc repo :sweat_smile:
 - avoid infinite recursion with ref bind patterns
 - avoid another infinite recursion
 - handle literal patterns, add a new LITERAL_PAT syntax node for this
 - fix an expect that's wrong on some invalid code

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
5 years agoAdd comment and mark
Florian Diebold [Sat, 9 Feb 2019 21:03:01 +0000 (22:03 +0100)]
Add comment and mark

5 years agoFix another crash, and try harder to prevent stack overflows
Florian Diebold [Sat, 9 Feb 2019 20:31:31 +0000 (21:31 +0100)]
Fix another crash, and try harder to prevent stack overflows

5 years agoFix another crash found when analyzing rustc
Florian Diebold [Sat, 9 Feb 2019 19:55:51 +0000 (20:55 +0100)]
Fix another crash found when analyzing rustc

5 years agoFix handling of literal patterns
Florian Diebold [Sat, 9 Feb 2019 18:07:35 +0000 (19:07 +0100)]
Fix handling of literal patterns

Wrap them in a LiteralPat node so they can be distinguished from literal
expressions.