Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit cd20fbf

Browse files
committedMay 25, 2020
chore: add a base VSCode config
VSCode configs for our repo are tricky enough that people would benefit from having them checked into the repo. Some people are strongly opposed to having them checked in at the default location though, for what I assume are the following reasons: - There's no good way to have user-specific, workspace-specific preferences, so one set of `.vscode` files would apply to everyone. - If you already had workspace-specific VSCode preferences, the new files would collide. - Not everyone uses VSCode, so if we start adding `.vscode` files, we should also start adding `.idea` files and others, and where will it end? As a compromise, adding a script which will copy a base VSCode config into place. You can choose the run the script if you want it, and you can choose not to run it if you don't. Everybody happy, right? If necessary, we'll be able to extend this in the future with custom per-user configs, but for now let's start with something simple.
1 parent 8b19453 commit cd20fbf

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed
 

‎.gitpod.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
image: jsii/superchain
22
tasks:
3-
- init: yarn build --skip-test --no-bail
3+
- init: scripts/init-vscode && yarn build --skip-test --no-bail
44

55
vscode:
66
extensions:

‎scripts/default.vscode/launch.json

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
// Has convenient settings for attaching to a NodeJS process for debugging purposes
9+
// that are NOT the default and otherwise every developers has to configure for
10+
// themselves again and again.
11+
"type": "node",
12+
"request": "attach",
13+
"name": "Attach to NodeJS",
14+
// If we don't do this, every step-into into an async function call will go into
15+
// NodeJS internals which are hard to step out of.
16+
"skipFiles": [
17+
"<node_internals>/**"
18+
],
19+
// Saves some button-pressing latency on attaching
20+
"stopOnEntry": false
21+
}
22+
]
23+
}

‎scripts/init-vscode

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# For people that want a base VSCode setup (with useful launchers etc)
3+
# But without checking in a .vscode directory by default: there are
4+
# people who definitely do not want it checked in.
5+
set -eu
6+
scriptdir=$(cd $(dirname $0) && pwd)
7+
8+
mkdir -p ${scriptdir}/../.vscode
9+
cp ${scriptdir}/default.vscode/* ${scriptdir}/../.vscode
10+

0 commit comments

Comments
 (0)
Please sign in to comment.