Skip to content

Changelog 184 #169

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 3 commits into from
Dec 5, 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
93 changes: 93 additions & 0 deletions _posts/2022-12-05-changelog-184.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
---
layout: post
title: "IntelliJ Rust Changelog #184"
date: 2022-12-05 13:00:00 +0300
---


## Update on Procedural Macros Support

We finally [enabled](https://github.com/intellij-rust/intellij-rust/pull/9729) [function-like](https://doc.rust-lang.org/reference/procedural-macros.html#function-like-procedural-macros) and [derive](https://doc.rust-lang.org/reference/procedural-macros.html#derive-macros) procedural macro expansion by default 🎉


Now the plugin provides them with syntax highlighting, completion, the [Show Macro Expansion](https://plugins.jetbrains.com/plugin/8182-rust/docs/rust-code-reference-info.html#macro-exansion) popup, and other features already available for declarative macros. Generated items are now suggested in code completion and considered in other code insight features:

<img src="/assets/posts/changelog-184/derive_proc_macro.png" width="700px"/>

Note that [attribute](https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros) procedural macro expansion is still disabled by default. If you want to try out, enable `org.rust.macros.proc.attr` [experimental feature](https://plugins.jetbrains.com/plugin/8182-rust/docs/rust-faq.html#experimental-features).

Read more about macros and how they are supported in Rust plugin in the [corresponding blog post](https://blog.jetbrains.com/rust/2022/12/05/what-every-rust-developer-should-know-about-macro-support-in-ides/)

## New Features

* [#4768] Show [coerced](https://doc.rust-lang.org/reference/type-coercions.html) types via `View | Type Info` action (<kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd>)

<img src="/assets/posts/changelog-184/type_info.png" width="350px"/>

* [#9686] Support short [intra-doc links](https://doc.rust-lang.org/rustdoc/write-documentation/linking-to-items-by-name.html) (in the `[link]` format)

* [#9808] Parse half-open [range patterns](https://doc.rust-lang.org/reference/patterns.html#range-patterns)

* [#9760] Notify users about changes in the crate roots of procedural macro libraries to reload the project model. Otherwise, the plugin won't be able to expand procedural macro calls properly

* [#9711] Experimentally set `RUST_IDE_PROC_MACRO_COMPLETION` and `RUST_IDE_PROC_MACRO_COMPLETION_DUMMY_IDENTIFIER` environment variables for procedural macro when invoking them during completion. The idea is that authors of procedural macros could use these variables and based on them change the behavior of the macro to provide a better (possibly custom) completion for IDE users. See [usage example](https://github.com/yewstack/yew/pull/2972) in `yew::html!` macro

## Fixes

* [#9756] Suggest `Reload project` instead of `Attach file to a module` quick-fix for the crate root files after their creation

* [#9761] Fix type inference in closures on nightly Rust

* [#9779] Fix false-positive errors like `Use of moved values` after invalidating caches without clearing file caches

* [#9800] Fix impl search when there are multiple type aliases with the same names

* [#9783] Fix [move statement up/down](https://www.jetbrains.com/idea/guide/tutorials/rearranging-code/moving-statements-around/) editor action being incorrectly disabled with some IDE configurations (by [@afetisov])

* [#9823] Fix completion inside local macro calls in 2022.3 IDE builds

* [#9767] Fix navigation, highlighting, completion and other code insight features with function-like macros invoked in the pattern context

* [#9762] Fix `Find usages` for variables defined by macros

* [#9764] Fix handling of nested blocks expanded from local macros

* [#9741] Don't offer `Un-elide lifetimes` intention when there are no input lifetimes

* [#9788] Don't show `File does not belong to any known Cargo project` warning for [scratch files](https://www.jetbrains.com/help/idea/scratches.html)

* [#9345] Fix nesting of renamed imports (by [@afetisov])

* [#9745] Restore `Import | Fix all 'Unresolved reference' problems in file` quick-fix option, which adds all missing unambiguous imports. Note, if you prefer missing imports to be fixed on the fly, you can enable `Add unambiguous imports on the fly` option in `Settings | Editor | General | Auto Import` settings

* [#9737] Don't create separate `Undo` entries when adding unambiguous import on the fly

## Internal Improvements

* [#9758] Make 2022.3 platform default for development

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

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

[#4768]: https://github.com/intellij-rust/intellij-rust/pull/4768
[#9345]: https://github.com/intellij-rust/intellij-rust/pull/9345
[#9686]: https://github.com/intellij-rust/intellij-rust/pull/9686
[#9711]: https://github.com/intellij-rust/intellij-rust/pull/9711
[#9729]: https://github.com/intellij-rust/intellij-rust/pull/9729
[#9737]: https://github.com/intellij-rust/intellij-rust/pull/9737
[#9741]: https://github.com/intellij-rust/intellij-rust/pull/9741
[#9745]: https://github.com/intellij-rust/intellij-rust/pull/9745
[#9756]: https://github.com/intellij-rust/intellij-rust/pull/9756
[#9758]: https://github.com/intellij-rust/intellij-rust/pull/9758
[#9760]: https://github.com/intellij-rust/intellij-rust/pull/9760
[#9761]: https://github.com/intellij-rust/intellij-rust/pull/9761
[#9762]: https://github.com/intellij-rust/intellij-rust/pull/9762
[#9764]: https://github.com/intellij-rust/intellij-rust/pull/9764
[#9767]: https://github.com/intellij-rust/intellij-rust/pull/9767
[#9779]: https://github.com/intellij-rust/intellij-rust/pull/9779
[#9783]: https://github.com/intellij-rust/intellij-rust/pull/9783
[#9788]: https://github.com/intellij-rust/intellij-rust/pull/9788
[#9800]: https://github.com/intellij-rust/intellij-rust/pull/9800
[#9808]: https://github.com/intellij-rust/intellij-rust/pull/9808
[#9823]: https://github.com/intellij-rust/intellij-rust/pull/9823
Binary file added assets/posts/changelog-184/derive_proc_macro.png
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-184/type_info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.