Commit Graph

17187 Commits

Author SHA1 Message Date
Aramis Razzaghipour
eca4b764e4
Remove superfluous early-returns 2021-05-24 14:54:48 +10:00
Aramis Razzaghipour
e51188cd09
Rename ‘foreign’ semantic token modifier to ‘library’ 2021-05-24 14:54:48 +10:00
Aramis Razzaghipour
fa0d0bfb7f
Add testing of foreign item highlighting 2021-05-24 14:54:16 +10:00
Aramis Razzaghipour
b4cddc0705
Highlight foreign modules as such 2021-05-24 14:54:16 +10:00
Aramis Razzaghipour
c32428571c
Remove hir krate methods 2021-05-24 14:54:16 +10:00
Aramis Razzaghipour
4fd5248749
Add highlighting of items from other crates 2021-05-24 14:53:48 +10:00
bors[bot]
495c9586ec
Merge #8945
8945: fix: Make expected type work in more situations r=flodiebold a=flodiebold

Also makes call info show the correct types for generic methods.

![2021-05-23-182952_1134x616_scrot](https://user-images.githubusercontent.com/906069/119269023-dd5a5b00-bbf5-11eb-993a-b6e122c3b9a6.png)
![2021-05-23-183117_922x696_scrot](https://user-images.githubusercontent.com/906069/119269025-dfbcb500-bbf5-11eb-983c-fc415b8428e0.png)


Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-05-23 21:55:51 +00:00
Florian Diebold
b8262099cc Get rid of field_type again 2021-05-23 23:54:35 +02:00
bors[bot]
a2ce091fd7
Merge #8953
8953: feat: generate getter avoids generating types like `&Vec<T>` r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-23 21:17:20 +00:00
Aleksey Kladov
479a7387c2 feat: generate getter avoids generating types like &Vec<T> 2021-05-24 00:15:23 +03:00
bors[bot]
4e376ba3ce
Merge #8954
8954: internal: document ItemTree design r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-23 21:10:37 +00:00
Jonas Schievink
693325fc39 internal: document ItemTree design 2021-05-23 23:09:38 +02:00
Kirill Bulatov
b5f524c7ff Don't discover workspaces when detached files are given 2021-05-24 00:09:24 +03:00
bors[bot]
951c0e95f4
Merge #8948
8948: feat: generate getter assist places the cursor at the generated function r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-23 20:48:35 +00:00
Kirill Bulatov
c1f6a5a0b0 Fix ts lint errors 2021-05-23 23:47:58 +03:00
Aleksey Kladov
8696c82777 feat: generate getter assist places the cursor at the generated function 2021-05-23 23:43:33 +03:00
bors[bot]
e0864c9c15
Merge #8950
8950: minor: align import style with styleguide r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-23 20:40:39 +00:00
Aleksey Kladov
8d5f59e0f1 minor: align import style with styleguide 2021-05-23 23:40:19 +03:00
Aleksey Kladov
a6633a88a8 fix: reveal snippets 2021-05-23 23:40:19 +03:00
Kirill Bulatov
72594beca4 Deal with todos 2021-05-23 23:37:59 +03:00
Aleksey Kladov
af54b1e248 minimize tests 2021-05-23 23:19:00 +03:00
Aleksey Kladov
c06599504b remove duplicate tests 2021-05-23 23:15:54 +03:00
Aleksey Kladov
4c8259e210 reduce duplication 2021-05-23 23:13:35 +03:00
Kirill Bulatov
2ca2e24a39 Do not add cargo target for detached files only project 2021-05-23 23:10:05 +03:00
Andy Russell
a90b9a5872
implement range formatting 2021-05-23 15:50:36 -04:00
Kirill Bulatov
de090749d9 Drag detached files towards loading 2021-05-23 22:46:20 +03:00
Kirill Bulatov
695569d978 Draft detached files retrieval 2021-05-23 22:46:20 +03:00
Kirill Bulatov
b3383b0661 Send detached files info to server via init params 2021-05-23 22:46:20 +03:00
Kirill Bulatov
d9a5490646 Start rust-analyzer server for arbitrary rust files 2021-05-23 22:46:20 +03:00
bors[bot]
1605488710
Merge #8947
8947: Correctly resolve crate name in use paths when import shadows it r=Veykril a=Veykril

Fixes #7763
bors r+

Co-authored-by: Lukas Tobias Wirth <lukastw97@gmail.com>
2021-05-23 17:37:36 +00:00
Lukas Tobias Wirth
da74c66947 Correctly resolve crate name in use paths when import shadows itself 2021-05-23 19:37:01 +02:00
bors[bot]
f04daf693a
Merge #8946
8946: Minor: fix comment style r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-23 16:51:09 +00:00
Aleksey Kladov
7283163bb9 Minor: fix comment style
See https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/dev/style.md#documentation
2021-05-23 19:50:23 +03:00
Florian Diebold
e65803748d Infer correct expected type in closure
Sadly currently only works if the closure body isn't completely missing.
2021-05-23 18:45:44 +02:00
Florian Diebold
7a0c93c58a Infer correct expected type for generic struct fields 2021-05-23 18:45:44 +02:00
Florian Diebold
4a6cdd776d Record method call substs and use them in call info 2021-05-23 18:24:21 +02:00
bors[bot]
96e5412f88
Merge #8944
8944: minor: explain why nested `TypeRef` aren't interned r=jonas-schievink a=jonas-schievink

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-23 14:29:18 +00:00
Jonas Schievink
11825ac5fe Explain why nested TypeRef aren't interned 2021-05-23 16:28:23 +02:00
bors[bot]
064ff633f6
Merge #8940
8940: Give ‘unsafe’ semantic token modifier to unsafe traits r=Veykril a=arzg

Hi! This is my first pull request that touches rust-analyzer itself beyond a search-and-replace, so please tell me if I should change anything or do anything differently. :)

Co-authored-by: Aramis Razzaghipour <aramisnoah@gmail.com>
2021-05-23 12:40:14 +00:00
Aramis Razzaghipour
4d4dbcfead
Give ‘unsafe’ semantic token modifier to unsafe traits 2021-05-23 21:45:10 +10:00
bors[bot]
57eedd9066
Merge #8936 #8939
8936: fix: Improve nightly downloads with better local state management r=matklad a=SomeoneToIgnore

When any nightly is downloaded, we store its GitHub release id in the local cache and never invalidate that cache.

Due to this, it was possible to do the following sequence:
* have the nightly locally
* downgrade the extension to any stable version
* observe that despite the `"rust-analyzer.updates.channel": "nightly",` setting, no nightly updates are happening
* on the next day, the actual update happens (given the new nightly is released)

Since it's impossible to install nightly version directly through the VSCode marketplace, any fiddling with dev version results in the same situation: one have to wait for the next nightly release to happen in order to restore the nightly.

This PR 
* invalidates the cache eagerly during bootstrap if the current plugin is not nightly
* enforces the release id check for nightly versions only
* fixes the `ctx.globalStoragePath` deprecated API usage

Hopefully, it also helps mysterious non-updated plugins that we encounter from time to time, but hard to tell for sure.

8939: internal: disable debug symbols due to failing windows build r=matklad a=matklad

bors r+
🤖

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-23 11:12:45 +00:00
Aleksey Kladov
9f9c4bf3de internal: disable debug symbols due to failing windows build
See https://github.com/rust-lang/rust/issues/85598
2021-05-23 14:06:25 +03:00
bors[bot]
0ec4ce1e9b
Merge #8938
8938: internal: Fix #8931 r=flodiebold a=flodiebold

  - and add some better checking for similar bugs

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-05-23 11:03:18 +00:00
Florian Diebold
34a3bc4196 Paper over #8931 a bit more
The problem was the skipping of binders in
`resolve_method_call_as_callable`; this still doesn't use the _correct_
substitution, but at least it doesn't return a type with free variables
in it.

Fixes #8931.
2021-05-23 13:00:14 +02:00
Kirill Bulatov
daedcc2b77 More style fixes 2021-05-23 13:57:04 +03:00
Florian Diebold
a5d85a6356 Add test for #8931 and better checking 2021-05-23 12:52:41 +02:00
Kirill Bulatov
223dbd2187 Style fix 2021-05-23 13:43:06 +03:00
Kirill Bulatov
95c51d8f1d Don't use a deprecated accessor 2021-05-23 11:54:03 +03:00
Kirill Bulatov
230ed3304a Better releaseId naming 2021-05-23 11:51:35 +03:00
Kirill Bulatov
be3e997ddf Remove nightly release id from local storage for stable extensions 2021-05-23 11:49:34 +03:00