Changelog #19

Commit: ec3fb1c
Release: 2020-04-06

New Features

  • BREAKING #3824 changed the name of many options. The current set is specified here. If you are using a non-VS Code client, note that rust-analyzer now asks for rust-analyzer secion of configuration, and expects this config to be present in initializationOptions.

  • #3804, #3825 it is now possible to use arbitrary command for on the fly error checking:

    1
    2
    3
    4
    5
    
    {
        "rust-analyzer.checkOnSave.overrideCommand": [
            "./x.py", "check", "--json-output"
        ]
    }
    
  • #3807, #3825 similarly, it is now possible to completely override rustfmt command.

  • #3820 remove support for old syntax highlighting. To use the new semantic tokens highlighting:

    1. install the recent vscode insiders build

    2. add

      1
      2
      3
      4
      
      {
          "rust-analyzer.highlighting.semanticTokens": true,
          "editor.semanticHighlighting.enabled": false,
      }
      

      to config

    3. run vscode as code-insiders --enabled-proposed-api matklad.rust-analyzer

    4. make sure to use a color theme with support for syntax highlighitng.

    5. Rust specific tokens and modifiers are listed here. For example, to underline all mut and &mut variables, add this to settings.json:

      1
      2
      3
      4
      5
      
      "editor.tokenColorCustomizationsExperimental": {
          "*.mutable": {
              "fontStyle": "underline"
          }
      }
      
  • #3814 add Implement From for enum variant assist

    78559964 8f2da100 7815 11ea 99a4 00b431df7022
  • #3746 add Create function assist.

    78560241 111dca00 7816 11ea 89a4 5489ddf6d9dc
  • #3840 automatically add call parenthesis for tuple-like enum variants

    78560584 9a350100 7816 11ea 93ad 66bf625fcb93
  • #3666 handle some configuration changes without server restart.

  • #3777 populate default task list in VS Code with cargo commands.

  • #3765 SSR no longer takes field order into account.

  • #3829 SSR treats method call and UFCS equivalently.

  • #3779 code completion for recrod literals now suggest only fields which are not already present.

Fixes

  • #3785 attach doc comments to declaration even if there’s a blank line after comment.

  • #3781, #3819 make Run action correctly handle the case with several major versions of the package in the crate graph.

  • #3786 Fill Match Arms assits does not leave the floating comma behind.

  • #3797 don’t show chaining hints for record literals and unit structs.

  • #3844 make sure that default configuration values are honored.

  • #3857 fix inference of function pointer return types.

  • #3858 don’t show return type for ()-returning function.

Internal Improvements

  • #3817, #3815, #3816 Show Syntax Tree internal command now has syntax highlighting and auto scroll from source.

  • #3805, #3806, #3811 lower literal patterns.

  • #3790 use uniiform naming (config) for all configuration-related functionality.

  • #3792, #3802 inspired by Emacs, rename "cargo watch" functionality to flycheck.

  • #3738, #3800 more groundwork for proc-macro support.

  • #3793 add integrated test for code-generating build.rs.

  • #3795 decouple flycheck and project model.

  • #3809 reduce the number of structs holding configuration from three to one.

  • #3836 wrap macros in pattern position into ast::MacroPat node to not confuse them with expressions.

  • #3744 upgrade chalk.