]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoMove type inlay hint truncation to language server
Emil Lauridsen [Mon, 18 Nov 2019 17:02:28 +0000 (18:02 +0100)]
Move type inlay hint truncation to language server

This commit implements a general truncation framework for HirFormatter
that keeps track of how much has been output so far. This information
can then be used to perform truncation inside the language server,
instead of relying on the client.

Initial support is implemented for truncating types hints using the
maxInlayHintLength server config option. The existing solution in the
VSCode extension has been removed in favor of letting the server
truncate type hints.

4 years agoMerge #2309
bors[bot] [Mon, 18 Nov 2019 20:04:36 +0000 (20:04 +0000)]
Merge #2309

2309: Goto type def through macros r=matklad a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoGoto type def through macros
kjeremy [Mon, 18 Nov 2019 19:57:42 +0000 (14:57 -0500)]
Goto type def through macros

4 years agoMerge #2307
bors[bot] [Mon, 18 Nov 2019 19:57:06 +0000 (19:57 +0000)]
Merge #2307

2307: Support hover through macro r=matklad a=kjeremy

Allows hover to work through macros like `match_ast!`.

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoFix test
kjeremy [Mon, 18 Nov 2019 19:02:02 +0000 (14:02 -0500)]
Fix test

4 years agoMerge #2308
bors[bot] [Mon, 18 Nov 2019 18:21:44 +0000 (18:21 +0000)]
Merge #2308

2308: Remove the custom impl of AttrsOwner for ImplItem r=matklad a=DJMcNab

The default impl should have the same behaviour, and it can be generated by codegen.
See also `ModuleItem` and `NominalDef`.

Also see https://github.com/rust-analyzer/rust-analyzer/commit/5dbbfda34ae423229487595fd0ae9e727ae42906#r36011245

Co-authored-by: DJMcNab <36049421+djmcnab@users.noreply.github.com>
4 years agoRemove the custom impl of AttrsOwner for ImplItem
DJMcNab [Mon, 18 Nov 2019 18:13:56 +0000 (18:13 +0000)]
Remove the custom impl of AttrsOwner for ImplItem

The default impl should have the same behaviour, and it can be generated
by codegen.
See also `ModuleItem` and `NominalDef`

4 years agoSupport hover through macro
kjeremy [Mon, 18 Nov 2019 16:58:42 +0000 (11:58 -0500)]
Support hover through macro

4 years agoMerge #2305
bors[bot] [Mon, 18 Nov 2019 16:28:04 +0000 (16:28 +0000)]
Merge #2305

2305: Remove CI badge r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoRemove CI badge
Aleksey Kladov [Mon, 18 Nov 2019 16:27:41 +0000 (19:27 +0300)]
Remove CI badge

4 years agoMerge #2304
bors[bot] [Mon, 18 Nov 2019 15:50:47 +0000 (15:50 +0000)]
Merge #2304

2304: Use Source<&ast::Name> in classify_name r=matklad a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoUse Source<&ast::Name> in classify_name
kjeremy [Mon, 18 Nov 2019 15:47:19 +0000 (10:47 -0500)]
Use Source<&ast::Name> in classify_name

4 years agoMerge #2302
bors[bot] [Mon, 18 Nov 2019 13:09:29 +0000 (13:09 +0000)]
Merge #2302

2302: Collapse TokenMap and RevTokenMap r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoCollapse TokenMap and RevTokenMap
Aleksey Kladov [Mon, 18 Nov 2019 13:08:41 +0000 (16:08 +0300)]
Collapse TokenMap and RevTokenMap

4 years agoMerge #2301
bors[bot] [Mon, 18 Nov 2019 12:41:59 +0000 (12:41 +0000)]
Merge #2301

2301: Don't create a separate bin for format hook r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDon't create a separate bin for format hook
Aleksey Kladov [Mon, 18 Nov 2019 12:22:51 +0000 (15:22 +0300)]
Don't create a separate bin for format hook

4 years agoMerge #2300
bors[bot] [Mon, 18 Nov 2019 12:09:24 +0000 (12:09 +0000)]
Merge #2300

2300: Token-based reverse-mapping r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoToken-based reverse-mapping
Aleksey Kladov [Mon, 18 Nov 2019 12:08:39 +0000 (15:08 +0300)]
Token-based reverse-mapping

