neoclide / coc-prettier

Prettier extension for coc.nvim.
MIT License
546 stars 48 forks source link

[question] how to add defaultFormatter #154

Open carvalhoviniciusluiz opened 2 years ago

carvalhoviniciusluiz commented 2 years ago

in vscode I have this configuration and I want to pass everything to nvim but it's not working

// .vscode/settings.json

{
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[yaml]": {
    "editor.defaultFormatter": "redhat.vscode-yaml"
  },
  "editor.codeActionsOnSave": {
    "source.fixAll": true,
    "source.organizeImports": true
  },
  "typescript.preferences.importModuleSpecifier": "non-relative",
  "js/ts.implicitProjectConfig.experimentalDecorators": true,
  "files.eol": "\n",
  "editor.tabSize": 2
}

on nvim i'm having this problem

Captura de Tela 2022-06-23 às 14 58 59

but there shouldn't be a space between braces

Captura de Tela 2022-06-23 às 15 04 47

my coc-settings.json file

Captura de Tela 2022-06-23 às 16 18 15

any tips?

I thought it might be something in my prettier settings but it's working in vscode so it can't be

I even opened this problem,

https://github.com/prettier/eslint-plugin-prettier/issues/473

but if it solves here I'll close it and point to this one

chemzqm commented 2 years ago

Seems you need prettier to format your document, but it's not working, checkout output by :CocCommand workspace.showOutput Prettier