Commit Graph

16082 Commits

Author SHA1 Message Date
Volkan Sagcan
dd4d3f0a09 fix #13105: Ignore auto-import assist on parameter names 2022-10-15 18:00:32 +02:00
bors
855cd5c280 Auto merge of #13418 - lnicola:bump-deps, r=lnicola
Bump deps
2022-10-15 11:27:12 +00:00
Laurențiu Nicola
342764d31a Add new license 2022-10-15 14:26:30 +03:00
Laurențiu Nicola
119e1bafcc Bump notify 2022-10-15 13:03:39 +03:00
Laurențiu Nicola
f5bbf9a06a Bump proc-macro2 2022-10-15 13:02:10 +03:00
Laurențiu Nicola
792920f441 Bump pulldown-cmark-to-cmark 2022-10-15 13:00:41 +03:00
Laurențiu Nicola
275848803b Bump mimalloc 2022-10-15 12:59:56 +03:00
Laurențiu Nicola
39777bf941 Bump rowan 2022-10-15 12:58:57 +03:00
Laurențiu Nicola
97eebbfab6 Bump url 2022-10-15 12:57:30 +03:00
Laurențiu Nicola
e294640484 Bump libc 2022-10-15 12:55:56 +03:00
Laurențiu Nicola
3a5f6a705e Bump dashmap 2022-10-15 12:54:25 +03:00
Laurențiu Nicola
6e74a22918 Bump home 2022-10-15 12:53:26 +03:00
Laurențiu Nicola
bb6990c4c9 Bump tracing 2022-10-15 12:52:34 +03:00
Laurențiu Nicola
50f990c46f Bump smallvec 2022-10-15 12:52:34 +03:00
Laurențiu Nicola
cbce0cda08 Bump anyhow, arbitrary, itertools, semver, serde 2022-10-15 12:52:34 +03:00
bors
36a70b7435 Auto merge of #13401 - lnicola:opt-tests, r=lnicola
Run `analysis-stats` on CI, with `opt-level = 1`