4 years agoMerge #2299
bors[bot] [Mon, 18 Nov 2019 11:37:46 +0000 (11:37 +0000)]
Merge #2299

2299: More sources r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMore sources
Aleksey Kladov [Mon, 18 Nov 2019 11:36:11 +0000 (14:36 +0300)]
More sources

4 years agoMerge #2298
bors[bot] [Mon, 18 Nov 2019 11:24:35 +0000 (11:24 +0000)]
Merge #2298

2298: Add ra_ide_api::expand r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoAdd ra_ide_api::expand
Aleksey Kladov [Mon, 18 Nov 2019 11:23:24 +0000 (14:23 +0300)]
Add ra_ide_api::expand

This module should handle all tricky bits with mapping macro-expanded
HirFileId to original files the user actually can see in the editor

4 years agoMore Source
Aleksey Kladov [Mon, 18 Nov 2019 11:07:13 +0000 (14:07 +0300)]
More Source

4 years agoMerge #2296
bors[bot] [Mon, 18 Nov 2019 09:59:36 +0000 (09:59 +0000)]
Merge #2296

2296: Remove obsolete links r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agofix bors integration
Aleksey Kladov [Mon, 18 Nov 2019 09:59:09 +0000 (12:59 +0300)]
fix bors integration

4 years agoRemove obsolete links
Aleksey Kladov [Mon, 18 Nov 2019 09:45:33 +0000 (12:45 +0300)]
Remove obsolete links

4 years agoSwitch to Actions
Aleksey Kladov [Mon, 18 Nov 2019 08:13:31 +0000 (11:13 +0300)]
Switch to Actions

4 years agoRun npm travis through xvfb-run
cad97 [Sun, 17 Nov 2019 00:51:12 +0000 (19:51 -0500)]
Run npm travis through xvfb-run

4 years agoEnable github actions ci
cad97 [Sat, 16 Nov 2019 22:26:54 +0000 (17:26 -0500)]
Enable github actions ci

4 years agoMerge #2294
bors[bot] [Mon, 18 Nov 2019 07:36:27 +0000 (07:36 +0000)]
Merge #2294

2294: Publicise GenericParams r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoPublicise GenericParams
Aleksey Kladov [Mon, 18 Nov 2019 07:35:33 +0000 (10:35 +0300)]
Publicise GenericParams

See https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Exposing.20GenericParam.2Ename

4 years agoMerge #2292
bors[bot] [Sun, 17 Nov 2019 19:25:51 +0000 (19:25 +0000)]
Merge #2292

2292: :arrow_up: rowan r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years ago:arrow_up: rowan
Aleksey Kladov [Sun, 17 Nov 2019 19:21:45 +0000 (22:21 +0300)]
:arrow_up: rowan

4 years agoMerge #2289
bors[bot] [Sun, 17 Nov 2019 17:17:21 +0000 (17:17 +0000)]
Merge #2289

2289: More correct expansion mapping r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMore correct expansion mapping
Aleksey Kladov [Sun, 17 Nov 2019 17:15:55 +0000 (20:15 +0300)]
More correct expansion mapping

We can't really map arbitrary ranges, we only can map tokens

4 years agoMerge #2288
bors[bot] [Sun, 17 Nov 2019 16:12:28 +0000 (16:12 +0000)]
Merge #2288

2288: Make shift an implementation detail of mbe r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMake shift an implementation detail of mbe
Aleksey Kladov [Sun, 17 Nov 2019 16:11:43 +0000 (19:11 +0300)]
Make shift an implementation detail of mbe

4 years agoMerge #2287
bors[bot] [Sun, 17 Nov 2019 15:45:30 +0000 (15:45 +0000)]
Merge #2287

2287: Disable doctests r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMerge #2286
bors[bot] [Sun, 17 Nov 2019 15:35:36 +0000 (15:35 +0000)]
Merge #2286

2286: Alias for less verbose tests r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDisable doctests
Aleksey Kladov [Sun, 17 Nov 2019 15:35:05 +0000 (18:35 +0300)]
Disable doctests

4 years agoAlias for less verbose tests
Aleksey Kladov [Sun, 17 Nov 2019 15:26:52 +0000 (18:26 +0300)]
Alias for less verbose tests

4 years agoMerge #2285
bors[bot] [Sun, 17 Nov 2019 15:25:39 +0000 (15:25 +0000)]
Merge #2285

