]> git.lizzy.rs Git - rust.git/log
rust.git
21 months agoRemove simplistic interpolation for manifest-path
Lukas Wirth [Wed, 19 Oct 2022 21:34:36 +0000 (23:34 +0200)]
Remove simplistic interpolation for manifest-path

21 months ago{manifest-path} interpolation
Lukas Wirth [Mon, 26 Sep 2022 13:58:55 +0000 (15:58 +0200)]
{manifest-path} interpolation

21 months agoUse correct invocation strategy config for checkOnSave
Lukas Wirth [Thu, 15 Sep 2022 11:35:46 +0000 (13:35 +0200)]
Use correct invocation strategy config for checkOnSave

21 months agoImplement invocation strategy config for checkOnSave
Lukas Wirth [Thu, 15 Sep 2022 11:28:09 +0000 (13:28 +0200)]
Implement invocation strategy config for checkOnSave

Note that due to how cargo works, none of the modes currently work for r-a

21 months agoImplement invocation strategy config for build scripts
Lukas Wirth [Sat, 27 Aug 2022 16:28:09 +0000 (18:28 +0200)]
Implement invocation strategy config for build scripts

21 months agoAuto merge of #13423 - Veykril:vscode-vars, r=Veykril
bors [Mon, 17 Oct 2022 10:08:12 +0000 (10:08 +0000)]
Auto merge of #13423 - Veykril:vscode-vars, r=Veykril

Substitute some VSCode variables in the VSCode client

cc https://github.com/rust-lang/rust-analyzer/issues/13405

21 months agoAuto merge of #13399 - DropDemBits:assists-format-args-capture-pt2, r=Veykril
bors [Mon, 17 Oct 2022 09:54:07 +0000 (09:54 +0000)]
Auto merge of #13399 - DropDemBits:assists-format-args-capture-pt2, r=Veykril

Migrate assists to format args captures, part 2

Continuation of #13379

Migrates:

- `generate_constant`
- `generate_default_from_enum_variant`
- `generate_default_from_new`
- `generate_delegate_methods`
- `generate_deref`
- `generate_documentation_template`
- `generate_enum_is_method`
- `generate_enum_projection_method`
- `generate_from_impl_for_enum`
- `generate_function`
- `generate_getter`
- `generate_impl`
- `generate_new`
- `generate_setter`

21 months agoSubstitute some VSCode variables in the VSCode client
Lukas Wirth [Sun, 16 Oct 2022 15:11:24 +0000 (17:11 +0200)]
Substitute some VSCode variables in the VSCode client

21 months agoAuto merge of #13397 - zyctree:zyctree-patch-2, r=lnicola
bors [Sun, 16 Oct 2022 17:40:21 +0000 (17:40 +0000)]
Auto merge of #13397 - zyctree:zyctree-patch-2, r=lnicola

fix link in syntax.md

21 months agoupdate link in syntax.md
zyctree [Sun, 16 Oct 2022 17:39:19 +0000 (01:39 +0800)]
update link in syntax.md

21 months agoupdate link in syntax.md
zyctree [Sun, 16 Oct 2022 15:41:32 +0000 (23:41 +0800)]
update link in syntax.md

21 months agoAuto merge of #13354 - Veykril:try-stuff, r=Veykril
bors [Sun, 16 Oct 2022 11:11:08 +0000 (11:11 +0000)]
Auto merge of #13354 - Veykril:try-stuff, r=Veykril

feat: Diagnose some incorrect usages of the question mark operator

Trying to figure out how the type stuff in r-a works some more, I think I am doing this correct here but I am not quite sure :)

21 months agoDiagnose incorrect usages of the question mark operator
Lukas Wirth [Wed, 5 Oct 2022 17:15:07 +0000 (19:15 +0200)]
Diagnose incorrect usages of the question mark operator

21 months agoAuto merge of #13408 - lowr:patch/bump-chalk-0.86, r=Veykril
bors [Sun, 16 Oct 2022 10:57:23 +0000 (10:57 +0000)]
Auto merge of #13408 - lowr:patch/bump-chalk-0.86, r=Veykril

Bump chalk

There's a bug in current chalk that prevents us from properly supporting GATs, which is supposed to be fixed in v0.86. Note the following:
- v0.86 is only going to be released next Sunday so I'll keep this PR as draft until then.
- This doesn't compile without https://github.com/rust-lang/chalk/pull/779, which I hope will be included in v0.86. I confirmed this compiles with it locally.

