What’s New in IntelliJ Rust

栏目: IT技术 · 发布时间: 5年前

内容简介:In this post, we’ll take a look at the updates that IntelliJ Rust has received over the 2020.1 release cycle.But before we start, we have an exciting announcement that we would like to share.Now, let’s get back to the plugin updates:

In this post, we’ll take a look at the updates that IntelliJ Rust has received over the 2020.1 release cycle.

But before we start, we have an exciting announcement that we would like to share. It is now possible to debug your Rust code in IDEs other than CLion! Here are a few more details:

  • It’s available in IntelliJ IDEA Ultimate, AppCode, and RubyMine starting with version 2020.1.
  • It works with LLDB on macOS and Linux.
  • It requires thenativeDebug plugin to work in IntelliJ IDEA Ultimate.
  • It requires you to download the debugger binaries, which are not bundled. The IDEs will prompt you to do this.

Now, let’s get back to the plugin updates:

Improvements to LLDB support

If you are working on macOS or Linux, you have the choice to use LLDB as your Rust debugger. LLDB doesn’t natively support Rust and treats it as C code by default, so the plugin has to do its part to make your debugging experience more convenient. You can track the progress of this ongoing work in this umbrella ticket .

As a basis for improving LLDB support, we took the ‘rust-enabled lldb’ patches developed by Tom Tromey , fine-tuned them to suit the recent versions of the debugger, and applied them to CLion’s bundled LLDB.

This patched version of LLDB brings long-awaited improvements in type representation. Now the debugger can properly show enums and primitive types like i32 , which was previously displayed as a C-style int .

The patched version of LLDB is also capable of demangling Rust function names, which allows the plugin to show them in a human-readable format inside the call stack (notice the Frames pane in the screenshot below). Moreover, demangled names are now available for Evaluate Expression . Simple function calls like fn foo() -> i32 can already be included in the expressions, and we are working on handling more complicated cases.

What’s New in IntelliJ Rust

Rust REPL

A major novelty of this release is the REPL console, an interactive read-eval-print-loop environment for prototyping and testing your code. This handy tool is a notebook, a calculator, and a Rust interpreter all in one.

Implemented on top of the evcxr_repl utility, Rust REPL provides syntax highlighting and completion for the code lines you type. It also shows a pane with the list of variables, functions, and structures currently in use.

To open the console, call Tools | Rust REPL or search for REPL in the Find Action dialog ( Ctrl+Shift+A on Windows/Linux, Shift⌘A   on macOS). The plugin will ask you to install the appropriate version of evcxr_repl, and then you’ll be ready to go.

What’s New in IntelliJ Rust

Updates to language support

The first change to note here is the introduction of code insight for impl blocks with type aliases. For performance reasons, this has been enabled only for types with fewer than a predefined number of aliases (the threshold is set to 10 at the moment).

What’s New in IntelliJ Rust

Another important improvement concerns type inference. It now covers subslice patterns and, in some cases, const generics :

What’s New in IntelliJ Rust

Editor enhancements

Code insight has also received some improvements. If some of the local variables or parameters are never used, you will see them highlighted in grey:

What’s New in IntelliJ Rust

The return type mismatch check is now equipped with a quick-fix:

What’s New in IntelliJ Rust

A new inspection, Lift return , identifies i f and match expressions where return can safely be pulled up from the branches:

What’s New in IntelliJ Rust

And the list of refactoring intentions has been enriched, as well. You can now extract enum variants into separate structures and edit them while simultaneously affecting all usages:

What’s New in IntelliJ Rust

____________

Those are the most notable changes we’ve made to IntelliJ Rust for the 2020.1 release. Please share your feedback with us, and if you encounter any issues, don’t hesitate to report them in the plugin’s tracker . Thank you!

DOWNLOAD CLION 2020.1

Your Rust team

JetBrains

The Drive to Develop


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

谁说菜鸟不会数据分析

谁说菜鸟不会数据分析

张文霖、刘夏璐、狄松 编著 / 电子工业出版社 / 2011-7 / 59.00元

《谁说菜鸟不会数据分析(全彩)》内容简介:很多人看到数据分析就望而却步,担心门槛高,无法迈入数据分析的门槛。《谁说菜鸟不会数据分析(全彩)》在降低学习难度方面做了大量的尝试:基于通用的Excel工具,加上必知必会的数据分析概念,并且采用通俗易懂的讲解方式。《谁说菜鸟不会数据分析(全彩)》努力将数据分析写成像小说一样通俗易懂,使读者可以在无形之中学会数据分析。《谁说菜鸟不会数据分析(全彩)》按照数据......一起来看看 《谁说菜鸟不会数据分析》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

SHA 加密
SHA 加密

SHA 加密工具

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具