Commit Graph

7998 Commits

Author SHA1 Message Date
bors[bot]
4fea5808e9
Merge #3191
3191: Remove two stage constuction r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-17 13:24:07 +00:00
Aleksey Kladov
3717b0e03f Simplify some more ctors 2020-02-17 14:23:23 +01:00
Aleksey Kladov
3c12cd49ec Simplify ctor 2020-02-17 14:22:09 +01:00
Aleksey Kladov
7dccfd9183 remove debug print 2020-02-17 14:20:18 +01:00
Aleksey Kladov
89afb1a841 Remove two stage constuction 2020-02-17 14:11:01 +01:00
Aleksey Kladov
978bea2b31 Fix link to the manual 2020-02-17 14:04:32 +01:00
Aleksey Kladov
ee4e41cbea Push IO and error handling up 2020-02-17 14:03:33 +01:00
Aleksey Kladov
6167101302
Merge pull request #3190 from matklad/reload
Simplify TS reload logic
2020-02-17 13:54:33 +01:00
Aleksey Kladov
d24e612106 Simplify startup 2020-02-17 13:40:47 +01:00
Aleksey Kladov
dcdbbddd16 Simplify TS reload logic
Fixes #3164
2020-02-17 13:40:47 +01:00
bors[bot]
fcf15cc05a
Merge #3169
3169: Show record field names in Enum completion r=flodiebold a=adamrk

