Skip to content

Commit 4ff3d9e

Browse files
author
Tyler Deemer
committed
Implemented reload of files for studio actions
1 parent 23f9cad commit 4ff3d9e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/commands/compile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function updateOthers(others: string[]) {
3838
});
3939
}
4040

41-
async function loadChanges(files: CurrentFile[]): Promise<any> {
41+
export async function loadChanges(files: CurrentFile[]): Promise<any> {
4242
if (!files.length) {
4343
return;
4444
}

src/commands/studio.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import * as vscode from "vscode";
22
import { AtelierAPI } from "../api";
33
import { config, FILESYSTEM_SCHEMA } from "../extension";
4-
import { outputChannel, outputConsole } from "../utils";
4+
import { outputChannel, outputConsole, currentFile } from "../utils";
55
import { DocumentContentProvider } from "../providers/DocumentContentProvider";
66
import { ClassNode } from "../explorer/models/classesNode";
77
import { PackageNode } from "../explorer/models/packageNode";
88
import { RoutineNode } from "../explorer/models/routineNode";
99
import { NodeBase } from "../explorer/models/nodeBase";
10-
import { importAndCompile } from "./compile";
10+
import { importAndCompile, loadChanges } from "./compile";
1111

1212
export let documentBeingProcessed: vscode.TextDocument = null;
1313

@@ -55,6 +55,10 @@ class StudioActions {
5555
outputChannel.appendLine(errorText);
5656
outputChannel.show();
5757
}
58+
if(userAction.reload) {
59+
const document = vscode.window.activeTextEditor.document;
60+
loadChanges([currentFile(document)]);
61+
}
5862
if(config().studioActionDebugOutput) {
5963
outputChannel.appendLine(JSON.stringify(userAction));
6064
}

0 commit comments

Comments
 (0)