Skip to content

Commit

Permalink
Open Output to Side (#5)
Browse files Browse the repository at this point in the history
* Open Output to Side

* Add configuration option for open to side

Co-authored-by: Firebolt <24422634+Fireboltofdeath@users.noreply.github.com>
  • Loading branch information
osyrisrblx and Fireboltofdeath committed Jul 2, 2021
1 parent cd6d5a6 commit 64cbf9c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@
"type": "number",
"default": 2,
"description": "The amount of digits to round to while using the color picker."
},
"roblox-ts.openOutputToSide": {
"type": "boolean",
"default": true,
"description": "Determines whether the Open Output command will open the editor to the side."
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ export async function activate(context: vscode.ExtensionContext) {
const outputPath = pathTranslator.getOutputPath(currentFile);
if (!existsSync(outputPath)) return showErrorMessage("Output file could not be found");

const openToSide = vscode.workspace.getConfiguration('roblox-ts').get<boolean>("openOutputToSide", true);
const viewColumn = openToSide ? vscode.ViewColumn.Beside : vscode.ViewColumn.Active;
vscode.workspace.openTextDocument(vscode.Uri.file(outputPath))
.then(document => vscode.window.showTextDocument(document));
.then(document => vscode.window.showTextDocument(document, viewColumn));
};

const outputChannel = new VirtualTerminal("roblox-ts");
Expand Down

0 comments on commit 64cbf9c

Please sign in to comment.