]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoRemove unnecessary to_nav_target
Ville Penttinen [Sat, 23 Feb 2019 12:08:57 +0000 (14:08 +0200)]
Remove unnecessary to_nav_target

5 years agoAdd name_range field to FileSymbol
Ville Penttinen [Sat, 23 Feb 2019 11:05:45 +0000 (13:05 +0200)]
Add name_range field to FileSymbol

This contains the syntax range of the name itself, allowing NavigationTarget to
properly set the focus_range. This should make it so that when using symbol
based navigation, we should always focus on the name, instead of the full range.

5 years agoFix NavigationTarget debug_render container_name output
Ville Penttinen [Sat, 23 Feb 2019 10:53:53 +0000 (12:53 +0200)]
Fix NavigationTarget debug_render container_name output

5 years agoFix goto def not working when cursor was over the name of a def
Ville Penttinen [Sat, 23 Feb 2019 09:02:42 +0000 (11:02 +0200)]
Fix goto def not working when cursor was over the name of a def

We now allow goto_definition to return the named NavigationTarget if the cursor
is on the name of a definition.

5 years agoMerge #866
bors[bot] [Fri, 22 Feb 2019 19:58:22 +0000 (19:58 +0000)]
Merge #866

866: Implement basic support for Associated Methods r=flodiebold a=vipentti

This is my attempt at learning to understand how the type inference works by adding basic support for associated methods. Currently it does not resolve associated types or constants.

The basic idea is that `Resolver::resolve_path` returns a new `PathResult` type, which has two variants, `FullyResolved` and `PartiallyResolved`, fully resolved matches the previous behavior, where as `PartiallyResolved` contains the `PerNs<Resolution` in addition to a `segment_index` which contains the index of the segment which we failed to resolve. This index can then be used to continue inference in `infer_path_expr` using the `Type` we managed to resolve.

This changes some of the previous apis, so looking for feedback and suggestions.

This should enable fixing #832

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
5 years agoChange resolve_path to return the fully resolved path or PerNs::none
Ville Penttinen [Fri, 22 Feb 2019 08:15:23 +0000 (10:15 +0200)]
Change resolve_path to return the fully resolved path or PerNs::none

This also adds new pub(crate) resolve_path_segments which returns the
PathResult, which may or may not be fully resolved. PathResult is also now
pub(crate) since it is an implementation detail.

5 years agoIgnore failing test for now
Ville Penttinen [Thu, 21 Feb 2019 22:27:22 +0000 (00:27 +0200)]
Ignore failing test for now

5 years agoMake nameres::ResolvePathResult private and refactor
Ville Penttinen [Thu, 21 Feb 2019 22:11:21 +0000 (00:11 +0200)]
Make nameres::ResolvePathResult private and refactor

5 years agoRemove Const inference for now, refactor PathResult
Ville Penttinen [Thu, 21 Feb 2019 21:57:07 +0000 (23:57 +0200)]
Remove Const inference for now, refactor PathResult

5 years agoMerge #864
bors[bot] [Thu, 21 Feb 2019 20:47:50 +0000 (20:47 +0000)]
Merge #864

864: Fix handling of generics in tuple variants and refactor a bit r=matklad a=flodiebold

(The problem was that we created separate substitutions for the return value, so we lost the connection between the type arguments in the constructor call and the type arguments of the result.)

Also make them display a tiny bit nicer.

Fixes #860.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
5 years agoAdd an assert (and fix the other)
Florian Diebold [Thu, 21 Feb 2019 20:25:27 +0000 (21:25 +0100)]
Add an assert (and fix the other)

5 years agoMerge #876
bors[bot] [Thu, 21 Feb 2019 16:55:26 +0000 (16:55 +0000)]
Merge #876

876: Fix join_lines not adding a comma after join_single_expr_block with match arm r=matklad a=vipentti

Fixes #868

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
5 years agoMove `non_trivia_sibling` to `ra_syntax::algo`
Ville Penttinen [Thu, 21 Feb 2019 16:49:03 +0000 (18:49 +0200)]
Move `non_trivia_sibling` to `ra_syntax::algo`

5 years agoSimplify adding a comma after match arm
Ville Penttinen [Thu, 21 Feb 2019 16:26:27 +0000 (18:26 +0200)]
Simplify adding a comma after match arm

5 years agoFix join_lines not adding a comma after join_single_expr_block in match arm
Ville Penttinen [Thu, 21 Feb 2019 15:51:41 +0000 (17:51 +0200)]
Fix join_lines not adding a comma after join_single_expr_block in match arm

