Skip to content

Commit 088d265

Browse files
committed
correct run/debug testcase from code lens
1 parent 0d29150 commit 088d265

File tree

2 files changed

+31
-20
lines changed

2 files changed

+31
-20
lines changed

tsconfig.json

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
{
22
"compilerOptions": {
3+
"baseUrl": ".",
34
"module": "commonjs",
4-
"target": "es6",
5+
"target": "es2018",
56
"outDir": "out",
67
"lib": [
7-
"ES2019"
8+
"es6",
9+
"es2018",
10+
"dom",
11+
"ES2019",
12+
"ES2020"
813
],
914
"sourceMap": true,
1015
"rootDir": "vscode-client",
11-
"strict": true /* enable all strict type-checking options */
12-
/* Additional Checks */
13-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
14-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
15-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
16+
"strict": true,
17+
"experimentalDecorators": true,
18+
"allowSyntheticDefaultImports": true,
19+
"noImplicitAny": true,
20+
"noImplicitThis": true,
21+
"noUnusedLocals": true,
22+
//"noUnusedParameters": true,
23+
"noFallthroughCasesInSwitch": true,
24+
"resolveJsonModule": true,
25+
"removeComments": true,
26+
"noImplicitReturns": true,
1627
},
1728
"exclude": [
1829
"node_modules",
19-
".vscode-test"
30+
".vscode-test",
31+
"out",
2032
]
21-
}
33+
}

vscode-client/extension.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import * as net from "net";
22
import * as path from "path";
3-
import * as fs from "fs";
43
import * as vscode from "vscode";
54
import { LanguageClient, LanguageClientOptions, ServerOptions } from "vscode-languageclient/node";
65
import { sleep } from "./utils";
@@ -316,6 +315,8 @@ async function getCurrentTestFromActiveResource(
316315
})) ?? undefined
317316
);
318317
} catch {}
318+
319+
return;
319320
}
320321

321322
interface Test {
@@ -448,7 +449,7 @@ async function onRobotExited(session: vscode.DebugSession, outputFile?: string,
448449
case "disabled":
449450
return;
450451
case "external":
451-
vscode.env.openExternal(vscode.Uri.file(reportFile));
452+
vscode.env.openExternal(vscode.Uri.file(reportFile));
452453
}
453454
}
454455
}
@@ -496,7 +497,7 @@ export async function activateAsync(context: vscode.ExtensionContext) {
496497
let res = resource ?? vscode.window.activeTextEditor?.document.uri;
497498

498499
let realTest =
499-
(test !== undefined && test instanceof String ? test.toString() : undefined) ??
500+
(test !== undefined && typeof test === "string" ? test.toString() : undefined) ??
500501
(await getTestFromResource(res));
501502
if (!realTest) return;
502503

@@ -512,7 +513,7 @@ export async function activateAsync(context: vscode.ExtensionContext) {
512513
let res = resource ?? vscode.window.activeTextEditor?.document.uri;
513514

514515
let realTest =
515-
(test !== undefined && test instanceof String ? test.toString() : undefined) ??
516+
(test !== undefined && typeof test === "string" ? test.toString() : undefined) ??
516517
(await getTestFromResource(res));
517518
if (!realTest) return;
518519

@@ -600,12 +601,6 @@ export async function activateAsync(context: vscode.ExtensionContext) {
600601
},
601602
}),
602603

603-
// vscode.debug.onDidStartDebugSession(async (session) => {
604-
// if (session.configuration.type === "robotcode") {
605-
// await attachPython(session);
606-
// }
607-
// })
608-
609604
vscode.workspace.onDidChangeConfiguration((event) => {
610605
for (let s of [
611606
"python.pythonPath",
@@ -649,7 +644,11 @@ export async function activateAsync(context: vscode.ExtensionContext) {
649644
): vscode.ProviderResult<vscode.InlineValue[]> {
650645
const allValues: vscode.InlineValue[] = [];
651646

652-
for (let l = 0; l <= context.stoppedLocation.end.line; l++) {
647+
for (
648+
let l = viewPort.start.line;
649+
l <= Math.min(viewPort.end.line, context.stoppedLocation.end.line);
650+
l++
651+
) {
653652
const line = document.lineAt(l);
654653
let text = line.text.split("#")[0];
655654

0 commit comments

Comments
 (0)