11import * as vscode from "vscode" ;
2+ import { registerOpenWorkflowFile } from "./commands/openWorkflowFile" ;
3+ import { registerOpenWorkflowRun } from "./commands/openWorkflowRun" ;
4+ import { registerOpenWorkflowRunLogs } from "./commands/openWorkflowRunLogs" ;
25import { getGitHubContext } from "./git/repository" ;
6+ import { LogScheme } from "./logs/constants" ;
7+ import { WorkflowStepLogProvider } from "./logs/fileProvider" ;
8+ import { WorkflowStepLogFoldingProvider } from "./logs/foldingProvider" ;
9+ import { WorkflowStepLogSymbolProvider } from "./logs/symbolProvider" ;
310import { initWorkflowDocumentTracking } from "./tracker/workflowDocumentTracker" ;
411import { initResources } from "./treeViews/icons" ;
512import { SettingsTreeProvider } from "./treeViews/settings" ;
@@ -17,7 +24,10 @@ export function activate(context: vscode.ExtensionContext) {
1724 // Track workflow
1825 initWorkflowDocumentTracking ( context ) ;
1926
20- // Actions Explorer
27+ //
28+ // Tree views
29+ //
30+
2131 const workflowTreeProvider = new WorkflowsTreeProvider ( ) ;
2232 context . subscriptions . push (
2333 vscode . window . registerTreeDataProvider (
@@ -41,36 +51,15 @@ export function activate(context: vscode.ExtensionContext) {
4151 } )
4252 ) ;
4353
44- /*
45- context.subscriptions.push(
46- vscode.commands.registerCommand(
47- "github-actions.explorer.openRun",
48- (args) => {
49- const url = args.url || args;
50- vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(url));
51- }
52- )
53- );
54- context.subscriptions.push(
55- vscode.commands.registerCommand(
56- "github-actions.explorer.openWorkflowFile",
57- async (args) => {
58- const wf: Workflow = args.wf;
54+ //
55+ // Commands
56+ //
5957
60- const fileUri = getWorkflowUri(wf.path);
61- if (fileUri) {
62- const textDocument = await vscode.workspace.openTextDocument(fileUri);
63- vscode.window.showTextDocument(textDocument);
64- return;
65- }
58+ registerOpenWorkflowRun ( context ) ;
59+ registerOpenWorkflowFile ( context ) ;
60+ registerOpenWorkflowRunLogs ( context ) ;
6661
67- // File not found in workspace
68- vscode.window.showErrorMessage(
69- `Workflow ${wf.path} not found in current workspace`
70- );
71- }
72- )
73- );
62+ /*
7463 context.subscriptions.push(
7564 vscode.commands.registerCommand(
7665 "github-actions.explorer.triggerRun",
@@ -224,69 +213,6 @@ export function activate(context: vscode.ExtensionContext) {
224213 )
225214 );
226215
227- context.subscriptions.push(
228- vscode.commands.registerCommand(
229- "github-actions.workflow.run.open",
230- async (args) => {
231- const run: WorkflowRun = args.run;
232- const url = run.html_url;
233- vscode.env.openExternal(vscode.Uri.parse(url));
234- }
235- )
236- );
237-
238- context.subscriptions.push(
239- vscode.commands.registerCommand(
240- "github-actions.workflow.logs",
241- async (args) => {
242- const gitHubContext: GitHubContext = args.gitHubContext;
243- const job: WorkflowJob = args.job;
244- const step: WorkflowStep | undefined = args.step;
245- const uri = buildLogURI(
246- gitHubContext.owner,
247- gitHubContext.name,
248- job.id,
249- step?.name
250- );
251- const doc = await vscode.workspace.openTextDocument(uri);
252- const editor = await vscode.window.showTextDocument(doc, {
253- preview: false,
254- });
255-
256- const logInfo = getLogInfo(uri);
257- if (!logInfo) {
258- throw new Error("Could not get log info");
259- }
260-
261- // Custom formatting after the editor has been opened
262- updateDecorations(editor, logInfo);
263-
264- // Deep linking
265- if (step) {
266- let matchingSection = logInfo.sections.find(
267- (s) => s.name && s.name === step.name
268- );
269- if (!matchingSection) {
270- // If we cannot match by name, see if we can try to match by number
271- matchingSection = logInfo.sections[step.number - 1];
272- }
273-
274- if (matchingSection) {
275- editor.revealRange(
276- new vscode.Range(
277- matchingSection.start,
278- 0,
279- matchingSection.start,
280- 0
281- ),
282- vscode.TextEditorRevealType.InCenter
283- );
284- }
285- }
286- }
287- )
288- );
289-
290216 context.subscriptions.push(
291217 vscode.commands.registerCommand(
292218 "github-actions.workflow.run.rerun",
@@ -467,6 +393,7 @@ export function activate(context: vscode.ExtensionContext) {
467393 }
468394 )
469395 );
396+ */
470397
471398 //
472399 // Log providers
@@ -494,6 +421,7 @@ export function activate(context: vscode.ExtensionContext) {
494421 )
495422 ) ;
496423
424+ /*
497425 //
498426 // Editing features
499427 //
0 commit comments