2285: Don't store shift redundantly r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoDon't store shift redundantly
Aleksey Kladov [Sun, 17 Nov 2019 15:22:34 +0000 (18:22 +0300)]
Don't store shift redundantly

4 years agoMerge #2283
bors[bot] [Sun, 17 Nov 2019 09:35:52 +0000 (09:35 +0000)]
Merge #2283

2283: Fix #2275 r=matklad a=edwin0cheng

Fix #2275

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
4 years agoAdd bound check
Edwin Cheng [Sun, 17 Nov 2019 05:18:42 +0000 (13:18 +0800)]
Add bound check

4 years agoMerge #2280
bors[bot] [Sat, 16 Nov 2019 19:51:25 +0000 (19:51 +0000)]
Merge #2280

2280: Add ast for plain and raw string literals r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoAdd ast for plain and raw string literals
Aleksey Kladov [Sat, 16 Nov 2019 19:50:41 +0000 (22:50 +0300)]
Add ast for plain and raw string literals

4 years agoMerge #2279
bors[bot] [Sat, 16 Nov 2019 19:18:46 +0000 (19:18 +0000)]
Merge #2279

2279: Better factoring of macro expansion machinery in goto def r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoBetter factoring of macro expansion machinery in goto def
Aleksey Kladov [Sat, 16 Nov 2019 19:18:07 +0000 (22:18 +0300)]
Better factoring of macro expansion machinery in goto def

4 years agoMerge #2273
bors[bot] [Sat, 16 Nov 2019 14:07:44 +0000 (14:07 +0000)]
Merge #2273

2273: goto in macro calls r=matklad a=matklad