Two breaking changes from v0.84:
- `TypeFolder` has been split into `TypeFolder` and `FallibleTypeFolder` (https://github.com/rust-lang/chalk/pull/772)
- `ProjectionTy::self_type_parameter()` has been removed (https://github.com/rust-lang/chalk/pull/778)

21 months agoBump chalk to 0.86
Ryo Yoshida [Thu, 13 Oct 2022 15:39:14 +0000 (00:39 +0900)]
Bump chalk to 0.86

Two breaking changes:
- `TypeFolder` has been split into `TypeFolder` and `FallibleTypeFolder`
- `ProjectionTy::self_type_parameter()` has been removed

21 months agoAuto merge of #13421 - rust-lang:Veykril-patch-1, r=Veykril
bors [Sun, 16 Oct 2022 09:52:16 +0000 (09:52 +0000)]
Auto merge of #13421 - rust-lang:Veykril-patch-1, r=Veykril

Update guide.md to reflect support for proc-macros

21 months agoUpdate guide.md to reflect support for proc-macros
Lukas Wirth [Sun, 16 Oct 2022 09:52:01 +0000 (11:52 +0200)]
Update guide.md to reflect support for proc-macros

21 months agoAuto merge of #13402 - HKalbasi:patch-1, r=Veykril
bors [Sun, 16 Oct 2022 09:20:38 +0000 (09:20 +0000)]
Auto merge of #13402 - HKalbasi:patch-1, r=Veykril

Cast runnableEnv items to string

fix #13390

An alternative approach could be raising an error if there is non string values.

21 months agoAuto merge of #13420 - volsa:master, r=Veykril
bors [Sun, 16 Oct 2022 08:42:24 +0000 (08:42 +0000)]
Auto merge of #13420 - volsa:master, r=Veykril

fix: Ignore auto-import assist on parameter names

Fixes #13105; before & after

https://user-images.githubusercontent.com/29666622/195999489-0474c93a-b2bf-41c4-b7da-a4242a8082d8.mov

https://user-images.githubusercontent.com/29666622/195999571-605ee09c-bc6f-4ee5-bfe4-73e37254c647.mov

21 months agofix #13105: Ignore auto-import assist on parameter names
Volkan Sagcan [Sat, 15 Oct 2022 16:00:32 +0000 (18:00 +0200)]
fix #13105: Ignore auto-import assist on parameter names

21 months agoAuto merge of #13419 - lnicola:bump-setup-node, r=lnicola
bors [Sat, 15 Oct 2022 11:48:14 +0000 (11:48 +0000)]
Auto merge of #13419 - lnicola:bump-setup-node, r=lnicola

Bump `actions/setup-node`

Fixes more Node 12 deprecation warnings.

21 months agoBump actions/setup-node
Laurențiu Nicola [Sat, 15 Oct 2022 11:44:51 +0000 (14:44 +0300)]
Bump actions/setup-node

21 months agoAuto merge of #13418 - lnicola:bump-deps, r=lnicola
bors [Sat, 15 Oct 2022 11:27:12 +0000 (11:27 +0000)]
Auto merge of #13418 - lnicola:bump-deps, r=lnicola

Bump deps

21 months agoAdd new license
Laurențiu Nicola [Sat, 15 Oct 2022 11:07:21 +0000 (14:07 +0300)]
Add new license

21 months agoBump the rest of the deps
Laurențiu Nicola [Sat, 15 Oct 2022 10:06:10 +0000 (13:06 +0300)]
Bump the rest of the deps

21 months agoBump notify
Laurențiu Nicola [Sat, 15 Oct 2022 10:03:39 +0000 (13:03 +0300)]
Bump notify

21 months agoBump proc-macro2
Laurențiu Nicola [Sat, 15 Oct 2022 10:02:10 +0000 (13:02 +0300)]
Bump proc-macro2

21 months agoBump pulldown-cmark-to-cmark
Laurențiu Nicola [Sat, 15 Oct 2022 10:00:41 +0000 (13:00 +0300)]
Bump pulldown-cmark-to-cmark

21 months agoBump mimalloc
Laurențiu Nicola [Sat, 15 Oct 2022 09:59:56 +0000 (12:59 +0300)]
Bump mimalloc

21 months agoBump rowan
Laurențiu Nicola [Sat, 15 Oct 2022 09:58:57 +0000 (12:58 +0300)]
Bump rowan

21 months agoBump url
Laurențiu Nicola [Sat, 15 Oct 2022 09:57:30 +0000 (12:57 +0300)]
Bump url

21 months agoBump libc
Laurențiu Nicola [Sat, 15 Oct 2022 09:55:56 +0000 (12:55 +0300)]
Bump libc

21 months agoBump dashmap
Laurențiu Nicola [Sat, 15 Oct 2022 09:54:25 +0000 (12:54 +0300)]
Bump dashmap

21 months agoBump home
Laurențiu Nicola [Sat, 15 Oct 2022 09:53:26 +0000 (12:53 +0300)]
Bump home

21 months agoBump tracing
Laurențiu Nicola [Sat, 8 Oct 2022 18:30:04 +0000 (21:30 +0300)]
Bump tracing

21 months agoBump smallvec
Laurențiu Nicola [Thu, 6 Oct 2022 12:28:50 +0000 (15:28 +0300)]
Bump smallvec

21 months agoBump anyhow, arbitrary, itertools, semver, serde
Laurențiu Nicola [Mon, 3 Oct 2022 06:02:42 +0000 (09:02 +0300)]
Bump anyhow, arbitrary, itertools, semver, serde

21 months agoAuto merge of #13415 - lnicola:ovsx-timeout, r=lnicola
bors [Fri, 14 Oct 2022 16:39:16 +0000 (16:39 +0000)]
Auto merge of #13415 - lnicola:ovsx-timeout, r=lnicola

internal: Set a timeout when publishing to OVSX

CC https://github.com/rust-lang/rust-analyzer/issues/11080#issuecomment-1279212120

21 months agoSet a timeout when publishing to OVSX
Laurențiu Nicola [Fri, 14 Oct 2022 16:23:32 +0000 (19:23 +0300)]
Set a timeout when publishing to OVSX

21 months agoAuto merge of #13414 - lnicola:bump-cache, r=lnicola
bors [Fri, 14 Oct 2022 14:32:00 +0000 (14:32 +0000)]
Auto merge of #13414 - lnicola:bump-cache, r=lnicola

minor: Bump `Swatinem/rust-cache` to move off Node 12

21 months agoBump Swatinem/rust-cache to move off Node 12
Laurențiu Nicola [Fri, 14 Oct 2022 14:31:22 +0000 (17:31 +0300)]
Bump Swatinem/rust-cache to move off Node 12

21 months agoAuto merge of #13413 - rust-lang:revert-13367-fix-problem-matchers, r=jonas-schievink
bors [Fri, 14 Oct 2022 07:32:44 +0000 (07:32 +0000)]
Auto merge of #13413 - rust-lang:revert-13367-fix-problem-matchers, r=jonas-schievink

Revert "fix: in VSCode, correctly resolve relative paths to errors"

Reverts rust-lang/rust-analyzer#13367

I didn't manage to figure out what exactly is the issue, so reverting this to fix https://github.com/rust-lang/rust-analyzer/issues/13404 before monday.

21 months agoRevert "fix: in VSCode, correctly resolve relative paths to errors"
Jonas Schievink [Fri, 14 Oct 2022 07:28:44 +0000 (09:28 +0200)]
Revert "fix: in VSCode, correctly resolve relative paths to errors"

21 months agoAuto merge of #13401 - lnicola:opt-tests, r=lnicola
bors [Fri, 14 Oct 2022 07:00:38 +0000 (07:00 +0000)]
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.

21 months agoRun analysis-stats on CI
Laurențiu Nicola [Thu, 13 Oct 2022 09:49:16 +0000 (12:49 +0300)]
Run analysis-stats on CI

21 months agofix formatting
HKalbasi [Wed, 12 Oct 2022 21:14:59 +0000 (14:14 -0700)]
fix formatting

21 months agoCast runnableEnv items to string
HKalbasi [Wed, 12 Oct 2022 17:10:49 +0000 (20:40 +0330)]
Cast runnableEnv items to string

21 months agoAvoid format! in favor of to_string
Laurențiu Nicola [Wed, 12 Oct 2022 14:01:54 +0000 (17:01 +0300)]
Avoid format! in favor of to_string

21 months agoSet opt-level = 1 on dev profile
Laurențiu Nicola [Wed, 12 Oct 2022 14:01:27 +0000 (17:01 +0300)]
Set opt-level = 1 on dev profile

21 months agoMigrate assists to format args captures, part 2
DropDemBits [Mon, 10 Oct 2022 18:22:01 +0000 (14:22 -0400)]
Migrate assists to format args captures, part 2

21 months agoAuto merge of #13358 - btwotwo:feature/env-vars-autocompletion, r=Veykril
bors [Tue, 11 Oct 2022 18:45:31 +0000 (18:45 +0000)]
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 :)

21 months agoFormatting
btwotwo [Tue, 11 Oct 2022 17:53:22 +0000 (19:53 +0200)]
Formatting

21 months agoFix formatting for cargo vars list
btwotwo [Tue, 11 Oct 2022 17:29:09 +0000 (19:29 +0200)]
Fix formatting for cargo vars list

21 months agoRename `get_outer_macro` to `macro_call_for_string_token`
btwotwo [Tue, 11 Oct 2022 17:28:42 +0000 (19:28 +0200)]
Rename `get_outer_macro` to `macro_call_for_string_token`

21 months agoRemove extra parameter, access Db through semantics
btwotwo [Tue, 11 Oct 2022 17:23:41 +0000 (19:23 +0200)]
Remove extra parameter, access Db through semantics

21 months agoAuto merge of #13382 - lowr:fix/reorder-dyn-bounds-on-render, r=lowr
bors [Tue, 11 Oct 2022 11:44:32 +0000 (11:44 +0000)]
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](https://github.com/rust-lang/rust-analyzer/blob/3a69435af7a1e6273744085cb251adb2b9c30a03/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](https://github.com/rust-lang/rust-analyzer/blob/3a69435af7a1e6273744085cb251adb2b9c30a03/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.

21 months agoUpdate docs/dev/syntax.md
zyctree [Tue, 11 Oct 2022 11:37:49 +0000 (19:37 +0800)]
Update docs/dev/syntax.md

Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
21 months agofix: reorder dyn bounds on render
Ryo Yoshida [Mon, 10 Oct 2022 10:32:24 +0000 (19:32 +0900)]
fix: reorder dyn bounds on render

21 months agofix link in syntax.md
zyctree [Tue, 11 Oct 2022 06:05:04 +0000 (14:05 +0800)]
fix link in syntax.md

21 months agoAuto merge of #13357 - Veykril:minicore, r=Veykril
bors [Mon, 10 Oct 2022 21:43:17 +0000 (21:43 +0000)]
Auto merge of #13357 - Veykril:minicore, r=Veykril

internal: Allow minicore flags specification to be order independent

21 months agoAuto merge of #13329 - Veykril:rustc-proc-macro, r=Veykril
bors [Mon, 10 Oct 2022 21:35:07 +0000 (21:35 +0000)]
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

21 months agoAuto merge of #13392 - Veykril:spec-pref, r=Veykril
bors [Mon, 10 Oct 2022 20:49:06 +0000 (20:49 +0000)]
Auto merge of #13392 - Veykril:spec-pref, r=Veykril

Prefer similar tokens when expanding macros speculatively

Should improve completions in proc-macros in some cases

21 months agoPrefer similar tokens when expanding macros speculatively
Lukas Wirth [Mon, 10 Oct 2022 20:47:52 +0000 (22:47 +0200)]
Prefer similar tokens when expanding macros speculatively

21 months agoAuto merge of #13391 - dvdsk:update-manual, r=lnicola
bors [Mon, 10 Oct 2022 17:03:44 +0000 (17:03 +0000)]
Auto merge of #13391 - dvdsk:update-manual, r=lnicola

Update manual now stable can be installed with rustup

this a new PR for #13374 as `bors squash` seemed to have broken `bors`
_______
`rustup` can now install `rust-analyzer` for the stable tool-chain. This commit removes the note that `rustup` can only install for the nightly branch and adjusts the command.

I also added a note on how to find the path to the `rust-analyzer` binary when installed using `rustup`, and suggestions on how to work around it not being placed in `~/.cargo/bin`.

I thought it would be ideal to point everyone to use `rustup run stable rust-analyzer` to start `rust-analyzer`. That would make it trivial to switch to nightly however I could not get this to work in `nvim` therefore I left it as a suggestion at the end.

21 months agoUpdate manual now stable can be installed with rustup
dvdsk [Mon, 10 Oct 2022 17:00:47 +0000 (19:00 +0200)]
Update manual now stable can be installed with rustup

`rustup` can now install `rust-analyzer` for the stable tool-chain. This commit removes the note that `rustup` can only install for the nightly branch and adjusts the command.

I also added a note on how to find the path to the `rust-analyzer` binary when installed using `rustup`, and suggestions on how to work around it not being placed in `~/.cargo/bin`.

I thought it would be ideal to point everyone to use `rustup run stable rust-analyzer` to start `rust-analyzer`. That would make it trivial to switch to nightly however I could not get this to work in `nvim` therefore I left it as a suggestion at the end.

21 months agoAuto merge of #13386 - Veykril:completions-ref, r=Veykril
bors [Mon, 10 Oct 2022 14:05:38 +0000 (14:05 +0000)]
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)

