Skip to content

Commit 7b2fc46

Browse files
committed
Use tarantool.debug.getsources function instead tarantool_builtin_module
1 parent 242ed9f commit 7b2fc46

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

debugger/debugger.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ import {Send} from "./send";
3636
import {Breakpoint} from "./breakpoint";
3737
import {Thread, mainThread, mainThreadName, isThread} from "./thread";
3838

39+
import * as tarantool from "tarantool";
40+
3941
export interface Var {
4042
val: unknown;
4143
type: string;
@@ -509,12 +511,13 @@ export namespace Debugger {
509511
if (!path) {
510512
Send.error(`Bad expression: ${inp}`);
511513
} else {
512-
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
513-
const content: string | null = tarantool_builtin_module(`@${path}`);
514+
// eslint-disable-next-line max-len
515+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
516+
const content: string | null = tarantool.debug.getsources(`@${path}`);
514517
if (typeof content === "string") {
515518
Send.result(content);
516519
} else {
517-
Send.error(`Nullable tarantool_builtin_module response: @${path}`);
520+
Send.error(`Nullable tarantool.debug.getsources response: @${path}`);
518521
}
519522
}
520523
} else if (inp === "autocont" || inp === "autocontinue") {

debugger/tarantool.d.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
declare function tarantool_builtin_module(filePath: string): string | null;
1+
declare module "tarantool" {
2+
export namespace debug {
3+
export function getsources(filePath: string): string | null;
4+
}
5+
}

debugger/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"noHeader": true,
2222
"luaBundle": "lldebugger.lua",
2323
"luaBundleEntry": "lldebugger.ts",
24-
"luaLibImport": "none"
24+
"luaLibImport": "none",
25+
"noResolvePaths": ["tarantool"]
2526
}
2627
}

0 commit comments

Comments
 (0)