Skip to content

Commit 72e7ddb

Browse files
committed
Minor cleanup
Signed-off-by: worksofliam <[email protected]>
1 parent afb2eed commit 72e7ddb

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

src/testing/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import vscode from "vscode";
1+
import * as vscode from "vscode";
22
import { env } from "process";
33
import { TestSuitesTreeProvider } from "./testCasesTree";
44
import { getInstance } from "../base";

src/views/jobManager/ConfigManager.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { Disposable, ProgressLocation, ThemeIcon, TreeItem, TreeItemCollapsibleState, commands, window } from "vscode";
1+
import { Disposable, ThemeIcon, TreeItem, TreeItemCollapsibleState, commands, window } from "vscode";
22
import Configuration from "../../configuration";
3-
import { JDBCOptions } from "../../connection/types";
4-
import { JobManagerView, SQLJobItem } from "./jobManagerView";
3+
import { SQLJobItem } from "./jobManagerView";
54
import { JobManager } from "../../config";
6-
import { OldSQLJob } from "../../connection/sqlJob";
75
import { editJobUi } from "./editJob";
6+
import { JDBCOptions } from "@ibm/mapepire-js/dist/src/types";
87

98
interface JobConfigs {
109
[name: string]: JDBCOptions

src/views/queryHistoryView/index.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
import vscode, { MarkdownString, ThemeIcon, TreeItem, window, workspace } from "vscode";
1+
import { commands, EventEmitter, ExtensionContext, MarkdownString, ThemeIcon, TreeItem, TreeItemCollapsibleState, window, workspace, Event } from "vscode";
22
import { TreeDataProvider } from "vscode";
33
import { Config } from "../../config";
4-
import { QueryHistoryItem } from "../../Storage";
54

65
const openSqlDocumentCommand = `vscode-db2i.openSqlDocument`;
76

87
export class queryHistory implements TreeDataProvider<any> {
9-
private _onDidChangeTreeData: vscode.EventEmitter<vscode.TreeItem | undefined | null | void> = new vscode.EventEmitter<vscode.TreeItem | undefined | null | void>();
10-
readonly onDidChangeTreeData: vscode.Event<vscode.TreeItem | undefined | null | void> = this._onDidChangeTreeData.event;
8+
private _onDidChangeTreeData: EventEmitter<TreeItem | undefined | null | void> = new EventEmitter<TreeItem | undefined | null | void>();
9+
readonly onDidChangeTreeData: Event<TreeItem | undefined | null | void> = this._onDidChangeTreeData.event;
1110

12-
constructor(context: vscode.ExtensionContext) {
11+
constructor(context: ExtensionContext) {
1312
context.subscriptions.push(
14-
vscode.commands.registerCommand(openSqlDocumentCommand, (query: string = ``) => {
13+
commands.registerCommand(openSqlDocumentCommand, (query: string = ``) => {
1514
workspace.openTextDocument({
1615
language: `sql`,
1716
content: (typeof query === `string` ? query : ``)
@@ -20,7 +19,7 @@ export class queryHistory implements TreeDataProvider<any> {
2019
});
2120
}),
2221

23-
vscode.commands.registerCommand(`vscode-db2i.queryHistory.prepend`, async (newQuery?: string) => {
22+
commands.registerCommand(`vscode-db2i.queryHistory.prepend`, async (newQuery?: string) => {
2423
if (newQuery && Config.ready) {
2524
let currentList = Config.getPastQueries();
2625
const existingQuery = currentList.findIndex(queryItem => queryItem.query.trim() === newQuery.trim());
@@ -44,7 +43,7 @@ export class queryHistory implements TreeDataProvider<any> {
4443
}
4544
}),
4645

47-
vscode.commands.registerCommand(`vscode-db2i.queryHistory.remove`, async (node: PastQueryNode) => {
46+
commands.registerCommand(`vscode-db2i.queryHistory.remove`, async (node: PastQueryNode) => {
4847
if (node && Config.ready) {
4948
let currentList = Config.getPastQueries();
5049
const chosenQuery = node.query;
@@ -61,7 +60,7 @@ export class queryHistory implements TreeDataProvider<any> {
6160
}
6261
}),
6362

64-
vscode.commands.registerCommand(`vscode-db2i.queryHistory.clear`, async () => {
63+
commands.registerCommand(`vscode-db2i.queryHistory.clear`, async () => {
6564
if (Config.ready) {
6665
await Config.setPastQueries([]);
6766
this.refresh();
@@ -74,11 +73,11 @@ export class queryHistory implements TreeDataProvider<any> {
7473
this._onDidChangeTreeData.fire();
7574
}
7675

77-
getTreeItem(element: vscode.TreeItem) {
76+
getTreeItem(element: TreeItem) {
7877
return element;
7978
}
8079

81-
async getChildren(timePeriod?: TimePeriodNode): Promise<vscode.TreeItem[]> {
80+
async getChildren(timePeriod?: TimePeriodNode): Promise<TreeItem[]> {
8281
if (Config.ready) {
8382
if (timePeriod) {
8483
return timePeriod.getChildren();
@@ -137,10 +136,9 @@ export class queryHistory implements TreeDataProvider<any> {
137136
}
138137
}
139138

140-
class TimePeriodNode extends vscode.TreeItem {
139+
class TimePeriodNode extends TreeItem {
141140
constructor(public period: string, private nodes: PastQueryNode[], expanded = false) {
142-
super(period, expanded ? vscode.TreeItemCollapsibleState.Expanded : vscode.TreeItemCollapsibleState.Collapsed);
143-
141+
super(period, expanded ? TreeItemCollapsibleState.Expanded : TreeItemCollapsibleState.Collapsed);
144142
this.contextValue = `timePeriod`;
145143

146144
this.iconPath = new ThemeIcon(`calendar`);
@@ -151,7 +149,7 @@ class TimePeriodNode extends vscode.TreeItem {
151149
}
152150
}
153151

154-
class PastQueryNode extends vscode.TreeItem {
152+
class PastQueryNode extends TreeItem {
155153
constructor(public query: string) {
156154
super(query.length > 63 ? query.substring(0, 60) + `...` : query);
157155

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"module": "commonjs",
44
"target": "ES2019",
55
"checkJs": true, /* Typecheck .js files. */
6+
"esModuleInterop": true,
67
"lib": [
78
"ES2019"
89
],

0 commit comments

Comments
 (0)