]>
git.lizzy.rs Git - rust.git/log
Aleksey Kladov [Tue, 20 Aug 2019 15:53:59 +0000 (18:53 +0300)]
translate \n -> \r\n on the way out
Aleksey Kladov [Tue, 20 Aug 2019 15:33:23 +0000 (18:33 +0300)]
make CTX type param instead of assoc type
that way, we can implement ConvWith<&'_ CTX> for different lifetimes
Aleksey Kladov [Tue, 20 Aug 2019 15:26:07 +0000 (18:26 +0300)]
add tests for crlf
Aleksey Kladov [Tue, 20 Aug 2019 15:25:27 +0000 (18:25 +0300)]
minor
bors[bot] [Tue, 20 Aug 2019 16:27:57 +0000 (16:27 +0000)]
Merge #1707
1707: make sure lockfile is used for cargo install r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Tue, 20 Aug 2019 16:27:33 +0000 (19:27 +0300)]
make sure lockfile is used for cargo install
bors[bot] [Mon, 19 Aug 2019 12:42:06 +0000 (12:42 +0000)]
Merge #1703
1703: don't load sysroot in most heavy tests r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 19 Aug 2019 12:41:18 +0000 (15:41 +0300)]
don't load sysroot in most heavy tests
bors[bot] [Mon, 19 Aug 2019 12:09:33 +0000 (12:09 +0000)]
Merge #1702
1702: replace heck with just ascii transformation r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 19 Aug 2019 12:08:36 +0000 (15:08 +0300)]
replace heck with just ascii transformation
bors[bot] [Mon, 19 Aug 2019 11:31:01 +0000 (11:31 +0000)]
Merge #1701
1701: qualify ast types with `ast::` r=matklad a=matklad
(only the last commit is relevant, the rest are from #1700)
bors r+
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 19 Aug 2019 11:27:15 +0000 (14:27 +0300)]
qualify ast types with `ast::`
By convention, ast nodes should always be used as `ast::FnDef`. This
is to avoid confusion with similarly-named hir types.
bors[bot] [Mon, 19 Aug 2019 11:18:09 +0000 (11:18 +0000)]
Merge #1700
1700: remove ast::*Kind enums r=matklad a=matklad
bors r+
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 19 Aug 2019 11:13:58 +0000 (14:13 +0300)]
remove ast::*Kind from ra_ide_api
Aleksey Kladov [Mon, 19 Aug 2019 11:11:09 +0000 (14:11 +0300)]
remove ast::*Kind enums from assists
Aleksey Kladov [Mon, 19 Aug 2019 11:04:51 +0000 (14:04 +0300)]
remove ast::*Kind from hir
Aleksey Kladov [Mon, 19 Aug 2019 10:58:49 +0000 (13:58 +0300)]
remove ast::*Kind enums
With the new owned trees, we don't need an indirection here
bors[bot] [Mon, 19 Aug 2019 10:30:19 +0000 (10:30 +0000)]
Merge #1699
1699: :arrow_up: vfs r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 19 Aug 2019 10:21:34 +0000 (13:21 +0300)]
:arrow_up: vfs
bors[bot] [Mon, 19 Aug 2019 10:17:23 +0000 (10:17 +0000)]
Merge #1698
1698: use derive(Debug) for SyntaxKind r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 19 Aug 2019 10:11:51 +0000 (13:11 +0300)]
use derive(Debug) for SyntaxKind
bors[bot] [Mon, 19 Aug 2019 09:37:03 +0000 (09:37 +0000)]
Merge #1697
1697: Use quote instead of tera for boilerplate generation r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 19 Aug 2019 09:26:34 +0000 (12:26 +0300)]
plug new boilerplate_gen into ra_tools
Aleksey Kladov [Mon, 19 Aug 2019 08:39:12 +0000 (11:39 +0300)]
rename codegen -> boilerplate_gen
Aleksey Kladov [Mon, 19 Aug 2019 08:05:49 +0000 (11:05 +0300)]
drop tera dependency
Aleksey Kladov [Mon, 19 Aug 2019 08:02:18 +0000 (11:02 +0300)]
use new quote-generated syntax kinds
bors[bot] [Mon, 19 Aug 2019 08:05:39 +0000 (08:05 +0000)]
Merge #1696
1696: fix #1424 r=matklad a=coderfox
- resolve "~" in raLspServerPath
I think expanding simply `~/` is quite simple as node provides `homedir`, but expanding `~foo/` is difficult as there is no cross-platform approach of reading home directory of another user. So this pull request only resolves `~/` in `raLspServerPath`.
Besides, the source code is arranged in a way hard to write tests. Would anyone provide me with instructions of writing tests for this feature, or no test is required for this feature?
Co-authored-by: xfoxfu <i@xfox.me>
Aleksey Kladov [Mon, 19 Aug 2019 08:02:04 +0000 (11:02 +0300)]
use quote! to generate syntax kinds
xfoxfu [Mon, 19 Aug 2019 02:48:39 +0000 (10:48 +0800)]
fix #1424
resolve "~" in raLspServerPath
Aleksey Kladov [Sun, 18 Aug 2019 20:36:22 +0000 (23:36 +0300)]
use new quote-generated ast
Aleksey Kladov [Sun, 18 Aug 2019 20:11:08 +0000 (23:11 +0300)]
use quote! macro to generate grammar
We already use syn"e elsewhere (transitively), so it make sense to
cut down on the number of technologies and get rid of tera
Aleksey Kladov [Sun, 18 Aug 2019 18:54:51 +0000 (21:54 +0300)]
deserialize grammar
Aleksey Kladov [Sun, 18 Aug 2019 18:44:24 +0000 (21:44 +0300)]
switch to new codegen
Aleksey Kladov [Sun, 18 Aug 2019 18:34:55 +0000 (21:34 +0300)]
codegen boilerplate
Aleksey Kladov [Sun, 18 Aug 2019 18:33:31 +0000 (21:33 +0300)]
add quote dep
bors[bot] [Sat, 17 Aug 2019 19:23:16 +0000 (19:23 +0000)]
Merge #1695
1695: update lsp r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 17 Aug 2019 18:34:31 +0000 (21:34 +0300)]
update lsp
bors[bot] [Sat, 17 Aug 2019 15:57:02 +0000 (15:57 +0000)]
Merge #1694
1694: Implement initial type-inference support for Index r=flodiebold a=matklad
This doesn't actually infer indexing types, but at least it walks sub-expressions!
Initially, I wanted to make `Index` just a new kind of `BinOp` (b/c indexing is kind of a binary op), so I've refactoring binop handing a bit.
However, in the end I've decided to add a separate expr kind for Index, because `foo[0]`, `&foo[1]` and `&mut foo[1]` all seem to need slightly different handing, which is not binop-like
r? @flodiebold
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 17 Aug 2019 15:05:20 +0000 (18:05 +0300)]
implement initial type inference for index expressions
Aleksey Kladov [Sat, 17 Aug 2019 14:51:01 +0000 (17:51 +0300)]
normalize ordering ops
Aleksey Kladov [Sat, 17 Aug 2019 14:42:41 +0000 (17:42 +0300)]
Introduce separate hir::BinaryOp
Unlike ast::BinOp, it has significantly more structure to it, so it's
easier to, say, handle all assignment-like operations in the same way.
Aleksey Kladov [Sat, 17 Aug 2019 14:17:01 +0000 (17:17 +0300)]
implement accessors for IndexExpr
Aleksey Kladov [Sat, 17 Aug 2019 14:14:22 +0000 (17:14 +0300)]
simplify
bors[bot] [Sat, 17 Aug 2019 12:30:33 +0000 (12:30 +0000)]
Merge #1693
1693: Remove cpuprofile dependencies r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 17 Aug 2019 12:29:57 +0000 (15:29 +0300)]
Remove cpuprofile dependencies
bors[bot] [Sat, 17 Aug 2019 10:53:33 +0000 (10:53 +0000)]
Merge #1692
1692: :arrow_up: deps r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 17 Aug 2019 10:51:22 +0000 (13:51 +0300)]
:arrow_up: deps
bors[bot] [Fri, 16 Aug 2019 14:24:51 +0000 (14:24 +0000)]
Merge #1691
1691: Show inherent and trait impls of structs and enums r=viorina a=viorina
Co-authored-by: Ekaterina Babshukova <ekaterina.babshukova@yandex.ru>
Ekaterina Babshukova [Fri, 16 Aug 2019 13:34:47 +0000 (16:34 +0300)]
show inherent and trait impls of structs and enums
bors[bot] [Fri, 16 Aug 2019 02:44:13 +0000 (02:44 +0000)]
Merge #1689
1689: Update deps r=kjeremy a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Fri, 16 Aug 2019 02:36:17 +0000 (22:36 -0400)]
Update deps
bors[bot] [Thu, 15 Aug 2019 12:58:33 +0000 (12:58 +0000)]
Merge #1686
1686: :arrow_up: deps r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 15 Aug 2019 12:58:08 +0000 (15:58 +0300)]
:arrow_up: deps
bors[bot] [Thu, 15 Aug 2019 12:35:12 +0000 (12:35 +0000)]
Merge #1445
1445: Use the new "durability" infrastructure from salsa r=matklad a=matklad
Based on https://github.com/nikomatsakis/salsa/tree/durability
Durability allows us to skip *validation* work for sysroot and crates.io libraries, which massively speeds up some workloads
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 15 Aug 2019 12:18:48 +0000 (15:18 +0300)]
switch to upstream salsa
Aleksey Kladov [Wed, 26 Jun 2019 06:12:46 +0000 (09:12 +0300)]
implement durability
Aleksey Kladov [Fri, 5 Jul 2019 14:45:57 +0000 (17:45 +0300)]
switch from volatile to untracked read
bors[bot] [Thu, 15 Aug 2019 05:49:13 +0000 (05:49 +0000)]
Merge #1685
1685: fix error of RangeFrom in for-loop r=DJMcNab a=bravomikekilo
fix [issue-1542](https://github.com/rust-analyzer/rust-analyzer/issues/1542) @matklad
Co-authored-by: bravomikekilo <bmk1221@126.com>
bors[bot] [Wed, 14 Aug 2019 15:10:31 +0000 (15:10 +0000)]
Merge #1676
1676: Fix for<'lifetime> for types specified by path r=matklad a=eupn
Fixes #1467.
Co-authored-by: Evgenii P <eupn@protonmail.com>
bravomikekilo [Wed, 14 Aug 2019 13:20:04 +0000 (21:20 +0800)]
fix test position
bravomikekilo [Wed, 14 Aug 2019 04:42:58 +0000 (12:42 +0800)]
fix test
bravomikekilo [Wed, 14 Aug 2019 03:55:21 +0000 (11:55 +0800)]
fix error of RangeFrom in for-loop
Evgenii P [Tue, 13 Aug 2019 15:36:01 +0000 (22:36 +0700)]
Fix is_path_start to accept T![<], fix is_path_start usages
bors[bot] [Tue, 13 Aug 2019 12:46:47 +0000 (12:46 +0000)]
Merge #1636
1636: fix block parse problem r=matklad a=bravomikekilo
try to fix [issue-1598](https://github.com/rust-analyzer/rust-analyzer/issues/1598).
Co-authored-by: bravomikekilo <bmk1221@126.com>
bravomikekilo [Tue, 13 Aug 2019 10:17:10 +0000 (18:17 +0800)]
add inline test
bors[bot] [Mon, 12 Aug 2019 19:43:57 +0000 (19:43 +0000)]
Merge #1677
1677: Associated types r=flodiebold a=flodiebold
This implements basic support for (fully qualified) associated type projections:
- handle fully qualified paths like `<T as Trait>::AssocType` (basically desugaring to something like `Trait<Self=T>::AssocType`)
- lower these to a new `Ty::Projection` enum variant
- also introduce `Ty::UnselectedProjection` for cases like `T::AssocType` where the trait from which the type comes isn't specified, but these aren't handled further so far
- in inference, normalize these projections using Chalk: basically, when encountering a type e.g. from a type annotation or signature, we replace these `Ty::Projection`s by type variables and add obligations to normalize the associated type
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Florian Diebold [Sun, 11 Aug 2019 13:54:31 +0000 (15:54 +0200)]
Handle placeholder assoc types when Chalk produces them
Florian Diebold [Sun, 11 Aug 2019 11:52:34 +0000 (13:52 +0200)]
Normalize assoc types in more places
Florian Diebold [Sat, 10 Aug 2019 10:13:39 +0000 (12:13 +0200)]
Improve debug logging a bit
Florian Diebold [Wed, 7 Aug 2019 20:06:09 +0000 (22:06 +0200)]
Normalize associated types during inference
Florian Diebold [Mon, 5 Aug 2019 20:42:38 +0000 (22:42 +0200)]
Lower fully qualified associated type paths
I.e. `<T as Trait>::Foo`.
Florian Diebold [Mon, 5 Aug 2019 19:13:34 +0000 (21:13 +0200)]
Add representations of associated types
This adds three different representations, copied from the Chalk model:
- `Ty::Projection` is an associated type projection written somewhere in the
code, like `<Foo as Trait>::Bar`.
- `Ty::UnselectedProjection` is similar, but we don't know the trait
yet (`Foo::Bar`).
- The above representations are normalized to their actual types during type
inference. When that isn't possible, for example for `T::Item` inside an `fn
foo<T: Iterator>`, the type is normalized to an application type with
`TypeCtor::AssociatedType`.
Florian Diebold [Sun, 14 Jul 2019 12:19:00 +0000 (14:19 +0200)]
Add another test for assoc type resolution
bors[bot] [Mon, 12 Aug 2019 16:22:58 +0000 (16:22 +0000)]
Merge #1683
1683: Use Source in Diagnostic r=matklad a=eupn
Closes #1681.
Co-authored-by: Evgenii P <eupn@protonmail.com>
Evgenii P [Mon, 12 Aug 2019 16:06:08 +0000 (23:06 +0700)]
Use Source in Diagnostic and implement
bors[bot] [Mon, 12 Aug 2019 10:49:59 +0000 (10:49 +0000)]
Merge #1682
1682: Drop support for old extendSelection API r=matklad a=matklad
Emacs now handles this via native LSP request
https://github.com/emacs-lsp/lsp-mode/commit/
dc86bbb227147aa8141e690ad5648fdbd2ebdb9f
r? @flodiebold
(Have not actually tried elisp code)
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 12 Aug 2019 10:12:45 +0000 (13:12 +0300)]
Drop support for old extendSelection API
Emacs now handles this via native LSP request
https://github.com/emacs-lsp/lsp-mode/commit/
dc86bbb227147aa8141e690ad5648fdbd2ebdb9f
bors[bot] [Mon, 12 Aug 2019 10:33:59 +0000 (10:33 +0000)]
Merge #1667
1667: Show backtraces in lens runnables r=matklad a=SomeoneToIgnore
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
bors[bot] [Mon, 12 Aug 2019 10:23:33 +0000 (10:23 +0000)]
Merge #1675
1675: Improvements to emacs inlay hints r=matklad a=flodiebold
- only send request if workspace is initialized (emacs-lsp doesn't seem to
prevent sending requests before the initialized notification is sent)
- check whether we're still in the correct buffer before sending request
Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Evgenii P [Sun, 11 Aug 2019 09:56:05 +0000 (16:56 +0700)]
Fix for<'lifetime> for types specified by path
Florian Diebold [Mon, 5 Aug 2019 19:15:44 +0000 (21:15 +0200)]
Improvements to emacs inlay hints
- only send request if workspace is initialized (emacs-lsp doesn't seem to
prevent sending requests before the initialized notification is sent)
- check whether we're still in the correct buffer before sending request
Kirill Bulatov [Fri, 9 Aug 2019 20:34:14 +0000 (23:34 +0300)]
Always set the runnable name
Kirill Bulatov [Fri, 9 Aug 2019 19:18:47 +0000 (22:18 +0300)]
Extract common logic
Kirill Bulatov [Thu, 8 Aug 2019 19:23:05 +0000 (22:23 +0300)]
Show backtraces in lens runnables
bors[bot] [Fri, 9 Aug 2019 10:17:47 +0000 (10:17 +0000)]
Merge #1673
1673: Move numeric names inside of `NameRef` r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Fri, 9 Aug 2019 10:16:47 +0000 (12:16 +0200)]
Move numeric names inside of `NameRef`
bors[bot] [Fri, 9 Aug 2019 09:21:50 +0000 (09:21 +0000)]
Merge #1669
1669: Parse tuple struct field initialization r=matklad a=eupn
Closes #1218.
This PR modifies the parser to accept the following code:
```rust
fn main() {
struct TupleStruct(usize);
let s = TupleStruct {
0: 1usize,
};
dbg!(s.0);
}
```
<details><summary>with following AST:</summary>
```
SOURCE_FILE@[0; 118)
FN_DEF@[0; 116)
FN_KW@[0; 2) "fn"
WHITESPACE@[2; 3) " "
NAME@[3; 7)
IDENT@[3; 7) "main"
PARAM_LIST@[7; 9)
L_PAREN@[7; 8) "("
R_PAREN@[8; 9) ")"
WHITESPACE@[9; 10) " "
BLOCK@[10; 116)
L_CURLY@[10; 11) "{"
WHITESPACE@[11; 16) "\n "
STRUCT_DEF@[16; 42)
STRUCT_KW@[16; 22) "struct"
WHITESPACE@[22; 23) " "
NAME@[23; 34)
IDENT@[23; 34) "TupleStruct"
POS_FIELD_DEF_LIST@[34; 41)
L_PAREN@[34; 35) "("
POS_FIELD_DEF@[35; 40)
PATH_TYPE@[35; 40)
PATH@[35; 40)
PATH_SEGMENT@[35; 40)
NAME_REF@[35; 40)
IDENT@[35; 40) "usize"
R_PAREN@[40; 41) ")"
SEMI@[41; 42) ";"
WHITESPACE@[42; 47) "\n "
LET_STMT@[47; 94)
LET_KW@[47; 50) "let"
WHITESPACE@[50; 51) " "
BIND_PAT@[51; 52)
NAME@[51; 52)
IDENT@[51; 52) "s"
WHITESPACE@[52; 53) " "
EQ@[53; 54) "="
WHITESPACE@[54; 55) " "
STRUCT_LIT@[55; 93)
PATH@[55; 66)
PATH_SEGMENT@[55; 66)
NAME_REF@[55; 66)
IDENT@[55; 66) "TupleStruct"
WHITESPACE@[66; 67) " "
NAMED_FIELD_LIST@[67; 93)
L_CURLY@[67; 68) "{"
WHITESPACE@[68; 77) "\n "
NAMED_FIELD@[77; 86)
NAME_REF@[77; 78)
INT_NUMBER@[77; 78) "0"
COLON@[78; 79) ":"
WHITESPACE@[79; 80) " "
LITERAL@[80; 86)
INT_NUMBER@[80; 86) "1usize"
COMMA@[86; 87) ","
WHITESPACE@[87; 92) "\n "
R_CURLY@[92; 93) "}"
SEMI@[93; 94) ";"
WHITESPACE@[94; 104) "\n \n "
EXPR_STMT@[104; 114)
MACRO_CALL@[104; 113)
PATH@[104; 107)
PATH_SEGMENT@[104; 107)
NAME_REF@[104; 107)
IDENT@[104; 107) "dbg"
EXCL@[107; 108) "!"
TOKEN_TREE@[108; 113)
L_PAREN@[108; 109) "("
IDENT@[109; 110) "s"
DOT@[110; 111) "."
INT_NUMBER@[111; 112) "0"
R_PAREN@[112; 113) ")"
SEMI@[113; 114) ";"
WHITESPACE@[114; 115) "\n"
R_CURLY@[115; 116) "}"
WHITESPACE@[116; 118) "\n\n"
```
</summary>
Co-authored-by: Evgenii P <eupn@protonmail.com>
Evgenii P [Fri, 9 Aug 2019 09:08:36 +0000 (16:08 +0700)]
Make name_ref to accept numeric names optionally
Evgenii P [Fri, 9 Aug 2019 08:38:52 +0000 (15:38 +0700)]
Parse tuple struct field initialization
bors[bot] [Fri, 9 Aug 2019 08:11:26 +0000 (08:11 +0000)]
Merge #1668
1668: Reduce code duplication in lexer r=matklad a=eupn
During an investigation of a fix for #1218, I stumbled upon some code duplication in the lexer.
Co-authored-by: Evgenii P <eupn@protonmail.com>
Evgenii P [Fri, 9 Aug 2019 08:04:13 +0000 (15:04 +0700)]
Change macro to function
Evgenii P [Fri, 9 Aug 2019 07:23:13 +0000 (14:23 +0700)]
rustfmt
Evgenii P [Fri, 9 Aug 2019 07:08:34 +0000 (14:08 +0700)]
Reduce code duplication in lexer by introducing small macro
bors[bot] [Thu, 8 Aug 2019 13:04:28 +0000 (13:04 +0000)]
Merge #1661
1661: Parse function parameters attributes r=matklad a=eupn
Fixes #1397. The [RFC-2565](https://github.com/rust-lang/rfcs/blob/master/text/2565-formal-function-parameter-attributes.md) specifies `#[attributes]` to function parameters:
```rust
fn foo(#[attr] a, #[unused] b, #[must_use] ...) {
// ...
}
```
This PR adds those attributes into grammar and to the parser, extending corresponding inline tests.
Co-authored-by: Evgenii P <eupn@protonmail.com>
Evgenii P [Thu, 8 Aug 2019 02:12:07 +0000 (09:12 +0700)]
Fix parser tests according to review
Evgenii P [Thu, 8 Aug 2019 01:58:28 +0000 (08:58 +0700)]
Deduplicate while loop break condition
bors[bot] [Wed, 7 Aug 2019 19:00:38 +0000 (19:00 +0000)]
Merge #1664
1664: assoc types bounds r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 7 Aug 2019 19:00:02 +0000 (21:00 +0200)]
assoc types bounds
bors[bot] [Wed, 7 Aug 2019 18:31:37 +0000 (18:31 +0000)]
Merge #1663
1663: architecture.md: update path to parser tests r=matklad a=eupn
Co-authored-by: eupn <36292692+eupn@users.noreply.github.com>
bors[bot] [Wed, 7 Aug 2019 18:21:33 +0000 (18:21 +0000)]
Merge #1662
1662: architecture.md: "finish not Y" -> "finish node Y" r=matklad a=eupn
Is this a typo?
Co-authored-by: eupn <36292692+eupn@users.noreply.github.com>