We will also remove optional whitespace between the expression and the comma.

e.g.

```rust
fn foo() {
    let x = (<|>{
       4
    }   ,); // NOTE: whitespace
}
```

becomes

```rust
fn foo() {
    let x = (<|>4,);
}
```

5 years agoMerge #874
bors[bot] [Thu, 21 Feb 2019 15:28:16 +0000 (15:28 +0000)]
Merge #874

874: Update lsp-types and backtrace r=matklad a=kjeremy

Co-authored-by: kjeremy <kjeremy@gmail.com>
5 years agoUpdate lsp-types and backtrace
kjeremy [Thu, 21 Feb 2019 15:07:14 +0000 (10:07 -0500)]
Update lsp-types and backtrace

5 years agoMerge #873
bors[bot] [Thu, 21 Feb 2019 14:36:08 +0000 (14:36 +0000)]
Merge #873

873: add API guide to ra_syntax r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoadd API guide to ra_syntax
Aleksey Kladov [Thu, 21 Feb 2019 14:35:45 +0000 (17:35 +0300)]
add API guide to ra_syntax

5 years agoMerge #872
bors[bot] [Thu, 21 Feb 2019 13:13:45 +0000 (13:13 +0000)]
Merge #872

872: simplify trait bounds r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agosimplify trait bounds
Aleksey Kladov [Thu, 21 Feb 2019 13:12:15 +0000 (16:12 +0300)]
simplify trait bounds

5 years agorearrange methods
Aleksey Kladov [Thu, 21 Feb 2019 13:04:03 +0000 (16:04 +0300)]
rearrange methods

5 years agokill utils module
Aleksey Kladov [Thu, 21 Feb 2019 12:51:22 +0000 (15:51 +0300)]
kill utils module

5 years agoMerge #871
bors[bot] [Thu, 21 Feb 2019 12:45:31 +0000 (12:45 +0000)]
Merge #871

871: Ignore lockfile in fuzz r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoIgnore lockfile in fuzz
Aleksey Kladov [Thu, 21 Feb 2019 12:44:38 +0000 (15:44 +0300)]
Ignore lockfile in fuzz

It's too much trouble maintaining it

5 years agoMerge #870
bors[bot] [Thu, 21 Feb 2019 12:25:32 +0000 (12:25 +0000)]
Merge #870

870: docs r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agodocs
Aleksey Kladov [Thu, 21 Feb 2019 12:24:42 +0000 (15:24 +0300)]
docs

5 years agoadd failing test
Aleksey Kladov [Thu, 21 Feb 2019 11:06:21 +0000 (14:06 +0300)]
add failing test

5 years agoMerge #867
bors[bot] [Thu, 21 Feb 2019 10:46:17 +0000 (10:46 +0000)]
Merge #867

867: This moves the parser to separate crate r=matklad a=matklad

That makes parser independent form both the token and the tree representation.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agofix the test
Aleksey Kladov [Thu, 21 Feb 2019 10:45:10 +0000 (13:45 +0300)]
fix the test

5 years agofix compilation
Aleksey Kladov [Thu, 21 Feb 2019 10:37:32 +0000 (13:37 +0300)]
fix compilation

5 years agomove parser to a separate crate
Aleksey Kladov [Thu, 21 Feb 2019 10:27:45 +0000 (13:27 +0300)]
move parser to a separate crate

5 years agoImplement basic support for Associated Methods and Constants
Ville Penttinen [Thu, 21 Feb 2019 10:04:14 +0000 (12:04 +0200)]
Implement basic support for Associated Methods and Constants

This is done in `infer_path_expr`. When `Resolver::resolve_path` returns
`PartiallyResolved`, we use the returned `Resolution` together with the given
`segment_index` to check if we can find something matching the segment at
segment_index in the impls for that particular type.

5 years agoMerge #865
bors[bot] [Thu, 21 Feb 2019 09:25:20 +0000 (09:25 +0000)]
Merge #865

865: Parser decoupling r=matklad a=matklad

More work on making parser independent from text

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agomake grammar independent of syntax tree
Aleksey Kladov [Thu, 21 Feb 2019 09:12:04 +0000 (12:12 +0300)]
make grammar independent of syntax tree

5 years agominor
Aleksey Kladov [Thu, 21 Feb 2019 09:05:52 +0000 (12:05 +0300)]
minor

