Commit Graph

2714 Commits

Author SHA1 Message Date
Aleksey Kladov
434f1520df add ref postfix template 2019-02-14 20:13:39 +03:00
bors[bot]
b85c189500 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>
2019-02-14 09:35:08 +00:00
Ville Penttinen
f7a78b2846 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.
2019-02-14 10:57:06 +02:00
bors[bot]
ebfa26658e 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>
2019-02-13 21:33:31 +00:00
Felix S. Klock II
da300fd553 rustfmt 2019-02-13 22:31:33 +01:00
bors[bot]
cb4327b3a9 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 😅 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 😄 

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>
2019-02-13 20:14:39 +00:00
Florian Diebold
911e32bca9 Complete names from prelude 2019-02-13 21:13:08 +01:00
Florian Diebold
92c595a6a6 Handle extern crates better, so they work correctly in 2015 edition
(see the removed comment.)
2019-02-13 21:13:08 +01:00
Florian Diebold
70839b7ef8 Make edition handling a bit nicer and allow specifying edition in crate_graph macro 2019-02-13 20:31:47 +01:00
Florian Diebold
d5ad38cbb8 Resolve 2015 style imports 2019-02-13 20:10:46 +01:00
Florian Diebold
3a9934e2c3 Keep track of crate edition 2019-02-13 20:10:46 +01:00
Florian Diebold
1526eb25c9 Import the prelude 2019-02-13 20:10:09 +01:00
bors[bot]
65266c644a 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>
2019-02-13 16:17:10 +00:00
Felix S. Klock II
cfed7c59f4 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.
2019-02-13 17:16:28 +01:00
Ville Penttinen
3973974de1 Fix possible issue where unnamed is_symbol_def would pop stack wrongly
This removes is_symbol_def as unnecessary.
2019-02-13 18:02:18 +02:00
Ville Penttinen
0c37a9cc28 Use cloned over map + clone 2019-02-13 17:42:15 +02:00
Ville Penttinen
d9905f7be5 Use clone directly rather than map + clone 2019-02-13 17:28:15 +02:00
Ville Penttinen
2ef6c469ef Remove unnecessary braces 2019-02-13 11:08:25 +02:00
bors[bot]
74d03d57e7 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>
2019-02-13 08:26:34 +00:00
bors[bot]
92faa2225a 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>
2019-02-12 21:05:09 +00:00
Florian Diebold
e5f9d54661 Fix another crash 2019-02-12 21:49:54 +01:00
Andrea Pretto
6518fb2bf8 auto_import: import in enclosing module instead of file 2019-02-12 21:18:55 +01:00
Andrea Pretto
468e1d4c5e auto_import: more tests and some refactorings 2019-02-12 21:18:42 +01:00
Ville Penttinen
dd6307ddc4 Add support for container_name in workspace/symbol query 2019-02-12 22:06:14 +02:00
bors[bot]
61324a845b 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>
2019-02-12 19:31:22 +00:00
Laurențiu Nicola
040fb91387 Filter attributes from the completion details/label 2019-02-12 20:35:10 +02:00
bors[bot]
24287d024d Merge #810
810: make token trees eq r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-12 17:57:39 +00:00
Aleksey Kladov
5f89180fd9 make token trees eq 2019-02-12 20:57:13 +03:00
bors[bot]
3e367b5760 Merge #809
809: what goes bump in the night? r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
2019-02-12 16:11:19 +00:00
bors[bot]
afdcfb79b9 Merge #808
808: rename yellow -> syntax_node r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-12 16:03:47 +00:00
kjeremy
c15d0e0194 what goes bump in the night? 2019-02-12 11:03:28 -05:00
Aleksey Kladov
4e91c23c79 rename yellow -> syntax_node
why yellow in the first place? Its red + green.
2019-02-12 19:02:30 +03:00
bors[bot]
abc5d377e2 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>
2019-02-12 15:33:02 +00:00
kjeremy
50383ceae1 Specify vscode 1.31 2019-02-12 10:31:11 -05:00
Aleksey Kladov
72a122092b mention no compatability gurantee 2019-02-12 18:28:39 +03:00
Aleksey Kladov
03691c797a update readme to point to the WG 2019-02-12 17:55:02 +03:00
bors[bot]
74ecfc2729 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>
2019-02-12 14:08:20 +00:00
Pascal Hertleif
4fd3613434 Fix some typos 2019-02-12 15:02:57 +01:00
bors[bot]
a36e310229 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>
2019-02-12 13:06:16 +00:00
Aleksey Kladov
7820fb38f4 don't distinguish Create and Write events in VFS 2019-02-12 16:01:01 +03:00
bors[bot]
19718ea109 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>
2019-02-12 11:07:21 +00:00
Laurențiu Nicola
7e8527f748 Implement completion for associated items 2019-02-12 12:51:01 +02:00
bors[bot]
37148000dc Merge #802
802: fix obsolete comment r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-12 10:33:17 +00:00
Aleksey Kladov
60524771fd replace clone with copy 2019-02-12 13:32:34 +03:00
Aleksey Kladov
fa2e6e0bda fix obsolete comment 2019-02-12 13:29:27 +03:00
bors[bot]
db43080693 Merge #794
794: fix regression in self-referential completion r=flodiebold a=matklad

r? @flodiebold 

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-11 22:05:39 +00:00
Aleksey Kladov
8ef80086a0 fix regression in self-referential completion 2019-02-11 23:43:24 +03:00
bors[bot]
db6d214411 Merge #793
793: remove hard-coded query-group macro r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-11 19:25:26 +00:00
Aleksey Kladov
0d060b073c remove hard-coded query-group macro 2019-02-11 22:24:39 +03:00
bors[bot]
a78142cc64 Merge #791
791: docs r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-11 18:32:18 +00:00