]>
git.lizzy.rs Git - rust.git/log
bors[bot] [Tue, 16 Jun 2020 05:29:05 +0000 (05:29 +0000)]
Merge #4878
4878: Make "Replace qualified name with use" replace *all* mentions of the path r=matklad a=jonas-schievink
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/4836
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Jonas Schievink [Mon, 15 Jun 2020 22:49:59 +0000 (00:49 +0200)]
Operate only on AST paths instead of HIR
Jonas Schievink [Mon, 15 Jun 2020 20:59:49 +0000 (22:59 +0200)]
Simplify
Jonas Schievink [Mon, 15 Jun 2020 20:39:26 +0000 (22:39 +0200)]
It's fookin' raw
bors[bot] [Mon, 15 Jun 2020 15:03:31 +0000 (15:03 +0000)]
Merge #4860
4860: Accept relative paths in rust-project.json r=matklad a=tweksteen
If a relative path is found as part of Crate.root_module or Root.path, interpret it as relative to the location of the rust-project.json file.
Fixes: #4816
Co-authored-by: Thiébaud Weksteen <tweek@google.com>
bors[bot] [Mon, 15 Jun 2020 13:44:46 +0000 (13:44 +0000)]
Merge #4877
4877: Fix syntax highlighting of recursive macros r=matklad a=ltentrup
Add syntax highlighting for the BANG (`!`) token if the parent is `MACRO_CALL`.
Before:
<img width="514" alt="before" src="https://user-images.githubusercontent.com/201808/
84595030 -
11f65c00 -ae56-11ea-9bb2-
b1abe2236990 .png">
After:
<img width="516" alt="recursive-macro" src="https://user-images.githubusercontent.com/201808/
84594981 -
d196de00 -ae55-11ea-8636-
f877d5d795ff .png">
Fixes #4694.
Co-authored-by: Leander Tentrup <leander.tentrup@gmail.com>
bors[bot] [Mon, 15 Jun 2020 13:15:33 +0000 (13:15 +0000)]
Merge #4892
4892: Make ra_syntax::{SyntaxNodeChildren, SyntaxElementChildren} public. r=matklad a=davidlattimore
SyntaxNode::children and SyntaxNode::children_with_tokens return these types, but there's currently no way AFAIK to name them.
Co-authored-by: David Lattimore <dml@google.com>
bors[bot] [Mon, 15 Jun 2020 13:07:38 +0000 (13:07 +0000)]
Merge #4893
4893: Add Embark Studios to the sponsors list r=matklad a=matklad
Forgot to do this when updating the sponsors list on the website the
last time :(
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 15 Jun 2020 13:06:03 +0000 (15:06 +0200)]
Add Embark Studios to the sponsors list
Forgot to do this when updating the sponsors list on the website the
last time :(
Leander Tentrup [Sun, 14 Jun 2020 13:40:06 +0000 (15:40 +0200)]
Fix syntax highlighting of recursive macros
Add syntax highlighting for the BANG (`!`) token if the parent is `MACRO_CALL`.
David Lattimore [Mon, 15 Jun 2020 11:36:30 +0000 (21:36 +1000)]
Make ra_syntax::{SyntaxNodeChildren, SyntaxElementChildren} public.
SyntaxNode::children and SyntaxNode::children_with_tokens return these types, but there's currently no way AFAIK to name them.
Thiébaud Weksteen [Tue, 9 Jun 2020 19:26:42 +0000 (21:26 +0200)]
Accept relative paths in rust-project.json
If a relative path is found as part of Crate.root_module or Root.path,
interpret it as relative to the location of the rust-project.json file.
bors[bot] [Mon, 15 Jun 2020 09:02:53 +0000 (09:02 +0000)]
Merge #4889
4889: Deprecate hir::Path::from_ast r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 15 Jun 2020 09:02:17 +0000 (11:02 +0200)]
Update parser tests with env var
Aleksey Kladov [Mon, 15 Jun 2020 08:59:05 +0000 (10:59 +0200)]
Allow attributes on expressions
https://github.com/rust-lang/rust/pull/69201/
Aleksey Kladov [Mon, 15 Jun 2020 08:49:40 +0000 (10:49 +0200)]
Deprecate hir::Path::from_ast
bors[bot] [Mon, 15 Jun 2020 08:33:45 +0000 (08:33 +0000)]
Merge #4888
4888: Var naming r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Mon, 15 Jun 2020 08:33:17 +0000 (10:33 +0200)]
Var naming
bors[bot] [Mon, 15 Jun 2020 08:25:05 +0000 (08:25 +0000)]
Merge #4882
4882: _match.rs: improve comment formatting r=matklad a=jonas-schievink
This results in much nicer rustdoc output
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
bors[bot] [Mon, 15 Jun 2020 08:13:22 +0000 (08:13 +0000)]
Merge #4880
4880: "fill match arms" assist: Match on bind patterns r=flodiebold a=tobz1000
This prevents duplication of match arms where the pre-existing arm is a bind pattern.
Co-authored-by: Toby Dimmick <tobydimmick@pm.me>
Toby Dimmick [Sun, 14 Jun 2020 21:44:28 +0000 (22:44 +0100)]
fill_match_arms bind pattern implementation
Toby Dimmick [Sun, 14 Jun 2020 21:43:16 +0000 (22:43 +0100)]
fill_match_arms bind pattern test
Jonas Schievink [Sun, 14 Jun 2020 13:56:02 +0000 (15:56 +0200)]
_match.rs: improve comment formatting
bors[bot] [Sun, 14 Jun 2020 12:16:00 +0000 (12:16 +0000)]
Merge #4875
4875: Introduce paths crate r=matklad a=matklad
It's a good idea to distinguish between absolute and relative paths at
the type level, to avoid accidental dependency on the cwd, which
really shouldn't matter for rust-analyzer service
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sun, 14 Jun 2020 12:08:28 +0000 (14:08 +0200)]
Introduce paths crate
It's a good idea to distinguish between absolute and relative paths at
the type level, to avoid accidental dependency on the cwd, which
really shouldn't matter for rust-analyzer service
Jonas Schievink [Sat, 13 Jun 2020 17:05:31 +0000 (19:05 +0200)]
Shorten *all* qualified paths when adding use
Jonas Schievink [Sat, 13 Jun 2020 16:56:14 +0000 (18:56 +0200)]
Expose `find_insert_use_container`
Jonas Schievink [Sat, 13 Jun 2020 16:55:10 +0000 (18:55 +0200)]
Fix `rewrite_root` when there's only 1 replacement
bors[bot] [Sat, 13 Jun 2020 12:35:44 +0000 (12:35 +0000)]
Merge #4867
4867: Cleanup URL handling r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
bors[bot] [Sat, 13 Jun 2020 12:27:51 +0000 (12:27 +0000)]
Merge #4869
4869: Discourage allocation r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 13 Jun 2020 12:27:23 +0000 (14:27 +0200)]
Discourage allocation
Aleksey Kladov [Sat, 13 Jun 2020 09:00:06 +0000 (11:00 +0200)]
Cleanup URL handling
bors[bot] [Sat, 13 Jun 2020 12:12:08 +0000 (12:12 +0000)]
Merge #4868
4868: Fix if and while postfix completions r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 13 Jun 2020 12:06:13 +0000 (14:06 +0200)]
Fix if and while postfix completions
bors[bot] [Sat, 13 Jun 2020 12:02:59 +0000 (12:02 +0000)]
Merge #4700
4700: Add top level keywords completion r=matklad a=mcrakhman
This fixes the following issue: https://github.com/rust-analyzer/rust-analyzer/issues/4566.
Also added simple logic which filters the keywords which can be used with unsafe on the top level.
Co-authored-by: Mikhail Rakhmanov <rakhmanov.m@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Sat, 13 Jun 2020 11:57:18 +0000 (13:57 +0200)]
More concise completion tests
Aleksey Kladov [Sat, 13 Jun 2020 11:47:30 +0000 (13:47 +0200)]
Cleanup
bors[bot] [Sat, 13 Jun 2020 11:04:42 +0000 (11:04 +0000)]
Merge #4862
4862: Revert "Hide squiggly for unused and unnecessary" r=matklad a=GabbeV
This reverts https://github.com/rust-analyzer/rust-analyzer/pull/4721
Co-authored-by: Gabriel Valfridsson <gabriel.valfridsson@gmail.com>
Mikhail Rakhmanov [Sat, 13 Jun 2020 08:48:39 +0000 (10:48 +0200)]
Remove accidentally added adoc file
Mikhail Rakhmanov [Sat, 13 Jun 2020 08:43:39 +0000 (10:43 +0200)]
Add keywords completions on source file position
Mikhail Rakhmanov [Sat, 13 Jun 2020 06:42:15 +0000 (08:42 +0200)]
Merge branch 'master' into keyword_completion
# Conflicts:
# docs/user/generated_features.adoc
Mikhail Rakhmanov [Fri, 12 Jun 2020 23:21:48 +0000 (01:21 +0200)]
Fix tests and remove unused methods
Mikhail Rakhmanov [Fri, 12 Jun 2020 22:55:21 +0000 (00:55 +0200)]
Add more patterns, tests and fix keywords
Mikhail Rakhmanov [Fri, 12 Jun 2020 18:30:57 +0000 (20:30 +0200)]
Rewrite snapshot checks
Gabriel Valfridsson [Fri, 12 Jun 2020 16:39:50 +0000 (18:39 +0200)]
Revert "Hide squiggly for unused and unnecessary"
This reverts commit
599c105e6fabb2b81c2d0a11b86c0c96f6ab1b88 .
bors[bot] [Fri, 12 Jun 2020 14:28:40 +0000 (14:28 +0000)]
Merge #4857
4857: Fix invalid shorthand initialization diagnostic for tuple structs r=jonas-schievink a=OptimalStrategy
Initializing tuple structs explicitly, like in the example below, produces a "Shorthand struct initialization" diagnostic that leads to a compilation error when applied:
```rust
struct S(usize);
fn main() {
let s = S { 0: 0 }; // OK, but triggers the diagnostic
// let s = S { 0 }; // Compilation error
}
```
This PR adds a check that the field name is not a literal.
Co-authored-by: OptimalStrategy <george@usan-podgornov.com>
Co-authored-by: OptimalStrategy <17456182+OptimalStrategy@users.noreply.github.com>
OptimalStrategy [Fri, 12 Jun 2020 14:16:19 +0000 (10:16 -0400)]
simplify determining whether the field is a tuple field
bors[bot] [Fri, 12 Jun 2020 12:49:30 +0000 (12:49 +0000)]
Merge #4855
4855: Use more idiomatic style for lifetimes in generated code r=matklad a=Veetaha
Co-authored-by: Veetaha <veetaha2@gmail.com>
bors[bot] [Fri, 12 Jun 2020 12:41:52 +0000 (12:41 +0000)]
Merge #4856
4856: Simplify r=matklad a=Veetaha
Co-authored-by: Veetaha <veetaha2@gmail.com>
bors[bot] [Fri, 12 Jun 2020 11:47:56 +0000 (11:47 +0000)]
Merge #4858
4858: find_path: return shorter paths for external items r=flodiebold a=jonas-schievink
If a containing module is already in scope, there's no need to use the full path to the item.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/4846
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Mikhail Rakhmanov [Fri, 12 Jun 2020 11:14:53 +0000 (13:14 +0200)]
Remove comment and incorrect assert
Mikhail Rakhmanov [Fri, 12 Jun 2020 11:06:26 +0000 (13:06 +0200)]
Return snapshots to tests
Jonas Schievink [Fri, 12 Jun 2020 11:01:20 +0000 (13:01 +0200)]
find_path: return shorter paths for external items
If a containing module is already in scope, there's no need to
use the full path to the item.
Mikhail Rakhmanov [Fri, 12 Jun 2020 10:15:53 +0000 (12:15 +0200)]
More assert refactoring
Mikhail Rakhmanov [Fri, 12 Jun 2020 08:12:15 +0000 (10:12 +0200)]
Add more pattern tests
Mikhail Rakhmanov [Fri, 12 Jun 2020 06:49:12 +0000 (08:49 +0200)]
New testing approach for keywords
OptimalStrategy [Fri, 12 Jun 2020 05:11:54 +0000 (01:11 -0400)]
Fix invalid shorthand initialization diagnostic for tuple structs
Veetaha [Thu, 11 Jun 2020 23:06:28 +0000 (02:06 +0300)]
Simplify
Veetaha [Thu, 11 Jun 2020 22:26:58 +0000 (01:26 +0300)]
Apply codegen with idiomatic lifetimes
Veetaha [Thu, 11 Jun 2020 22:23:04 +0000 (01:23 +0300)]
Use more idiomatic style for lifetimes in generated code
Mikhail Rakhmanov [Thu, 11 Jun 2020 22:17:30 +0000 (00:17 +0200)]
Add few smoke tests for patterns and refactoring
Mikhail Rakhmanov [Thu, 11 Jun 2020 21:25:58 +0000 (23:25 +0200)]
Add more patterns and keywords
bors[bot] [Thu, 11 Jun 2020 17:33:20 +0000 (17:33 +0000)]
Merge #4833
4833: Separating parsing of `for` in predicates and types r=matklad a=matthewjasper
We now correctly accept `for<'a> (&'a F): Fn(&'a str)` in a where clause and correctly reject `for<'a> &'a u32` as a type.
Co-authored-by: Matthew Jasper <mjjasper1@gmail.com>
Matthew Jasper [Thu, 11 Jun 2020 17:15:03 +0000 (18:15 +0100)]
Add example of old trait object syntax
Matthew Jasper [Thu, 11 Jun 2020 17:14:57 +0000 (18:14 +0100)]
Move complex inline test to own file
bors[bot] [Thu, 11 Jun 2020 15:30:05 +0000 (15:30 +0000)]
Merge #4849
4849: Make known paths use `core` instead of `std` r=matklad a=jonas-schievink
I'm not sure if this causes problems today, but it seems like it easily could, if rust-analyzer processes the libstd sources for the right `--target` and that target is a `#![no_std]`-only target.
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Thu, 11 Jun 2020 15:28:32 +0000 (17:28 +0200)]
Update wrap return tests
Update "no diagnostic" tests, use `()` instead of `String`
bors[bot] [Thu, 11 Jun 2020 15:20:24 +0000 (15:20 +0000)]
Merge #4850
4850: Indent chain `.` even if there's more stuff afterwards r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 11 Jun 2020 15:13:24 +0000 (17:13 +0200)]
Indent chain `.` even if there's more stuff afterwards
Jonas Schievink [Thu, 11 Jun 2020 14:22:31 +0000 (16:22 +0200)]
Make known paths use `core` instead of `std`
bors[bot] [Thu, 11 Jun 2020 13:00:28 +0000 (13:00 +0000)]
Merge #4847
4847: Update crates r=kjeremy a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Thu, 11 Jun 2020 12:55:41 +0000 (08:55 -0400)]
Update crates
bors[bot] [Thu, 11 Jun 2020 12:44:56 +0000 (12:44 +0000)]
Merge #4845
4845: Updated yanked crate r=kjeremy a=kjeremy
Co-authored-by: kjeremy <kjeremy@gmail.com>
kjeremy [Thu, 11 Jun 2020 12:43:35 +0000 (08:43 -0400)]
Updated yanked crate
Mikhail Rakhmanov [Thu, 11 Jun 2020 12:32:14 +0000 (14:32 +0200)]
Add todo
Mikhail Rakhmanov [Thu, 11 Jun 2020 12:16:35 +0000 (14:16 +0200)]
Add more keywords
bors[bot] [Thu, 11 Jun 2020 11:35:39 +0000 (11:35 +0000)]
Merge #4844
4844: Remove dead code r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 11 Jun 2020 11:26:48 +0000 (13:26 +0200)]
Remove dead code
bors[bot] [Thu, 11 Jun 2020 10:18:53 +0000 (10:18 +0000)]
Merge #4843
4843: Don't guess macro expansion crate r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Thu, 11 Jun 2020 10:08:24 +0000 (12:08 +0200)]
Don't guess macro expansion crate
bors[bot] [Thu, 11 Jun 2020 10:07:52 +0000 (10:07 +0000)]
Merge #4819
4819: Add an FST index to `ImportMap` and use it to speed up auto import r=matklad a=jonas-schievink
For the importing crate, we still use the symbol index, but I've modified it to only look at files that comprise that crate (instead of the whole workspace).
Oh, and since now the symbol query limit is respected correctly, it's possible that some results from the local crate now disappear if there are many matches.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/4763
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
Jonas Schievink [Thu, 11 Jun 2020 10:03:08 +0000 (12:03 +0200)]
Add symbol index FIXME
Aleksey Kladov [Thu, 11 Jun 2020 09:30:06 +0000 (11:30 +0200)]
Make relevant_crates return a Set
bors[bot] [Wed, 10 Jun 2020 19:29:04 +0000 (19:29 +0000)]
Merge #4837
4837: Fix parser test directory name in dev docs r=matklad a=jacg
The docs referred to `parser/error` while in reality it is `parser/err`.
Co-authored-by: Jacek Generowicz <jacg@my-post-office.net>
Jacek Generowicz [Wed, 10 Jun 2020 18:32:29 +0000 (20:32 +0200)]
Fix parser test directory name in dev docs
Jonas Schievink [Wed, 10 Jun 2020 14:15:49 +0000 (16:15 +0200)]
ImportMap: use IndexMap internally
It iterates in insertion order, which makes the ordering more
predictable.
Jonas Schievink [Wed, 10 Jun 2020 14:04:55 +0000 (16:04 +0200)]
Respect casing when searching for imports
bors[bot] [Wed, 10 Jun 2020 12:12:32 +0000 (12:12 +0000)]
Merge #4835
4835: Explain inline tests r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
Aleksey Kladov [Wed, 10 Jun 2020 12:12:08 +0000 (14:12 +0200)]
Explain inline tests
Jonas Schievink [Wed, 10 Jun 2020 10:37:00 +0000 (12:37 +0200)]
Move limit check down
Jonas Schievink [Wed, 10 Jun 2020 10:30:33 +0000 (12:30 +0200)]
Limit import map queries
Jonas Schievink [Wed, 10 Jun 2020 09:52:00 +0000 (11:52 +0200)]
Clean up import_map.rs
Jonas Schievink [Wed, 10 Jun 2020 09:39:06 +0000 (11:39 +0200)]
Add test for macro generated items
Jonas Schievink [Tue, 9 Jun 2020 16:48:44 +0000 (18:48 +0200)]
ImportsLocator: use ImportMap for non-local crates
Jonas Schievink [Tue, 9 Jun 2020 16:48:00 +0000 (18:48 +0200)]
ra_hir: expose `import_map::search_dependencies`
Jonas Schievink [Tue, 9 Jun 2020 16:47:14 +0000 (18:47 +0200)]
symbol_index: allow querying a single crate
Jonas Schievink [Tue, 9 Jun 2020 15:32:42 +0000 (17:32 +0200)]
Add an FST index to `ImportMap`
Jonas Schievink [Mon, 8 Jun 2020 11:00:53 +0000 (13:00 +0200)]
Fix the symbol query limit
Jonas Schievink [Mon, 8 Jun 2020 11:00:31 +0000 (13:00 +0200)]
Profile `world_symbols`
bors[bot] [Wed, 10 Jun 2020 10:37:27 +0000 (10:37 +0000)]
Merge #4834
4834: In field patterns, don't highlight local binding as a field r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>