5 years agomove whitespace handling to tree builder
Aleksey Kladov [Thu, 21 Feb 2019 09:03:42 +0000 (12:03 +0300)]
move whitespace handling to tree builder

5 years agoFix handling of generics in tuple variants and refactor a bit
Florian Diebold [Wed, 20 Feb 2019 21:36:54 +0000 (22:36 +0100)]
Fix handling of generics in tuple variants and refactor a bit

Also make them display a tiny bit nicer.

Fixes #860.

5 years agoMerge #863
bors[bot] [Wed, 20 Feb 2019 20:33:40 +0000 (20:33 +0000)]
Merge #863

863: Token source r=matklad a=matklad

Some reshuffling of parser's API with the eye towards extracting parse **without** syntax tree into a separate crate, to be used with macro expansion

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agomove syntax error to parser
Aleksey Kladov [Wed, 20 Feb 2019 20:17:07 +0000 (23:17 +0300)]
move syntax error to parser

5 years agosimplify
Aleksey Kladov [Wed, 20 Feb 2019 20:05:59 +0000 (23:05 +0300)]
simplify

5 years agoremove TokenPos
Aleksey Kladov [Wed, 20 Feb 2019 19:58:56 +0000 (22:58 +0300)]
remove TokenPos

5 years agoflattern module structure
Aleksey Kladov [Wed, 20 Feb 2019 19:52:32 +0000 (22:52 +0300)]
flattern module structure

5 years agomerge parse_impl and parser_api
Aleksey Kladov [Wed, 20 Feb 2019 19:44:06 +0000 (22:44 +0300)]
merge parse_impl and parser_api

5 years agofix off by one error
Aleksey Kladov [Wed, 20 Feb 2019 19:27:49 +0000 (22:27 +0300)]
fix off by one error

5 years agomove abstract traits to top
Aleksey Kladov [Wed, 20 Feb 2019 19:19:12 +0000 (22:19 +0300)]
move abstract traits to top

5 years agoswitch to dynamic dispatch for TokenSource
Aleksey Kladov [Wed, 20 Feb 2019 19:02:03 +0000 (22:02 +0300)]
switch to dynamic dispatch for TokenSource

Benchmarks show no difference. This is probably because we are
bottlenecked on memory allocations, and we should fix that, but we are
not optimizing for performance just yet.

changes. Lines starting # with '#' will be ignored, and an empty
message aborts the commit. # # On branch token-source # Changes to be
committed: # modified: crates/ra_syntax/src/parsing/parser_api.rs #
modified: crates/ra_syntax/src/parsing/parser_impl.rs #

5 years agoroute parsing via TokenSource trait
Aleksey Kladov [Wed, 20 Feb 2019 18:50:07 +0000 (21:50 +0300)]
route parsing via TokenSource trait

5 years agorename Sink -> TreeSink
Aleksey Kladov [Wed, 20 Feb 2019 18:08:59 +0000 (21:08 +0300)]
rename Sink -> TreeSink

5 years agoMerge #861
bors[bot] [Wed, 20 Feb 2019 13:50:29 +0000 (13:50 +0000)]
Merge #861

861: Move parsing to a separate module r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agofix tests
Aleksey Kladov [Wed, 20 Feb 2019 13:48:06 +0000 (16:48 +0300)]
fix tests

5 years agorearrange modules in a suggestd reading order
Aleksey Kladov [Wed, 20 Feb 2019 13:24:39 +0000 (16:24 +0300)]
rearrange modules in a suggestd reading order

5 years agoflatten modules
Aleksey Kladov [Wed, 20 Feb 2019 13:16:14 +0000 (16:16 +0300)]
flatten modules

5 years agomove reparsers to grammar
Aleksey Kladov [Wed, 20 Feb 2019 13:02:06 +0000 (16:02 +0300)]
move reparsers to grammar

5 years agotighten visibility
Aleksey Kladov [Wed, 20 Feb 2019 12:57:26 +0000 (15:57 +0300)]
tighten visibility

5 years agomove all parsing related bits to a separate module
Aleksey Kladov [Wed, 20 Feb 2019 12:47:32 +0000 (15:47 +0300)]
move all parsing related bits to a separate module

5 years agoslightly better name
Aleksey Kladov [Wed, 20 Feb 2019 12:03:31 +0000 (15:03 +0300)]
slightly better name

5 years agomake stuff private
Aleksey Kladov [Wed, 20 Feb 2019 11:53:19 +0000 (14:53 +0300)]
make stuff private

