From bd9dd481f30922e6df4886eb2fa6ab2defda6f02 Mon Sep 17 00:00:00 2001 From: Morgante Pell Date: Thu, 18 Jul 2024 14:51:49 -0700 Subject: [PATCH] [skip ci] yolo --- Cargo.lock | 1 + crates/cli_bin/Cargo.toml | 2 +- crates/cli_bin/tests/apply.rs | 6 +++++- crates/cli_bin/tests/snapshots/apply__output_jsonl.snap | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6aa2e601d..398889069 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1804,6 +1804,7 @@ dependencies = [ "linked-hash-map", "pest", "pest_derive", + "regex", "serde", "similar", "yaml-rust", diff --git a/crates/cli_bin/Cargo.toml b/crates/cli_bin/Cargo.toml index 5dca545d0..48d02340e 100644 --- a/crates/cli_bin/Cargo.toml +++ b/crates/cli_bin/Cargo.toml @@ -37,7 +37,7 @@ tracing-subscriber = { version = "0.3", default-features = false, optional = tru serde_json = "1.0.96" tempfile = "3.1" rayon = "1.8.0" -insta = { version = "1.30.0", features = ["yaml", "redactions"] } +insta = { version = "1.30.0", features = ["yaml", "redactions", "filters"] } predicates = "3.0.3" fs_extra = "1.3" ntest = "0.9.0" diff --git a/crates/cli_bin/tests/apply.rs b/crates/cli_bin/tests/apply.rs index fc842a561..f095bc4da 100644 --- a/crates/cli_bin/tests/apply.rs +++ b/crates/cli_bin/tests/apply.rs @@ -1708,7 +1708,11 @@ fn output_jsonl() -> Result<()> { ); let content = fs_err::read_to_string(dir.join("output.jsonl"))?; - assert_snapshot!(content); + insta::with_settings!({filters => vec![ + (r"\b[[:xdigit:]]{8}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{4}-[[:xdigit:]]{12}\b", "[UUID]"), + ]}, { + assert_snapshot!(content); + }); let line_count = content.lines().count(); assert_eq!(line_count, 3); diff --git a/crates/cli_bin/tests/snapshots/apply__output_jsonl.snap b/crates/cli_bin/tests/snapshots/apply__output_jsonl.snap index 537bf8d77..1e1c6016d 100644 --- a/crates/cli_bin/tests/snapshots/apply__output_jsonl.snap +++ b/crates/cli_bin/tests/snapshots/apply__output_jsonl.snap @@ -2,6 +2,6 @@ source: crates/cli_bin/tests/apply.rs expression: content --- -{"__typename":"Match","messages":[],"variables":[{"name":"$new_files","scopedName":"0_0_$new_files","ranges":[]},{"name":"$program","scopedName":"0_1_$program","ranges":[]},{"name":"$filename","scopedName":"0_2_$filename","ranges":[]},{"name":"$absolute_filename","scopedName":"0_3_$absolute_filename","ranges":[]},{"name":"$GLOBAL_IMPORTED_SOURCES","scopedName":"0_4_$GLOBAL_IMPORTED_SOURCES","ranges":[]},{"name":"$GLOBAL_IMPORTED_NAMES","scopedName":"0_5_$GLOBAL_IMPORTED_NAMES","ranges":[]},{"name":"$body","scopedName":"2_0_$body","ranges":[{"start":{"line":1,"column":1},"end":{"line":14,"column":2},"startByte":0,"endByte":256}]},{"name":"$p","scopedName":"7_0_$p","ranges":[]},{"name":"$all_imports","scopedName":"7_1_$all_imports","ranges":[]},{"name":"$h","scopedName":"7_2_$h","ranges":[]},{"name":"$statements","scopedName":"7_3_$statements","ranges":[]},{"name":"$anchor","scopedName":"7_4_$anchor","ranges":[]},{"name":"$p","scopedName":"8_0_$p","ranges":[]},{"name":"$all_imports","scopedName":"8_1_$all_imports","ranges":[]},{"name":"$our_source","scopedName":"8_2_$our_source","ranges":[]},{"name":"$imported_names","scopedName":"8_3_$imported_names","ranges":[]},{"name":"$joined_imported_names","scopedName":"8_4_$joined_imported_names","ranges":[]},{"name":"$p","scopedName":"9_0_$p","ranges":[]},{"name":"$our_source","scopedName":"9_1_$our_source","ranges":[]},{"name":"$imported_names","scopedName":"9_2_$imported_names","ranges":[]},{"name":"$all_imports","scopedName":"9_3_$all_imports","ranges":[]},{"name":"$name","scopedName":"9_4_$name","ranges":[]},{"name":"$our_source","scopedName":"10_0_$our_source","ranges":[]},{"name":"$joined_imported_names","scopedName":"10_1_$joined_imported_names","ranges":[]},{"name":"$imports","scopedName":"10_2_$imports","ranges":[]},{"name":"$source","scopedName":"10_3_$source","ranges":[]},{"name":"$statement","scopedName":"10_4_$statement","ranges":[]},{"name":"$imports","scopedName":"11_0_$imports","ranges":[]},{"name":"$source","scopedName":"11_1_$source","ranges":[]},{"name":"$match","scopedName":"12_0_$match","ranges":[{"start":{"line":4,"column":15},"end":{"line":9,"column":4},"startByte":81,"endByte":172},{"start":{"line":6,"column":17},"end":{"line":8,"column":6},"startByte":129,"endByte":168},{"start":{"line":13,"column":10},"end":{"line":13,"column":39},"startByte":223,"endByte":252}]}],"sourceFile":"small.ts","content":"// This is a smaller example\nfunction() { \n console.log(\"thing\");\n const foo = () => {\n console.log(\"bar\");\n const bar = () => {\n console.log(\"baz\");\n }\n };\n // Not this\n // Delay a bit\n // Wow\n handle(() => { console.log(\"foo\"); });\n}","ranges":[{"start":{"line":4,"column":15},"end":{"line":9,"column":4},"startByte":81,"endByte":172},{"start":{"line":6,"column":17},"end":{"line":8,"column":6},"startByte":129,"endByte":168},{"start":{"line":13,"column":10},"end":{"line":13,"column":39},"startByte":223,"endByte":252}],"reason":null,"id":"991cf284-2d30-4048-99e6-a872d795126b"} -{"__typename":"Match","messages":[],"variables":[{"name":"$new_files","scopedName":"0_0_$new_files","ranges":[]},{"name":"$program","scopedName":"0_1_$program","ranges":[]},{"name":"$filename","scopedName":"0_2_$filename","ranges":[]},{"name":"$absolute_filename","scopedName":"0_3_$absolute_filename","ranges":[]},{"name":"$GLOBAL_IMPORTED_SOURCES","scopedName":"0_4_$GLOBAL_IMPORTED_SOURCES","ranges":[]},{"name":"$GLOBAL_IMPORTED_NAMES","scopedName":"0_5_$GLOBAL_IMPORTED_NAMES","ranges":[]},{"name":"$body","scopedName":"2_0_$body","ranges":[{"start":{"line":1,"column":1},"end":{"line":120,"column":1},"startByte":0,"endByte":3269}]},{"name":"$p","scopedName":"7_0_$p","ranges":[]},{"name":"$all_imports","scopedName":"7_1_$all_imports","ranges":[]},{"name":"$h","scopedName":"7_2_$h","ranges":[]},{"name":"$statements","scopedName":"7_3_$statements","ranges":[]},{"name":"$anchor","scopedName":"7_4_$anchor","ranges":[]},{"name":"$p","scopedName":"8_0_$p","ranges":[]},{"name":"$all_imports","scopedName":"8_1_$all_imports","ranges":[]},{"name":"$our_source","scopedName":"8_2_$our_source","ranges":[]},{"name":"$imported_names","scopedName":"8_3_$imported_names","ranges":[]},{"name":"$joined_imported_names","scopedName":"8_4_$joined_imported_names","ranges":[]},{"name":"$p","scopedName":"9_0_$p","ranges":[]},{"name":"$our_source","scopedName":"9_1_$our_source","ranges":[]},{"name":"$imported_names","scopedName":"9_2_$imported_names","ranges":[]},{"name":"$all_imports","scopedName":"9_3_$all_imports","ranges":[]},{"name":"$name","scopedName":"9_4_$name","ranges":[]},{"name":"$our_source","scopedName":"10_0_$our_source","ranges":[]},{"name":"$joined_imported_names","scopedName":"10_1_$joined_imported_names","ranges":[]},{"name":"$imports","scopedName":"10_2_$imports","ranges":[]},{"name":"$source","scopedName":"10_3_$source","ranges":[]},{"name":"$statement","scopedName":"10_4_$statement","ranges":[]},{"name":"$imports","scopedName":"11_0_$imports","ranges":[]},{"name":"$source","scopedName":"11_1_$source","ranges":[]},{"name":"$match","scopedName":"12_0_$match","ranges":[{"start":{"line":14,"column":39},"end":{"line":66,"column":4},"startByte":452,"endByte":1767},{"start":{"line":18,"column":19},"end":{"line":22,"column":6},"startByte":590,"endByte":710},{"start":{"line":24,"column":17},"end":{"line":26,"column":6},"startByte":729,"endByte":775},{"start":{"line":32,"column":26},"end":{"line":35,"column":6},"startByte":858,"endByte":933},{"start":{"line":36,"column":26},"end":{"line":39,"column":6},"startByte":961,"endByte":1036},{"start":{"line":40,"column":20},"end":{"line":51,"column":6},"startByte":1058,"endByte":1323},{"start":{"line":52,"column":20},"end":{"line":65,"column":6},"startByte":1345,"endByte":1761},{"start":{"line":71,"column":71},"end":{"line":71,"column":79},"startByte":1882,"endByte":1890},{"start":{"line":107,"column":25},"end":{"line":119,"column":2},"startByte":2904,"endByte":3267},{"start":{"line":109,"column":71},"end":{"line":109,"column":79},"startByte":2997,"endByte":3005}]}],"sourceFile":"big.ts","content":"import type { ChildProcessWithoutNullStreams } from 'child_process';\nimport { spawn } from 'child_process';\nimport type { stdlib } from '@getgrit/api';\n\nexport function wrap_exec({\n callback,\n cp,\n passOnNonZeroExitCode,\n}: {\n callback?: (write: (str: string) => void, end: () => void) => void;\n cp: ChildProcessWithoutNullStreams;\n passOnNonZeroExitCode: boolean | undefined;\n}): Promise {\n return new Promise((resolve) => {\n const allout = [] as string[];\n const stdout = [] as string[];\n const stderr = [] as string[];\n const write = (str: string): void => {\n process.stdin.cork();\n process.stdin.write(str);\n process.stdin.uncork();\n };\n\n const end = (): void => {\n process.stdin.end();\n };\n\n if (callback) {\n callback(write, end);\n }\n\n cp.stdout.on('data', (data: string) => {\n stdout.push(data);\n allout.push(data);\n });\n cp.stderr.on('data', (data: string) => {\n stderr.push(data);\n allout.push(data);\n });\n cp.on('error', (e) => {\n resolve({\n __typename: 'ShResult',\n kind: 'direct',\n success: false,\n code: -1,\n allout: allout.join(''),\n stdout: stdout.join(''),\n stderr: stderr.join(''),\n message: e.message,\n });\n });\n cp.on('close', (code: number) => {\n // Trailing info is more valuable than truncated.\n const message = stderr.join('').slice(-2000);\n resolve({\n __typename: 'ShResult',\n kind: 'direct',\n success: passOnNonZeroExitCode ? true : code === 0,\n code: code || 0,\n allout: allout.join(''),\n stdout: stdout.join(''),\n stderr: stderr.join(''),\n message,\n });\n });\n });\n}\n\nexport function baseSh(\n cmd: string,\n callback: (write: (str: string) => void, end: () => void) => void = () => {},\n cwd: string | URL | undefined = undefined,\n passOnNonZeroExitCode: boolean | undefined = undefined,\n env: NodeJS.ProcessEnv | undefined = undefined,\n detached?: boolean,\n): Promise {\n const cp = spawn(cmd, { shell: true, detached, cwd, env: { ...process.env, ...(env ?? {}) } });\n const interruptCP = function () {\n cp.emit('SIGINT');\n };\n\n try {\n const promise = wrap_exec({ callback, cp, passOnNonZeroExitCode });\n if (!detached) {\n return promise;\n }\n } finally {\n process.removeListener('SIGINT', interruptCP);\n }\n return Promise.resolve({\n __typename: 'ShResult',\n kind: 'detached',\n allout: 'Result is detached',\n stderr: '',\n stdout: 'Result is detached',\n code: 0,\n success: true,\n });\n}\n/**\n * The most basic sh. Sends output to console if anything goes wrong, that is, if status code != 0\n * @param cmd the command to run\n * @param callback the callback to run\n * @returns All output from the command.\n */\n\nexport const simpleSh = async (\n cmd: string,\n callback: (write: (str: string) => void, end: () => void) => void = () => {},\n cwd: string | URL | undefined = undefined,\n): Promise => {\n const res = await baseSh(cmd, callback, cwd);\n if (res.code !== 0) {\n console.log(res.stdout);\n console.error(res.stderr);\n throw new Error(res.stderr);\n }\n return res.allout;\n};\n","ranges":[{"start":{"line":14,"column":39},"end":{"line":66,"column":4},"startByte":452,"endByte":1767},{"start":{"line":18,"column":19},"end":{"line":22,"column":6},"startByte":590,"endByte":710},{"start":{"line":24,"column":17},"end":{"line":26,"column":6},"startByte":729,"endByte":775},{"start":{"line":32,"column":26},"end":{"line":35,"column":6},"startByte":858,"endByte":933},{"start":{"line":36,"column":26},"end":{"line":39,"column":6},"startByte":961,"endByte":1036},{"start":{"line":40,"column":20},"end":{"line":51,"column":6},"startByte":1058,"endByte":1323},{"start":{"line":52,"column":20},"end":{"line":65,"column":6},"startByte":1345,"endByte":1761},{"start":{"line":71,"column":71},"end":{"line":71,"column":79},"startByte":1882,"endByte":1890},{"start":{"line":107,"column":25},"end":{"line":119,"column":2},"startByte":2904,"endByte":3267},{"start":{"line":109,"column":71},"end":{"line":109,"column":79},"startByte":2997,"endByte":3005}],"reason":null,"id":"bd6639f7-8083-4a62-8fa8-f71e03e27b20"} +{"__typename":"Match","messages":[],"variables":[{"name":"$new_files","scopedName":"0_0_$new_files","ranges":[]},{"name":"$program","scopedName":"0_1_$program","ranges":[]},{"name":"$filename","scopedName":"0_2_$filename","ranges":[]},{"name":"$absolute_filename","scopedName":"0_3_$absolute_filename","ranges":[]},{"name":"$GLOBAL_IMPORTED_SOURCES","scopedName":"0_4_$GLOBAL_IMPORTED_SOURCES","ranges":[]},{"name":"$GLOBAL_IMPORTED_NAMES","scopedName":"0_5_$GLOBAL_IMPORTED_NAMES","ranges":[]},{"name":"$body","scopedName":"2_0_$body","ranges":[{"start":{"line":1,"column":1},"end":{"line":14,"column":2},"startByte":0,"endByte":256}]},{"name":"$p","scopedName":"7_0_$p","ranges":[]},{"name":"$all_imports","scopedName":"7_1_$all_imports","ranges":[]},{"name":"$h","scopedName":"7_2_$h","ranges":[]},{"name":"$statements","scopedName":"7_3_$statements","ranges":[]},{"name":"$anchor","scopedName":"7_4_$anchor","ranges":[]},{"name":"$p","scopedName":"8_0_$p","ranges":[]},{"name":"$all_imports","scopedName":"8_1_$all_imports","ranges":[]},{"name":"$our_source","scopedName":"8_2_$our_source","ranges":[]},{"name":"$imported_names","scopedName":"8_3_$imported_names","ranges":[]},{"name":"$joined_imported_names","scopedName":"8_4_$joined_imported_names","ranges":[]},{"name":"$p","scopedName":"9_0_$p","ranges":[]},{"name":"$our_source","scopedName":"9_1_$our_source","ranges":[]},{"name":"$imported_names","scopedName":"9_2_$imported_names","ranges":[]},{"name":"$all_imports","scopedName":"9_3_$all_imports","ranges":[]},{"name":"$name","scopedName":"9_4_$name","ranges":[]},{"name":"$our_source","scopedName":"10_0_$our_source","ranges":[]},{"name":"$joined_imported_names","scopedName":"10_1_$joined_imported_names","ranges":[]},{"name":"$imports","scopedName":"10_2_$imports","ranges":[]},{"name":"$source","scopedName":"10_3_$source","ranges":[]},{"name":"$statement","scopedName":"10_4_$statement","ranges":[]},{"name":"$imports","scopedName":"11_0_$imports","ranges":[]},{"name":"$source","scopedName":"11_1_$source","ranges":[]},{"name":"$match","scopedName":"12_0_$match","ranges":[{"start":{"line":4,"column":15},"end":{"line":9,"column":4},"startByte":81,"endByte":172},{"start":{"line":6,"column":17},"end":{"line":8,"column":6},"startByte":129,"endByte":168},{"start":{"line":13,"column":10},"end":{"line":13,"column":39},"startByte":223,"endByte":252}]}],"sourceFile":"small.ts","content":"// This is a smaller example\nfunction() { \n console.log(\"thing\");\n const foo = () => {\n console.log(\"bar\");\n const bar = () => {\n console.log(\"baz\");\n }\n };\n // Not this\n // Delay a bit\n // Wow\n handle(() => { console.log(\"foo\"); });\n}","ranges":[{"start":{"line":4,"column":15},"end":{"line":9,"column":4},"startByte":81,"endByte":172},{"start":{"line":6,"column":17},"end":{"line":8,"column":6},"startByte":129,"endByte":168},{"start":{"line":13,"column":10},"end":{"line":13,"column":39},"startByte":223,"endByte":252}],"reason":null,"id":"6c923219-04fb-4b3b-be3a-8e286d8b7198"} +{"__typename":"Match","messages":[],"variables":[{"name":"$new_files","scopedName":"0_0_$new_files","ranges":[]},{"name":"$program","scopedName":"0_1_$program","ranges":[]},{"name":"$filename","scopedName":"0_2_$filename","ranges":[]},{"name":"$absolute_filename","scopedName":"0_3_$absolute_filename","ranges":[]},{"name":"$GLOBAL_IMPORTED_SOURCES","scopedName":"0_4_$GLOBAL_IMPORTED_SOURCES","ranges":[]},{"name":"$GLOBAL_IMPORTED_NAMES","scopedName":"0_5_$GLOBAL_IMPORTED_NAMES","ranges":[]},{"name":"$body","scopedName":"2_0_$body","ranges":[{"start":{"line":1,"column":1},"end":{"line":120,"column":1},"startByte":0,"endByte":3269}]},{"name":"$p","scopedName":"7_0_$p","ranges":[]},{"name":"$all_imports","scopedName":"7_1_$all_imports","ranges":[]},{"name":"$h","scopedName":"7_2_$h","ranges":[]},{"name":"$statements","scopedName":"7_3_$statements","ranges":[]},{"name":"$anchor","scopedName":"7_4_$anchor","ranges":[]},{"name":"$p","scopedName":"8_0_$p","ranges":[]},{"name":"$all_imports","scopedName":"8_1_$all_imports","ranges":[]},{"name":"$our_source","scopedName":"8_2_$our_source","ranges":[]},{"name":"$imported_names","scopedName":"8_3_$imported_names","ranges":[]},{"name":"$joined_imported_names","scopedName":"8_4_$joined_imported_names","ranges":[]},{"name":"$p","scopedName":"9_0_$p","ranges":[]},{"name":"$our_source","scopedName":"9_1_$our_source","ranges":[]},{"name":"$imported_names","scopedName":"9_2_$imported_names","ranges":[]},{"name":"$all_imports","scopedName":"9_3_$all_imports","ranges":[]},{"name":"$name","scopedName":"9_4_$name","ranges":[]},{"name":"$our_source","scopedName":"10_0_$our_source","ranges":[]},{"name":"$joined_imported_names","scopedName":"10_1_$joined_imported_names","ranges":[]},{"name":"$imports","scopedName":"10_2_$imports","ranges":[]},{"name":"$source","scopedName":"10_3_$source","ranges":[]},{"name":"$statement","scopedName":"10_4_$statement","ranges":[]},{"name":"$imports","scopedName":"11_0_$imports","ranges":[]},{"name":"$source","scopedName":"11_1_$source","ranges":[]},{"name":"$match","scopedName":"12_0_$match","ranges":[{"start":{"line":14,"column":39},"end":{"line":66,"column":4},"startByte":452,"endByte":1767},{"start":{"line":18,"column":19},"end":{"line":22,"column":6},"startByte":590,"endByte":710},{"start":{"line":24,"column":17},"end":{"line":26,"column":6},"startByte":729,"endByte":775},{"start":{"line":32,"column":26},"end":{"line":35,"column":6},"startByte":858,"endByte":933},{"start":{"line":36,"column":26},"end":{"line":39,"column":6},"startByte":961,"endByte":1036},{"start":{"line":40,"column":20},"end":{"line":51,"column":6},"startByte":1058,"endByte":1323},{"start":{"line":52,"column":20},"end":{"line":65,"column":6},"startByte":1345,"endByte":1761},{"start":{"line":71,"column":71},"end":{"line":71,"column":79},"startByte":1882,"endByte":1890},{"start":{"line":107,"column":25},"end":{"line":119,"column":2},"startByte":2904,"endByte":3267},{"start":{"line":109,"column":71},"end":{"line":109,"column":79},"startByte":2997,"endByte":3005}]}],"sourceFile":"big.ts","content":"import type { ChildProcessWithoutNullStreams } from 'child_process';\nimport { spawn } from 'child_process';\nimport type { stdlib } from '@getgrit/api';\n\nexport function wrap_exec({\n callback,\n cp,\n passOnNonZeroExitCode,\n}: {\n callback?: (write: (str: string) => void, end: () => void) => void;\n cp: ChildProcessWithoutNullStreams;\n passOnNonZeroExitCode: boolean | undefined;\n}): Promise {\n return new Promise((resolve) => {\n const allout = [] as string[];\n const stdout = [] as string[];\n const stderr = [] as string[];\n const write = (str: string): void => {\n process.stdin.cork();\n process.stdin.write(str);\n process.stdin.uncork();\n };\n\n const end = (): void => {\n process.stdin.end();\n };\n\n if (callback) {\n callback(write, end);\n }\n\n cp.stdout.on('data', (data: string) => {\n stdout.push(data);\n allout.push(data);\n });\n cp.stderr.on('data', (data: string) => {\n stderr.push(data);\n allout.push(data);\n });\n cp.on('error', (e) => {\n resolve({\n __typename: 'ShResult',\n kind: 'direct',\n success: false,\n code: -1,\n allout: allout.join(''),\n stdout: stdout.join(''),\n stderr: stderr.join(''),\n message: e.message,\n });\n });\n cp.on('close', (code: number) => {\n // Trailing info is more valuable than truncated.\n const message = stderr.join('').slice(-2000);\n resolve({\n __typename: 'ShResult',\n kind: 'direct',\n success: passOnNonZeroExitCode ? true : code === 0,\n code: code || 0,\n allout: allout.join(''),\n stdout: stdout.join(''),\n stderr: stderr.join(''),\n message,\n });\n });\n });\n}\n\nexport function baseSh(\n cmd: string,\n callback: (write: (str: string) => void, end: () => void) => void = () => {},\n cwd: string | URL | undefined = undefined,\n passOnNonZeroExitCode: boolean | undefined = undefined,\n env: NodeJS.ProcessEnv | undefined = undefined,\n detached?: boolean,\n): Promise {\n const cp = spawn(cmd, { shell: true, detached, cwd, env: { ...process.env, ...(env ?? {}) } });\n const interruptCP = function () {\n cp.emit('SIGINT');\n };\n\n try {\n const promise = wrap_exec({ callback, cp, passOnNonZeroExitCode });\n if (!detached) {\n return promise;\n }\n } finally {\n process.removeListener('SIGINT', interruptCP);\n }\n return Promise.resolve({\n __typename: 'ShResult',\n kind: 'detached',\n allout: 'Result is detached',\n stderr: '',\n stdout: 'Result is detached',\n code: 0,\n success: true,\n });\n}\n/**\n * The most basic sh. Sends output to console if anything goes wrong, that is, if status code != 0\n * @param cmd the command to run\n * @param callback the callback to run\n * @returns All output from the command.\n */\n\nexport const simpleSh = async (\n cmd: string,\n callback: (write: (str: string) => void, end: () => void) => void = () => {},\n cwd: string | URL | undefined = undefined,\n): Promise => {\n const res = await baseSh(cmd, callback, cwd);\n if (res.code !== 0) {\n console.log(res.stdout);\n console.error(res.stderr);\n throw new Error(res.stderr);\n }\n return res.allout;\n};\n","ranges":[{"start":{"line":14,"column":39},"end":{"line":66,"column":4},"startByte":452,"endByte":1767},{"start":{"line":18,"column":19},"end":{"line":22,"column":6},"startByte":590,"endByte":710},{"start":{"line":24,"column":17},"end":{"line":26,"column":6},"startByte":729,"endByte":775},{"start":{"line":32,"column":26},"end":{"line":35,"column":6},"startByte":858,"endByte":933},{"start":{"line":36,"column":26},"end":{"line":39,"column":6},"startByte":961,"endByte":1036},{"start":{"line":40,"column":20},"end":{"line":51,"column":6},"startByte":1058,"endByte":1323},{"start":{"line":52,"column":20},"end":{"line":65,"column":6},"startByte":1345,"endByte":1761},{"start":{"line":71,"column":71},"end":{"line":71,"column":79},"startByte":1882,"endByte":1890},{"start":{"line":107,"column":25},"end":{"line":119,"column":2},"startByte":2904,"endByte":3267},{"start":{"line":109,"column":71},"end":{"line":109,"column":79},"startByte":2997,"endByte":3005}],"reason":null,"id":"48a60220-ecef-4d0c-857e-dcb9ce3e7cb3"} {"__typename":"AllDone","processed":2,"found":2,"reason":"allMatchesFound"}