aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-09-18 21:30:17 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-09-18 21:30:17 -0700
commit9d3f60d44ed90bcb581b590067b42d92e7cdecad (patch)
tree0cb216a22fce01e144c558d89ba6b7c75cd29c5d
parentb453ec38d6140b1c24c4c4531f3fc975b06e7599 (diff)
downloadbun-9d3f60d44ed90bcb581b590067b42d92e7cdecad.tar.gz
bun-9d3f60d44ed90bcb581b590067b42d92e7cdecad.tar.zst
bun-9d3f60d44ed90bcb581b590067b42d92e7cdecad.zip
Prettier
-rw-r--r--packages/bun-vscode/scripts/build.mjs2
-rw-r--r--packages/bun-vscode/src/features/debug.ts4
-rw-r--r--packages/bun-vscode/src/features/lockfile.style.ts52
-rw-r--r--packages/bun-vscode/src/features/tasks/package.json.ts2
-rw-r--r--test/js/bun/test/expect.test.js6
-rw-r--r--test/js/node/watch/fs.watch.test.ts8
6 files changed, 35 insertions, 39 deletions
diff --git a/packages/bun-vscode/scripts/build.mjs b/packages/bun-vscode/scripts/build.mjs
index 5db577281..347a59631 100644
--- a/packages/bun-vscode/scripts/build.mjs
+++ b/packages/bun-vscode/scripts/build.mjs
@@ -12,7 +12,7 @@ buildSync({
external: ["vscode"],
platform: "node",
format: "cjs",
-
+
// The following settings are required to allow for extension debugging
minify: false,
sourcemap: true,
diff --git a/packages/bun-vscode/src/features/debug.ts b/packages/bun-vscode/src/features/debug.ts
index d5522c493..caa0c9378 100644
--- a/packages/bun-vscode/src/features/debug.ts
+++ b/packages/bun-vscode/src/features/debug.ts
@@ -13,7 +13,6 @@ export const DEBUG_CONFIGURATION: vscode.DebugConfiguration = {
cwd: "${workspaceFolder}",
stopOnEntry: false,
watchMode: false,
-
};
export const RUN_CONFIGURATION: vscode.DebugConfiguration = {
@@ -83,7 +82,7 @@ function debugFileCommand(resource?: vscode.Uri) {
}
function injectDebugTerminal(terminal: vscode.Terminal): void {
- if (!getConfig("debugTerminal.enabled")) return
+ if (!getConfig("debugTerminal.enabled")) return;
const { name, creationOptions } = terminal;
if (name !== "JavaScript Debug Terminal") {
@@ -246,4 +245,3 @@ function getRuntime(scope?: vscode.ConfigurationScope): string {
function getConfig<T>(path: string, scope?: vscode.ConfigurationScope) {
return vscode.workspace.getConfiguration("bun", scope).get<T>(path);
}
- \ No newline at end of file
diff --git a/packages/bun-vscode/src/features/lockfile.style.ts b/packages/bun-vscode/src/features/lockfile.style.ts
index 76af4801b..7c4650497 100644
--- a/packages/bun-vscode/src/features/lockfile.style.ts
+++ b/packages/bun-vscode/src/features/lockfile.style.ts
@@ -1,37 +1,35 @@
export function styleLockfile(preview: string) {
- // Match all lines that don't start with a whitespace character
- const lines = preview.split(/\n(?!\s)/);
+ // Match all lines that don't start with a whitespace character
+ const lines = preview.split(/\n(?!\s)/);
- return lines.map(styleSection).join('\n')
+ return lines.map(styleSection).join("\n");
}
function styleSection(section: string) {
- const lines = section.split(/\n/);
+ const lines = section.split(/\n/);
- return lines.map(styleLine).join('\n')
+ return lines.map(styleLine).join("\n");
}
function styleLine(line: string) {
- if(line.startsWith('#')){
- return `<span class="mtk5">${line}</span>`
- }
-
- const parts = line.trim().split(' ')
- if(line.startsWith(' ')){
- return `<span><span class="mtk1">&nbsp;&nbsp;&nbsp;&nbsp;${parts[0]}&nbsp;</span><span class="mtk16">${parts[1]}</span></span>`
- }
- if(line.startsWith(' ')){
- const leftPart = `<span class="mtk6">&nbsp;&nbsp;${parts[0]}&nbsp;</span>`
-
- if(parts.length === 1)
- return `<span>${leftPart}</span>`
-
- if(parts[1].startsWith('"http://') || parts[1].startsWith('"https://'))
- return `<span>${leftPart}<span class="mtk12 detected-link">${parts[1]}</span></span>`
- if(parts[1].startsWith('"'))
- return `<span>${leftPart}<span class="mtk16">${parts[1]}</span></span>`
-
- return `<span>${leftPart}<span class="mtk6">${parts[1]}</span></span>`
- }
- return `<span class="mtk1">${line}&nbsp;</span>`
+ if (line.startsWith("#")) {
+ return `<span class="mtk5">${line}</span>`;
+ }
+
+ const parts = line.trim().split(" ");
+ if (line.startsWith(" ")) {
+ return `<span><span class="mtk1">&nbsp;&nbsp;&nbsp;&nbsp;${parts[0]}&nbsp;</span><span class="mtk16">${parts[1]}</span></span>`;
+ }
+ if (line.startsWith(" ")) {
+ const leftPart = `<span class="mtk6">&nbsp;&nbsp;${parts[0]}&nbsp;</span>`;
+
+ if (parts.length === 1) return `<span>${leftPart}</span>`;
+
+ if (parts[1].startsWith('"http://') || parts[1].startsWith('"https://'))
+ return `<span>${leftPart}<span class="mtk12 detected-link">${parts[1]}</span></span>`;
+ if (parts[1].startsWith('"')) return `<span>${leftPart}<span class="mtk16">${parts[1]}</span></span>`;
+
+ return `<span>${leftPart}<span class="mtk6">${parts[1]}</span></span>`;
+ }
+ return `<span class="mtk1">${line}&nbsp;</span>`;
}
diff --git a/packages/bun-vscode/src/features/tasks/package.json.ts b/packages/bun-vscode/src/features/tasks/package.json.ts
index f9a24937d..764ea9712 100644
--- a/packages/bun-vscode/src/features/tasks/package.json.ts
+++ b/packages/bun-vscode/src/features/tasks/package.json.ts
@@ -189,7 +189,7 @@ function registerHoverProvider(context: vscode.ExtensionContext) {
return;
}
- const terminal = vscode.window.createTerminal({name});
+ const terminal = vscode.window.createTerminal({ name });
terminal.show();
terminal.sendText(`bun ${script}`);
}),
diff --git a/test/js/bun/test/expect.test.js b/test/js/bun/test/expect.test.js
index 4b9e5ec22..b6e312022 100644
--- a/test/js/bun/test/expect.test.js
+++ b/test/js/bun/test/expect.test.js
@@ -2636,9 +2636,9 @@ describe("expect()", () => {
expect({ a: [1, 2, 3] }).toMatchObject({ a: expect.arrayContaining([1, 2]) });
expect({ a: [1, 2, 3] }).not.toMatchObject({ a: expect.arrayContaining([4]) });
- expect({ a: ['hello', 'world'] }).toMatchObject({ a: expect.arrayContaining([]) });
- expect({ a: ['hello', 'world'] }).toMatchObject({ a: expect.arrayContaining(['world']) });
- expect({ a: ['hello', 'world'] }).not.toMatchObject({ a: expect.arrayContaining(['hello', 'mars']) });
+ expect({ a: ["hello", "world"] }).toMatchObject({ a: expect.arrayContaining([]) });
+ expect({ a: ["hello", "world"] }).toMatchObject({ a: expect.arrayContaining(["world"]) });
+ expect({ a: ["hello", "world"] }).not.toMatchObject({ a: expect.arrayContaining(["hello", "mars"]) });
expect([]).toMatchObject([]);
expect([]).toMatchObject({});
diff --git a/test/js/node/watch/fs.watch.test.ts b/test/js/node/watch/fs.watch.test.ts
index 10fc754d2..787ce413c 100644
--- a/test/js/node/watch/fs.watch.test.ts
+++ b/test/js/node/watch/fs.watch.test.ts
@@ -67,7 +67,7 @@ describe("fs.watch", () => {
const root = path.join(testDir, "add-directory");
try {
fs.mkdirSync(root);
- } catch { }
+ } catch {}
let err: Error | undefined = undefined;
const watcher = fs.watch(root, { signal: AbortSignal.timeout(3000) });
watcher.on("change", (event, filename) => {
@@ -102,7 +102,7 @@ describe("fs.watch", () => {
const root = path.join(testDir, "add-subdirectory");
try {
fs.mkdirSync(root);
- } catch { }
+ } catch {}
const subfolder = path.join(root, "subfolder");
fs.mkdirSync(subfolder);
const watcher = fs.watch(root, { recursive: true, signal: AbortSignal.timeout(3000) });
@@ -438,7 +438,7 @@ describe("fs.promises.watch", () => {
const root = path.join(testDir, "add-promise-directory");
try {
fs.mkdirSync(root);
- } catch { }
+ } catch {}
let success = false;
let err: Error | undefined = undefined;
try {
@@ -480,7 +480,7 @@ describe("fs.promises.watch", () => {
const root = path.join(testDir, "add-promise-subdirectory");
try {
fs.mkdirSync(root);
- } catch { }
+ } catch {}
const subfolder = path.join(root, "subfolder");
fs.mkdirSync(subfolder);
let success = false;