5 years agoMerge #859
bors[bot] [Tue, 19 Feb 2019 17:07:26 +0000 (17:07 +0000)]
Merge #859

859: remove ignored macro tests r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoremove ignored macro tests
Aleksey Kladov [Tue, 19 Feb 2019 16:51:48 +0000 (19:51 +0300)]
remove ignored macro tests

we need to significantly reengineer macros, so the tests as they exist
are useless

5 years agoMerge #858
bors[bot] [Tue, 19 Feb 2019 09:10:52 +0000 (09:10 +0000)]
Merge #858

858: Use named multiline Problem Matcher r=matklad a=kjeremy

Now that https://github.com/Microsoft/vscode/pull/65840 is in the latest release we can use the first commit from https://github.com/rust-analyzer/rust-analyzer/pull/408

Co-authored-by: kjeremy <kjeremy@gmail.com>
5 years agoUse named multiline Problem Matcher
kjeremy [Mon, 18 Feb 2019 18:12:54 +0000 (13:12 -0500)]
Use named multiline Problem Matcher

Now that https://github.com/Microsoft/vscode/pull/65840 is in the latest
release we can use the first commit from https://github.com/rust-analyzer/rust-analyzer/pull/408

5 years agoMerge #857
bors[bot] [Mon, 18 Feb 2019 13:44:15 +0000 (13:44 +0000)]
Merge #857

857: remove local-vfs r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoremove local-vfs
Aleksey Kladov [Mon, 18 Feb 2019 13:43:30 +0000 (16:43 +0300)]
remove local-vfs

5 years agoswitch to crates.io vfs
Aleksey Kladov [Mon, 18 Feb 2019 13:43:16 +0000 (16:43 +0300)]
switch to crates.io vfs

5 years agoMerge #856
bors[bot] [Mon, 18 Feb 2019 13:21:01 +0000 (13:21 +0000)]
Merge #856

856: Reduce dependnecies of ra_vfs r=pnkfelix a=matklad

In preparation for moving `ra_vfs` to a separate repo with extensive cross-platform CI, remove dependency on `ra_thread_workder` and `ra_arena`.

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agobetter comments
Aleksey Kladov [Mon, 18 Feb 2019 13:20:12 +0000 (16:20 +0300)]
better comments

5 years agodrop dependency on thread_worker
Aleksey Kladov [Mon, 18 Feb 2019 12:30:58 +0000 (15:30 +0300)]
drop dependency on thread_worker

5 years agodrop unused extern crate
Aleksey Kladov [Mon, 18 Feb 2019 11:39:18 +0000 (14:39 +0300)]
drop unused extern crate

5 years agohide TaskResult from the public API
Aleksey Kladov [Mon, 18 Feb 2019 11:29:54 +0000 (14:29 +0300)]
hide TaskResult from the public API

5 years agomove public API to top of the file
Aleksey Kladov [Mon, 18 Feb 2019 11:21:25 +0000 (14:21 +0300)]
move public API to top of the file

5 years agoremove depedency on ra_arena
Aleksey Kladov [Mon, 18 Feb 2019 11:20:54 +0000 (14:20 +0300)]
remove depedency on ra_arena

5 years agoremove arena from Roots
Aleksey Kladov [Mon, 18 Feb 2019 11:13:13 +0000 (14:13 +0300)]
remove arena from Roots

we want to move ra_vfs to a new repo, so having fewer deps is useful.
Arena is a thin layer of sugar on top of Vec anyway.

5 years agoremove useless Arc
Aleksey Kladov [Mon, 18 Feb 2019 11:05:08 +0000 (14:05 +0300)]
remove useless Arc

5 years agoMerge #855
bors[bot] [Mon, 18 Feb 2019 09:47:31 +0000 (09:47 +0000)]
Merge #855

855: :arrow_up: deps r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agodrop unused deps
Aleksey Kladov [Mon, 18 Feb 2019 09:46:08 +0000 (12:46 +0300)]
drop unused deps

5 years ago:arrow_up: deps
Aleksey Kladov [Mon, 18 Feb 2019 09:36:04 +0000 (12:36 +0300)]
:arrow_up: deps

5 years agoMerge #854
bors[bot] [Mon, 18 Feb 2019 09:26:24 +0000 (09:26 +0000)]
Merge #854

854: more compact edits in insta r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agomore compact edits in insta
Aleksey Kladov [Mon, 18 Feb 2019 09:23:31 +0000 (12:23 +0300)]
more compact edits in insta