We might want to run `analysis-stats` on PRs, and this makes it less unbearable.
2022-10-14 07:00:38 +00:00
Laurențiu Nicola
82a8774a08 Avoid format! in favor of to_string 2022-10-12 17:44:15 +03:00
bors
a0ab61fb6c Auto merge of #13358 - btwotwo:feature/env-vars-autocompletion, r=Veykril
feat: Autocomplete Cargo-defined env vars in `env!` and `option_env!` (#12448)

Closes #12448

Important to know:

- Variables are taken from https://doc.rust-lang.org/cargo/reference/environment-variables.html and hardcoded as a const array.
- For the sake of simplicity I didn't include the autocompletion of `CARGO_BIN_EXE_<name>` and `OUT_DIR` since it would require information about build.rs and binary name. If somebody knows an easy way of obtaining them I can add those vars as well :)
2022-10-11 18:45:31 +00:00
btwotwo
2b2b9f8c73
Formatting 2022-10-11 19:53:22 +02:00
btwotwo
b5e87ac111
Fix formatting for cargo vars list 2022-10-11 19:29:09 +02:00
btwotwo
a807cc3afb
Rename get_outer_macro to macro_call_for_string_token 2022-10-11 19:28:42 +02:00
btwotwo
3c39668ca4
Remove extra parameter, access Db through semantics 2022-10-11 19:23:41 +02:00
bors
d08f1c3dff Auto merge of #13382 - lowr:fix/reorder-dyn-bounds-on-render, r=lowr
fix: reorder dyn bounds on render

Fixes #13368

#13192 changed the order of dyn bounds, violating the [contract](3a69435af7/crates/hir-ty/src/display.rs (L896-L901)) with `write_bounds_like_dyn_trait()` on render. The projection bounds are expected to come right after the trait bound they are accompanied with.

Although the reordering procedure can be made a bit more efficient, I opted for relying only on the [invariants](3a69435af7/crates/hir-ty/src/lower.rs (L995-L998)) currently documented in `lower_dyn_trait()`. It's not the hottest path and dyn bounds tend to be short so I believe it shouldn't hurt performance noticeably.
2022-10-11 11:44:32 +00:00
Ryo Yoshida
5e43ea96aa
fix: reorder dyn bounds on render 2022-10-11 20:26:11 +09:00
bors
5d49951913 Auto merge of #13357 - Veykril:minicore, r=Veykril
internal: Allow minicore flags specification to be order independent
2022-10-10 21:43:17 +00:00
bors
21319d135f Auto merge of #13329 - Veykril:rustc-proc-macro, r=Veykril
Use $crate instead of std for panic builtin_fn_macro

This should be closer to the expected output and gets rid of a few type mismatches in rustc/library
2022-10-10 21:35:07 +00:00
Lukas Wirth
c069f1b7d2 Prefer similar tokens when expanding macros speculatively 2022-10-10 22:47:52 +02:00
bors
d23537394e Auto merge of #13386 - Veykril:completions-ref, r=Veykril
Refactor completions expansion

Depends on https://github.com/rust-lang/rust-analyzer/pull/13384
Diff is unfortunately massive as I changed the functions in the analysis module from associated ones to standalone (unfortunately without an extra commit)
2022-10-10 14:05:38 +00:00
bors
deddad347b Auto merge of #13380 - Veykril:cfg-pat-params, r=Veykril
Honor cfg attributes on params when lowering their patterns

Closes https://github.com/rust-lang/rust-analyzer/issues/13375
2022-10-10 13:57:09 +00:00
bors
ef014aac02 Auto merge of #13385 - Veykril:progress, r=Veykril
Don't report build-scripts and proc-macros as metadata progress

Seems somewhat confusing to me, given `metadata` is already the step we do for workspace loading
2022-10-10 13:48:26 +00:00
Lukas Wirth
f3ae5e56fb Refactor completions expansion 2022-10-10 15:45:24 +02:00
Lukas Wirth
fd9cd8476b Don't report build-scripts and proc-macros are metadata progress 2022-10-10 15:41:32 +02:00
bors
4ac3f2c24f Auto merge of #13384 - Veykril:macro-fallbacks, r=Veykril
Expand unmatched mbe fragments to reasonable default token trees

Currently we expand unmatched fragments by not replacing them at all, leaving us with `$ident`. This trips up the parser or subsequent macro calls. Instead it makes more sense to replace these with some reasonable default depending on the fragment kind which should make more recursive macro calls work better for completions.
2022-10-10 13:40:09 +00:00
Lukas Wirth
78f33c0e96 Expand unmatched mbe fragments to reasonable default token trees
Currently we expand unmatched fragments by not replacing them at all,
leaving us with `$ident`. This trips up the parser or subsequent macro
calls. Instead it makes more sense to replace these with some reasonable
default depending on the fragment kind which should make more recursive
macro calls work better for completions.
2022-10-10 14:27:05 +02:00
bors
3a69435af7 Auto merge of #13333 - feniljain:fix_assists, r=Veykril
fix(generate_method): correct method indentation inside generated impl and change gen loc

should fix #10619
2022-10-10 08:36:18 +00:00
Lukas Wirth
1574fe0d54 Use $crate instead of std for panic builtin_fn_macro
This should be closer to the expected output and gets rid of a few
type mismatches in rustc/library
2022-10-10 10:33:49 +02:00
bors
dcf1d71bb8 Auto merge of #13303 - jplatte:convert-named-struct-to-tuple-struct, r=Veykril
Add convert_named_struct_to_tuple_struct assist

Closes #11643, since the assist for converting in the other direction is already there (I based most of the implementation and all of the tests on it).
2022-10-10 08:24:37 +00:00
Lukas Wirth
63ed71bd30 Honor cfg attributes on params when lowering their patterns 2022-10-10 09:47:09 +02:00
bors
05a6bc48b5 Auto merge of #13377 - DropDemBits:doc-link-underline-range, r=Veykril
fix: Underline only the intra-doc link itself instead of the whole doc comment
2022-10-10 07:14:43 +00:00
bors
910c565b17 Auto merge of #13376 - DropDemBits:strip-generic-bounds-and-defaults, r=Veykril
internal: Add `GenericParamList::to_generic_args` and `{TypeParam,ConstParam}::remove_default` APIs

Also fixes `generate_impl` not removing the default const param value, though it seems that no one has encountered or reported that issue yet 😅

This initially started out as refactoring `utils::generate_impl_text_inner` to understand it better (which was the reason for adding `{TypeParam,ConstParam}::remove_default`), but ended up also finding another place that needed `GenericParamList::to_generic_args`, hence its addition in here.
2022-10-10 06:34:58 +00:00
DropDemBits
a69cccfc0e Underline only the intra-doc link instead of the whole doc comment 2022-10-09 21:29:31 -04:00
DropDemBits
1015a177d4 Have to_generic_args return ast::GenericArgList 2022-10-09 21:03:38 -04:00
DropDemBits
bfe6ec9b77 Add {TypeParam, ConstParam}::remove_default
Also includes a drive-by refactor of `utils::generate_impl_text_inner`,
since that's what drove this change
2022-10-09 18:46:31 -04:00
DropDemBits
75f641799e Add GenericParamList::to_generic_args 2022-10-09 18:44:23 -04:00
Laurențiu Nicola
df7d39b2ed Bump once_cell 2022-10-08 21:25:11 +03:00
Aleksey Kladov
39fa8b5c39 internal: ⬆️ xflags
The main change here should be that flags are not inhereted, so

   $ rust-analyzer analysis-stats . -v -v

would do what it should do

We also no longer Don\'t
2022-10-08 15:35:07 +01:00
Maybe Waffle
1c0ec9f0c8 Fix go-to-def for #[doc = include_str!("path")] 2022-10-07 09:04:41 +00:00
btwotwo
3732d159b2
Pass context to env vars completion 2022-10-06 21:35:12 +02:00
btwotwo
e2d3c1506f
Restrict auto-completion for only built-in macros 2022-10-06 21:35:01 +02:00
btwotwo
f458ea15d6
Make helper method less specific 2022-10-06 21:34:19 +02:00