From a8a1e55655682016a62a6a052c0c4f8e5e470dce Mon Sep 17 00:00:00 2001 From: Trae Yelovich Date: Fri, 27 Dec 2024 11:34:26 -0500 Subject: [PATCH] refactor: Update CodeLens formatting, make editor refresh Signed-off-by: Trae Yelovich --- packages/zowe-explorer/src/trees/job/JobInit.ts | 9 ++++++--- packages/zowe-explorer/src/trees/shared/SharedUtils.ts | 10 +++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/zowe-explorer/src/trees/job/JobInit.ts b/packages/zowe-explorer/src/trees/job/JobInit.ts index 2440c66fb..0456f4d53 100644 --- a/packages/zowe-explorer/src/trees/job/JobInit.ts +++ b/packages/zowe-explorer/src/trees/job/JobInit.ts @@ -18,7 +18,7 @@ import { ZoweLogger } from "../../tools/ZoweLogger"; import { SharedActions } from "../shared/SharedActions"; import { SharedContext } from "../shared/SharedContext"; import { SharedInit } from "../shared/SharedInit"; -import { FetchMoreCodeLens, SharedUtils } from "../shared/SharedUtils"; +import { LoadMoreCodeLens, SharedUtils } from "../shared/SharedUtils"; import { JobFSProvider } from "./JobFSProvider"; import { PollProvider } from "./JobPollProvider"; import { JobTableView } from "./JobTableView"; @@ -164,10 +164,13 @@ export class JobInit { ); context.subscriptions.push( vscode.commands.registerCommand("zowe.jobs.fetchMore", async (document: vscode.TextDocument) => { - await JobFSProvider.instance.fetchSpoolAtUri(document.uri.with({ query: `?startRecord=${document.lineCount - 1}` })); + await JobFSProvider.instance.fetchSpoolAtUri( + document.uri.with({ query: `?startRecord=${document.lineCount - 1}` }), + vscode.window.activeTextEditor + ); }) ); - const codeLensProvider = new FetchMoreCodeLens("zowe.jobs.fetchMore"); + const codeLensProvider = new LoadMoreCodeLens("zowe.jobs.fetchMore"); const disposableCodeLens = vscode.languages.registerCodeLensProvider({ scheme: ZoweScheme.Jobs }, codeLensProvider); context.subscriptions.push(disposableCodeLens); diff --git a/packages/zowe-explorer/src/trees/shared/SharedUtils.ts b/packages/zowe-explorer/src/trees/shared/SharedUtils.ts index e378ad483..b2ad5ac78 100644 --- a/packages/zowe-explorer/src/trees/shared/SharedUtils.ts +++ b/packages/zowe-explorer/src/trees/shared/SharedUtils.ts @@ -22,20 +22,20 @@ import { ZoweLogger } from "../../tools/ZoweLogger"; import { SharedContext } from "./SharedContext"; import { Definitions } from "../../configuration/Definitions"; -export class FetchMoreCodeLens implements vscode.CodeLensProvider { +export class LoadMoreCodeLens implements vscode.CodeLensProvider { private commandId: string; - constructor(commandId: string) { + public constructor(commandId: string) { this.commandId = commandId; } - provideCodeLenses(document: vscode.TextDocument, token: vscode.CancellationToken): vscode.ProviderResult { + public provideCodeLenses(document: vscode.TextDocument, token: vscode.CancellationToken): vscode.ProviderResult { const lineCount = document.lineCount; const lastLine = lineCount - 1; const lastLineRange = new vscode.Range(lastLine, 0, lastLine, 0); const codelens = new vscode.CodeLens(lastLineRange, { - title: vscode.l10n.t("Load more content..."), + title: vscode.l10n.t("$(chevron-down) Load more..."), command: this.commandId, arguments: [document], }); @@ -43,7 +43,7 @@ export class FetchMoreCodeLens implements vscode.CodeLensProvider { return [codelens]; } - resolveCodeLens(codeLens: vscode.CodeLens, token: vscode.CancellationToken): vscode.ProviderResult { + public resolveCodeLens(codeLens: vscode.CodeLens, token: vscode.CancellationToken): vscode.ProviderResult { return codeLens; } }