neoclide / coc-solargraph

Solargraph extension for coc.nvim

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

autoformat doesn't seem to be working with solargraph-standardrb

anhari opened this issue · comments

I'm trying to use this with solargraph-standardrb to format according to standard's rules, but it still seems to format with rubocop's ruleset.

i.e. saving will convert double quote strings to single quote strings, but it will report errors using standards config (standard prefers double quote strings):

image


The .solargraph.yml project file:

plugins:
  - solargraph-standardrb
reporters:
  - standardrb

Using solargraph-standardrb-0.0.4, standard 0.1.8, and the following coc-settings.json:

{
  "coc.preferences.formatOnSaveFiletypes": [
    "css",
    "elixir",
    "eruby",
    "ex",
    "exs",
    "html",
    "javascript",
    "javascript.jsx",
    "javascriptreact",
    "json",
    "markdown",
    "ruby",
    "scss",
    "typescript",
    "typescript.tsx",
    "typescriptreact"
  ],
  "solargraph.enable": true,
  "solargraph.diagnostics": true,
  "solargraph.autoformat": true,
  "solargraph.formatting": true,
  "solargraph.hover": true,
  "emmet.includeLanguages": {
    "eruby": "html"
  },
  "suggest.echodocSupport": true,
  "suggest.maxCompleteItemCount": 20,
  "eslint.filetypes": [
    "javascript",
    "typescript",
    "typescriptreact",
    "javascriptreact"
  ],
  "diagnostic.errorSign": "",
  "diagnostic.warningSign": "",
  "diagnostic.infoSign": "",
  "diagnostic.signOffset": 9999999,
  "snippets.editSnippetsCommand": "tabe",
  "git.enableGutters": false
}

Seems the extension should upgrade to support that.

For anyone who stumbled here looking for a solution (like me). The simplest solution is to rely on rubocop's formatting (which works out of the box with coc-solargraph).

.rubocop.yml

require:
  - standard
inherit_gem:
  standard: config/base.yml

coc-settings.json

{
  "solargraph.formatting": true
}