Commit Graph

10456 Commits

Author SHA1 Message Date
bors[bot]
a5f427ced3
Merge #4793
4793: Don't @ people in commit messages r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-08 11:20:01 +00:00
Aleksey Kladov
4968321706 Don't @ people in commit messages 2020-06-08 13:19:32 +02:00
bors[bot]
3623c1663f
Merge #4792
4792: Document more knowledge r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-08 10:55:29 +00:00
Aleksey Kladov
cc07c82fef Preconditions style 2020-06-08 12:54:48 +02:00
Aleksey Kladov
ee8dec5dc1 IDE API 2020-06-08 12:52:28 +02:00
bors[bot]
d8552d114c
Merge #4781
4781: Remove redundancy in syntax highlighting tests r=matklad a=ltentrup

Follow up from #4683. Improves syntax highlighting testing by introducing a function that contains the boilerplate comparison code. Keeps the `ra_fixture` argument in the first position, thus, the editor syntax highlighting injection still works.

Co-authored-by: Leander Tentrup <leander.tentrup@gmail.com>
2020-06-08 09:48:38 +00:00
bors[bot]
bb0d4600ff
Merge #4770
4770: Clean up handling of int/float literal types r=matklad a=flodiebold

'Unknown' int/float types actually never exist as such, they get replaced by type variables immediately. So the whole `Uncertain<IntTy>` thing was unnecessary and just led to a bunch of match branches that were never hit.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2020-06-08 09:37:37 +00:00
bors[bot]
b366b98a9e
Merge #4787
4787: Fix bug in lexer for format specifier r=matklad a=ltentrup

The `type` and `width` were not correctly distinguished.
Fixes #4696.

Co-authored-by: Leander Tentrup <leander.tentrup@gmail.com>
2020-06-08 09:05:09 +00:00
bors[bot]
d6967762dd
Merge #4788
4788: Update quote r=kjeremy a=kjeremy



Co-authored-by: Jeremy Kolb <kjeremy@gmail.com>
2020-06-07 22:24:40 +00:00
Jeremy Kolb
0d01be7e18 Update quote 2020-06-07 18:21:38 -04:00
bors[bot]
c59ffac4c8
Merge #4780
4780: Fix VSCode settings r=SomeoneToIgnore a=vincentisambart

closes #4779

#4779 was reproducing every time, so doing a bisect I found out the problem to be coming from #4730.
The only change to the extension that #4730 included was changes to editors/code/package.json.
So I tried modifying those changes a bit and got it working.

Co-authored-by: Vincent Isambart <vincent.isambart@gmail.com>
2020-06-07 21:27:37 +00:00
Leander Tentrup
3aaaf924cb Fix bug in lexer for format specifier where the type and width were not correctly distinguished 2020-06-07 22:57:24 +02:00
Leander Tentrup
65943c0585 Remove redundancy in syntax highlighting tests 2020-06-07 14:50:02 +02:00
Vincent Isambart
3162b9ed8f Fix VSCode settings 2020-06-07 12:07:00 +09:00
bors[bot]
dc340f12a3
Merge #4772
4772: Document certain invariants r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-06 17:55:13 +00:00
Aleksey Kladov
81ffe973ac Document certain invariants 2020-06-06 19:54:41 +02:00
Aleksey Kladov
ae1acbd09c Document import style 2020-06-06 19:32:45 +02:00
Florian Diebold
d66daee849 Clean up handling of int/float literal types
'Unknown' int/float types actually never exist as such, they get replaced by
type variables immediately. So the whole `Uncertain<IntTy>` thing was
unnecessary and just led to a bunch of match branches that were never hit.
2020-06-06 17:52:00 +02:00
bors[bot]
d4a92b4fef
Merge #4769
4769: Fix Run lens. r=matklad a=vsrs

This PR fixes a bug introduced in https://github.com/rust-analyzer/rust-analyzer/pull/4710: second and all subsequent clicks on the Run lens produce invalid commands:

1. `cargo test --package ra_ide --lib -- hover::tests::test_hover_enum_has_impl_action --exact --nocapture`
2. `cargo test --package ra_ide --lib -- hover::tests::test_hover_enum_has_impl_action --exact --nocapture` **`-- hover::tests::test_hover_enum_has_impl_action --exact --nocapture`**
3. `cargo test --package ra_ide --lib -- hover::tests::test_hover_enum_has_impl_action --exact --nocapture` **`-- hover::tests::test_hover_enum_has_impl_action --exact --nocapture -- hover::tests::test_hover_enum_has_impl_action --exact --nocapture`**

Co-authored-by: vsrs <vit@conrlab.com>
2020-06-06 15:05:59 +00:00
vsrs
b91fa7494e Fix Run lens. 2020-06-06 15:12:17 +03:00
bors[bot]
a609336d72
Merge #4765
4765: Fix type parameter defaults r=matklad a=flodiebold

They should not be applied in expression or pattern contexts, unless there are other explicitly given type args.

(The existing tests about this were actually wrong.)

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-06-06 10:56:59 +00:00
Florian Diebold
a4a4a1854e Fix type parameter defaults
They should not be applied in expression or pattern contexts, unless there are
other explicitly given type args.
2020-06-05 20:09:13 +02:00
bors[bot]
02f7b5d7ab
Merge #4761
4761: Upgrade Chalk to published version r=matklad a=flodiebold

CC @pksunkara 

Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-06-05 16:05:06 +00:00
bors[bot]
2a3ab7f3b4
Merge #4689
4689: Implement return position impl trait / opaque type support r=matklad a=flodiebold