21 months agoAuto merge of #13380 - Veykril:cfg-pat-params, r=Veykril
bors [Mon, 10 Oct 2022 13:57:09 +0000 (13:57 +0000)]
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

21 months agoAuto merge of #13385 - Veykril:progress, r=Veykril
bors [Mon, 10 Oct 2022 13:48:26 +0000 (13:48 +0000)]
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

21 months agoRefactor completions expansion
Lukas Wirth [Mon, 10 Oct 2022 13:45:24 +0000 (15:45 +0200)]
Refactor completions expansion

21 months agoDon't report build-scripts and proc-macros are metadata progress
Lukas Wirth [Mon, 10 Oct 2022 13:41:32 +0000 (15:41 +0200)]
Don't report build-scripts and proc-macros are metadata progress

21 months agoAuto merge of #13384 - Veykril:macro-fallbacks, r=Veykril
bors [Mon, 10 Oct 2022 13:40:09 +0000 (13:40 +0000)]
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.

21 months agoExpand unmatched mbe fragments to reasonable default token trees
Lukas Wirth [Mon, 10 Oct 2022 12:25:14 +0000 (14:25 +0200)]
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.

21 months agoAuto merge of #13333 - feniljain:fix_assists, r=Veykril
bors [Mon, 10 Oct 2022 08:36:18 +0000 (08:36 +0000)]
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

