File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -50,10 +50,16 @@ export default function setupConsole(context: ExtensionContext) {
5050 proc . on ( 'close' , ( code ) => {
5151 provider . webview ?. webview . postMessage ( { type : 'close' , value : code ?. toString ( ) } ) ;
5252 sketchProcess = undefined ;
53+ commands . executeCommand ( 'setContext' , 'processing.sketch.running' , false ) ;
5354 } ) ;
5455 provider . webview ?. show ?.( true ) ;
5556 provider . webview ?. webview . postMessage ( { type : 'clear' } ) ;
5657 sketchProcess = proc ;
58+ commands . executeCommand ( 'setContext' , 'processing.sketch.running' , true ) ;
59+ } ) ;
60+
61+ const restartSketch = commands . registerCommand ( 'processing.sketch.restart' , ( resource : Uri ) => {
62+ commands . executeCommand ( 'processing.sketch.run' , resource ) ;
5763 } ) ;
5864
5965 const stopSketch = commands . registerCommand ( 'processing.sketch.stop' , ( ) => {
@@ -66,6 +72,7 @@ export default function setupConsole(context: ExtensionContext) {
6672 context . subscriptions . push (
6773 register ,
6874 startSketch ,
75+ restartSketch ,
6976 stopSketch
7077 ) ;
7178}
Original file line number Diff line number Diff line change 4949 "title" : " Run the Processing Sketch" ,
5050 "icon" : " media/start.svg"
5151 },
52+ {
53+ "command" : " processing.sketch.restart" ,
54+ "title" : " Restart the Processing Sketch" ,
55+ "icon" : " media/restart.svg"
56+ },
5257 {
5358 "command" : " processing.sketch.stop" ,
5459 "title" : " Stop the Processing Sketch" ,
8388 "editor/title" : [
8489 {
8590 "command" : " processing.sketch.run" ,
86- "when" : " editorLangId == Processing || editorLangId == java" ,
91+ "when" : " !processing.sketch.running && (editorLangId == Processing || editorLangId == java)" ,
92+ "group" : " navigation"
93+ },
94+ {
95+ "command" : " processing.sketch.restart" ,
96+ "when" : " processing.sketch.running && (editorLangId == Processing || editorLangId == java)" ,
8797 "group" : " navigation"
8898 },
8999 {
You can’t perform that action at this time.
0 commit comments