From 1b9f13e767562b3e228f32689c45d1d858e8b2ef Mon Sep 17 00:00:00 2001 From: oltolm Date: Thu, 14 Mar 2024 01:04:44 +0100 Subject: [PATCH] set "noImplicitAny" to true and fix the problems --- package-lock.json | 51 +++++++++++++++++++++++++++++ package.json | 1 + src/backend/backend.ts | 4 +-- src/backend/gdb_expansion.ts | 11 ++++--- src/backend/mi2/mi2.ts | 42 ++++++++++++------------ src/backend/mi2/mi2lldb.ts | 4 +-- src/backend/mi2/mi2mago.ts | 4 +-- src/backend/mi_parse.ts | 21 +++++++----- src/frontend/extension.ts | 4 +-- src/mibase.ts | 22 ++++++------- src/test/unit/gdb_expansion.test.ts | 3 +- tsconfig.json | 3 +- 12 files changed, 114 insertions(+), 56 deletions(-) diff --git a/package-lock.json b/package-lock.json index b0b94fcd..aa8b7454 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,7 @@ "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/mocha": "^5.2.6", "@types/node": "^11.11.3", + "@types/ssh2": "^1.15.0", "@types/vscode": "^1.55.0", "@typescript-eslint/eslint-plugin": "^5.22.0", "@typescript-eslint/parser": "^5.22.0", @@ -972,6 +973,24 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "node_modules/@types/ssh2": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@types/ssh2/-/ssh2-1.15.0.tgz", + "integrity": "sha512-YcT8jP5F8NzWeevWvcyrrLB3zcneVjzYY9ZDSMAMboI+2zR1qYWFhwsyOFVzT7Jorn67vqxC0FRiw8YyG9P1ww==", + "dev": true, + "dependencies": { + "@types/node": "^18.11.18" + } + }, + "node_modules/@types/ssh2/node_modules/@types/node": { + "version": "18.19.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.24.tgz", + "integrity": "sha512-eghAz3gnbQbvnHqB+mgB2ZR3aH6RhdEmHGS48BnV75KceQPHqabkxKI0BbUSsqhqy2Ddhc2xD/VAR9ySZd57Lw==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, "node_modules/@types/vscode": { "version": "1.62.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.62.0.tgz", @@ -5361,6 +5380,12 @@ "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", "dev": true }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/unique-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", @@ -6445,6 +6470,26 @@ "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", "dev": true }, + "@types/ssh2": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/@types/ssh2/-/ssh2-1.15.0.tgz", + "integrity": "sha512-YcT8jP5F8NzWeevWvcyrrLB3zcneVjzYY9ZDSMAMboI+2zR1qYWFhwsyOFVzT7Jorn67vqxC0FRiw8YyG9P1ww==", + "dev": true, + "requires": { + "@types/node": "^18.11.18" + }, + "dependencies": { + "@types/node": { + "version": "18.19.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.24.tgz", + "integrity": "sha512-eghAz3gnbQbvnHqB+mgB2ZR3aH6RhdEmHGS48BnV75KceQPHqabkxKI0BbUSsqhqy2Ddhc2xD/VAR9ySZd57Lw==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } + } + } + }, "@types/vscode": { "version": "1.62.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.62.0.tgz", @@ -9654,6 +9699,12 @@ "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", "dev": true }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "unique-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", diff --git a/package.json b/package.json index a57ce891..fb20330b 100644 --- a/package.json +++ b/package.json @@ -1112,6 +1112,7 @@ "@istanbuljs/nyc-config-typescript": "^1.0.2", "@types/mocha": "^5.2.6", "@types/node": "^11.11.3", + "@types/ssh2": "^1.15.0", "@types/vscode": "^1.55.0", "@typescript-eslint/eslint-plugin": "^5.22.0", "@typescript-eslint/parser": "^5.22.0", diff --git a/src/backend/backend.ts b/src/backend/backend.ts index 747c0188..dcf785e8 100644 --- a/src/backend/backend.ts +++ b/src/backend/backend.ts @@ -60,8 +60,8 @@ export interface IBackend { attach(cwd: string, executable: string, target: string, autorun: string[]): Thenable; connect(cwd: string, executable: string, target: string, autorun: string[]): Thenable; start(runToStart: boolean): Thenable; - stop(); - detach(); + stop(): void; + detach(): void; interrupt(): Thenable; continue(): Thenable; next(): Thenable; diff --git a/src/backend/gdb_expansion.ts b/src/backend/gdb_expansion.ts index d2c83e41..250a0d03 100644 --- a/src/backend/gdb_expansion.ts +++ b/src/backend/gdb_expansion.ts @@ -1,3 +1,4 @@ +import { VariableObject } from "./backend"; import { MINode } from "./mi_parse"; const resultRegex = /^([a-zA-Z_\-][a-zA-Z0-9_\-]*|\[\d+\])\s*=\s*/; @@ -29,7 +30,7 @@ export function isExpandable(value: string): number { else return 0; } -export function expandValue(variableCreate: Function, value: string, root: string = "", extra: any = undefined): any { +export function expandValue(variableCreate: (arg: VariableObject | string, options?: any) => any, value: string, root: string = "", extra: any = undefined): any { const parseCString = () => { value = value.trim(); if (value[0] != '"' && value[0] != '\'') @@ -56,10 +57,10 @@ export function expandValue(variableCreate: Function, value: string, root: strin }; const stack = [root]; - let parseValue, parseCommaResult, parseCommaValue, parseResult, createValue; + let parseValue: () => any, parseCommaResult: (pushToStack: boolean) => any, parseCommaValue: () => any, parseResult: (pushToStack: boolean) => any, createValue: (name: string, val: any) => any; let variable = ""; - const getNamespace = (variable) => { + const getNamespace = (variable: string) => { let namespace = ""; let prefix = ""; stack.push(variable); @@ -209,7 +210,7 @@ export function expandValue(variableCreate: Function, value: string, root: strin return createValue(name, val); }; - createValue = (name, val) => { + createValue = (name: string, val: any) => { let ref = 0; if (typeof val == "object") { ref = variableCreate(val); @@ -223,7 +224,7 @@ export function expandValue(variableCreate: Function, value: string, root: strin val = "Object@" + val; } } else if (typeof val == "string" && val.startsWith("@0x")) { - ref = variableCreate(getNamespace("*&" + name.substr)); + ref = variableCreate(getNamespace("*&" + name.substring(1))); val = "Ref" + val; } else if (typeof val == "string" && val.startsWith("<...>")) { ref = variableCreate(getNamespace(name)); diff --git a/src/backend/mi2/mi2.ts b/src/backend/mi2/mi2.ts index 8963b7e9..bc814cc8 100644 --- a/src/backend/mi2/mi2.ts +++ b/src/backend/mi2/mi2.ts @@ -6,7 +6,7 @@ import * as linuxTerm from '../linux/console'; import * as net from "net"; import * as fs from "fs"; import * as path from "path"; -import { Client } from "ssh2"; +import { Client, ClientChannel, ExecOptions } from "ssh2"; export function escape(str: string) { return str.replace(/\\/g, "\\\\").replace(/"/g, "\\\""); @@ -29,7 +29,7 @@ export class MI2 extends EventEmitter implements IBackend { super(); if (procEnv) { - const env = {}; + const env: { [key: string]: string } = {}; // Duplicate process.env so we don't override it for (const key in process.env) if (process.env.hasOwnProperty(key)) @@ -57,8 +57,8 @@ export class MI2 extends EventEmitter implements IBackend { this.process = ChildProcess.spawn(this.application, args, { cwd: cwd, env: this.procEnv }); this.process.stdout.on("data", this.stdout.bind(this)); this.process.stderr.on("data", this.stderr.bind(this)); - this.process.on("exit", (() => { this.emit("quit"); }).bind(this)); - this.process.on("error", ((err) => { this.emit("launcherror", err); }).bind(this)); + this.process.on("exit", () => this.emit("quit")); + this.process.on("error", err => this.emit("launcherror", err)); const promises = this.initCommands(target, cwd); if (procArgs && procArgs.length) promises.push(this.sendCommand("exec-arguments " + procArgs)); @@ -137,7 +137,7 @@ export class MI2 extends EventEmitter implements IBackend { this.sshConn.on("ready", () => { this.log("stdout", "Running " + this.application + " over ssh..."); - const execArgs: any = {}; + const execArgs: ExecOptions = {}; if (args.forwardX11) { execArgs.x11 = { single: false, @@ -150,7 +150,7 @@ export class MI2 extends EventEmitter implements IBackend { if (err) { this.log("stderr", "Could not run " + this.application + "(" + sshCMD + ") over ssh!"); if (err === undefined) { - err = ""; + err = new Error(""); } this.log("stderr", err.toString()); this.emit("quit"); @@ -161,10 +161,10 @@ export class MI2 extends EventEmitter implements IBackend { this.stream = stream; stream.on("data", this.stdout.bind(this)); stream.stderr.on("data", this.stderr.bind(this)); - stream.on("exit", (() => { + stream.on("exit", () => { this.emit("quit"); this.sshConn.end(); - }).bind(this)); + }); const promises = this.initCommands(target, cwd, attach); promises.push(this.sendCommand("environment-cd \"" + escape(cwd) + "\"")); if (attach) { @@ -181,7 +181,7 @@ export class MI2 extends EventEmitter implements IBackend { }).on("error", (err) => { this.log("stderr", "Error running " + this.application + " over ssh!"); if (err === undefined) { - err = ""; + err = new Error(""); } this.log("stderr", err.toString()); this.emit("quit"); @@ -235,8 +235,8 @@ export class MI2 extends EventEmitter implements IBackend { this.process = ChildProcess.spawn(this.application, args, { cwd: cwd, env: this.procEnv }); this.process.stdout.on("data", this.stdout.bind(this)); this.process.stderr.on("data", this.stderr.bind(this)); - this.process.on("exit", (() => { this.emit("quit"); }).bind(this)); - this.process.on("error", ((err) => { this.emit("launcherror", err); }).bind(this)); + this.process.on("exit", () => this.emit("quit")); + this.process.on("error", err => this.emit("launcherror", err)); const promises = this.initCommands(target, cwd, true); if (target.startsWith("extended-remote")) { promises.push(this.sendCommand("target-select " + target)); @@ -267,8 +267,8 @@ export class MI2 extends EventEmitter implements IBackend { this.process = ChildProcess.spawn(this.application, args, { cwd: cwd, env: this.procEnv }); this.process.stdout.on("data", this.stdout.bind(this)); this.process.stderr.on("data", this.stderr.bind(this)); - this.process.on("exit", (() => { this.emit("quit"); }).bind(this)); - this.process.on("error", ((err) => { this.emit("launcherror", err); }).bind(this)); + this.process.on("exit", () => this.emit("quit")); + this.process.on("error", err => this.emit("launcherror", err)); const promises = this.initCommands(target, cwd, true); promises.push(this.sendCommand("target-select remote " + target)); promises.push(...autorun.map(value => { return this.sendUserInput(value); })); @@ -279,7 +279,7 @@ export class MI2 extends EventEmitter implements IBackend { }); } - stdout(data) { + stdout(data: any) { if (trace) this.log("stderr", "stdout: " + data); if (typeof data == "string") @@ -298,7 +298,7 @@ export class MI2 extends EventEmitter implements IBackend { } } - stderr(data) { + stderr(data: any) { if (typeof data == "string") this.errbuf += data; else @@ -563,7 +563,7 @@ export class MI2 extends EventEmitter implements IBackend { loadBreakPoints(breakpoints: Breakpoint[]): Thenable<[boolean, Breakpoint][]> { if (trace) this.log("stderr", "loadBreakPoints"); - const promisses = []; + const promisses: Thenable<[boolean, Breakpoint]>[] = []; breakpoints.forEach(breakpoint => { promisses.push(this.addBreakPoint(breakpoint)); }); @@ -651,7 +651,7 @@ export class MI2 extends EventEmitter implements IBackend { if (trace) this.log("stderr", "clearBreakPoints"); return new Promise((resolve, reject) => { - const promises = []; + const promises: Thenable[] = []; const breakpoints = this.breakpoints; this.breakpoints = new Map(); breakpoints.forEach((k, index) => { @@ -709,7 +709,7 @@ export class MI2 extends EventEmitter implements IBackend { const result = await this.sendCommand(["stack-list-frames"].concat(options).join(" ")); const stack = result.result("stack"); - return stack.map(element => { + return stack.map((element: any) => { const level = MINode.valueOf(element, "@frame.level"); const addr = MINode.valueOf(element, "@frame.addr"); const func = MINode.valueOf(element, "@frame.func"); @@ -856,7 +856,7 @@ export class MI2 extends EventEmitter implements IBackend { //TODO: add `from` and `to` arguments const res = await this.sendCommand(`var-list-children --all-values ${this.quote(name)}`); const children = res.result("children") || []; - const omg: VariableObject[] = children.map(child => new VariableObject(child[1])); + const omg: VariableObject[] = children.map((child: any) => new VariableObject(child[1])); return omg; } @@ -945,6 +945,6 @@ export class MI2 extends EventEmitter implements IBackend { protected buffer: string; protected errbuf: string; protected process: ChildProcess.ChildProcess; - protected stream; - protected sshConn; + protected stream: ClientChannel; + protected sshConn: Client; } diff --git a/src/backend/mi2/mi2lldb.ts b/src/backend/mi2/mi2lldb.ts index e04f118c..600c7931 100644 --- a/src/backend/mi2/mi2lldb.ts +++ b/src/backend/mi2/mi2lldb.ts @@ -41,8 +41,8 @@ export class MI2_LLDB extends MI2 { this.process = ChildProcess.spawn(this.application, args, { cwd: cwd, env: this.procEnv }); this.process.stdout.on("data", this.stdout.bind(this)); this.process.stderr.on("data", this.stderr.bind(this)); - this.process.on("exit", (() => { this.emit("quit"); }).bind(this)); - this.process.on("error", ((err) => { this.emit("launcherror", err); }).bind(this)); + this.process.on("exit", () => this.emit("quit")); + this.process.on("error", err => this.emit("launcherror", err)); const promises = this.initCommands(target, cwd, true); promises.push(this.sendCommand("file-exec-and-symbols \"" + escape(executable) + "\"")); promises.push(this.sendCommand("target-attach " + target)); diff --git a/src/backend/mi2/mi2mago.ts b/src/backend/mi2/mi2mago.ts index ab5aee6d..fc63d6a6 100644 --- a/src/backend/mi2/mi2mago.ts +++ b/src/backend/mi2/mi2mago.ts @@ -9,8 +9,8 @@ export class MI2_Mago extends MI2_LLDB { this.sendCommand(command).then((result) => { const stack = result.resultRecords.results; const ret: Stack[] = []; - const remaining = []; - const addToStack = (element) => { + const remaining: any = []; + const addToStack = (element: any) => { const level = MINode.valueOf(element, "frame.level"); const addr = MINode.valueOf(element, "frame.addr"); const func = MINode.valueOf(element, "frame.func"); diff --git a/src/backend/mi_parse.ts b/src/backend/mi_parse.ts index 75a64ae3..f3f4cf8b 100644 --- a/src/backend/mi_parse.ts +++ b/src/backend/mi_parse.ts @@ -150,19 +150,19 @@ export function parseMI(output: string): MINode { */ let token = undefined; - const outOfBandRecord = []; + const outOfBandRecord: { isStream: boolean, type: string, asyncClass: string, output: [string, any][], content: string }[] = []; let resultRecords = undefined; const asyncRecordType = { "*": "exec", "+": "status", "=": "notify" - }; + } as const; const streamRecordType = { "~": "console", "@": "target", "&": "log" - }; + } as const; const parseCString = () => { if (output[0] != '"') @@ -192,7 +192,7 @@ export function parseMI(output: string): MINode { return str; }; - let parseValue, parseCommaResult, parseCommaValue, parseResult; + let parseValue: () => any, parseCommaResult: () => any, parseCommaValue: () => any, parseResult: () => any; const parseTupleOrList = () => { if (output[0] != '{' && output[0] != '[') @@ -274,9 +274,10 @@ export function parseMI(output: string): MINode { output = output.substring(classMatch[0].length); const asyncRecord = { isStream: false, - type: asyncRecordType[match[2]], + type: asyncRecordType[match[2] as keyof typeof asyncRecordType], asyncClass: classMatch[0], - output: [] + output: [] as any, + content: "" }; let result; while (result = parseCommaResult()) @@ -285,8 +286,10 @@ export function parseMI(output: string): MINode { } else if (match[3]) { const streamRecord = { isStream: true, - type: streamRecordType[match[3]], - content: parseCString() + type: streamRecordType[match[3] as keyof typeof streamRecordType], + content: parseCString(), + output: [] as [string, any][], + asyncClass: "" }; outOfBandRecord.push(streamRecord); } @@ -310,5 +313,5 @@ export function parseMI(output: string): MINode { output = output.replace(newlineRegex, ""); } - return new MINode(token, outOfBandRecord || [], resultRecords); + return new MINode(token, outOfBandRecord || [], resultRecords); } diff --git a/src/frontend/extension.ts b/src/frontend/extension.ts index 222be7b3..eaa65583 100644 --- a/src/frontend/extension.ts +++ b/src/frontend/extension.ts @@ -70,7 +70,7 @@ function examineMemory() { else return vscode.window.showErrorMessage("No debugging sessions available"); } - const pickedFile = (file) => { + const pickedFile = (file: string) => { vscode.window.showInputBox({ placeHolder: "Memory Location or Range", validateInput: range => getMemoryRange(range) === undefined ? "Range must either be in format 0xF00-0xF01, 0xF100+32 or 0xABC154" : "" }).then(range => { vscode.window.showTextDocument(vscode.Uri.parse("debugmemory://" + file + "?" + getMemoryRange(range))); }); @@ -90,7 +90,7 @@ class MemoryContentProvider implements vscode.TextDocumentContentProvider { provideTextDocumentContent(uri: vscode.Uri, token: vscode.CancellationToken): Thenable { return new Promise((resolve, reject) => { const conn = net.connect(path.join(os.tmpdir(), "code-debug-sockets", uri.authority.toLowerCase())); - let from, to; + let from: number, to: number; let highlightAt = -1; const splits = uri.query.split("&"); if (splits[0].split("=")[0] == "at") { diff --git a/src/mibase.ts b/src/mibase.ts index e6cb2054..a342925a 100644 --- a/src/mibase.ts +++ b/src/mibase.ts @@ -13,7 +13,7 @@ import * as fs from "fs"; import { SourceFileMap } from "./source_file_map"; class ExtendedVariable { - constructor(public name, public options) { + constructor(public name: string, public options: { "arg": any }) { } } @@ -75,7 +75,7 @@ export class MI2DebugSession extends DebugSession { func = rawCmd.substring(0, spaceIndex); args = JSON.parse(rawCmd.substring(spaceIndex + 1)); } - Promise.resolve(this.miDebugger[func].apply(this.miDebugger, args)).then(data => { + Promise.resolve((this.miDebugger as any)[func].apply(this.miDebugger, args)).then(data => { c.write(data.toString()); }); }); @@ -220,15 +220,15 @@ export class MI2DebugSession extends DebugSession { } protected override setFunctionBreakPointsRequest(response: DebugProtocol.SetFunctionBreakpointsResponse, args: DebugProtocol.SetFunctionBreakpointsArguments): void { - const all = []; + const all: Thenable<[boolean, Breakpoint]>[] = []; args.breakpoints.forEach(brk => { all.push(this.miDebugger.addBreakPoint({ raw: brk.name, condition: brk.condition, countCondition: brk.hitCondition })); }); Promise.all(all).then(brkpoints => { - const finalBrks = []; + const finalBrks: DebugProtocol.Breakpoint[] = []; brkpoints.forEach(brkp => { if (brkp[0]) - finalBrks.push({ line: brkp[1].line }); + finalBrks.push({ line: brkp[1].line, verified: true }); }); response.body = { breakpoints: finalBrks @@ -250,7 +250,7 @@ export class MI2DebugSession extends DebugSession { return this.miDebugger.addBreakPoint({ file: path, line: brk.line, condition: brk.condition, countCondition: brk.hitCondition }); }); Promise.all(all).then(brkpoints => { - const finalBrks = []; + const finalBrks: DebugProtocol.Breakpoint[] = []; brkpoints.forEach(brkp => { // TODO: Currently all breakpoints returned are marked as verified, // which leads to verified breakpoints on a broken lldb. @@ -434,9 +434,9 @@ export class MI2DebugSession extends DebugSession { const variables: DebugProtocol.Variable[] = []; const id: VariableScope | string | VariableObject | ExtendedVariable = this.variableHandles.get(args.variablesReference); - const createVariable = (arg, options?) => { + const createVariable = (arg: string | VariableObject, options?: any) => { if (options) - return this.variableHandles.create(new ExtendedVariable(arg, options)); + return this.variableHandles.create(new ExtendedVariable(typeof arg === 'string' ? arg : arg.name, options)); else return this.variableHandles.create(arg); }; @@ -473,7 +473,7 @@ export class MI2DebugSession extends DebugSession { try { const changes = await this.miDebugger.varUpdate(varObjName); const changelist = changes.result("changelist"); - changelist.forEach((change) => { + changelist.forEach((change: any) => { const name = MINode.valueOf(change, "name"); const vId = this.variableHandlesReverse[name]; const v = this.variableHandles.get(vId) as any; @@ -582,7 +582,7 @@ export class MI2DebugSession extends DebugSession { } else if (id instanceof ExtendedVariable) { const varReq = id; if (varReq.options.arg) { - const strArr = []; + const strArr: DebugProtocol.Variable[] = []; let argsPart = true; let arrIndex = 0; const submit = () => { @@ -767,7 +767,7 @@ export class MI2DebugSession extends DebugSession { } -function prettyStringArray(strings) { +function prettyStringArray(strings: any) { if (typeof strings == "object") { if (strings.length !== undefined) return strings.join(", "); diff --git a/src/test/unit/gdb_expansion.test.ts b/src/test/unit/gdb_expansion.test.ts index 9f00a8cc..2bc5f085 100644 --- a/src/test/unit/gdb_expansion.test.ts +++ b/src/test/unit/gdb_expansion.test.ts @@ -1,8 +1,9 @@ import * as assert from 'assert'; import { expandValue, isExpandable } from '../../backend/gdb_expansion'; +import { VariableObject } from '../../backend/backend'; suite("GDB Value Expansion", () => { - const variableCreate = (variable) => { return { expanded: variable }; }; + const variableCreate = (variable: string) => ({ expanded: variable }); test("Various values", () => { assert.strictEqual(isExpandable(`false`), 0); assert.strictEqual(expandValue(variableCreate, `false`), "false"); diff --git a/tsconfig.json b/tsconfig.json index 915ff8fc..97824ed7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,8 @@ { "name": "tslint-language-service" } - ] + ], + "noImplicitAny": true }, "exclude": [ "node_modules",