21 months agoUse $crate instead of std for panic builtin_fn_macro
Lukas Wirth [Sat, 1 Oct 2022 20:51:09 +0000 (22:51 +0200)]
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

21 months agoAuto merge of #13303 - jplatte:convert-named-struct-to-tuple-struct, r=Veykril
bors [Mon, 10 Oct 2022 08:24:37 +0000 (08:24 +0000)]
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).

21 months agoAuto merge of #13367 - matklad:fix-problem-matchers, r=Veykril
bors [Mon, 10 Oct 2022 07:54:55 +0000 (07:54 +0000)]
Auto merge of #13367 - matklad:fix-problem-matchers, r=Veykril

fix: in VSCode, correctly resolve relative paths to errors

VS Code problem matcher are restricted to be static "regexes". You can't create a problem matcher dynamically, and you can't use custom code in lieu of problem matcher.

This creates a problem for rust/cargo compiler errors. They use paths relative to the root of the Cargo workspace, but VS Code doesn't necessary know where that root is.

Luckily, there's a way out: our current problem matcher is defined like this:

    "fileLocation": [ "autoDetect", "${workspaceRoot}" ],

That means that relative pahts would be resoleved relative to workspace root. VS Code allows to specify a command inside `${}`. So we can plug custom logic there to fetch Cargo's workspace root!

