Intellij-rust: Improve number primitives completion

Created on 24 Mar 2019  路  3Comments  路  Source: intellij-rust/intellij-rust

Environment

  • Intellij-Rust plugin version: v0.2.94.2119-191
  • Rust toolchain version: 1.33.0 (2aa4c46cf 2019-02-28)
  • IDE name and version: IntelliJ IDEA 2019.1 (Ultimate Edition) Build #IU-191.6183.62, built on March 21, 2019
  • Operating system: macOS 10.14.3

Problem description

There is a number of the completion issues with the primitives. It would be good to stub the completion somehow if the macros expansion is not coming soon.

  • let max = std::u32::MAX; and similar are not autocompleted and it's not possible to navigate to their values.
  • For let a: i32 = 42; there's no autocompletion for methods such as pow, to_string

It's hard to say what other methods are missing, but having those would be awesome already.

macros

Most helpful comment

@itmuckel What macro expansion engine did you enable?
Currently, we have two options:

  1. Default macro engine. It's stable but can't process impl blocks generated by macros so the plugin doesn't provide any methods generated by macros during the code completion
  2. Experimental macro engine. It's quite unstable yet but we don't know any critical issues related to it. It correctly processes impl blocks so name resolution/code completion should work as expected when this option enabled
    image

All 3 comments

Especially for numbers all mathematical functions like abs() and sin() are nice to have. I expected it to work when enabling macro expansion in the settings, but I still only see
grafik

@itmuckel What macro expansion engine did you enable?
Currently, we have two options:

  1. Default macro engine. It's stable but can't process impl blocks generated by macros so the plugin doesn't provide any methods generated by macros during the code completion
  2. Experimental macro engine. It's quite unstable yet but we don't know any critical issues related to it. It correctly processes impl blocks so name resolution/code completion should work as expected when this option enabled
    image

I had that enabled. The problem was that I aborted the macro expansion in the past. I reset the Toolchain location and then the macro expansion restarted. Now everything works fine. Thank you!

Was this page helpful?
0 / 5 - 0 ratings