Adresses https://github.com/rust-analyzer/rust-analyzer/issues/2947.
Previously the details shown when autocompleting an Enum variant would look like the variant was a tuple even if it was a record:
![2020-02-16-15:59:32_crop](https://user-images.githubusercontent.com/16367467/74607233-64f21980-50d7-11ea-99db-e973e29c71d7.png)

This change will show the names of the fields for a record and use curly braces instead of parentheses:
![2020-02-16-15:33:00_crop](https://user-images.githubusercontent.com/16367467/74607251-8ce17d00-50d7-11ea-9d4d-38d198a4aec0.png)

This required exposing the type `adt::StructKind` from `ra_hir` and adding a function 
```
kind(self, db: &impl HirDatabase) -> StructKind
```
in the `impl` of `EnumVariant`. 

There was also a previously existing function `is_unit(self, db: &impl HirDatabase) -> bool` for `EnumVariant` which I removed because it seemed redundant after adding `kind`.

Co-authored-by: adamrk <ark.email@gmail.com>
2020-02-17 10:54:32 +00:00
adamrk
0e260aa6b1 use 'if let' instead of match on kind in lower.rs 2020-02-17 11:53:12 +01:00
bors[bot]
334f53465f
Merge #3187
3187: ⬆️ npm deps r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-17 10:13:45 +00:00
Aleksey Kladov
48dd1d7053 ⬆️ npm deps 2020-02-17 11:13:16 +01:00
Aleksey Kladov
2225cadd5a update lockfile 2020-02-17 11:12:45 +01:00
bors[bot]
93d28fb50c
Merge #3099
3099: Init implementation of structural search replace r=matklad a=mikhail-m1

next steps:
* ignore space and other minor difference
* add support to ra_cli
* call rust parser to check pattern
* documentation

original issue #2267 

Co-authored-by: Mikhail Modin <mikhailm1@gmail.com>
2020-02-17 10:02:54 +00:00
bors[bot]
429fa445b7
Merge #3185
3185: Mention rust-src r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-17 09:55:38 +00:00
Aleksey Kladov
353f7ce2ec Mention rust-src 2020-02-17 10:55:08 +01:00
bors[bot]
8d8d542dfa
Merge #3108
3108: Magic Completion for `impl Trait for` Associated Items r=matklad a=kdelorey

# Summary
This PR adds a set of magic completions to auto complete associated trait items (functions/consts/types). 

![Associated Trait Impl](https://user-images.githubusercontent.com/2295721/74493144-d8f1af00-4e96-11ea-93a4-82725bf89646.gif)

## Notes
Since the assist and completion share the same logic when figuring out the associated items that are missing, a shared utility was created in the `ra_assists::utils` module.

Resolves #1046 

As this is my first PR to the rust-analyzer project, I'm new to the codebase, feedback welcomed!

Co-authored-by: Kevin DeLorey <2295721+kdelorey@users.noreply.github.com>
2020-02-17 09:34:08 +00:00
bors[bot]
953dbe3e02
Merge #3181
3181: Add ability to pass additional arguments to rustfmt. r=matklad a=Leonqn

relates to #2848

Co-authored-by: Ilya Titkov <ilya@titkov.me>
2020-02-17 09:05:01 +00:00
bors[bot]
c9989a524c
Merge #3153
3153: When a single test is run, do not run others with overlapping names r=matklad a=SomeoneToIgnore



Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2020-02-17 08:52:45 +00:00
bors[bot]
dd8fc5a61a
Merge #3177 #3178
3177: Update debug docs r=matklad a=Veetaha

Updated `debugging.md` file, added two useful demo videos.

3178: vscode: minor refactorings r=matklad a=Veetaha

Very minor

Co-authored-by: Veetaha <gerzoh1@gmail.com>
Co-authored-by: Veetaha <gersoh3@gmail.com>
2020-02-17 08:45:39 +00:00
Ilya Titkov
a2b0bdcc24 Add arguments to rustfmt 2020-02-17 11:44:58 +03:00
bors[bot]
daffdd8674
Merge #3179
3179: Introduce AsMacroCall trait r=matklad a=edwin0cheng

This PR introduce `AsMacroCall` trait to help convert `ast::MacroCall` to `MacroCallId`. The main goal here is to centralize various conversions to single place and make implementing eager macro calls without further ado.

```rust
pub trait AsMacroCall {
    fn as_call_id(
        &self,
        db: &(impl db::DefDatabase + AstDatabase),
        resolver: impl Fn(path::ModPath) -> Option<MacroDefId>,
    ) -> Option<MacroCallId>;
}
```

Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2020-02-17 08:38:09 +00:00
Edwin Cheng
2d4e79e1e6 Introduce AsMacroCall trait 2020-02-17 12:57:24 +08:00
Veetaha
bd113623a0 vscode: minor refactorings 2020-02-17 02:07:11 +02:00
Veetaha
31ae646448 vscode: add comment on possible UnhandledPromise rejection error 2020-02-17 01:39:58 +02:00
Veetaha
2d7fe230f5 docs: Fix grammar mistakes 2020-02-16 23:52:41 +02:00
Veetaha
884e382fb8
Fix typo
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:47:12 +02:00
Veetaha
5bf7e9a455
Remove ptrace note
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:43:13 +02:00
Veetaha
bb9844e195
Add more verbose description
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:42:48 +02:00
Veetaha
7050697871
Add the article
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:42:10 +02:00
Veetaha
3db91db421
Reworded abit
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:40:31 +02:00
Veetaha
329a1b665d
Add an article
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:38:25 +02:00
Veetaha
dc90507dbe
Migrate from 'npm i' to 'npm install'
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:36:16 +02:00
Veetaha
1a96d4c15c
Make Rust Great Again
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:35:41 +02:00
Veetaha
79625e2dc2
Apply better wording as per lnicola
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:35:10 +02:00
Veetaha
351cc9021e
Add the article
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 23:33:23 +02:00
Veetaha
200a2475a2 docs: fix typo 2020-02-16 23:21:11 +02:00
Veetaha
64112b0b61 docs: update debugging.md with the freshest VSCode debugging information 2020-02-16 23:00:10 +02:00
Veetaha
43a41819cb docs: remove obsolescence notice in debugging.md 2020-02-16 21:03:24 +02:00
bors[bot]
32fc890de8
Merge #3175
3175: vscode: skip node internals while debugging r=matklad a=Veetaha

Before:
![without-skip-files](https://user-images.githubusercontent.com/36276403/74610221-de9aff00-50f9-11ea-81bb-73dce8ca7acc.gif)
After:
![with-skip-files](https://user-images.githubusercontent.com/36276403/74610222-e22e8600-50f9-11ea-980b-e8d098ee82b4.gif)


Co-authored-by: Veetaha <gerzoh1@gmail.com>
2020-02-16 18:51:51 +00:00
Veetaha
54432c3ae8 vscode: apply lnicolas amendments to comments in launch.json 2020-02-16 20:38:04 +02:00
Veetaha
cc280aba0f vscode: remove extra comment lone 2020-02-16 20:22:27 +02:00
Veetaha
29c7cbb46f vscode: skip node internals while debugging 2020-02-16 20:20:30 +02:00
bors[bot]
3a1c7808a4
Merge #3174
3174:  Added description and disable-extensions r=matklad a=Fihtangolz



Co-authored-by: Dmitry <mamhigtt@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-16 17:55:04 +00:00
Aleksey Kladov
5b781de56c
Apply suggestions from code review
Co-Authored-By: Laurențiu Nicola <lnicola@users.noreply.github.com>
2020-02-16 18:54:32 +01:00
bors[bot]
a90f5b0787
Merge #3173
3173: vscode: fix stupid mistake of mine r=matklad a=Veetaha

Shame on me...
Fixes #3056

Co-authored-by: Veetaha <gerzoh1@gmail.com>
2020-02-16 17:40:23 +00:00
Dmitry
58e15d12e4 Merge remote-tracking branch 'origin/master' 2020-02-17 00:36:48 +07:00
bors[bot]
10f910df4b
Merge #3172
3172: 1-based columns r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-02-16 17:31:16 +00:00