5 years agoDon't use additional_text_edits API internally
Aleksey Kladov [Mon, 18 Feb 2019 09:05:16 +0000 (12:05 +0300)]
Don't use additional_text_edits API internally

5 years agoMerge #852
bors[bot] [Mon, 18 Feb 2019 09:13:51 +0000 (09:13 +0000)]
Merge #852

852: Handle != r=flodiebold a=matklad

r? @flodiebold

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoMore orthogonal method naming
Aleksey Kladov [Mon, 18 Feb 2019 09:07:47 +0000 (12:07 +0300)]
More orthogonal method naming

5 years agoMerge #853
bors[bot] [Mon, 18 Feb 2019 07:32:21 +0000 (07:32 +0000)]
Merge #853

853: More compact debug representation for completion r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoMore compact debug representation for completion
Aleksey Kladov [Mon, 18 Feb 2019 07:31:00 +0000 (10:31 +0300)]
More compact debug representation for completion

5 years agohandle != operator
Aleksey Kladov [Mon, 18 Feb 2019 07:09:44 +0000 (10:09 +0300)]
handle != operator

5 years agoMerge #850
bors[bot] [Mon, 18 Feb 2019 06:22:07 +0000 (06:22 +0000)]
Merge #850

850: Handle tuple structs / enum variants properly in type inference r=matklad a=flodiebold

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
5 years agoMerge #851
bors[bot] [Mon, 18 Feb 2019 06:14:39 +0000 (06:14 +0000)]
Merge #851

851: Enable parsing attributes for generic lifetimes and type parameters r=matklad a=vipentti

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
5 years agoEnable parsing attributes for generic lifetimes and type parameters
Ville Penttinen [Sun, 17 Feb 2019 20:19:21 +0000 (22:19 +0200)]
Enable parsing attributes for generic lifetimes and type parameters

5 years agoHandle tuple structs / enum variants properly in type inference
Florian Diebold [Sun, 17 Feb 2019 16:29:51 +0000 (17:29 +0100)]
Handle tuple structs / enum variants properly in type inference

5 years agoMerge #849
bors[bot] [Sun, 17 Feb 2019 18:47:09 +0000 (18:47 +0000)]
Merge #849

849: Don't render `()` in calls to assoc functions r=matklad a=matklad

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agoMerge #846
bors[bot] [Sun, 17 Feb 2019 18:39:26 +0000 (18:39 +0000)]
Merge #846

846: WIP: Enable parsing of attributes inside a match block r=matklad a=vipentti

We allow invalid inner attributes to be parsed, e.g. inner attributes that are
not directly after the opening brace of the match block.

Instead we run validation on `MatchArmList` to allow better reporting of errors.

This fixes #845 and works towards #759

Co-authored-by: Ville Penttinen <villem.penttinen@gmail.com>
5 years agoRemove match_armlist validator
Ville Penttinen [Sun, 17 Feb 2019 18:32:10 +0000 (20:32 +0200)]
Remove match_armlist validator

5 years agoDon't render `()` in calls to assoc functions
Aleksey Kladov [Sun, 17 Feb 2019 18:30:46 +0000 (21:30 +0300)]
Don't render `()` in calls to assoc functions

5 years agoMerge #847
bors[bot] [Sun, 17 Feb 2019 18:19:27 +0000 (18:19 +0000)]
Merge #847

847: Refactor vfs r=matklad a=matklad

Some slight refctorings of VFS, in preparation for moving it to a separate repo

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
5 years agomarginally better names
Aleksey Kladov [Sun, 17 Feb 2019 18:10:40 +0000 (21:10 +0300)]
marginally better names

5 years agofix-tests
Aleksey Kladov [Sun, 17 Feb 2019 18:05:33 +0000 (21:05 +0300)]
fix-tests

5 years agoremove overlay removes overlay
Aleksey Kladov [Sun, 17 Feb 2019 17:58:28 +0000 (20:58 +0300)]
remove overlay removes overlay

5 years agosimplify overlay handling
Aleksey Kladov [Sun, 17 Feb 2019 17:54:11 +0000 (20:54 +0300)]
simplify overlay handling

5 years agoParse only outer_attributes for match arms for now
Ville Penttinen [Sun, 17 Feb 2019 17:48:08 +0000 (19:48 +0200)]
Parse only outer_attributes for match arms for now

5 years agosimplify
Aleksey Kladov [Sun, 17 Feb 2019 17:34:01 +0000 (20:34 +0300)]
simplify