Skip to content

Changelog 181 #165

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

Merged
merged 8 commits into from
Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
129 changes: 129 additions & 0 deletions _posts/2022-10-24-changelog-181.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
---
layout: post
title: "IntelliJ Rust Changelog #181"
date: 2022-10-24 12:50:00 +0300
---


## New Features

* [#9532] Enable [build script] evaluation by default.
Now the plugin builds and executes all build scripts in the project (including build scripts in external dependencies)
during project model loading to create source code generated during compilation and collect information about
generated environment variables and `cfg` options. A typical use case is to generate some code by a build script
and include it via `include!(concat!(env!("OUT_DIR"), "/path_to_generated_file.rs"))`. Now the plugin understands
where generated sources are located and includes them into its own analysis.
Under the hood, build script evaluation uses `cargo check` call modified in a way to compile and execute only
host code (i.e. only build scripts and procedural macros as well as their dependencies). Besides execution of
build scripts code, it also allows the plugin to compile all procedural macro libraries which is required
for procedural macro expansion.
Note, procedural macro expansion is still disabled by default. To turn it on, enable `org.rust.macros.proc`
[experimental] feature.

Read more about build scripts and how to work with them in Rust plugin in the corresponding
[blog post](https://blog.jetbrains.com/rust/2022/10/24/evaluating-build-scripts-in-the-intellij-rust-plugin/)

* [#9239] Support new Cargo features syntax from Rust 1.60.0. See [Rust release blog post] for more info about the
syntax

* [#9429] Add `Inline type alias` refactoring in addition to existing `Substitute type alias` intention

{% include gif-img.html path="/assets/posts/changelog-181/inline" w="600px" %}

* [#9517] Provide code folding for `extern` blocks (`extern "C" { ... }`) (by [@Kobzol])

* [#9459] Resolve and complete items from the stdlib in Rust files which don't belong to a particular Cargo project (detached and [scratch](https://www.jetbrains.com/help/idea/scratches.html) files)

* [#9451] Provide completion for `'static` lifetime (by [@Kobzol])

* [#9443] Add imports for macros by [`Move refactoring`].
Currently, only macros from dependency crates are supported

* [#9433] Take into account return type of some stdlib macros in completion sorting.
For example, now `vec![]` will be bubbled up in the completion list if expected expression type is `Vec`

* [#9502] Annotate usage of `wasm` [external ABI] as experimental

## Performance Improvements

* [#9488] Fix IDE freezing on searching implementation via `Has Implementation` line marker in gutter

* [#9357] Slightly speed up name resolution

## Fixes

* [#9567] Fix possible stack overflow during type inference

* [#9545] Fix name resolution of absolute path when there is `extern crate` with alias

* [#9537] Fix `Attach file to module` quick-fix. Now `File is not included in module tree` bar will disappear after
attaching the file to a module tree as expected

* [#9510] Don't use private re-exports declared in the same crate by `Import` quick-fix

* [#9507] Improve error message for [`E0407`] error

* [#9506] Don't reorder re-exports of legacy macros when optimizing imports

* [#9504] Add imports for return type by [`Change signature`] refactoring properly

* [#9485] Handle [`$crate`] variable during procedural macro expansion properly

* [#9430] Fix inference of types with mixed type/const type arguments

* [#9416] Fix false-positive [E0117] in some cases

* [#9374] Fix nested loop/block labels shadowing

* [#9358] Fix `todo!()` macro type inference

* [#9312], [#9558] Filter out attribute and derive procedural macros in usual macro calls completion

* [#9540] Fix procedural macro expansion cache invalidation. See issue [#9539] for more details

## Internal Improvements

* [#9480] Keep info about compiler features in json instead of generated Kotlin code

Full set of changes can be found [here](https://github.com/intellij-rust/intellij-rust/milestone/90?closed=1)

[@Kobzol]: https://github.com/Kobzol

[#9239]: https://github.com/intellij-rust/intellij-rust/pull/9239
[#9312]: https://github.com/intellij-rust/intellij-rust/pull/9312
[#9357]: https://github.com/intellij-rust/intellij-rust/pull/9357
[#9358]: https://github.com/intellij-rust/intellij-rust/pull/9358
[#9374]: https://github.com/intellij-rust/intellij-rust/pull/9374
[#9416]: https://github.com/intellij-rust/intellij-rust/pull/9416
[#9429]: https://github.com/intellij-rust/intellij-rust/pull/9429
[#9430]: https://github.com/intellij-rust/intellij-rust/pull/9430
[#9433]: https://github.com/intellij-rust/intellij-rust/pull/9433
[#9443]: https://github.com/intellij-rust/intellij-rust/pull/9443
[#9451]: https://github.com/intellij-rust/intellij-rust/pull/9451
[#9459]: https://github.com/intellij-rust/intellij-rust/pull/9459
[#9480]: https://github.com/intellij-rust/intellij-rust/pull/9480
[#9485]: https://github.com/intellij-rust/intellij-rust/pull/9485
[#9488]: https://github.com/intellij-rust/intellij-rust/pull/9488
[#9502]: https://github.com/intellij-rust/intellij-rust/pull/9502
[#9504]: https://github.com/intellij-rust/intellij-rust/pull/9504
[#9506]: https://github.com/intellij-rust/intellij-rust/pull/9506
[#9507]: https://github.com/intellij-rust/intellij-rust/pull/9507
[#9510]: https://github.com/intellij-rust/intellij-rust/pull/9510
[#9517]: https://github.com/intellij-rust/intellij-rust/pull/9517
[#9532]: https://github.com/intellij-rust/intellij-rust/pull/9532
[#9537]: https://github.com/intellij-rust/intellij-rust/pull/9537
[#9540]: https://github.com/intellij-rust/intellij-rust/pull/9540
[#9545]: https://github.com/intellij-rust/intellij-rust/pull/9545
[#9558]: https://github.com/intellij-rust/intellij-rust/pull/9558
[#9567]: https://github.com/intellij-rust/intellij-rust/pull/9567

[build script]: https://doc.rust-lang.org/cargo/reference/build-scripts.html
[experimental]: https://plugins.jetbrains.com/plugin/8182-rust/docs/rust-faq.html#experimental-features
[`Move refactoring`]: https://plugins.jetbrains.com/plugin/8182-rust/docs/rust-refactorings.html#move-refactoring
[#9539]: https://github.com/intellij-rust/intellij-rust/issues/9539
[Rust release blog post]: https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html#new-syntax-for-cargo-features
[external ABI]: https://doc.rust-lang.org/reference/items/external-blocks.html#abi
[`E0407`]: https://doc.rust-lang.org/error-index.html#E0407
[`$crate`]: https://doc.rust-lang.org/reference/macros-by-example.html#hygiene
[E0117]: https://doc.rust-lang.org/error-index.html#E0117
[`Change signature`]: https://plugins.jetbrains.com/plugin/8182-rust/docs/rust-refactorings.html#change-sign
Binary file added assets/posts/changelog-181/inline.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/posts/changelog-181/inline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.