Skip to content

Commit 7dd115a

Browse files
committed
Remove unused imports and commented code in setupCommands.ts
Cleaned up client/src/setupCommands.ts by removing the unused 'dirname' import and large blocks of commented-out code related to sketch running and stopping commands. This improves code readability and maintainability.
1 parent ce3f62f commit 7dd115a

File tree

1 file changed

+1
-72
lines changed

1 file changed

+1
-72
lines changed

client/src/setupCommands.ts

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,7 @@
1-
import { basename, dirname, join } from 'path';
1+
import { basename, join } from 'path';
22
import { ExtensionContext, commands, Uri, window, workspace } from 'vscode';
3-
// import { state } from './extension';
4-
5-
// const sketchNumber = 0;
63

74
export function setupCommands(context: ExtensionContext) {
8-
// const runSketch = commands.registerCommand('processing.sketch.run', (resource: Uri) => {
9-
// // TODO: Use VScode contexts to highlight run button when sketch is running, blocked until we do not run the sketch in a terminal
10-
// // https://code.visualstudio.com/api/references/when-clause-contexts
11-
12-
// const autosave = workspace
13-
// .getConfiguration('processing')
14-
// .get<boolean>('autosave');
15-
// if (autosave === true) {
16-
// // Save all files before running the sketch
17-
// commands.executeCommand('workbench.action.files.saveAll');
18-
// }
19-
// if (resource == undefined) {
20-
// const editor = window.activeTextEditor;
21-
// if (editor) {
22-
// resource = editor.document.uri;
23-
// }
24-
// }
25-
26-
// if (!resource) {
27-
// return;
28-
// }
29-
30-
// return;
31-
32-
// let terminal = state.terminal;
33-
// // Create a new terminal
34-
// if (terminal === undefined || terminal.exitStatus) {
35-
// window.terminals.forEach(t => {
36-
// if (t.name === "Sketch") {
37-
// t.dispose();
38-
// }
39-
// });
40-
// state.terminal = window.createTerminal("Sketch");
41-
// terminal = state.terminal;
42-
// // Show the terminal panel the first time
43-
// terminal.show(true);
44-
// } else {
45-
// // Send the command to the terminal
46-
// terminal.sendText('\x03', false);
47-
// }
48-
49-
// // clear the terminal
50-
// terminal.sendText("clear", true);
51-
52-
// let path = state.selectedVersion.path;
53-
// if (process.platform === "win32") {
54-
// // on windows we need to escape spaces
55-
// path = `& "${path}"`;
56-
// }
57-
58-
// let cmd = `${path} cli --sketch="${dirname(resource.fsPath)}" --run`;
59-
// if (process.platform === "win32") {
60-
// // on windows we need to pipe stderr to stdout and convert to string
61-
// cmd += ` 2>&1`;
62-
// }
63-
64-
// terminal.sendText(cmd, true);
65-
// });
66-
67-
// const stopSketch = commands.registerCommand('processing.sketch.stop', () => {
68-
// if (state.terminal === undefined) {
69-
// return;
70-
// }
71-
72-
// // Send the command to the terminal
73-
// state.terminal.sendText('\x03', false);
74-
// });
75-
765
const openSketch = commands.registerCommand('processing.sketch.open', async (folder: string, isReadOnly: boolean) => {
776
if (!folder) {
787
window.showErrorMessage("No sketch folder provided.");

0 commit comments

Comments
 (0)