Code Monkey home page Code Monkey logo

Comments (4)

phobetron avatar phobetron commented on June 19, 2024 1

Yes, that does seem the best way to go. I've just been spoiled by Vetur's useWorkspaceDependencies feature ๐Ÿ˜…

I'll go ahead and close this issue. Thanks for your input!

from coc-volar.

yaegassy avatar yaegassy commented on June 19, 2024

If you want to use "prettier", please install coc-prettier.

As a side note, coc-prettier is set to disable vue files by default, so you need to adjust your settings to enable them.

e.g. coc-settings.json:

{
  // (1) Disable volar formatting.
  "volar.formatting.enable": false,
  // (2) Use a formatter when saving files.
  "coc.preferences.formatOnSaveFiletypes": [
    // ...snip
    "vue"
  ],
  // (3) Enable coc-prettier to use vue files as well
  "prettier.disableLanguages": []
}

from coc-volar.

phobetron avatar phobetron commented on June 19, 2024

Thanks for the information, @yaegassy! I was unaware that Prettier would ignore Vue files. I suppose Vetur was superseding coc-prettier when configured to use workspace dependencies, and ran it in its own process... I don't yet understand the differences in design choices between the two LSPs.

Do you know whether it's possible to alter Volar's built-in formatting configuration as well? Does Volar handle formatting manually, or does it depend on other tools?

from coc-volar.

yaegassy avatar yaegassy commented on June 19, 2024

I think Volar uses prettyhtml, prettier (probably in the css part), pug-beautify, sass-formatter, etc. internally.

I don't think Volar's formatter allows you to change the detailed settings. With VSCode, it may be possible to adjust the ts/js part slightly, but not with coc-volar.

Volar formatter is designed to be used out of the box, for more custom rules I recommend switching to Prettier (coc-prettier).

from coc-volar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.