Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebase #2

Merged
merged 125 commits into from
Oct 9, 2020
Merged

Rebase #2

merged 125 commits into from
Oct 9, 2020

Conversation

matthewsanetra
Copy link
Owner

No description provided.

zebp and others added 30 commits September 29, 2020 14:48
cargo update as well
6114: Improve grammar and fix code example in style guide r=kjeremy a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
6116: Up rustc-ap-rustc_lexer to 681 r=matklad a=kjeremy

cargo update as well

Co-authored-by: kjeremy <kjeremy@gmail.com>
6104: Minor clippy performance suggestions r=matklad a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
6118: Document Clippy strategy r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
6105: Fix path comparison not comparing paths correctly with unequal lengths r=matklad a=Veykril

~~This PR includes the commit from #6102 there as I found a bug while writing that(so either merging this or both in order works) so I included a test there already which was just ignored.~~ This PR fixes that, basically inserting imports didn't consider path length for equality, so depending on the order it might insert the path before or after another import if they only differ in segment length.

~~Diff without the commit of #6102 2d90d3937d71f9a00f3d44c15b20679215311637~~



Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
5954: Add flexible configuration for runnables r=popzxc a=popzxc

This PR introduces two new configuration options for runnables: `overrideCargo` and `cargoExtraArgs`.
These options are applied to all the "run" tasks of rust analyzer, such as binaries and tests.

Overall motivation is that rust-analyzer provides similar options, for example, for `rustfmt`, but not for runnables.

## `overrideCargo`

This option allows user to replace `cargo` command with something else (well, something that is compatible with the cargo arguments).

Motivation is that some projects may have wrappers around cargo (or even whole alternatives to cargo), which do something related to the project, and only then run `cargo`. With this feature, such users will be able to use lens and run tests directly from the IDE rather than from terminal.

![cargo_override](https://user-images.githubusercontent.com/12111581/92306622-2f404f80-ef99-11ea-9bb7-6c6192a2c54a.gif)

## `cargoExtraArgs`

This option allows user to add any additional arguments for `cargo`, such as `--release`.

It may be useful, for example, if project has big integration tests which take too long in debug mode, or if any other `cargo` flag has to be passed.

![cargo_extra_args](https://user-images.githubusercontent.com/12111581/92306658-821a0700-ef99-11ea-8be9-bf0aff78e154.gif)

Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
5988: Postfix completions for fmt-like string literals r=matklad a=popzxc

This pull request adds a bunch of new postfix completions for `format`-like string literls.

For example, `"{32} {some_var:?}".println` will expand to `println!("{} {:?}", 32, some_var)`.

Postfix completions were added for most common format-like macros:

- `println` -> `println!(...)`
- `fmt` -> `format!(...)`
- `panic` -> `panic!(...)`
- `log` macros:
  + `logi` -> `log::info!(...)`
  + `logw` -> `log::warn!(...)`
  + `loge` -> `log::error!(...)`
  + `logt` -> `log::trace!(...)`
  + `logd` -> `log::debug!(...)`

![fmt_postfix](https://user-images.githubusercontent.com/12111581/92998650-a048af80-f523-11ea-8fd8-410146de8caa.gif)



Co-authored-by: Igor Aleksanov <popzxc@yandex.ru>
6121: Reduce visibiity r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
matklad and others added 28 commits October 7, 2020 12:15
Percentage is a UI concern, the physical fact here is fraction. It's
sad that percentage bleeds into the protocol level, we even duplicated
this bad API ourselves!
6166: Better progress API r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
6167: Add comparisons guideline to style r=matklad a=matklad

bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
6154: Shorten type hints for std::iter Iterators r=SomeoneToIgnore a=Veykril

Fixes #3750.

This re-exports the `hir_expand::name::known` module to be able to fetch the `Iterator` and `iter` names.
I'm not sure if there is anything to do with `Solution::Ambig` in `normalize_trait_assoc_type` or whether discarding those results is always wanted.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
6161: Bump chalk to use latest git to get upstream fix r=jonas-schievink a=Ameobea

 * Chalk very recently (like an hour ago) merged a fix that prevents rust analyzer from panicking.  This allows it to be usable again for code that hits those situations.  See #6134, #6145, Probably #6120

Co-authored-by: Casey Primozic <me@ameo.link>
5651: Add track_env_var to the proc macro server r=kjeremy a=lnicola

See rust-lang/rust#74653.

Fixes #6054.
Fixes #5640, maybe.

Should be merged when 1.47 is released.

Proc macros still don't work for me, but it no longer crashes.



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
6173: Bump rustc_lexer, cfg-if to 1.0 and add new license to check r=kjeremy a=kjeremy



Co-authored-by: kjeremy <kjeremy@gmail.com>
Signed-off-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
6181: Fix source_to_def for named enum variant fields r=jonas-schievink a=jonas-schievink

bors r+ 🤖

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Co-authored-by: Laurențiu Nicola <lnicola@users.noreply.github.com>
6185: Add note if RUST_SRC_PATH is likely to be wrong r=jonas-schievink a=jonas-schievink

bors r+ 🤖

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
6188: Treat `ast::Name` in field patterns as use r=jonas-schievink a=jonas-schievink

bors r+ 🤖 

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Previously, "find all references" on a variant field wouldn't find any
references outside the defining module. This is because variant fields
were incorrectly assumed to be private, like struct fields without
explicit visibility, but they actually inherit the enum's visibility.
6189: adt: correctly inherit field visibility from enum r=jonas-schievink a=jonas-schievink

Previously, "find all references" on a variant field wouldn't find any
references outside the defining module. This is because variant fields
were incorrectly assumed to be private, like struct fields without
explicit visibility, but they actually inherit the enum's visibility.

bors r+ 🤖 

Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
6187: Remove release build overrides r=jonas-schievink a=lnicola



Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
6176: add eprintln in fmt-like postfix r=SomeoneToIgnore a=bnjjj



Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com>
@matthewsanetra matthewsanetra merged commit 0e2987f into matthewsanetra:master Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.