【问题标题】:How do I let VScode use the newest Ruby Parser for RuboCop如何让 VScode 使用最新的 Ruby Parser for RuboCop
【发布时间】:2023-01-24 20:48:23
【问题描述】:

问题看起来像这样:

我使用的是 MacBook Air (M2)。 Ruby版本为ruby 3.1.2p20,解析器版本为3.3.7。这些是我有的相关扩展,所有设置都是默认的。我浏览了整个网络,找不到解决方案。我希望 VSCode 使用最新的 Ruby 解析器,这样当我尝试在 Ruby 中使用模式匹配时它不会抛出错误,这是在 Ruby 2.7 中引入的。

【问题讨论】:

    标签: ruby visual-studio-code rubygems lint rubocop


    【解决方案1】:

    .rubocop.yml 添加/更新行

    AllCops:

    TargetRubyVersion: 3.1.2

    【讨论】:

      猜你喜欢
      • 2018-10-28
      • 2018-06-10
      • 2020-02-15
      • 2019-04-21
      • 1970-01-01
      • 2018-08-22
      • 2019-07-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多