Git Product home page Git Product logo

Comments (5)

andyw8 avatar andyw8 commented on July 4, 2024 1

(I also restarted VS Code so that may have made a difference).

from prettier-plugin-erb.

adamzapasnik avatar adamzapasnik commented on July 4, 2024

hey @andyw8
I use VSCode ✌️ Is it a rails app? Is this plugin installed inside of a project? (package.json) Or did you install it globally? npm install -g...

I'm using it in a rails app and it works, so I think there has to be something misconfigured on your side.

FYI The ruby keyword that you have shown is VSCode's metadata https://code.visualstudio.com/api/references/extension-manifest It makes an extension findable when one writes ruby into an extension searchbox.

from prettier-plugin-erb.

andyw8 avatar andyw8 commented on July 4, 2024

Thanks for the quick reply. Yes, this is a Rails app, and the plugin is installed in the project.

from prettier-plugin-erb.

adamzapasnik avatar adamzapasnik commented on July 4, 2024
  1. Did you try to reset the vscode? 🙈
  2. When you try to format .html.erb manually, are there any other formatters to select?

Add this line to your settings "prettier.enableDebugLogs": true -> restart and and open terminal -> output -> Prettier.
You will see an output like this, is there .html.erb?

["INFO" - 5:40:13 PM] Enabling Prettier for Workspace test
{
  "languageSelector": [
    {
      "pattern": "test/**/*.{js,_js,bones,cjs,es,es6,frag,gs,jake,jsb,jscad,jsfl,jsm,jss,mjs,njs,pac,sjs,ssjs,xsjs,xsjslib,wxs,js.flow,jsx,ts,tsx,json,avsc,geojson,gltf,har,ice,JSON-tmLanguage,mcmeta,tfstate,tfstate.backup,topojson,webapp,webmanifest,yy,yyp,jsonc,sublime-build,sublime-commands,sublime-completions,sublime-keymap,sublime-macro,sublime-menu,sublime-mousemap,sublime-project,sublime-settings,sublime-theme,sublime-workspace,sublime_metrics,sublime_session,json5,css,wxss,pcss,postcss,less,scss,graphql,gql,graphqls,md,markdown,mdown,mdwn,mkd,mkdn,mkdown,ronn,workbook,mdx,component.html,html,htm,html.hl,inc,st,xht,xhtml,mjml,vue,yml,mir,reek,rviz,sublime-syntax,syntax,yaml,yaml-tmlanguage,yaml.sed,yml.mysql,html.erb,arb,axlsx,builder,eye,fcgi,gemfile,gemspec,god,jb,jbuilder,mspec,opal,pluginspec,podspec,rabl,rake,rb,rbi,rbuild,rbw,rbx,ru,ruby,thor,watchr,rbs,haml}",
      "scheme": "file"
    },

from prettier-plugin-erb.

andyw8 avatar andyw8 commented on July 4, 2024

I got it working:

Either you can set formatOnSave for every language:

{
  "editor.formatOnSave": true,
  "[ruby]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  }
}

or you can set it explicitly for [erb]:

{
  "[ruby]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  },
  "[erb]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
  }
}

from prettier-plugin-erb.

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.