Commit graph

1829 commits

Author SHA1 Message Date
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
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
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
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
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
Pascal Hertleif
4fd3613434 Fix some typos 2019-02-12 15:02:57 +01:00
Aleksey Kladov
7820fb38f4 don't distinguish Create and Write events in VFS 2019-02-12 16:01:01 +03:00
Laurențiu Nicola
7e8527f748 Implement completion for associated items 2019-02-12 12:51:01 +02: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
Aleksey Kladov
8ef80086a0 fix regression in self-referential completion 2019-02-11 23:43:24 +03:00
Aleksey Kladov
0d060b073c remove hard-coded query-group macro 2019-02-11 22:24:39 +03:00
Aleksey Kladov
ae312680d6 docs 2019-02-11 21:31:54 +03:00
Aleksey Kladov
0d34a256de assign ids when converting tt 2019-02-11 21:12:06 +03:00
Aleksey Kladov
58897dd8dd assign ids to tokens 2019-02-11 21:02:19 +03:00
bors[bot]
b356ab46f2 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>
2019-02-11 17:30:53 +00:00
Andrea Pretto
5c9c0d3ae2 ra_assists: assist "providers" can produce multiple assists 2019-02-11 18:07:21 +01:00
bors[bot]
77ccac74f9 Merge #790
790: make macro-rules eq r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-11 16:24:39 +00:00
Aleksey Kladov
2efdf41bdb make macro a NameOwner 2019-02-11 19:24:13 +03:00
Aleksey Kladov
e7b370226c make macro-rules eq 2019-02-11 19:19:23 +03:00
Aleksey Kladov
dc951098f6 typo 2019-02-11 19:09:53 +03:00
Aleksey Kladov
bbcd3566de remove useless hash 2019-02-11 19:09:53 +03:00
Aleksey Kladov
28fd228c70 remove query_definitions 2019-02-11 17:44:54 +03:00
Aleksey Kladov
8cafdb3a99 rename combine -> or
This way we match API of Option

https://doc.rust-lang.org/std/option/enum.Option.html#method.or
2019-02-11 17:29:20 +03:00
Aleksey Kladov
58ed8ee665 use extern prelude in Resolver
This fixes two bugs:

- completion for paths works again
- we handle extern prelude shadowing more correctly
2019-02-11 15:41:39 +03:00
bors[bot]
2babbbb978 Merge #784
784: WIP: improve multi-crate fixtures r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-11 10:54:27 +00:00
Aleksey Kladov
9923383d53 add graph fixture 2019-02-11 13:47:17 +03:00
Aleksey Kladov
dced2f4ed4 Handle SourceRoots automatically in fixtures 2019-02-11 12:53:10 +03:00
Ville Penttinen
710975ecd8 Fix typo in Cargo.toml authors
Fixes typo introduced in #782
2019-02-11 10:20:04 +02:00
Ville Penttinen
ab3d231b1d Update authors field in Cargo.tomls to "rust-analyzer developers"
This closes #777
2019-02-11 08:55:35 +02:00
bors[bot]
ffd407afff Merge #778
778: Glob imports r=matklad a=flodiebold

This implements glob imports, completing #231 :)

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2019-02-10 20:15:41 +00:00
bors[bot]
b952c270ee 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>
2019-02-10 19:00:36 +00:00
Florian Diebold
2f24e740db Implement glob imports within the same crate
Fixes #231.
2019-02-10 16:48:29 +01:00