Skip to content

Commit

Permalink
Merge branch 'cleanup/seperate_frontend' into cleanup/seperate_fronte…
Browse files Browse the repository at this point in the history
…nd_vitest
  • Loading branch information
worksofliam committed Jan 17, 2025
2 parents 342f7d3 + 728e0c2 commit 7d5e800
Show file tree
Hide file tree
Showing 18 changed files with 35 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/Instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { VsCodeConfig } from "./config/Configuration";
import { ConnectionConfig } from "./api/configuration/config/ConnectionManager";
import { EventEmitter } from "stream";
import { ConnectionStorage } from "./api/configuration/storage/ConnectionStorage";
import { VscodeTools } from "./ui/vscodeTools";
import { VscodeTools } from "./ui/Tools";

type IBMiEventSubscription = {
func: Function,
Expand Down
2 changes: 1 addition & 1 deletion src/commands/open.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Instance from "../Instance";
import { Tools } from "../api/Tools";
import { getUriFromPath, parseFSOptions } from "../filesystems/qsys/QSysFs";
import path from "path";
import { VscodeTools } from "../ui/vscodeTools";
import { VscodeTools } from "../ui/Tools";
import IBMi from "../api/IBMi";
import { DefaultOpenMode } from "../api/configuration/config/ConnectionManager";

Expand Down
2 changes: 1 addition & 1 deletion src/debug/certificates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { instance } from '../instantiate';
import IBMi from "../api/IBMi";
import IBMiContent from '../api/IBMiContent';
import { Tools } from '../api/Tools';
import { VscodeTools } from '../ui/vscodeTools';
import { VscodeTools } from '../ui/Tools';
import { DebugConfiguration, SERVICE_CERTIFICATE, CLIENT_CERTIFICATE, getDebugServiceDetails, getJavaHome, DEBUG_CONFIG_FILE, LEGACY_CERT_DIRECTORY } from '../api/configuration/DebugConfiguration';

type HostInfo = {
Expand Down
2 changes: 1 addition & 1 deletion src/debug/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Env, getEnvConfig } from "../filesystems/local/env";
import * as certificates from "./certificates";
import { DEBUG_CONFIG_FILE, DebugConfiguration, getDebugServiceDetails, resetDebugServiceDetails } from "../api/configuration/DebugConfiguration";
import * as server from "./server";
import { VscodeTools } from "../ui/vscodeTools";
import { VscodeTools } from "../ui/Tools";
import { getStoredPassword } from "../config/passwords";

const debugExtensionId = `IBM.ibmidebug`;
Expand Down
5 changes: 2 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { SettingsUI } from "./webviews/settings";
import { registerActionTools } from "./ui/actions";
import IBMi from "./api/IBMi";
import path from "path";
import { VscodeTools } from "./ui/vscodeTools";
import { VscodeTools } from "./ui/Tools";

export async function activate(context: ExtensionContext): Promise<CodeForIBMi> {
// Use the console to output diagnostic information (console.log) and errors (console.error)
Expand Down Expand Up @@ -126,8 +126,7 @@ export async function activate(context: ExtensionContext): Promise<CodeForIBMi>
instance, customUI: () => new CustomUI(),
deployTools: DeployTools,
evfeventParser: parseErrors,
tools: Tools,
vscodeTools: VscodeTools,
tools: VscodeTools,
componentRegistry: extensionComponentRegistry
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/filesystems/local/deployTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import vscode, { Uri, WorkspaceFolder } from 'vscode';
import { instance } from '../../instantiate';
import { LocalLanguageActions } from './LocalLanguageActions';
import { Deployment } from './deployment';
import { VscodeTools } from '../../ui/vscodeTools';
import { VscodeTools } from '../../ui/Tools';
import { DeploymentMethod } from '../../api/types';
import { DeploymentParameters } from '../../typings';

Expand Down
2 changes: 1 addition & 1 deletion src/filesystems/local/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getBranchLibraryName } from "./env";
import { instance } from "../../instantiate";
import IBMi from "../../api/IBMi";
import IBMiContent from "../../api/IBMiContent";
import { VscodeTools } from "../../ui/vscodeTools";
import { VscodeTools } from "../../ui/Tools";
import { ConnectionConfig } from "../../api/configuration/config/ConnectionManager";

const lastBranch: { [workspaceUri: string]: string } = {};
Expand Down
2 changes: 1 addition & 1 deletion src/filesystems/qsys/FSUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from "path";
import vscode, { l10n } from "vscode";
import { VscodeTools } from "../../ui/vscodeTools";
import { VscodeTools } from "../../ui/Tools";
import IBMi from "../../api/IBMi";
import { ReconnectMode } from "../../api/configuration/config/ConnectionManager";

Expand Down
2 changes: 1 addition & 1 deletion src/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import querystring from "querystring";
import { commands, ExtensionContext, l10n, Uri, window } from "vscode";
import { instance } from "./instantiate";
import { ConnectionData } from "./typings";
import { VscodeTools } from "./ui/vscodeTools";
import { VscodeTools } from "./ui/Tools";
import IBMi from "./api/IBMi";

export async function registerUriHandler(context: ExtensionContext) {
Expand Down
2 changes: 1 addition & 1 deletion src/testing/deployTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Tools } from "../api/Tools";
import { DeployTools } from "../filesystems/local/deployTools";
import { instance } from "../instantiate";
import { Action, DeploymentMethod } from "../typings";
import { VscodeTools } from "../ui/vscodeTools";
import { VscodeTools } from "../ui/Tools";
import { runAction } from "../ui/actions";

type FileInfo = {
Expand Down
5 changes: 2 additions & 3 deletions src/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import { ObjectFilters } from './api/configuration/config/ConnectionManager';
import { DeploymentMethod, FileError, IBMiMember, IBMiObject, WithPath } from "./api/types";
import { Ignore } from "ignore";
import { WorkspaceFolder } from "vscode";
import { VscodeTools } from "./ui/vscodeTools";
import { VscodeTools } from "./ui/Tools";

export interface CodeForIBMi {
instance: Instance,
customUI: () => CustomUI,
deployTools: typeof DeployTools,
evfeventParser: (lines: string[]) => Map<string, FileError[]>,
tools: typeof Tools,
vscodeTools: typeof VscodeTools,
tools: typeof VscodeTools,
componentRegistry: ComponentRegistry
}

Expand Down
17 changes: 16 additions & 1 deletion src/ui/vscodeTools.ts → src/ui/Tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import Crypto from 'crypto';
import { readFileSync } from "fs";
import vscode, { MarkdownString } from "vscode";
import { API, GitExtension } from "../filesystems/local/gitApi";
import { Tools } from '../api/Tools';
import { IBMiObject, IBMiMember, IFSFile } from '../typings';
import IBMi from '../api/IBMi';
import { Tools } from '../api/Tools';

let gitLookedUp: boolean;
let gitAPI: API | undefined;
Expand Down Expand Up @@ -198,4 +198,19 @@ export namespace VscodeTools {
return `Unknown`;
}
}

// These are exported to not break the API from 'the great re-write'.
export const qualifyPath = Tools.qualifyPath;
export const unqualifyPath = Tools.unqualifyPath;
export const escapePath = Tools.escapePath;
export const distinct = Tools.distinct;
export const capitalize = Tools.capitalize;
export const sanitizeObjNamesForPase = Tools.sanitizeObjNamesForPase;
export const parseMessages = Tools.parseMessages;
export const parseQSysPath = Tools.parseQSysPath;
export const fileToPath = Tools.fileToPath;
export const fixWindowsPath = Tools.fixWindowsPath;
export const parseAttrDate = Tools.parseAttrDate;
export const normalizePath = Tools.normalizePath;
export const resolvePath = Tools.resolvePath;
}
2 changes: 1 addition & 1 deletion src/ui/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FileError } from "../typings";
import Instance from "../Instance";
import { getEvfeventFiles } from "../filesystems/local/actions";
import { parseErrors } from "../api/errors/parser";
import { VscodeTools } from "./vscodeTools";
import { VscodeTools } from "./Tools";
import IBMi from "../api/IBMi";

