DEV: Update sample vscode config (#28685)

- Update extension recommendations and move under `.vscode/extensions.json`
- Update sample tasks/settings, and move under `.vscode/settings.json.sample` and `.vscode/tasks.json.sample`

`.vscode/settings.json` and `.vscode/tasks.json` remain gitignored, so will not be overwritten by this commit
This commit is contained in:
David Taylor 2024-09-02 19:05:45 +01:00 committed by GitHub
parent b1e539c1b9
commit c180d1db1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 137 additions and 57 deletions

6
.gitignore vendored
View File

@ -61,8 +61,10 @@
.ruby-gemset .ruby-gemset
.tool-versions .tool-versions
# Likewise, there is a .vscode-sample for VSCode config # Likewise, there are sample files for VSCode config
.vscode /.vscode/*
!/.vscode/extensions.json
!/.vscode/*.sample
# Front-end # Front-end
dist dist

View File

@ -1,12 +0,0 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"esbenp.prettier-vscode",
"typed-ember.glint-vscode",
"chiragpat.vscode-glimmer",
"dbaeumer.vscode-eslint"
]
}

View File

@ -1,19 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Discourse",
"type": "Ruby",
"request": "launch",
"cwd": "/home/discourse/workspace/discourse",
// run bundle install before rails server
"preLaunchTask": "Prepare discourse",
"env": { "DISCOURSE_DEV_HOSTS": "${env:CLOUDENV_ENVIRONMENT_ID}-9292.apps.codespaces.githubusercontent.com", "UNICORN_BIND_ALL": "1", "UNICORN_WORKERS": "4", "DISCOURSE_DEV_ALLOW_ANON_TO_IMPERSONATE": "1" },
"program": "bin/unicorn",
"args": ["-x"],
}
]
}

View File

@ -1,12 +0,0 @@
{
"[gjs]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[gts]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"eslint.validate": [
"glimmer-js",
"glimmer-ts"
]
}

View File

@ -1,12 +0,0 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Prepare discourse",
"type": "shell",
"command": "cd /home/discourse/workspace/discourse && bundle install && yarn && bin/rake db:migrate"
},
],
}

10
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,10 @@
{
// List of extensions which should be recommended for users of this workspace.
"recommendations": [
"Shopify.ruby-lsp",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint",
"ruby-syntax-tree.vscode-syntax-tree",
"lifeart.vscode-glimmer-syntax"
]
}

36
.vscode/settings.json.sample vendored Normal file
View File

@ -0,0 +1,36 @@
{
// Enable gjs support for eslint
"eslint.validate": [
"glimmer-js",
],
// Formatter configuration:
"[scss]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
"[glimmer-js]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[ruby]": {
"editor.formatOnSave": true,
"editor.defaultFormatter": "ruby-syntax-tree.vscode-syntax-tree"
},
"[handlebars]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true
},
// eslint fix on save
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"task.autoDetect": "off",
"eslint.debug": false,
}

87
.vscode/tasks.json.sample vendored Normal file
View File

@ -0,0 +1,87 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "deps/yarn",
"type": "shell",
"command": "yarn install",
"presentation": {
"reveal": "always",
"group": "deps",
"close": true
},
"problemMatcher": []
},
{
"label": "deps/bundle",
"type": "shell",
"command": "bundle install",
"presentation": {
"reveal": "always",
"group": "deps",
"close": true
},
"problemMatcher": []
},
{
"label": "deps/all",
"dependsOn": [
"deps/yarn",
"deps/bundle"
],
"problemMatcher": []
},
{
"label": "dev/migrate",
"type": "shell",
"command": "bin/rake db:create db:migrate",
"options": {
"env":{
"SKIP_MULTISITE": "1",
"SKIP_TEST_DATABASE": "1"
}
},
"problemMatcher": []
},
{
"label": "dev/server",
"type": "shell",
"command": "bin/ember-cli -u",
"options": {
"env":{
"DISCOURSE_DEV_ALLOW_ANON_TO_IMPERSONATE": "1"
}
},
"problemMatcher": [],
"isBackground": true
},
{
"label": "shortcuts/boot-dev",
"dependsOn": [
"deps/all",
"dev/migrate",
"dev/server"
],
"dependsOrder": "sequence",
"problemMatcher": [],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "spec/migrate",
"type": "shell",
"command": "RAILS_ENV=test bin/rake db:create db:migrate parallel:create parallel:migrate",
"problemMatcher": [],
},
{
"label": "spec/run-all",
"type": "shell",
"command": "bin/turbo_rspec",
"problemMatcher": [],
},
],
}