diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-13 20:14:39 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-13 20:14:39 +0000 |
commit | cb4327b3a9f0858235dc20b7c5c7e25c6c330aab (patch) | |
tree | 489b3497b2762dcabf60d2674031585431e16959 /crates/ra_syntax/src/grammar.ron | |
parent | 65266c644a31e6b321e5afb3c5a2ee75be76cb0c (diff) | |
parent | 911e32bca9b73e66eceb6bbee3768c82e94597d5 (diff) |
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 <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/grammar.ron')
-rw-r--r-- | crates/ra_syntax/src/grammar.ron | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/grammar.ron b/crates/ra_syntax/src/grammar.ron index 2e4b2d776..304bc5909 100644 --- a/crates/ra_syntax/src/grammar.ron +++ b/crates/ra_syntax/src/grammar.ron | |||
@@ -596,7 +596,8 @@ Grammar( | |||
596 | options: [ "Pat", "TypeRef" ], | 596 | options: [ "Pat", "TypeRef" ], |
597 | ), | 597 | ), |
598 | "UseItem": ( | 598 | "UseItem": ( |
599 | options: [ "UseTree" ] | 599 | traits: ["AttrsOwner"], |
600 | options: [ "UseTree" ], | ||
600 | ), | 601 | ), |
601 | "UseTree": ( | 602 | "UseTree": ( |
602 | options: [ "Path", "UseTreeList", "Alias" ] | 603 | options: [ "Path", "UseTreeList", "Alias" ] |