|
@@ -735,24 +735,22 @@ function activate(
|
|
menu.runMenu.codeRunners.add({
|
|
menu.runMenu.codeRunners.add({
|
|
tracker,
|
|
tracker,
|
|
noun: 'Code',
|
|
noun: 'Code',
|
|
- isEnabled: current => {
|
|
|
|
- let found = false;
|
|
|
|
- consoleTracker.forEach(console => {
|
|
|
|
- if (console.console.session.path === current.context.path) {
|
|
|
|
- found = true;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- return found;
|
|
|
|
- },
|
|
|
|
|
|
+ isEnabled: current =>
|
|
|
|
+ !!consoleTracker.find(c => c.session.path === current.context.path),
|
|
run: () => commands.execute(CommandIDs.runCode),
|
|
run: () => commands.execute(CommandIDs.runCode),
|
|
runAll: () => commands.execute(CommandIDs.runAllCode),
|
|
runAll: () => commands.execute(CommandIDs.runAllCode),
|
|
restartAndRunAll: current => {
|
|
restartAndRunAll: current => {
|
|
- return current.context.session.restart().then(restarted => {
|
|
|
|
- if (restarted) {
|
|
|
|
- void commands.execute(CommandIDs.runAllCode);
|
|
|
|
- }
|
|
|
|
- return restarted;
|
|
|
|
- });
|
|
|
|
|
|
+ const console = consoleTracker.find(
|
|
|
|
+ console => console.session.path === current.context.path
|
|
|
|
+ );
|
|
|
|
+ if (console) {
|
|
|
|
+ return console.session.restart().then(restarted => {
|
|
|
|
+ if (restarted) {
|
|
|
|
+ void commands.execute(CommandIDs.runAllCode);
|
|
|
|
+ }
|
|
|
|
+ return restarted;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} as IRunMenu.ICodeRunner<IDocumentWidget<FileEditor>>);
|
|
} as IRunMenu.ICodeRunner<IDocumentWidget<FileEditor>>);
|
|
}
|
|
}
|