Commit Graph

17110 Commits

Author SHA1 Message Date
Kirill Bulatov
2ca2e24a39 Do not add cargo target for detached files only project 2021-05-23 23:10:05 +03: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
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
Kirill Bulatov
b8635a8e60 Download nightly extension when configured and run from stable extension version 2021-05-23 11:28:06 +03:00
bors[bot]
808ebe4b86
Merge #8935
8935: docs(manual): Add rust-tools.nvim to nvim-lsp r=matklad a=simrat39

I'm not sure what to write there but this seems fine
https://github.com/simrat39/rust-tools.nvim/issues/16

Co-authored-by: sim <simrats169169@gmail.com>
2021-05-23 07:33:24 +00:00
sim
fe93c114e3
docs(manual): Add rust-tools.nvim to nvim-lsp 2021-05-22 21:17:40 -07:00
bors[bot]
e4722b6492
Merge #8932
8932: internal: even prettier itemtrees r=jonas-schievink a=jonas-schievink

Extends the ItemTree pretty printer to handle all `Path`s, and to print generic parameters and where-clauses.

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-23 01:00:33 +00:00
Jonas Schievink
15ff7faf3d Render where clauses and more generic params 2021-05-23 02:51:58 +02:00
Jonas Schievink
380293d6c2 Pretty-print generic parameters 2021-05-23 01:15:26 +02:00
Jonas Schievink
c22ccd07fe ItemTree: pretty-print all paths 2021-05-23 00:37:15 +02:00
bors[bot]
bc1ba1549d
Merge #8926
8926: internal: Drop uncompressed release artifacts and those following the old naming convention r=matklad a=lnicola

Closes #6996

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
2021-05-22 18:35:02 +00:00
bors[bot]
787caa3f24
Merge #8927
8927: internal: try enabling debug info for releases r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-22 18:21:02 +00:00
Aleksey Kladov
db393982ca internal: try enabling debug info for releases
We now compress releases, so let's check  if debug info is light enough
to actually ship to users. Getting line numbers back would be helpful!
2021-05-22 21:19:48 +03:00
Laurențiu Nicola
7ff972f0ce Drop uncompressed release artifacts and those following the old naming convention 2021-05-22 20:26:29 +03:00
bors[bot]
5b6fa95699
Merge #8924
8924: Add last remaining module docstring r=flodiebold a=flodiebold

That was easier than expected.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-05-22 14:41:21 +00:00
Florian Diebold
a88c7c04d2 Add last remaining module docstring 2021-05-22 16:39:56 +02:00
bors[bot]
a99de65573
Merge #8923
8923: Add even more docs r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-22 14:20:42 +00:00
Aleksey Kladov
dc1577d58d Add even more docs 2021-05-22 17:20:22 +03:00
bors[bot]
d56e52402e
Merge #8922
8922: Add more docs r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-22 13:54:13 +00:00
Aleksey Kladov
188b0f96f9 Add more docs 2021-05-22 16:53:47 +03:00
bors[bot]
542337eca4
Merge #8868
8868: internal: replace AstTransformer with mutable syntax trees r=matklad a=matklad



Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2021-05-22 13:30:32 +00:00
Aleksey Kladov
e6776c3e1b use more precise name 2021-05-22 16:23:07 +03:00
bors[bot]
057e2ed574
Merge #8921
8921: Resolve any lifetime variables to 'static after inference r=flodiebold a=flodiebold

Chalk's unification can sometimes create lifetime variables, which we
currently don't really deal with, but at least we don't want to leak
them outside of inference.

Should fix #8919.

Co-authored-by: Florian Diebold <flodiebold@gmail.com>
2021-05-22 12:32:12 +00:00
Aleksey Kladov
47d7434dde internal: replace AstTransformer with mutable syntax trees 2021-05-22 15:27:32 +03:00
Florian Diebold
63614aafad Resolve any lifetime variables to 'static after inference
Chalk's unification can sometimes create lifetime variables, which we
currently don't really deal with, but at least we don't want to leak
them outside of inference.

Should fix #8919.
2021-05-22 14:27:22 +02:00
bors[bot]
7d81e40e36
Merge #8901
8901: fix: `fill_match_arms` hangs on a tuple of large enums r=matklad a=iDawer

+ Lazy computation of missing arms.
+ Convenience function to test lazy computation: `ide_assists::tests::check_assist_unresolved`.

Fixes #8835 

Co-authored-by: Dawer <7803845+iDawer@users.noreply.github.com>
2021-05-22 12:26:40 +00:00
bors[bot]
3cfe2d0a5d
Merge #8918
8918: fix: fix hang caused by non-unique attribute IDs r=jonas-schievink a=jonas-schievink

Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8905 (again)

bors r+

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-22 00:31:17 +00:00
Jonas Schievink
d077b8a7e0 Work around non-unique AttrIds 2021-05-22 02:30:03 +02:00
bors[bot]
ae24651e44
Merge #8916
8916: ItemTree pretty-printing r=jonas-schievink a=jonas-schievink

This adds a printer for `ItemTree` contents, and a few tests to ensure that `ItemTree` lowering works like we expect it to. It also adds a new "Debug ItemTree" command that can be used to see the `ItemTree` of the currently open file. The pretty-printed output is usually close enough to Rust syntax that we can even use Rust syntax highlighting.

This is similar to the old `ItemTree` tests we had, but produces significantly more readable output, so these should actually carry their weight.

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
2021-05-21 23:18:19 +00:00
Jonas Schievink
463ecefc64 Use .rs file ending to get syntax highlighting 2021-05-22 00:11:54 +02:00