And that's exactly what this PR is doing!

21 months agoHonor cfg attributes on params when lowering their patterns
Lukas Wirth [Mon, 10 Oct 2022 07:47:09 +0000 (09:47 +0200)]
Honor cfg attributes on params when lowering their patterns

21 months agoAuto merge of #13377 - DropDemBits:doc-link-underline-range, r=Veykril
bors [Mon, 10 Oct 2022 07:14:43 +0000 (07:14 +0000)]
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

21 months agoAuto merge of #13376 - DropDemBits:strip-generic-bounds-and-defaults, r=Veykril
bors [Mon, 10 Oct 2022 06:34:58 +0000 (06:34 +0000)]
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.

21 months agoUnderline only the intra-doc link instead of the whole doc comment
DropDemBits [Mon, 10 Oct 2022 01:28:21 +0000 (21:28 -0400)]
Underline only the intra-doc link instead of the whole doc comment

21 months agoHave `to_generic_args` return `ast::GenericArgList`
DropDemBits [Mon, 10 Oct 2022 00:45:20 +0000 (20:45 -0400)]
Have `to_generic_args` return `ast::GenericArgList`

21 months agoAdd `{TypeParam, ConstParam}::remove_default`
DropDemBits [Sun, 9 Oct 2022 22:12:08 +0000 (18:12 -0400)]
Add `{TypeParam, ConstParam}::remove_default`

Also includes a drive-by refactor of `utils::generate_impl_text_inner`,
since that's what drove this change

