Skip to content

Commit 2e584d1

Browse files
Use source-map-support to provide better stack traces (#1130)
1 parent e3a0ccf commit 2e584d1

File tree

4 files changed

+63
-4
lines changed

4 files changed

+63
-4
lines changed

package-lock.json

Lines changed: 51 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,9 +1268,9 @@
12681268
"scripts": {
12691269
"vscode:prepublish": "npm run esbuild-bundle",
12701270
"esbuild-base": "del-cli ./dist && esbuild \"./src/**/*.ts\" --outdir=dist --format=cjs --platform=node --target=node18",
1271-
"esbuild": "npm run esbuild-base -- --sourcemap",
1272-
"esbuild-watch": "npm run esbuild-base -- --sourcemap --watch",
1273-
"esbuild-bundle": "del-cli ./dist && esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node --target=node18 --minify",
1271+
"esbuild": "npm run esbuild-base",
1272+
"esbuild-watch": "npm run esbuild-base -- --watch",
1273+
"esbuild-bundle": "del-cli ./dist && esbuild ./src/extension.ts --bundle --outfile=dist/extension.js --external:vscode --format=cjs --platform=node --target=node18 --minify --sourcemap",
12741274
"compile": "tsc",
12751275
"watch": "tsc --watch",
12761276
"lint": "eslint ./ --ext ts && tsc --noEmit",
@@ -1322,6 +1322,7 @@
13221322
"prettier": "3.3.2",
13231323
"sinon": "^19.0.2",
13241324
"sinon-chai": "^3.7.0",
1325+
"source-map-support": "^0.5.21",
13251326
"strip-ansi": "^6.0.1",
13261327
"typescript": "^5.5.3"
13271328
},

src/extension.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15+
// Use source-map-support to get better stack traces
16+
import "source-map-support/register";
17+
1518
import * as vscode from "vscode";
1619
import * as commands from "./commands";
1720
import * as debug from "./debugger/launch";
@@ -260,7 +263,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<Api |
260263
// show this error message as the VS Code error message only shows when running
261264
// the extension through the debugger
262265
vscode.window.showErrorMessage(`Activating Swift extension failed: ${errorMessage}`);
263-
throw Error(errorMessage);
266+
throw error;
264267
}
265268
}
266269

test/common.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
// SPDX-License-Identifier: Apache-2.0
1212
//
1313
//===----------------------------------------------------------------------===//
14+
15+
// Use source-map-support to get better stack traces
16+
import "source-map-support/register";
17+
1418
import * as chai from "chai";
1519
import * as sinonChai from "sinon-chai";
1620
import * as chaiAsPromised from "chai-as-promised";

0 commit comments

Comments
 (0)