const ileDiagnostics = vscode.languages.createDiagnosticCollection(`ILE`);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/LibraryListView.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import vscode, { commands, l10n } from "vscode";
import { instance } from "../../instantiate";
import { IBMiObject, WithLibrary } from "../../typings";
import { VscodeTools } from "../vscodeTools";
import { VscodeTools } from "../Tools";
import { ConnectionConfig } from "../../api/configuration/config/ConnectionManager";
import IBMi from "../../api/IBMi";

Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/debugView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { checkClientCertificate, debugKeyFileExists, remoteCertificatesExists }
import { DebugConfiguration, getDebugServiceDetails, SERVICE_CERTIFICATE } from "../../api/configuration/DebugConfiguration";
import { DebugJob, getDebugServerJob, getDebugServiceJob, isDebugEngineRunning, readActiveJob, readJVMInfo, startServer, startService, stopServer, stopService } from "../../debug/server";
import { instance } from "../../instantiate";
import { VscodeTools } from "../vscodeTools";
import { VscodeTools } from "../Tools";
import { BrowserItem } from "../types";

const title = "IBM i debugger";
Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/ifsBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Search } from "../../api/Search";
import { Tools } from "../../api/Tools";
import { instance } from "../../instantiate";
import { FocusOptions, IFSFile, IFS_BROWSER_MIMETYPE, OBJECT_BROWSER_MIMETYPE, SearchHit, SearchResults, WithPath } from "../../typings";
import { VscodeTools } from "../vscodeTools";
import { VscodeTools } from "../Tools";
import IBMi from "../../api/IBMi";
import { BrowserItem, BrowserItemParameters } from "../types";

Expand Down
2 changes: 1 addition & 1 deletion src/ui/views/objectBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getMemberUri } from "../../filesystems/qsys/QSysFs";
import { instance } from "../../instantiate";
import { CommandResult, FilteredItem, FocusOptions, IBMiMember, IBMiObject, MemberItem, OBJECT_BROWSER_MIMETYPE, ObjectItem, WithLibrary } from "../../typings";
import { editFilter } from "../../webviews/filters";
import { VscodeTools } from "../vscodeTools";
import { VscodeTools } from "../Tools";
import { DefaultOpenMode, ObjectFilters } from "../../api/configuration/config/ConnectionManager";
import { BrowserItem, BrowserItemParameters } from "../types";

Expand Down
2 changes: 1 addition & 1 deletion src/webviews/settings/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { isSEPSupported } from "../../debug/server";
import { extensionComponentRegistry } from "../../api/components/manager";
import { instance } from "../../instantiate";
import { ConnectionData, Server } from '../../typings';
import { VscodeTools } from "../../ui/vscodeTools";
import { VscodeTools } from "../../ui/Tools";
import IBMi from "../../api/IBMi";
import { ConnectionConfig, ConnectionManager } from "../../api/configuration/config/ConnectionManager";
import { deleteStoredPassword, getStoredPassword, setStoredPassword } from "../../config/passwords";
Expand Down

0 comments on commit 7d5e800

Please sign in to comment.