21 months agoAdd `GenericParamList::to_generic_args`
DropDemBits [Sun, 9 Oct 2022 21:58:55 +0000 (17:58 -0400)]
Add `GenericParamList::to_generic_args`

21 months agofix: in VSCode, correctly resolve relative paths to errors
Aleksey Kladov [Sat, 8 Oct 2022 22:18:11 +0000 (23:18 +0100)]
fix: in VSCode, correctly resolve relative paths to errors

VS Code problem matcher are restricted to be static "regexes". You can't
create a problem matcher dynamically, and you can't use custom code in
lieu of problem matcher.

This creates a problem for rust/cargo compiler errors. They use paths
relative to the root of the Cargo workspace, but VS Code doesn't
necessary know where that root is.

Luckily, there's a way out: our current problem matcher is defined like
this:

    "fileLocation": [ "autoDetect", "${workspaceRoot}" ],

That means that relative pahts would be resoleved relative to workspace
root. VS Code allows to specify a command inside `${}`. So we can plug
custom logic there to fetch Cargo's workspace root!

And that's exactly what this PR is doing!

21 months agoBump once_cell
Laurențiu Nicola [Sun, 2 Oct 2022 17:04:47 +0000 (20:04 +0300)]
Bump once_cell

21 months agoAuto merge of #13366 - matklad:xflags, r=lnicola
bors [Sat, 8 Oct 2022 16:46:15 +0000 (16:46 +0000)]
Auto merge of #13366 - matklad:xflags, r=lnicola

internal: :arrow_up: 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

21 months agointernal: :arrow_up: xflags
Aleksey Kladov [Sat, 8 Oct 2022 14:35:07 +0000 (15:35 +0100)]
internal: :arrow_up: 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

21 months agoAuto merge of #13362 - WaffleLapkin:go_to_def_fix_doc_include_str, r=Veykril
bors [Fri, 7 Oct 2022 09:56:12 +0000 (09:56 +0000)]
Auto merge of #13362 - WaffleLapkin:go_to_def_fix_doc_include_str, r=Veykril

fix: Make go-to-def work for `#[doc = include_str!("path")]`

See the added test, go-to-def on `#[doc = include_str!("path$0")]` should navigate to `path`.

21 months agoFix go-to-def for `#[doc = include_str!("path")]`
Maybe Waffle [Fri, 7 Oct 2022 09:04:41 +0000 (09:04 +0000)]
Fix go-to-def for `#[doc = include_str!("path")]`

21 months agoPass context to env vars completion
btwotwo [Thu, 6 Oct 2022 19:35:12 +0000 (21:35 +0200)]
Pass context to env vars completion

21 months agoRestrict auto-completion for only built-in macros
btwotwo [Thu, 6 Oct 2022 19:35:01 +0000 (21:35 +0200)]
Restrict auto-completion for only built-in macros

21 months agoMake helper method less specific
btwotwo [Thu, 6 Oct 2022 19:34:19 +0000 (21:34 +0200)]
Make helper method less specific

21 months agoFormatting
btwotwo [Thu, 6 Oct 2022 14:53:17 +0000 (16:53 +0200)]
Formatting

21 months agoRemove unnecessary dereference
btwotwo [Thu, 6 Oct 2022 14:42:31 +0000 (16:42 +0200)]
Remove unnecessary dereference

21 months agoUse helper method in is_format_string
btwotwo [Thu, 6 Oct 2022 14:29:23 +0000 (16:29 +0200)]
Use helper method in is_format_string

21 months agoReplace if with option, add detail for each env variable completion
btwotwo [Thu, 6 Oct 2022 14:28:33 +0000 (16:28 +0200)]
Replace if with option, add detail for each env variable completion

21 months agoAdd tests for env var completion
btwotwo [Thu, 6 Oct 2022 14:27:53 +0000 (16:27 +0200)]
Add tests for env var completion

21 months agoAdd const list of cargo-defined env variables with descriptions
btwotwo [Thu, 6 Oct 2022 14:27:27 +0000 (16:27 +0200)]
Add const list of cargo-defined env variables with descriptions

21 months agoAdd helper method to get a macro name from passed string
btwotwo [Thu, 6 Oct 2022 14:26:49 +0000 (16:26 +0200)]
Add helper method to get a macro name from passed string

21 months agoUse expanded version of text for env var completion
btwotwo [Thu, 6 Oct 2022 14:25:12 +0000 (16:25 +0200)]
Use expanded version of text for env var completion