]>
git.lizzy.rs Git - rust.git/log
bors[bot] [Mon, 11 Nov 2019 08:41:54 +0000 (08:41 +0000)]
Merge #2203
2203: Hover for builtins r=matklad a=kjeremy
Fixes #2192
Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
bors[bot] [Mon, 11 Nov 2019 08:27:38 +0000 (08:27 +0000)]
Merge #2207
2207: Forbid visibility qualifiers in traits r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 11 Nov 2019 08:26:57 +0000 (11:26 +0300)]
Forbid visibility qualifiers in traits
bors[bot] [Mon, 11 Nov 2019 07:12:43 +0000 (07:12 +0000)]
Merge #2206
2206: Disable debuginfo in dev builds r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 11 Nov 2019 07:11:46 +0000 (10:11 +0300)]
Disable debuginfo in dev builds
Hopefully, this makes printf debugging faster!
bors[bot] [Mon, 11 Nov 2019 06:21:14 +0000 (06:21 +0000)]
Merge #2204
2204: Make primitive tys public r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 11 Nov 2019 06:20:18 +0000 (09:20 +0300)]
Make primitive tys public
bors[bot] [Sun, 10 Nov 2019 21:35:19 +0000 (21:35 +0000)]
Merge #2201
2201: Resolve core types r=matklad a=Matthias247
This adds support for completion and goto definition of
types defined within the "core" crate. The core crate is
added as a dependency to each crate in the project.
The core crate exported it's own prelude. This caused
now all crates to inherit the core crates prelude instead
of the std crates. In order to avoid the problem the
prelude resolution has been changed to overwrite
an already resolved prelude if this was set to a crate
named core - in order to pick a better prelude like std.
Fixes #2199
Co-authored-by: Matthias Einwag <matthias.einwag@live.com>
Matthias Einwag [Sun, 10 Nov 2019 21:15:47 +0000 (13:15 -0800)]
Overwrite the prelude with one defined in a later dependency
This removes the special casing for the "core" prelude.
Whenever a later dependency also exports a prelude, it will replace
the formerly imported prelude. The utilized prelude then depends
purely on import order.
Jeremy Kolb [Sun, 10 Nov 2019 18:59:39 +0000 (13:59 -0500)]
Hover for builtins
Matthias Einwag [Sun, 10 Nov 2019 01:38:08 +0000 (17:38 -0800)]
Add tests for resolving types in core and std preludes
Matthias Einwag [Sat, 9 Nov 2019 23:22:19 +0000 (15:22 -0800)]
Resolve core types
This adds support for completion and goto definition of
types defined within the "core" crate. The core crate is
added as a dependency to each crate in the project.
The core crate exported it's own prelude. This caused
now all crates to inherit the core crates prelude instead
of the std crates. In order to avoid the problem the
prelude resolution has been changed to overwrite
an already resolved prelude if this was set to a crate
named core - in order to pick a better prelude like std.
Fixes #2199
bors[bot] [Sat, 9 Nov 2019 12:37:49 +0000 (12:37 +0000)]
Merge #2198
2198: Unfork struct and union ids r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 9 Nov 2019 12:34:00 +0000 (15:34 +0300)]
Unfork struct and union ids
bors[bot] [Sat, 9 Nov 2019 10:16:48 +0000 (10:16 +0000)]
Merge #2197
2197: Remove typed macro parsing API r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 9 Nov 2019 10:14:10 +0000 (13:14 +0300)]
Remove typed macro parsing API
We do type-erasure on every path anyway, so it doesn't make much sense
to duplicate this function for every type
Aleksey Kladov [Sat, 9 Nov 2019 09:49:35 +0000 (12:49 +0300)]
Minor cleanup
bors[bot] [Sat, 9 Nov 2019 09:13:14 +0000 (09:13 +0000)]
Merge #2169
2169: MBE: Mapping spans for goto definition r=matklad a=edwin0cheng
Currently, go to definition gives the wrong span in MBE. This PR implement a mapping mechanism to fix it and it could be used for future MBE hygiene implementation.
The basic idea of the mapping is:
1. When expanding the macro, generated 2 `TokenMap` which maps the macro args and macro defs between tokens and input text-ranges.
2. Before converting generated `TokenTree` to `SyntaxNode`, generated a `ExpandedRangeMap` which is a mapping between token and output text-ranges.
3. Using these 3 mappings to construct an `ExpansionInfo` which can map between input text ranges and output text ranges.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Sat, 9 Nov 2019 04:00:46 +0000 (12:00 +0800)]
Remove map_ranges in RevTokenMap
bors[bot] [Fri, 8 Nov 2019 21:24:02 +0000 (21:24 +0000)]
Merge #2196
2196: Touch up nameres doc comment r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 8 Nov 2019 21:23:19 +0000 (00:23 +0300)]
Touch up nameres doc comment
Aleksey Kladov [Fri, 8 Nov 2019 21:23:11 +0000 (00:23 +0300)]
Reduce visibility
Aleksey Kladov [Fri, 8 Nov 2019 21:17:17 +0000 (00:17 +0300)]
Extract path resolution submodule
Aleksey Kladov [Fri, 8 Nov 2019 20:53:39 +0000 (23:53 +0300)]
Simplify
There's only one call-site for the function, so it seems fine to
inline
Aleksey Kladov [Fri, 8 Nov 2019 20:47:52 +0000 (23:47 +0300)]
Reduce visibility
Edwin Cheng [Fri, 8 Nov 2019 20:00:27 +0000 (04:00 +0800)]
Refactor and simpfily
Edwin Cheng [Fri, 8 Nov 2019 01:57:01 +0000 (09:57 +0800)]
Refactor and add more comments
bors[bot] [Thu, 7 Nov 2019 18:28:10 +0000 (18:28 +0000)]
Merge #2194
2194: Update crates r=matklad a=kjeremy
Removes nodrop and extra arrayvec
We have an extra crossbeam-queue and crossbeam-utils left but those should
drop once rayon accepts https://github.com/rayon-rs/rayon/pull/704
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Thu, 7 Nov 2019 18:05:12 +0000 (13:05 -0500)]
Update crates
Removes nodrop and extra arrayvec
We have an extra crossbeam-queue and crossbeam-utils left but those should
drop once rayon accepts https://github.com/rayon-rs/rayon/pull/704
bors[bot] [Thu, 7 Nov 2019 14:57:30 +0000 (14:57 +0000)]
Merge #2193
2193: cargo xtask format with rust 1.39 r=matklad a=kjeremy
Needed to pass tests on latest stable
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Thu, 7 Nov 2019 14:44:45 +0000 (09:44 -0500)]
cargo xtask format with 1.39
bors[bot] [Wed, 6 Nov 2019 21:11:42 +0000 (21:11 +0000)]
Merge #2179
2179: Use HirDatabase to compute `is_deprecated` r=matklad a=martskins
This PR fixes #2167 by introducing `attributes_query` and adding `fn attrs(&self, def: crate::AttrDef) -> Option<Arc<[Attr]>>;` to the `DefDatabase` trait.
I'm a little concerned about the two spots in `attributes_query` where code is repeated, but I couldn't figure out a way to avoid that, so.. I welcome suggestions :smile:
Co-authored-by: Martin Asquino <martin.asquino@gmail.com>
bors[bot] [Wed, 6 Nov 2019 11:50:34 +0000 (11:50 +0000)]
Merge #2191
2191: Cleanup complete_postfix r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 6 Nov 2019 11:06:44 +0000 (14:06 +0300)]
Cleanup complete_postfix
bors[bot] [Wed, 6 Nov 2019 09:41:33 +0000 (09:41 +0000)]
Merge #2188
2188: Ignore line-endings when checking generated files for freshness r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 6 Nov 2019 09:40:28 +0000 (12:40 +0300)]
Ignore line-endings when checking generated files for freshness
closes #2184
bors[bot] [Tue, 5 Nov 2019 20:05:49 +0000 (20:05 +0000)]
Merge #2187
2187: Update smallvec to avoid UB and cc while we're at it r=kjeremy a=kjeremy
See: https://github.com/servo/rust-smallvec/releases/tag/v0.6.13
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Tue, 5 Nov 2019 20:04:00 +0000 (15:04 -0500)]
Update smallvec to avoid UB and cc while we're at it
bors[bot] [Tue, 5 Nov 2019 15:47:50 +0000 (15:47 +0000)]
Merge #2185
2185: Bump psm, console, indicatif r=kjeremy a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Tue, 5 Nov 2019 15:38:50 +0000 (10:38 -0500)]
Bump psm, console, indicatif
Edwin Cheng [Tue, 5 Nov 2019 01:43:59 +0000 (09:43 +0800)]
Fix formatting
Martin Asquino [Mon, 4 Nov 2019 13:33:10 +0000 (10:33 -0300)]
HirDatabase stored attributes
bors[bot] [Mon, 4 Nov 2019 20:37:59 +0000 (20:37 +0000)]
Merge #2177
2177: Reduce visibility r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 4 Nov 2019 20:37:35 +0000 (23:37 +0300)]
Reduce visibility
bors[bot] [Mon, 4 Nov 2019 20:03:11 +0000 (20:03 +0000)]
Merge #2176
2176: Move Namespace enum closer to usage r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 4 Nov 2019 20:02:35 +0000 (23:02 +0300)]
Move Namespace enum closer to usage
bors[bot] [Mon, 4 Nov 2019 19:35:43 +0000 (19:35 +0000)]
Merge #2175
2175: Appease the linter by dummy doc comments r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 4 Nov 2019 19:33:21 +0000 (22:33 +0300)]
Appease the linter by dummy doc comments
Aleksey Kladov [Mon, 4 Nov 2019 19:29:51 +0000 (22:29 +0300)]
Simplify
Aleksey Kladov [Mon, 4 Nov 2019 19:28:47 +0000 (22:28 +0300)]
Restore assists tests
Aleksey Kladov [Mon, 4 Nov 2019 19:21:15 +0000 (22:21 +0300)]
Rename MockDatabase -> TestDB
Actually working rename is sooo useful!
Edwin Cheng [Mon, 4 Nov 2019 19:20:54 +0000 (03:20 +0800)]
Refactor a bit
Aleksey Kladov [Mon, 4 Nov 2019 19:19:06 +0000 (22:19 +0300)]
remove dead code
Aleksey Kladov [Mon, 4 Nov 2019 19:12:49 +0000 (22:12 +0300)]
Remove more duplication in test fixtures
Aleksey Kladov [Mon, 4 Nov 2019 19:04:51 +0000 (22:04 +0300)]
Remove some duplicated test functions
bors[bot] [Mon, 4 Nov 2019 18:42:55 +0000 (18:42 +0000)]
Merge #2174
2174: Reduce visibility r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 4 Nov 2019 18:42:25 +0000 (21:42 +0300)]
Reduce visibility
Edwin Cheng [Mon, 4 Nov 2019 18:09:16 +0000 (02:09 +0800)]
Use macro_rules shift to map text ranges
Edwin Cheng [Mon, 4 Nov 2019 13:43:36 +0000 (21:43 +0800)]
Use ? and destructing to simplifed long code
Edwin Cheng [Sun, 3 Nov 2019 19:12:19 +0000 (03:12 +0800)]
Rename and fix typos
Edwin Cheng [Sun, 3 Nov 2019 17:56:38 +0000 (01:56 +0800)]
Add note for recurseive macro generated code
Edwin Cheng [Sun, 3 Nov 2019 17:49:49 +0000 (01:49 +0800)]
Add tests
Edwin Cheng [Sun, 3 Nov 2019 17:49:41 +0000 (01:49 +0800)]
Use new expansion feature in goto_definition
Edwin Cheng [Sun, 3 Nov 2019 17:47:59 +0000 (01:47 +0800)]
Remove dbg!
Edwin Cheng [Sun, 3 Nov 2019 17:45:58 +0000 (01:45 +0800)]
Fixed bug in ExpandedRangeMap
Edwin Cheng [Sun, 3 Nov 2019 17:44:23 +0000 (01:44 +0800)]
Add parent_expansion to HirFileId
Edwin Cheng [Sun, 3 Nov 2019 14:46:12 +0000 (22:46 +0800)]
Add macro_expansion_info in hir_expand
Edwin Cheng [Sun, 3 Nov 2019 05:19:50 +0000 (13:19 +0800)]
Add map_id to TokenId
bors[bot] [Mon, 4 Nov 2019 17:21:41 +0000 (17:21 +0000)]
Merge #2173
2173: MBE: Add TokenId shift in macro_rules r=matklad a=edwin0cheng
As discussed in #2169 , for fixing duplication TokenId during expansion :
> What we can do here is to re-number the tokens during expansion. Specifically:
> * when we create macro_rules, we note the highest id of the token we have as shift>
> * when we expand macro rules, if we need to output a token from definition, we just re-use its id
> * if we need to output a token from the argument, we increase its id by shift (so it's guaranteed to not to collide with anything from the definition)
> * finally, when we have a HirFileId of the expansion, we can look up the original value of shift and classify node to the arg/def by comparing it's id with shift.
>
This PR implement first 3 points of above solution.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
Edwin Cheng [Mon, 4 Nov 2019 17:16:06 +0000 (01:16 +0800)]
Change to add 1 if non zero shift
Edwin Cheng [Mon, 4 Nov 2019 17:01:05 +0000 (01:01 +0800)]
Refactor and rename
Edwin Cheng [Mon, 4 Nov 2019 16:33:19 +0000 (00:33 +0800)]
Change Option<u32> to u32 for shift value
Edwin Cheng [Mon, 4 Nov 2019 16:16:03 +0000 (00:16 +0800)]
Change to better naming
Edwin Cheng [Mon, 4 Nov 2019 15:22:18 +0000 (23:22 +0800)]
Add TokenId Shif in macro_rules
bors[bot] [Mon, 4 Nov 2019 10:30:09 +0000 (10:30 +0000)]
Merge #2172
2172: Use new text DSL instead of crate_graph! macro r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 4 Nov 2019 10:29:07 +0000 (13:29 +0300)]
Cleanup unused marks
Aleksey Kladov [Mon, 4 Nov 2019 10:25:42 +0000 (13:25 +0300)]
Use new text DSL instead of crate_graph! macro
bors[bot] [Mon, 4 Nov 2019 09:06:53 +0000 (09:06 +0000)]
Merge #2149
2149: Handle IfLet in convert_to_guarded_return. r=matklad a=krk
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/2124
I could not move the cursor position out of `let`:
`le<|>t` vs `let<|>`.
Also, please suggest extra test cases.
Co-authored-by: krk <keremkat@gmail.com>
bors[bot] [Sun, 3 Nov 2019 22:29:30 +0000 (22:29 +0000)]
Merge #2171
2171: Reexport relative_path from ra_db r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 3 Nov 2019 22:14:17 +0000 (01:14 +0300)]
Reexport relative_path from ra_db
bors[bot] [Sun, 3 Nov 2019 21:47:04 +0000 (21:47 +0000)]
Merge #2166
2166: Fix snapshots and tests line-ending in Windows r=matklad a=edwin0cheng
When running `cargo test` in Windows, there are some test and snapshots generated which are `LF` line-endings.
This PR try to force `git` to use `LF` for these files.
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
bors[bot] [Sun, 3 Nov 2019 21:34:50 +0000 (21:34 +0000)]
Merge #2163
2163: Move CrateDefMap to hir_def r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 3 Nov 2019 21:11:37 +0000 (00:11 +0300)]
Add small module-level docs
Aleksey Kladov [Sun, 3 Nov 2019 20:49:44 +0000 (23:49 +0300)]
Remove last traces of nameres from hir
Aleksey Kladov [Sun, 3 Nov 2019 20:44:23 +0000 (23:44 +0300)]
Restore crate_def_map marks
Aleksey Kladov [Sun, 3 Nov 2019 20:35:48 +0000 (23:35 +0300)]
move crate_def_map tests to hir_def
Aleksey Kladov [Sun, 3 Nov 2019 17:53:17 +0000 (20:53 +0300)]
Introduce ra_db::fixture fixture module
The goal here is to share more testing infrastructure between crates.
Aleksey Kladov [Thu, 31 Oct 2019 15:45:10 +0000 (18:45 +0300)]
Move CrateDefMap to hir_def
bors[bot] [Sun, 3 Nov 2019 14:41:30 +0000 (14:41 +0000)]
Merge #2160
2160: Set `deprecated` field on `CompletionItem`s r=matklad a=martskins
This PR aims to address #2042 by setting the deprecated field for completion items.
The setting the tags field for LSP 3.15 part still needs fixing, but that one is blocked due to lsp-types not being up to date with 3.15 yet.
Co-authored-by: Martin Asquino <martin.asquino@gmail.com>
Edwin Cheng [Sun, 3 Nov 2019 03:45:05 +0000 (11:45 +0800)]
Fix snapshots line-ending in windows
Martin Asquino [Sat, 2 Nov 2019 22:33:34 +0000 (19:33 -0300)]
Use `bool` instead of `Option<bool>` and print it's value only when `true`
bors[bot] [Sat, 2 Nov 2019 22:23:30 +0000 (22:23 +0000)]
Merge #2164
2164: Silence some warnings r=matklad a=lnicola
```
warning: unnecessary parentheses around type
--> crates/ra_tt/src/buffer.rs:114:32
|
114 | pub fn end(self) -> Option<(&'a Subtree)> {
| ^^^^^^^^^^^^^ help: remove these parentheses
|
= note: `#[warn(unused_parens)]` on by default
warning: unnecessary parentheses around type
--> crates/ra_tt/src/buffer.rs:130:30
|
130 | fn entry(self) -> Option<(&'a Entry<'a>)> {
| ^^^^^^^^^^^^^^^ help: remove these parentheses
```
Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Laurențiu Nicola [Sat, 2 Nov 2019 22:19:08 +0000 (00:19 +0200)]
Silence some warnings
bors[bot] [Sat, 2 Nov 2019 20:43:23 +0000 (20:43 +0000)]
Merge #2162
2162: Move diagnostics to hir_expand r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 2 Nov 2019 20:42:38 +0000 (23:42 +0300)]
Move diagnostics to hir_expand
Martin Asquino [Sat, 2 Nov 2019 02:52:59 +0000 (23:52 -0300)]
Set `deprecated` field on `CompletionItem`s
Aleksey Kladov [Sat, 2 Nov 2019 20:11:05 +0000 (23:11 +0300)]
Move Source to hir_expand
bors[bot] [Sat, 2 Nov 2019 19:21:45 +0000 (19:21 +0000)]
Merge #2159
2159: Remove forcing \n via rustfmt r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 2 Nov 2019 19:19:59 +0000 (22:19 +0300)]
Remove forcing \n via rustfmt
The original idea here was to make sure, on CI, that line endings are
\n. Travis however uses autocrlf, so the check doesn't actually work,
and forcing \n otherwise makes lives of windows folks difficult
closes #2157
bors[bot] [Sat, 2 Nov 2019 14:32:46 +0000 (14:32 +0000)]
Merge #2156
2156: Upgrade Chalk r=flodiebold a=flodiebold
Co-authored-by: Florian Diebold <flodiebold@gmail.com>