价值不是可接受的价值。有效值:[" rubocop"](737,20)

时间:2016-10-26 13:41:19

标签: ruby visual-studio-code rubocop

我在Visual Studio Code中安装了Ruby和ruby-rubocop扩展,但是这个警告显示在我的编辑器中:

Value is not an accepted value. Valid values: ["rubocop"] (737, 20)

当我点击警告重定向到settings.json (/)时,特别是"ruby.format": "",

// ruby language settings

    // Defines where the Ruby extension will look to find Modules, Classes and methods.
    "ruby.locate": {
        "exclude": "{**/@(test|spec|tmp|.*),**/@(test|spec|tmp|.*)/**,**/*_spec.rb}",
        "include": "**/*.rb"
    },

    // Path to the Ruby interpreter.  Set this to an absolute path to select from multiple installed Ruby versions.
    "ruby.interpreter.commandPath": "ruby",

    // Path to the rct-complete command.  Set this to an absolute path to select from multiple installed Ruby versions.
    "ruby.rctComplete.commandPath": "rct-complete",

    // Select the type of formatter to use. If 'rubocop' is selected, the ruby.lint.rubocop options will be passed to the formatter.
    "ruby.format": "",

    // Set individual ruby linters to use
    "ruby.lint": {},

在我的.vscode / settings.json中,我尝试"ruby.format": "rubocop","ruby.format": ["rubocop"],,但警告会一直显示。

1 个答案:

答案 0 :(得分:0)

重新启动Visual Studio代码解决问题"ruby.format": "rubocop",配置。