![goto](https://user-images.githubusercontent.com/1711539/68984944-2a50ba80-0824-11ea-896c-c0ea8edcd0d6.gif)

This builds on the awesome infrastructure created by @edwin0cheng

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoGoto definition works inside macros
Aleksey Kladov [Sat, 16 Nov 2019 13:49:26 +0000 (16:49 +0300)]
Goto definition works inside macros

4 years agoMerge #2276
bors[bot] [Sat, 16 Nov 2019 13:50:34 +0000 (13:50 +0000)]
Merge #2276

2276: Source-ify name_definition r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoMerge #2274
bors[bot] [Sat, 16 Nov 2019 13:17:20 +0000 (13:17 +0000)]
Merge #2274

2274: Chalk upgrade & dyn/impl support r=matklad a=flodiebold

 - upgrade Chalk, which is a bit more involved than usual this time -- associated type values (in impls) are now a separate entity in Chalk, so we have to intern separate IDs for them...
 - use Chalk's dyn/impl Trait support
 - fix our handling of binders/bound variables -- before, we didn't use them for anything except Chalk queries, but now that we use them in dyn/impl Trait types and pass that to Chalk, we have to be a bit more careful

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
4 years agoMerge #2263
bors[bot] [Sat, 16 Nov 2019 12:49:20 +0000 (12:49 +0000)]
Merge #2263

2263: Handle `cargo watch` errors caused by `cargo-watch` itself r=matklad a=oxalica

Currently, it silently fails when `cargo-watch` is installed but broken.

This PR handles missing cases and prompt the error message when failed.

Co-authored-by: oxalica <oxalicc@pm.me>
4 years agoUpgrade Chalk again
Florian Diebold [Sat, 16 Nov 2019 12:21:51 +0000 (13:21 +0100)]
Upgrade Chalk again

4 years agoFix handling of the binders in dyn/impl Trait
Florian Diebold [Sat, 16 Nov 2019 11:53:13 +0000 (12:53 +0100)]
Fix handling of the binders in dyn/impl Trait

We need to be more careful now when substituting bound variables (previously, we
didn't have anything that used bound variables except Chalk, so it was not a
problem).

This is obviously quite ad-hoc; Chalk has more infrastructure for handling this
in a principled way, which we maybe should adopt.

4 years agoUse Chalk's dyn/impl trait support
Florian Diebold [Fri, 15 Nov 2019 20:00:27 +0000 (21:00 +0100)]
Use Chalk's dyn/impl trait support

4 years agoUpgrade Chalk
Florian Diebold [Fri, 15 Nov 2019 19:32:58 +0000 (20:32 +0100)]
Upgrade Chalk

Associated type values (in impls) are now a separate entity in Chalk, so we have
to intern separate IDs for them.

4 years agoFix format
oxalica [Sat, 16 Nov 2019 10:52:47 +0000 (18:52 +0800)]
Fix format

4 years agoSource-ify name_definition
Aleksey Kladov [Sat, 16 Nov 2019 10:50:04 +0000 (13:50 +0300)]
Source-ify name_definition

4 years agoSourcify classify_name_ref
Aleksey Kladov [Sat, 16 Nov 2019 10:33:25 +0000 (13:33 +0300)]
Sourcify classify_name_ref

4 years agoMerge #2271
bors[bot] [Fri, 15 Nov 2019 23:12:59 +0000 (23:12 +0000)]
Merge #2271

2271: Force passing Source when creating a SourceAnalyzer r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoForce passing Source when creating a SourceAnalyzer
Aleksey Kladov [Fri, 15 Nov 2019 21:56:51 +0000 (00:56 +0300)]
Force passing Source when creating a SourceAnalyzer

4 years agoMerge #2268
bors[bot] [Fri, 15 Nov 2019 22:36:10 +0000 (22:36 +0000)]
Merge #2268

2268: Handle ast::MacroCall in classify_name and impl FromSource for MacroDef r=matklad a=kjeremy

Fixes #2260

Co-authored-by: kjeremy <kjeremy@gmail.com>
4 years agoPrepare SourceAnalyzer for macros
Aleksey Kladov [Fri, 15 Nov 2019 21:40:54 +0000 (00:40 +0300)]
Prepare SourceAnalyzer for macros

4 years agoMerge #2270
bors[bot] [Fri, 15 Nov 2019 22:15:30 +0000 (22:15 +0000)]
Merge #2270

2270: Reduce some duplication r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoReduce some duplication
Aleksey Kladov [Fri, 15 Nov 2019 22:14:56 +0000 (01:14 +0300)]
Reduce some duplication

4 years agoAdd a test that uses classify_name
kjeremy [Fri, 15 Nov 2019 22:13:52 +0000 (17:13 -0500)]
Add a test that uses classify_name

4 years agoRemove wrong clone
Aleksey Kladov [Fri, 15 Nov 2019 22:00:00 +0000 (01:00 +0300)]
Remove wrong clone

4 years agoMerge #2269
bors[bot] [Fri, 15 Nov 2019 21:57:48 +0000 (21:57 +0000)]
Merge #2269

2269: Prepare SourceAnalyzer for macros r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoHandle ast::MacroCall in classify_name and impl FromSource for MacroDef
kjeremy [Fri, 15 Nov 2019 21:20:00 +0000 (16:20 -0500)]
Handle ast::MacroCall in classify_name and impl FromSource for MacroDef

Fixes #2260

4 years agoPrepare SourceAnalyzer for macros
Aleksey Kladov [Fri, 15 Nov 2019 21:40:54 +0000 (00:40 +0300)]
Prepare SourceAnalyzer for macros

4 years agoSourcify some more
Aleksey Kladov [Fri, 15 Nov 2019 21:05:10 +0000 (00:05 +0300)]
Sourcify some more

4 years agoMerge #2266
bors[bot] [Fri, 15 Nov 2019 20:25:53 +0000 (20:25 +0000)]
Merge #2266

2266: Sourcify some things r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoSourcify some things
Aleksey Kladov [Fri, 15 Nov 2019 20:24:56 +0000 (23:24 +0300)]
Sourcify some things

If we want to support macros properly, we need to get rid of those
FileIds everywhere...

4 years agoMerge #2252
bors[bot] [Fri, 15 Nov 2019 20:15:29 +0000 (20:15 +0000)]
Merge #2252

2252: Fix parsing of "postfix" range expressions. r=matklad a=goffrie

Right now they are handled in `postfix_dot_expr`, but that doesn't allow it to
correctly handle precedence. Integrate it more tightly with the Pratt parser
instead.

Also includes a drive-by fix for parsing `match .. {}`.

Fixes #2242.

Co-authored-by: Geoffry Song <goffrie@gmail.com>
4 years agoMerge #2265
bors[bot] [Fri, 15 Nov 2019 20:05:48 +0000 (20:05 +0000)]
Merge #2265

2265: Fix add-new assist r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoAttempt to implement typed accessors
Geoffry Song [Fri, 15 Nov 2019 20:05:29 +0000 (12:05 -0800)]
Attempt to implement typed accessors

4 years agoFix add-new assist
Aleksey Kladov [Fri, 15 Nov 2019 19:48:07 +0000 (22:48 +0300)]
Fix add-new assist

4 years agoCheck exit code of `cargo watch`
oxalica [Fri, 15 Nov 2019 19:44:38 +0000 (03:44 +0800)]
Check exit code of `cargo watch`

4 years agoMerge #2264
bors[bot] [Fri, 15 Nov 2019 19:11:51 +0000 (19:11 +0000)]
Merge #2264

2264: move impls to hir-def r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoHandle errors when `cargo watch` fails
oxalica [Fri, 15 Nov 2019 18:49:44 +0000 (02:49 +0800)]
Handle errors when `cargo watch` fails

4 years agoRemove old impls infrastructure
Aleksey Kladov [Fri, 15 Nov 2019 18:28:00 +0000 (21:28 +0300)]
Remove old impls infrastructure

4 years agoStore impls in CrateDefMap
Aleksey Kladov [Fri, 15 Nov 2019 16:32:56 +0000 (19:32 +0300)]
Store impls in CrateDefMap

4 years agoAdd ImplId
Aleksey Kladov [Fri, 15 Nov 2019 16:14:50 +0000 (19:14 +0300)]
Add ImplId

4 years agoReduce visibility
Aleksey Kladov [Fri, 15 Nov 2019 16:04:00 +0000 (19:04 +0300)]
Reduce visibility

4 years agoMerge #2262
bors[bot] [Fri, 15 Nov 2019 18:19:16 +0000 (18:19 +0000)]
Merge #2262

2262: Speedup builds for users r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoSpeedup builds for users
Aleksey Kladov [Fri, 15 Nov 2019 18:18:44 +0000 (21:18 +0300)]
Speedup builds for users

4 years agoMerge #2261
bors[bot] [Fri, 15 Nov 2019 16:04:33 +0000 (16:04 +0000)]
Merge #2261

2261: Reduce visibility r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoReduce visibility
Aleksey Kladov [Fri, 15 Nov 2019 16:04:00 +0000 (19:04 +0300)]
Reduce visibility

4 years agoMerge #2259
bors[bot] [Fri, 15 Nov 2019 13:03:46 +0000 (13:03 +0000)]
Merge #2259

2259: Update smallvec and fix rustc warning r=matklad a=memoryruins

- Update smallvec in ra_mbe to [1.0](https://github.com/servo/rust-smallvec/releases/tag/v1.0.0)
- Heed rustc's `array_into_iter` lint https://github.com/rust-lang/rust/issues/66145

Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
4 years agoHeed the advice of rustc's into_iter() warning
memoryruins [Fri, 15 Nov 2019 11:53:11 +0000 (06:53 -0500)]
Heed the advice of rustc's into_iter() warning

4 years agoUpdate smallvec dep to 1.0
memoryruins [Fri, 15 Nov 2019 11:45:58 +0000 (06:45 -0500)]
Update smallvec dep to 1.0

4 years agoMerge #2257
bors[bot] [Fri, 15 Nov 2019 11:53:55 +0000 (11:53 +0000)]
Merge #2257

2257: Flatten expr module r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoFlatten expr module
Aleksey Kladov [Fri, 15 Nov 2019 11:53:09 +0000 (14:53 +0300)]
Flatten expr module

4 years agoMove scope tests to hir_def
Aleksey Kladov [Fri, 15 Nov 2019 11:47:26 +0000 (14:47 +0300)]
Move scope tests to hir_def

4 years agoReduce visibility
Aleksey Kladov [Fri, 15 Nov 2019 11:15:04 +0000 (14:15 +0300)]
Reduce visibility

4 years agoMerge #2255
bors[bot] [Fri, 15 Nov 2019 10:18:45 +0000 (10:18 +0000)]
Merge #2255

2255: Add convenience method for testing r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
4 years agoAdd convenience method for testing
Aleksey Kladov [Fri, 15 Nov 2019 10:16:16 +0000 (13:16 +0300)]
Add convenience method for testing

4 years agoMerge #2254
bors[bot] [Fri, 15 Nov 2019 09:57:00 +0000 (09:57 +0000)]
Merge #2254

2254: Auto-upgrade some insta snapshots r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>