]>
git.lizzy.rs Git - rust.git/log
Ville Penttinen [Sat, 23 Feb 2019 12:08:57 +0000 (14:08 +0200)]
Remove unnecessary to_nav_target
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.
Ville Penttinen [Sat, 23 Feb 2019 10:53:53 +0000 (12:53 +0200)]
Fix NavigationTarget debug_render container_name output
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.
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>
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.
Ville Penttinen [Thu, 21 Feb 2019 22:27:22 +0000 (00:27 +0200)]
Ignore failing test for now
Ville Penttinen [Thu, 21 Feb 2019 22:11:21 +0000 (00:11 +0200)]
Make nameres::ResolvePathResult private and refactor
Ville Penttinen [Thu, 21 Feb 2019 21:57:07 +0000 (23:57 +0200)]
Remove Const inference for now, refactor PathResult
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>
Florian Diebold [Thu, 21 Feb 2019 20:25:27 +0000 (21:25 +0100)]
Add an assert (and fix the other)
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>
Ville Penttinen [Thu, 21 Feb 2019 16:49:03 +0000 (18:49 +0200)]
Move `non_trivia_sibling` to `ra_syntax::algo`
Ville Penttinen [Thu, 21 Feb 2019 16:26:27 +0000 (18:26 +0200)]
Simplify adding a comma after 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,);
}
```
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>
kjeremy [Thu, 21 Feb 2019 15:07:14 +0000 (10:07 -0500)]
Update lsp-types and backtrace
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>
Aleksey Kladov [Thu, 21 Feb 2019 14:35:45 +0000 (17:35 +0300)]
add API guide to ra_syntax
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>
Aleksey Kladov [Thu, 21 Feb 2019 13:12:15 +0000 (16:12 +0300)]
simplify trait bounds
Aleksey Kladov [Thu, 21 Feb 2019 13:04:03 +0000 (16:04 +0300)]
rearrange methods
Aleksey Kladov [Thu, 21 Feb 2019 12:51:22 +0000 (15:51 +0300)]
kill utils module
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>
Aleksey Kladov [Thu, 21 Feb 2019 12:44:38 +0000 (15:44 +0300)]
Ignore lockfile in fuzz
It's too much trouble maintaining it
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>
Aleksey Kladov [Thu, 21 Feb 2019 12:24:42 +0000 (15:24 +0300)]
docs
Aleksey Kladov [Thu, 21 Feb 2019 11:06:21 +0000 (14:06 +0300)]
add failing test
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>
Aleksey Kladov [Thu, 21 Feb 2019 10:45:10 +0000 (13:45 +0300)]
fix the test
Aleksey Kladov [Thu, 21 Feb 2019 10:37:32 +0000 (13:37 +0300)]
fix compilation
Aleksey Kladov [Thu, 21 Feb 2019 10:27:45 +0000 (13:27 +0300)]
move parser to a separate crate
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.
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>
Aleksey Kladov [Thu, 21 Feb 2019 09:12:04 +0000 (12:12 +0300)]
make grammar independent of syntax tree
Aleksey Kladov [Thu, 21 Feb 2019 09:05:52 +0000 (12:05 +0300)]
minor
Aleksey Kladov [Thu, 21 Feb 2019 09:03:42 +0000 (12:03 +0300)]
move whitespace handling to tree builder
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.
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>
Aleksey Kladov [Wed, 20 Feb 2019 20:17:07 +0000 (23:17 +0300)]
move syntax error to parser
Aleksey Kladov [Wed, 20 Feb 2019 20:05:59 +0000 (23:05 +0300)]
simplify
Aleksey Kladov [Wed, 20 Feb 2019 19:58:56 +0000 (22:58 +0300)]
remove TokenPos
Aleksey Kladov [Wed, 20 Feb 2019 19:52:32 +0000 (22:52 +0300)]
flattern module structure
Aleksey Kladov [Wed, 20 Feb 2019 19:44:06 +0000 (22:44 +0300)]
merge parse_impl and parser_api
Aleksey Kladov [Wed, 20 Feb 2019 19:27:49 +0000 (22:27 +0300)]
fix off by one error
Aleksey Kladov [Wed, 20 Feb 2019 19:19:12 +0000 (22:19 +0300)]
move abstract traits to top
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 #
Aleksey Kladov [Wed, 20 Feb 2019 18:50:07 +0000 (21:50 +0300)]
route parsing via TokenSource trait
Aleksey Kladov [Wed, 20 Feb 2019 18:08:59 +0000 (21:08 +0300)]
rename Sink -> TreeSink
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>
Aleksey Kladov [Wed, 20 Feb 2019 13:48:06 +0000 (16:48 +0300)]
fix tests
Aleksey Kladov [Wed, 20 Feb 2019 13:24:39 +0000 (16:24 +0300)]
rearrange modules in a suggestd reading order
Aleksey Kladov [Wed, 20 Feb 2019 13:16:14 +0000 (16:16 +0300)]
flatten modules
Aleksey Kladov [Wed, 20 Feb 2019 13:02:06 +0000 (16:02 +0300)]
move reparsers to grammar
Aleksey Kladov [Wed, 20 Feb 2019 12:57:26 +0000 (15:57 +0300)]
tighten visibility
Aleksey Kladov [Wed, 20 Feb 2019 12:47:32 +0000 (15:47 +0300)]
move all parsing related bits to a separate module
Aleksey Kladov [Wed, 20 Feb 2019 12:03:31 +0000 (15:03 +0300)]
slightly better name
Aleksey Kladov [Wed, 20 Feb 2019 11:53:19 +0000 (14:53 +0300)]
make stuff private
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>
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
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>
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
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>
Aleksey Kladov [Mon, 18 Feb 2019 13:43:30 +0000 (16:43 +0300)]
remove local-vfs
Aleksey Kladov [Mon, 18 Feb 2019 13:43:16 +0000 (16:43 +0300)]
switch to crates.io vfs
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>
Aleksey Kladov [Mon, 18 Feb 2019 13:20:12 +0000 (16:20 +0300)]
better comments
Aleksey Kladov [Mon, 18 Feb 2019 12:30:58 +0000 (15:30 +0300)]
drop dependency on thread_worker
Aleksey Kladov [Mon, 18 Feb 2019 11:39:18 +0000 (14:39 +0300)]
drop unused extern crate
Aleksey Kladov [Mon, 18 Feb 2019 11:29:54 +0000 (14:29 +0300)]
hide TaskResult from the public API
Aleksey Kladov [Mon, 18 Feb 2019 11:21:25 +0000 (14:21 +0300)]
move public API to top of the file
Aleksey Kladov [Mon, 18 Feb 2019 11:20:54 +0000 (14:20 +0300)]
remove depedency on ra_arena
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.
Aleksey Kladov [Mon, 18 Feb 2019 11:05:08 +0000 (14:05 +0300)]
remove useless Arc
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>
Aleksey Kladov [Mon, 18 Feb 2019 09:46:08 +0000 (12:46 +0300)]
drop unused deps
Aleksey Kladov [Mon, 18 Feb 2019 09:36:04 +0000 (12:36 +0300)]
:arrow_up: deps
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>
Aleksey Kladov [Mon, 18 Feb 2019 09:23:31 +0000 (12:23 +0300)]
more compact edits in insta
Aleksey Kladov [Mon, 18 Feb 2019 09:05:16 +0000 (12:05 +0300)]
Don't use additional_text_edits API internally
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>
Aleksey Kladov [Mon, 18 Feb 2019 09:07:47 +0000 (12:07 +0300)]
More orthogonal method naming
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>
Aleksey Kladov [Mon, 18 Feb 2019 07:31:00 +0000 (10:31 +0300)]
More compact debug representation for completion
Aleksey Kladov [Mon, 18 Feb 2019 07:09:44 +0000 (10:09 +0300)]
handle != operator
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>
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>
Ville Penttinen [Sun, 17 Feb 2019 20:19:21 +0000 (22:19 +0200)]
Enable parsing attributes for generic lifetimes and type parameters
Florian Diebold [Sun, 17 Feb 2019 16:29:51 +0000 (17:29 +0100)]
Handle tuple structs / enum variants properly in type inference
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>
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>
Ville Penttinen [Sun, 17 Feb 2019 18:32:10 +0000 (20:32 +0200)]
Remove match_armlist validator
Aleksey Kladov [Sun, 17 Feb 2019 18:30:46 +0000 (21:30 +0300)]
Don't render `()` in calls to assoc functions
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>
Aleksey Kladov [Sun, 17 Feb 2019 18:10:40 +0000 (21:10 +0300)]
marginally better names
Aleksey Kladov [Sun, 17 Feb 2019 18:05:33 +0000 (21:05 +0300)]
fix-tests
Aleksey Kladov [Sun, 17 Feb 2019 17:58:28 +0000 (20:58 +0300)]
remove overlay removes overlay
Aleksey Kladov [Sun, 17 Feb 2019 17:54:11 +0000 (20:54 +0300)]
simplify overlay handling
Ville Penttinen [Sun, 17 Feb 2019 17:48:08 +0000 (19:48 +0200)]
Parse only outer_attributes for match arms for now
Aleksey Kladov [Sun, 17 Feb 2019 17:34:01 +0000 (20:34 +0300)]
simplify