Skip to content

Commit e6a852b

Browse files
committed
Add default TypeScript configuration
Fixes #122
1 parent 03ebaab commit e6a852b

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 4.1.0
2+
3+
### Added
4+
5+
- Default configurations for TypeScript
6+
17
# 4.0.0
28

39
### Added

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Provide run settings for the languages you use in `runSettings.json` at the root
5555
}
5656
```
5757

58-
**🔥 There are built-in default settings for C++, Python, Java, Go, Rust, JavaScript, Haskell, Ruby, Kotlin, and C#!** Access them with `Create runSettings.json` command.
58+
**🔥 There are built-in default settings for C++, Python, Java, Go, Rust, JavaScript, TypeScript, Haskell, Ruby, Kotlin, and C#!** Access them with `Create runSettings.json` command.
5959

6060
We can use [VSCode's built-in variables](https://code.visualstudio.com/docs/editor/variables-reference) which has the syntax of `${...}` and will get resolved by the extension. **`${defaultBuildTask}` is not supported because it requires resolving the entire build configuration which is super slow!**
6161

src/extension/runSettingsCommands.ts

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,18 @@ const languageTemplates: Record<string, object> = {
104104
debugAttachConfig: "JavaScript: Attach",
105105
},
106106
},
107+
TypeScript: {
108+
".ts": {
109+
runCommand: ["node", "--experimental-transform-types", "${file}"],
110+
debugCommand: [
111+
"node",
112+
"--experimental-transform-types",
113+
"--inspect-brk=localhost:${debugPort}",
114+
"${file}",
115+
],
116+
debugAttachConfig: "JavaScript: Attach",
117+
},
118+
},
107119
Haskell: {
108120
".hs": {
109121
compileCommand: [
@@ -174,6 +186,14 @@ const javaAttachConfig = {
174186
hostName: "localhost",
175187
port: "${debugPort}",
176188
};
189+
const javascriptAttachConfig = {
190+
name: "JavaScript: Attach",
191+
type: "node",
192+
request: "attach",
193+
port: "${debugPort}",
194+
address: "localhost",
195+
continueOnAttach: true,
196+
};
177197

178198
const launchTemplates: Record<string, vscode.DebugConfiguration> = {
179199
"C++ (GCC)": gdbAttachConfig,
@@ -197,14 +217,8 @@ const launchTemplates: Record<string, vscode.DebugConfiguration> = {
197217
host: "localhost",
198218
},
199219
Rust: gdbAttachConfig,
200-
JavaScript: {
201-
name: "JavaScript: Attach",
202-
type: "node",
203-
request: "attach",
204-
port: "${debugPort}",
205-
address: "localhost",
206-
continueOnAttach: true,
207-
},
220+
JavaScript: javascriptAttachConfig,
221+
TypeScript: javascriptAttachConfig,
208222
"C#": {
209223
name: "C#: Attach",
210224
type: "mono",

0 commit comments

Comments
 (0)