This is working, but I'm not that happy with how the lowering works. We might need an additional representation between `TypeRef` and `Ty` where names are resolved and `impl Trait` bounds are separated out, but things like inference variables don't exist and `impl Trait` is always represented the same way.

Also note that this doesn't implement correct handling of RPIT *inside* the function (which involves turning the `impl Trait`s into variables and creating obligations for them). That intermediate representation might help there as well.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
Co-authored-by: Florian Diebold <florian.diebold@freiheit.com>
2020-06-05 15:46:28 +00:00
Florian Diebold
0d2328f3ea Review fixes 2020-06-05 17:41:58 +02:00
bors[bot]
f133159ec0
Merge #4760
4760: Minimize FileLoader interface r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-05 15:23:22 +00:00
Aleksey Kladov
bbb40d7463 Minimize FileLoader interface 2020-06-05 17:22:56 +02:00
bors[bot]
4029628f15
Merge #4729 #4748
4729: Hover actions r=matklad a=vsrs

This PR adds a `hoverActions` LSP extension and a `Go to Implementations` action as an example:
![hover_actions_impl](https://user-images.githubusercontent.com/62505555/83335732-6d9de280-a2b7-11ea-8cc3-75253d062fe0.gif)



4748: Add an `ImportMap` and use it to resolve item paths in `find_path` r=matklad a=jonas-schievink

Removes the "go faster" queries I added in https://github.com/rust-analyzer/rust-analyzer/pull/4501 and https://github.com/rust-analyzer/rust-analyzer/pull/4506. I've checked this PR on the rustc code base and the assists are still fast.

This should fix https://github.com/rust-analyzer/rust-analyzer/issues/4515.

Note that this does introduce a change in behavior: We now always refer to items defined in external crates using paths through the external crate. Previously we could also use a local path (if for example the extern crate was reexported locally), as seen in the changed test. If that is undesired I can fix that, but the test didn't say why the previous behavior would be preferable.

Co-authored-by: vsrs <vit@conrlab.com>
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Jonas Schievink <jonas.schievink@ferrous-systems.com>
2020-06-05 15:14:35 +00:00
Florian Diebold
02962b374e Implement return position impl trait / opaque type support
This is working, but I'm not that happy with how the lowering works. We might
need an additional representation between `TypeRef` and `Ty` where names are
resolved and `impl Trait` bounds are separated out, but things like inference
variables don't exist and `impl Trait` is always represented the same
way.

Also note that this doesn't implement correct handling of RPIT *inside* the
function (which involves turning the `impl Trait`s into variables and creating
obligations for them). That intermediate representation might help there as
well.
2020-06-05 17:08:27 +02:00
Florian Diebold
69854f7795 Upgrade Chalk to published version 2020-06-05 17:06:07 +02:00
bors[bot]
9c52f527a1
Merge #4758
4758: Actually test include!(concant!(env!())); r=matklad a=matklad

It triggered index-based goto definition before :-(



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-05 13:51:35 +00:00
Aleksey Kladov
c9a41bd92d Actually test include!(concant!(env!()));
It triggered index-based goto definition before :-(
2020-06-05 15:49:12 +02:00
bors[bot]
54d6bd5c00
Merge #4757
4757: Update inotify r=matklad a=matklad

https://github.com/rust-analyzer/rust-analyzer/issues/4224#issuecomment-639328191



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-05 13:34:44 +00:00
Aleksey Kladov
d103d4b071 Update inotify
https://github.com/rust-analyzer/rust-analyzer/issues/4224#issuecomment-639328191
2020-06-05 15:33:55 +02:00
bors[bot]
d06df2c3e7
Merge #4756
4756: Cleanup resolution of file paths r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-05 13:15:31 +00:00
Aleksey Kladov
cb9d9040f7 Cleanup test 2020-06-05 15:14:47 +02:00
Aleksey Kladov
bba374bab2 More direct signature for resolve_path 2020-06-05 15:07:30 +02:00
Aleksey Kladov
e63c00f100 Rename resolve_relative_path -> resolve_path
For things like `concant!(env!("OUT_DIR"))`, we need to support abs paths
2020-06-05 14:58:30 +02:00
vsrs
bd9d7b6ad8 Remove hover actions heavy tests. 2020-06-05 15:26:46 +03:00
vsrs
78c9223b7b Remove hover contents marking as trusted.
Hover contents might be extracted from raw
doc comments and need some validation.
2020-06-05 15:25:01 +03:00
Jonas Schievink
bc2d172995 Clarify when we visit modules multiple times 2020-06-05 14:24:51 +02:00
bors[bot]
f98d057218
Merge #4755
4755: Inlay Hints: more directly account for self param r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2020-06-05 12:01:10 +00:00
vsrs
0fe43a124b Add capabilities tests. 2020-06-05 15:00:31 +03:00
vsrs
e35418ceb9 Apply suggestions from @kjeremy review 2020-06-05 15:00:31 +03:00
vsrs
92cfc0f2a1 Add enum hover action test. 2020-06-05 15:00:31 +03:00
vsrs
5d0c1aa162 Rebase on the latest master. 2020-06-05 15:00:30 +03:00
vsrs
b147e6eb95 Code formatting 2020-06-05 15:00:30 +03:00
vsrs
da7ec4b339 Add hover actions LSP extension documentation. 2020-06-05 15:00:28 +03:00
vsrs
7d0dd17b09 Add hover actions as LSP extension 2020-06-05 14:59:26 +03:00
Aleksey Kladov
522d24a607 Inlay Hints: more directly account for self param 2020-06-05 13:58:52 +02:00