Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Studio Code workspace settings #110

Open
j4-m opened this issue Mar 17, 2023 · 0 comments
Open

Visual Studio Code workspace settings #110

j4-m opened this issue Mar 17, 2023 · 0 comments

Comments

@j4-m
Copy link

j4-m commented Mar 17, 2023

How about adding some VS Code workspace settings? I've got quite a nice set up that I'm using on other projects which makes setting up sniffing/beautifying/formatting in VS Code very straight-forward.

There's gonna be 2 parts to this:

  1. Document the necessary VS Code extensions
  2. Ship a settings.json, the content of which is something like below.

Some of the settings below are for the PHP Sniffer & Beautifier Docker extension. It's pretty neat as it runs PHP_CodeSniffer inside Docker meaning users are not require to have (a particular version of) PHP installed on their machine. The one snag with this is that it requires the container name within the settings, fortunately this is fairly easy to predict with Lando, and could easily be set as part of composer create-project, but obviously mileage may varying using other local dev environments.

{
  "breadcrumbs.enabled": true,
  "css.validate": true,
  "diffEditor.ignoreTrimWhitespace": false,
  "editor.tabSize": 2,
  "editor.autoIndent": "full",
  "editor.insertSpaces": true,
  "editor.formatOnPaste": true,
  "editor.renderWhitespace": "boundary",
  "editor.wordWrapColumn": 80,
  "editor.wordWrap": "off",
  "editor.detectIndentation": true,
  "editor.rulers": [
    80
  ],
  "files.associations": {
    "*.inc": "php",
    "*.module": "php",
    "*.install": "php",
    "*.theme": "php",
    "*.profile": "php",
    "*.tpl.php": "php",
    "*.test": "php",
    "*.php": "php",
    "*.info": "ini"
  },
  "files.trimTrailingWhitespace": true,
  "files.restoreUndoStack": false,
  "files.insertFinalNewline": true,
  "html.format.enable": true,
  "html.format.wrapLineLength": 80,
  "emptyIndent.removeIndent": true,
  "emptyIndent.highlightIndent": false,
  "emptyIndent.highlightColor": "rgba(246,36,89,0.6)",
  "emmet.includeLanguages": {
    "twig": "html"
  },
  "phpsab.docker.standard": "Drupal,DrupalPractice",
  "phpsab.docker.snifferEnable": true,
  "phpsab.docker.fixerEnable": true,
  "phpsab.docker.snifferMode": "onType",
  "phpsab.docker.snifferShowSources": true,
  "phpsab.docker.dockerEnabled": true,
  "phpsab.docker.dockerContainer": "localgov_appserver_1",
  "phpsab.docker.dockerWorkspaceRoot": "/app",
  "[php]": {
    "editor.defaultFormatter": "mtbdata.vscode-phpsab-docker"
  },

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant