mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-12 11:49:27 +00:00
Compare commits
3 Commits
dependabot
...
experiment
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8885945b4 | ||
|
|
f343c7ffc5 | ||
|
|
493ddc22d7 |
@@ -14,6 +14,7 @@ module.exports = {
|
|||||||
'.browser_modules/*',
|
'.browser_modules/*',
|
||||||
'docs/*',
|
'docs/*',
|
||||||
'scripts/*',
|
'scripts/*',
|
||||||
|
'browser-app/*',
|
||||||
'electron-app/lib/*',
|
'electron-app/lib/*',
|
||||||
'electron-app/src-gen/*',
|
'electron-app/src-gen/*',
|
||||||
'electron-app/gen-webpack*.js',
|
'electron-app/gen-webpack*.js',
|
||||||
|
|||||||
31
.vscode/launch.json
vendored
31
.vscode/launch.json
vendored
@@ -80,6 +80,37 @@
|
|||||||
"port": 9222,
|
"port": 9222,
|
||||||
"webRoot": "${workspaceFolder}/electron-app"
|
"webRoot": "${workspaceFolder}/electron-app"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"name": "App (Browser)",
|
||||||
|
"program": "${workspaceRoot}/browser-app/src-gen/backend/main.js",
|
||||||
|
"args": [
|
||||||
|
"--hostname=0.0.0.0",
|
||||||
|
"--port=3000",
|
||||||
|
"--no-cluster",
|
||||||
|
"--no-app-auto-install",
|
||||||
|
"--plugins=local-dir:plugins"
|
||||||
|
],
|
||||||
|
"windows": {
|
||||||
|
"env": {
|
||||||
|
"NODE_ENV": "development",
|
||||||
|
"NODE_PRESERVE_SYMLINKS": "1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"NODE_ENV": "development"
|
||||||
|
},
|
||||||
|
"sourceMaps": true,
|
||||||
|
"outFiles": [
|
||||||
|
"${workspaceRoot}/browser-app/src-gen/backend/*.js",
|
||||||
|
"${workspaceRoot}/browser-app/lib/**/*.js",
|
||||||
|
"${workspaceRoot}/arduino-ide-extension/lib/**/*.js"
|
||||||
|
],
|
||||||
|
"smartStep": true,
|
||||||
|
"internalConsoleOptions": "openOnSessionStart",
|
||||||
|
"outputCapture": "std"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "node",
|
"type": "node",
|
||||||
"request": "launch",
|
"request": "launch",
|
||||||
|
|||||||
30
.vscode/tasks.json
vendored
30
.vscode/tasks.json
vendored
@@ -15,6 +15,17 @@
|
|||||||
"clear": false
|
"clear": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "Arduino IDE - Start Browser App",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "yarn --cwd ./browser-app start",
|
||||||
|
"group": "build",
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "new",
|
||||||
|
"clear": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "Watch Extension",
|
"label": "Watch Extension",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
@@ -26,6 +37,17 @@
|
|||||||
"clear": false
|
"clear": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "Arduino IDE - Watch Browser App",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "yarn --cwd ./browser-app watch",
|
||||||
|
"group": "build",
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "new",
|
||||||
|
"clear": false
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "Watch App",
|
"label": "Watch App",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
@@ -37,6 +59,14 @@
|
|||||||
"clear": false
|
"clear": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "Arduino IDE - Watch All [Browser]",
|
||||||
|
"type": "shell",
|
||||||
|
"dependsOn": [
|
||||||
|
"Arduino IDE - Watch IDE Extension",
|
||||||
|
"Arduino IDE - Watch Browser App"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "Watch All",
|
"label": "Watch All",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
|
|||||||
@@ -158,16 +158,8 @@
|
|||||||
"frontend": "lib/browser/arduino-ide-frontend-module"
|
"frontend": "lib/browser/arduino-ide-frontend-module"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
"frontend": "lib/browser/theia/core/browser-menu-module",
|
||||||
"frontendElectron": "lib/electron-browser/theia/core/electron-menu-module"
|
"frontendElectron": "lib/electron-browser/theia/core/electron-menu-module"
|
||||||
},
|
|
||||||
{
|
|
||||||
"frontendElectron": "lib/electron-browser/theia/core/electron-window-module"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"frontendElectron": "lib/electron-browser/electron-arduino-module"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"electronMain": "lib/electron-main/arduino-electron-main-module"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"arduino": {
|
"arduino": {
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { ColorContribution } from '@theia/core/lib/browser/color-application-con
|
|||||||
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
|
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
|
||||||
import { CommonMenus } from '@theia/core/lib/browser/common-frontend-contribution';
|
import { CommonMenus } from '@theia/core/lib/browser/common-frontend-contribution';
|
||||||
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application';
|
import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application';
|
||||||
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
|
||||||
import {
|
import {
|
||||||
TabBarToolbarContribution,
|
TabBarToolbarContribution,
|
||||||
TabBarToolbarRegistry,
|
TabBarToolbarRegistry,
|
||||||
@@ -24,7 +23,6 @@ import {
|
|||||||
import { MessageService } from '@theia/core/lib/common/message-service';
|
import { MessageService } from '@theia/core/lib/common/message-service';
|
||||||
import { nls } from '@theia/core/lib/common/nls';
|
import { nls } from '@theia/core/lib/common/nls';
|
||||||
import { isHighContrast } from '@theia/core/lib/common/theme';
|
import { isHighContrast } from '@theia/core/lib/common/theme';
|
||||||
import { ElectronWindowPreferences } from '@theia/core/lib/electron-browser/window/electron-window-preferences';
|
|
||||||
import {
|
import {
|
||||||
inject,
|
inject,
|
||||||
injectable,
|
injectable,
|
||||||
@@ -62,11 +60,11 @@ export class ArduinoFrontendContribution
|
|||||||
@inject(CommandRegistry)
|
@inject(CommandRegistry)
|
||||||
private readonly commandRegistry: CommandRegistry;
|
private readonly commandRegistry: CommandRegistry;
|
||||||
|
|
||||||
@inject(ElectronWindowPreferences)
|
// @inject(ElectronWindowPreferences)
|
||||||
private readonly electronWindowPreferences: ElectronWindowPreferences;
|
// private readonly electronWindowPreferences: ElectronWindowPreferences;
|
||||||
|
|
||||||
@inject(FrontendApplicationStateService)
|
// @inject(FrontendApplicationStateService)
|
||||||
private readonly appStateService: FrontendApplicationStateService;
|
// private readonly appStateService: FrontendApplicationStateService;
|
||||||
|
|
||||||
@postConstruct()
|
@postConstruct()
|
||||||
protected init(): void {
|
protected init(): void {
|
||||||
@@ -82,24 +80,24 @@ export class ArduinoFrontendContribution
|
|||||||
}
|
}
|
||||||
|
|
||||||
onStart(): void {
|
onStart(): void {
|
||||||
this.electronWindowPreferences.onPreferenceChanged((event) => {
|
// this.electronWindowPreferences.onPreferenceChanged((event) => {
|
||||||
if (event.newValue !== event.oldValue) {
|
// if (event.newValue !== event.oldValue) {
|
||||||
switch (event.preferenceName) {
|
// switch (event.preferenceName) {
|
||||||
case 'window.zoomLevel':
|
// case 'window.zoomLevel':
|
||||||
if (typeof event.newValue === 'number') {
|
// if (typeof event.newValue === 'number') {
|
||||||
window.electronTheiaCore.setZoomLevel(event.newValue || 0);
|
// window.electronTheiaCore.setZoomLevel(event.newValue || 0);
|
||||||
}
|
// }
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
this.appStateService.reachedState('ready').then(() =>
|
// this.appStateService.reachedState('ready').then(() =>
|
||||||
this.electronWindowPreferences.ready.then(() => {
|
// this.electronWindowPreferences.ready.then(() => {
|
||||||
const zoomLevel =
|
// const zoomLevel =
|
||||||
this.electronWindowPreferences.get('window.zoomLevel');
|
// this.electronWindowPreferences.get('window.zoomLevel');
|
||||||
window.electronTheiaCore.setZoomLevel(zoomLevel);
|
// window.electronTheiaCore.setZoomLevel(zoomLevel);
|
||||||
})
|
// })
|
||||||
);
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
registerToolbarItems(registry: TabBarToolbarRegistry): void {
|
registerToolbarItems(registry: TabBarToolbarRegistry): void {
|
||||||
|
|||||||
@@ -265,17 +265,12 @@ import {
|
|||||||
} from './dialogs/user-fields/user-fields-dialog';
|
} from './dialogs/user-fields/user-fields-dialog';
|
||||||
import { nls } from '@theia/core/lib/common';
|
import { nls } from '@theia/core/lib/common';
|
||||||
import { IDEUpdaterCommands } from './ide-updater/ide-updater-commands';
|
import { IDEUpdaterCommands } from './ide-updater/ide-updater-commands';
|
||||||
import {
|
import { IDEUpdater, IDEUpdaterClient } from '../common/protocol/ide-updater';
|
||||||
IDEUpdater,
|
|
||||||
IDEUpdaterClient,
|
|
||||||
IDEUpdaterPath,
|
|
||||||
} from '../common/protocol/ide-updater';
|
|
||||||
import { IDEUpdaterClientImpl } from './ide-updater/ide-updater-client-impl';
|
import { IDEUpdaterClientImpl } from './ide-updater/ide-updater-client-impl';
|
||||||
import {
|
import {
|
||||||
IDEUpdaterDialog,
|
IDEUpdaterDialog,
|
||||||
IDEUpdaterDialogProps,
|
IDEUpdaterDialogProps,
|
||||||
} from './dialogs/ide-updater/ide-updater-dialog';
|
} from './dialogs/ide-updater/ide-updater-dialog';
|
||||||
import { ElectronIpcConnectionProvider } from '@theia/core/lib/electron-browser/messaging/electron-ipc-connection-provider';
|
|
||||||
import { MonitorModel } from './monitor-model';
|
import { MonitorModel } from './monitor-model';
|
||||||
import { MonitorManagerProxyClientImpl } from './monitor-manager-proxy-client-impl';
|
import { MonitorManagerProxyClientImpl } from './monitor-manager-proxy-client-impl';
|
||||||
import { EditorManager as TheiaEditorManager } from '@theia/editor/lib/browser/editor-manager';
|
import { EditorManager as TheiaEditorManager } from '@theia/editor/lib/browser/editor-manager';
|
||||||
@@ -295,10 +290,7 @@ import { PreferenceTreeGenerator } from './theia/preferences/preference-tree-gen
|
|||||||
import { PreferenceTreeGenerator as TheiaPreferenceTreeGenerator } from '@theia/preferences/lib/browser/util/preference-tree-generator';
|
import { PreferenceTreeGenerator as TheiaPreferenceTreeGenerator } from '@theia/preferences/lib/browser/util/preference-tree-generator';
|
||||||
import { AboutDialog } from './theia/core/about-dialog';
|
import { AboutDialog } from './theia/core/about-dialog';
|
||||||
import { AboutDialog as TheiaAboutDialog } from '@theia/core/lib/browser/about-dialog';
|
import { AboutDialog as TheiaAboutDialog } from '@theia/core/lib/browser/about-dialog';
|
||||||
import {
|
import { SurveyNotificationService } from '../common/protocol/survey-service';
|
||||||
SurveyNotificationService,
|
|
||||||
SurveyNotificationServicePath,
|
|
||||||
} from '../common/protocol/survey-service';
|
|
||||||
import { WindowContribution } from './theia/core/window-contribution';
|
import { WindowContribution } from './theia/core/window-contribution';
|
||||||
import { WindowContribution as TheiaWindowContribution } from '@theia/core/lib/browser/window-contribution';
|
import { WindowContribution as TheiaWindowContribution } from '@theia/core/lib/browser/window-contribution';
|
||||||
import { CoreErrorHandler } from './contributions/core-error-handler';
|
import { CoreErrorHandler } from './contributions/core-error-handler';
|
||||||
@@ -394,6 +386,8 @@ import {
|
|||||||
VersionWelcomeDialog,
|
VersionWelcomeDialog,
|
||||||
VersionWelcomeDialogProps,
|
VersionWelcomeDialogProps,
|
||||||
} from './dialogs/version-welcome-dialog';
|
} from './dialogs/version-welcome-dialog';
|
||||||
|
import { DialogService } from './dialog-service';
|
||||||
|
import { AppInfo, AppService } from './app-service';
|
||||||
|
|
||||||
// Hack to fix copy/cut/paste issue after electron version update in Theia.
|
// Hack to fix copy/cut/paste issue after electron version update in Theia.
|
||||||
// https://github.com/eclipse-theia/theia/issues/12487
|
// https://github.com/eclipse-theia/theia/issues/12487
|
||||||
@@ -574,14 +568,15 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|||||||
WorkspaceVariableContribution
|
WorkspaceVariableContribution
|
||||||
);
|
);
|
||||||
|
|
||||||
bind(SurveyNotificationService)
|
bind(SurveyNotificationService).toConstantValue(
|
||||||
.toDynamicValue((context) => {
|
{} as SurveyNotificationService
|
||||||
return ElectronIpcConnectionProvider.createProxy(
|
);
|
||||||
context.container,
|
// return ElectronIpcConnectionProvider.createProxy(
|
||||||
SurveyNotificationServicePath
|
// context.container,
|
||||||
);
|
// SurveyNotificationServicePath
|
||||||
})
|
// );
|
||||||
.inSingletonScope();
|
// })
|
||||||
|
// .inSingletonScope();
|
||||||
|
|
||||||
// Layout and shell customizations.
|
// Layout and shell customizations.
|
||||||
rebind(TheiaOutlineViewContribution)
|
rebind(TheiaOutlineViewContribution)
|
||||||
@@ -1039,16 +1034,16 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|||||||
// Frontend binding for the IDE Updater service
|
// Frontend binding for the IDE Updater service
|
||||||
bind(IDEUpdaterClientImpl).toSelf().inSingletonScope();
|
bind(IDEUpdaterClientImpl).toSelf().inSingletonScope();
|
||||||
bind(IDEUpdaterClient).toService(IDEUpdaterClientImpl);
|
bind(IDEUpdaterClient).toService(IDEUpdaterClientImpl);
|
||||||
bind(IDEUpdater)
|
bind(IDEUpdater).toConstantValue({} as IDEUpdater);
|
||||||
.toDynamicValue((context) => {
|
// .toDynamicValue((context) => {
|
||||||
const client = context.container.get(IDEUpdaterClientImpl);
|
// const client = context.container.get(IDEUpdaterClientImpl);
|
||||||
return ElectronIpcConnectionProvider.createProxy(
|
// return ElectronIpcConnectionProvider.createProxy(
|
||||||
context.container,
|
// context.container,
|
||||||
IDEUpdaterPath,
|
// IDEUpdaterPath,
|
||||||
client
|
// client
|
||||||
);
|
// );
|
||||||
})
|
// })
|
||||||
.inSingletonScope();
|
// .inSingletonScope();
|
||||||
|
|
||||||
bind(HostedPluginSupportImpl).toSelf().inSingletonScope();
|
bind(HostedPluginSupportImpl).toSelf().inSingletonScope();
|
||||||
bind(HostedPluginSupport).toService(HostedPluginSupportImpl);
|
bind(HostedPluginSupport).toService(HostedPluginSupportImpl);
|
||||||
@@ -1113,6 +1108,32 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
bindViewsWelcome_TheiaGH14309({ bind, widget: TreeViewWidget });
|
bindViewsWelcome_TheiaGH14309({ bind, widget: TreeViewWidget });
|
||||||
|
|
||||||
|
bind(DialogService).toConstantValue(<DialogService>{});
|
||||||
|
bind(AppService).toConstantValue(<AppService>{
|
||||||
|
quit() {
|
||||||
|
console.log('Quitting application...');
|
||||||
|
// Implement quit logic here
|
||||||
|
},
|
||||||
|
async info() {
|
||||||
|
return {
|
||||||
|
name: 'MyApp',
|
||||||
|
version: '1.0.0',
|
||||||
|
description: 'An example application',
|
||||||
|
appVersion: '1.0.0',
|
||||||
|
cliVersion: '1.0.0',
|
||||||
|
buildDate: new Date().toISOString(),
|
||||||
|
} as AppInfo;
|
||||||
|
},
|
||||||
|
registerStartupTasksHandler(_) {
|
||||||
|
console.log('registerStartupTasksHandler', _);
|
||||||
|
return { dispose: () => {} };
|
||||||
|
},
|
||||||
|
scheduleDeletion(_) {
|
||||||
|
console.log(`Scheduled deletion for sketch}`, _);
|
||||||
|
// Implement deletion logic
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Align the viewsWelcome rendering with VS Code (https://github.com/eclipse-theia/theia/issues/14309)
|
// Align the viewsWelcome rendering with VS Code (https://github.com/eclipse-theia/theia/issues/14309)
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import { Installable } from '../../common/protocol/installable';
|
|||||||
import { ExecuteWithProgress } from '../../common/protocol/progressible';
|
import { ExecuteWithProgress } from '../../common/protocol/progressible';
|
||||||
import { BoardsListWidgetFrontendContribution } from '../boards/boards-widget-frontend-contribution';
|
import { BoardsListWidgetFrontendContribution } from '../boards/boards-widget-frontend-contribution';
|
||||||
import { LibraryListWidgetFrontendContribution } from '../library/library-widget-frontend-contribution';
|
import { LibraryListWidgetFrontendContribution } from '../library/library-widget-frontend-contribution';
|
||||||
import { WindowServiceExt } from '../theia/core/window-service-ext';
|
|
||||||
import type { ListWidget } from '../widgets/component-list/list-widget';
|
import type { ListWidget } from '../widgets/component-list/list-widget';
|
||||||
import { Command, CommandRegistry, Contribution } from './contribution';
|
import { Command, CommandRegistry, Contribution } from './contribution';
|
||||||
|
|
||||||
@@ -53,8 +52,8 @@ const Updatable = { type: 'Updatable' } as const;
|
|||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class CheckForUpdates extends Contribution {
|
export class CheckForUpdates extends Contribution {
|
||||||
@inject(WindowServiceExt)
|
// @inject(WindowServiceExt)
|
||||||
private readonly windowService: WindowServiceExt;
|
// private readonly windowService: WindowServiceExt;
|
||||||
@inject(ResponseServiceClient)
|
@inject(ResponseServiceClient)
|
||||||
private readonly responseService: ResponseServiceClient;
|
private readonly responseService: ResponseServiceClient;
|
||||||
@inject(BoardsService)
|
@inject(BoardsService)
|
||||||
@@ -72,16 +71,16 @@ export class CheckForUpdates extends Contribution {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
override async onReady(): Promise<void> {
|
// override async onReady(): Promise<void> {
|
||||||
const checkForUpdates = this.preferences['arduino.checkForUpdates'];
|
// const checkForUpdates = this.preferences['arduino.checkForUpdates'];
|
||||||
if (checkForUpdates) {
|
// if (checkForUpdates) {
|
||||||
this.windowService.isFirstWindow().then((firstWindow) => {
|
// this.windowService.isFirstWindow().then((firstWindow) => {
|
||||||
if (firstWindow) {
|
// if (firstWindow) {
|
||||||
this.checkForUpdates();
|
// this.checkForUpdates();
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
private async checkForUpdates(silent = true) {
|
private async checkForUpdates(silent = true) {
|
||||||
const [boardsPackages, libraryPackages] = await Promise.all([
|
const [boardsPackages, libraryPackages] = await Promise.all([
|
||||||
|
|||||||
@@ -7,11 +7,10 @@ import { ApplicationShell } from '@theia/core/lib/browser/shell/application-shel
|
|||||||
import { nls } from '@theia/core/lib/common/nls';
|
import { nls } from '@theia/core/lib/common/nls';
|
||||||
import type { MaybePromise } from '@theia/core/lib/common/types';
|
import type { MaybePromise } from '@theia/core/lib/common/types';
|
||||||
import { toArray } from '@theia/core/shared/@phosphor/algorithm';
|
import { toArray } from '@theia/core/shared/@phosphor/algorithm';
|
||||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
import { injectable } from '@theia/core/shared/inversify';
|
||||||
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
|
import { MonacoEditor } from '@theia/monaco/lib/browser/monaco-editor';
|
||||||
import { ArduinoMenus } from '../menu/arduino-menus';
|
import { ArduinoMenus } from '../menu/arduino-menus';
|
||||||
import { CurrentSketch } from '../sketches-service-client-impl';
|
import { CurrentSketch } from '../sketches-service-client-impl';
|
||||||
import { WindowServiceExt } from '../theia/core/window-service-ext';
|
|
||||||
import {
|
import {
|
||||||
Command,
|
Command,
|
||||||
CommandRegistry,
|
CommandRegistry,
|
||||||
@@ -28,8 +27,8 @@ import { SaveAsSketch } from './save-as-sketch';
|
|||||||
*/
|
*/
|
||||||
@injectable()
|
@injectable()
|
||||||
export class Close extends SketchContribution {
|
export class Close extends SketchContribution {
|
||||||
@inject(WindowServiceExt)
|
// @inject(WindowServiceExt)
|
||||||
private readonly windowServiceExt: WindowServiceExt;
|
// private readonly windowServiceExt: WindowServiceExt;
|
||||||
|
|
||||||
private shell: ApplicationShell | undefined;
|
private shell: ApplicationShell | undefined;
|
||||||
|
|
||||||
@@ -59,7 +58,7 @@ export class Close extends SketchContribution {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.windowServiceExt.close();
|
// return this.windowServiceExt.close();
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,12 @@ import { nls } from '@theia/core/lib/common/nls';
|
|||||||
import { inject, injectable } from '@theia/core/shared/inversify';
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||||
import { CoreService, IndexType } from '../../common/protocol';
|
import { CoreService, IndexType } from '../../common/protocol';
|
||||||
import { NotificationCenter } from '../notification-center';
|
import { NotificationCenter } from '../notification-center';
|
||||||
import { WindowServiceExt } from '../theia/core/window-service-ext';
|
|
||||||
import { Command, CommandRegistry, Contribution } from './contribution';
|
import { Command, CommandRegistry, Contribution } from './contribution';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class UpdateIndexes extends Contribution {
|
export class UpdateIndexes extends Contribution {
|
||||||
@inject(WindowServiceExt)
|
// @inject(WindowServiceExt)
|
||||||
private readonly windowService: WindowServiceExt;
|
// private readonly windowService: WindowServiceExt;
|
||||||
@inject(LocalStorageService)
|
@inject(LocalStorageService)
|
||||||
private readonly localStorage: LocalStorageService;
|
private readonly localStorage: LocalStorageService;
|
||||||
@inject(CoreService)
|
@inject(CoreService)
|
||||||
@@ -53,30 +52,28 @@ export class UpdateIndexes extends Contribution {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (await this.windowService.isFirstWindow()) {
|
const summary = await this.coreService.indexUpdateSummaryBeforeInit();
|
||||||
const summary = await this.coreService.indexUpdateSummaryBeforeInit();
|
if (summary.message) {
|
||||||
if (summary.message) {
|
this.messageService.error(summary.message);
|
||||||
this.messageService.error(summary.message);
|
|
||||||
}
|
|
||||||
const typesToCheck = IndexType.All.filter((type) => !(type in summary));
|
|
||||||
if (Object.keys(summary).length) {
|
|
||||||
console.debug(
|
|
||||||
`[update-indexes]: Detected an index update summary before the core gRPC client initialization. Updating local storage with ${JSON.stringify(
|
|
||||||
summary
|
|
||||||
)}`
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
console.debug(
|
|
||||||
'[update-indexes]: No index update summary was available before the core gRPC client initialization. Checking the status of the all the index types.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await Promise.allSettled([
|
|
||||||
...Object.entries(summary).map(([type, updatedAt]) =>
|
|
||||||
this.setLastUpdateDateTime(type as IndexType, updatedAt)
|
|
||||||
),
|
|
||||||
this.updateIndexes(typesToCheck),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
const typesToCheck = IndexType.All.filter((type) => !(type in summary));
|
||||||
|
if (Object.keys(summary).length) {
|
||||||
|
console.debug(
|
||||||
|
`[update-indexes]: Detected an index update summary before the core gRPC client initialization. Updating local storage with ${JSON.stringify(
|
||||||
|
summary
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
console.debug(
|
||||||
|
'[update-indexes]: No index update summary was available before the core gRPC client initialization. Checking the status of the all the index types.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
await Promise.allSettled([
|
||||||
|
...Object.entries(summary).map(([type, updatedAt]) =>
|
||||||
|
this.setLastUpdateDateTime(type as IndexType, updatedAt)
|
||||||
|
),
|
||||||
|
this.updateIndexes(typesToCheck),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private async updateIndexes(
|
private async updateIndexes(
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import { injectable } from '@theia/core/shared/inversify';
|
||||||
|
import {
|
||||||
|
BrowserMainMenuFactory as TheiaBrowserMainMenuFactory,
|
||||||
|
MenuBarWidget,
|
||||||
|
} from '@theia/core/lib/browser/menu/browser-menu-plugin';
|
||||||
|
import { MainMenuManager } from '../../../common/main-menu-manager';
|
||||||
|
|
||||||
|
@injectable()
|
||||||
|
export class BrowserMainMenuFactory
|
||||||
|
extends TheiaBrowserMainMenuFactory
|
||||||
|
implements MainMenuManager
|
||||||
|
{
|
||||||
|
protected menuBar: MenuBarWidget | undefined;
|
||||||
|
|
||||||
|
override createMenuBar(): MenuBarWidget {
|
||||||
|
this.menuBar = super.createMenuBar();
|
||||||
|
return this.menuBar;
|
||||||
|
}
|
||||||
|
|
||||||
|
update(): void {
|
||||||
|
if (this.menuBar) {
|
||||||
|
this.menuBar.clearMenus();
|
||||||
|
this.fillMenuBar(this.menuBar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import '../../../../src/browser/style/browser-menu.css';
|
||||||
|
import { ContainerModule } from '@theia/core/shared/inversify';
|
||||||
|
import {
|
||||||
|
BrowserMenuBarContribution,
|
||||||
|
BrowserMainMenuFactory as TheiaBrowserMainMenuFactory,
|
||||||
|
} from '@theia/core/lib/browser/menu/browser-menu-plugin';
|
||||||
|
import { MainMenuManager } from '../../../common/main-menu-manager';
|
||||||
|
import { ArduinoMenuContribution } from './browser-menu-plugin';
|
||||||
|
import { BrowserMainMenuFactory } from './browser-main-menu-factory';
|
||||||
|
|
||||||
|
export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
||||||
|
bind(BrowserMainMenuFactory).toSelf().inSingletonScope();
|
||||||
|
bind(MainMenuManager).toService(BrowserMainMenuFactory);
|
||||||
|
rebind(TheiaBrowserMainMenuFactory).toService(BrowserMainMenuFactory);
|
||||||
|
rebind(BrowserMenuBarContribution)
|
||||||
|
.to(ArduinoMenuContribution)
|
||||||
|
.inSingletonScope();
|
||||||
|
});
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
import { DefaultWindowService as TheiaDefaultWindowService } from '@theia/core/lib/browser/window/default-window-service';
|
||||||
|
import { injectable } from '@theia/core/shared/inversify';
|
||||||
|
import { WindowServiceExt } from './window-service-ext';
|
||||||
|
|
||||||
|
@injectable()
|
||||||
|
export class DefaultWindowService
|
||||||
|
extends TheiaDefaultWindowService
|
||||||
|
implements WindowServiceExt
|
||||||
|
{
|
||||||
|
close(): void {
|
||||||
|
throw new Error('Method not implemented.');
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* The default implementation always resolves to `true`.
|
||||||
|
* IDE2 does not use it. It's currently an electron-only app.
|
||||||
|
*/
|
||||||
|
async isFirstWindow(): Promise<boolean> {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
import { DefaultWindowService as TheiaDefaultWindowService } from '@theia/core/lib/browser/window/default-window-service';
|
||||||
|
import { injectable } from '@theia/core/shared/inversify';
|
||||||
|
import { WindowServiceExt } from './window-service-ext';
|
||||||
|
|
||||||
|
@injectable()
|
||||||
|
export class DefaultWindowService
|
||||||
|
extends TheiaDefaultWindowService
|
||||||
|
implements WindowServiceExt
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The default implementation always resolves to `true`.
|
||||||
|
* IDE2 does not use it. It's currently an electron-only app.
|
||||||
|
*/
|
||||||
|
async isFirstWindow(): Promise<boolean> {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
close() {
|
||||||
|
console.log('close');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,7 +22,6 @@ import { MonacoThemeRegistry as TheiaMonacoThemeRegistry } from '@theia/monaco/l
|
|||||||
import type { ThemeMix } from '@theia/monaco/lib/browser/textmate/monaco-theme-types';
|
import type { ThemeMix } from '@theia/monaco/lib/browser/textmate/monaco-theme-types';
|
||||||
import { HostedPluginSupport } from '../../hosted/hosted-plugin-support';
|
import { HostedPluginSupport } from '../../hosted/hosted-plugin-support';
|
||||||
import { ArduinoThemes, compatibleBuiltInTheme } from '../core/theming';
|
import { ArduinoThemes, compatibleBuiltInTheme } from '../core/theming';
|
||||||
import { WindowServiceExt } from '../core/window-service-ext';
|
|
||||||
|
|
||||||
type MonacoThemeRegistrationSource =
|
type MonacoThemeRegistrationSource =
|
||||||
/**
|
/**
|
||||||
@@ -156,8 +155,8 @@ export class CleanupObsoleteThemes implements FrontendApplicationContribution {
|
|||||||
private readonly themeService: ThemeService;
|
private readonly themeService: ThemeService;
|
||||||
@inject(MessageService)
|
@inject(MessageService)
|
||||||
private readonly messageService: MessageService;
|
private readonly messageService: MessageService;
|
||||||
@inject(WindowServiceExt)
|
// @inject(WindowServiceExt)
|
||||||
private readonly windowService: WindowServiceExt;
|
// private readonly windowService: WindowServiceExt;
|
||||||
|
|
||||||
onStart(): void {
|
onStart(): void {
|
||||||
this.hostedPlugin.didStart.then(() => this.cleanupObsoleteThemes());
|
this.hostedPlugin.didStart.then(() => this.cleanupObsoleteThemes());
|
||||||
@@ -172,7 +171,7 @@ export class CleanupObsoleteThemes implements FrontendApplicationContribution {
|
|||||||
if (!obsoleteThemeIds.length) {
|
if (!obsoleteThemeIds.length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const firstWindow = await this.windowService.isFirstWindow();
|
const firstWindow = true; // await this.windowService.isFirstWindow();
|
||||||
if (firstWindow) {
|
if (firstWindow) {
|
||||||
await this.removeObsoleteThemesFromIndexedDB(obsoleteThemeIds);
|
await this.removeObsoleteThemesFromIndexedDB(obsoleteThemeIds);
|
||||||
this.unregisterObsoleteThemes(obsoleteThemeIds);
|
this.unregisterObsoleteThemes(obsoleteThemeIds);
|
||||||
|
|||||||
@@ -19,14 +19,13 @@ import {
|
|||||||
hasStartupTasks,
|
hasStartupTasks,
|
||||||
StartupTask,
|
StartupTask,
|
||||||
} from '../../../electron-common/startup-task';
|
} from '../../../electron-common/startup-task';
|
||||||
import { WindowServiceExt } from '../core/window-service-ext';
|
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class WorkspaceService extends TheiaWorkspaceService {
|
export class WorkspaceService extends TheiaWorkspaceService {
|
||||||
@inject(SketchesService)
|
@inject(SketchesService)
|
||||||
private readonly sketchesService: SketchesService;
|
private readonly sketchesService: SketchesService;
|
||||||
@inject(WindowServiceExt)
|
// @inject(WindowServiceExt)
|
||||||
private readonly windowServiceExt: WindowServiceExt;
|
// private readonly windowServiceExt: WindowServiceExt;
|
||||||
@inject(ContributionProvider)
|
@inject(ContributionProvider)
|
||||||
@named(StartupTaskProvider)
|
@named(StartupTaskProvider)
|
||||||
private readonly providers: ContributionProvider<StartupTaskProvider>;
|
private readonly providers: ContributionProvider<StartupTaskProvider>;
|
||||||
@@ -104,7 +103,8 @@ export class WorkspaceService extends TheiaWorkspaceService {
|
|||||||
protected override reloadWindow(options?: WorkspaceInput): void {
|
protected override reloadWindow(options?: WorkspaceInput): void {
|
||||||
const tasks = this.tasks(options);
|
const tasks = this.tasks(options);
|
||||||
this.setURLFragment(this._workspace?.resource.path.toString() || '');
|
this.setURLFragment(this._workspace?.resource.path.toString() || '');
|
||||||
this.windowServiceExt.reload({ tasks });
|
console.log(tasks);
|
||||||
|
// this.windowServiceExt.reload({ tasks });
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override openNewWindow(
|
protected override openNewWindow(
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
export const MainMenuManager = Symbol('MainMenuManager');
|
// export const MainMenuManager = Symbol('MainMenuManager');
|
||||||
export interface MainMenuManager {
|
export class MainMenuManager {
|
||||||
/**
|
/**
|
||||||
* Call this method if you have changed the content of the main menu (updated a toggle flag, removed/added new groups or menu items)
|
* Call this method if you have changed the content of the main menu (updated a toggle flag, removed/added new groups or menu items)
|
||||||
* and you want to re-render it from scratch. Works for electron too.
|
* and you want to re-render it from scratch. Works for electron too.
|
||||||
*/
|
*/
|
||||||
update(): void;
|
update() {
|
||||||
|
console.warn('MainMenuManager.update() is not implemented');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
64
browser-app/package.json
Normal file
64
browser-app/package.json
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
{
|
||||||
|
"private": true,
|
||||||
|
"name": "browser-app",
|
||||||
|
"version": "2.0.0",
|
||||||
|
"license": "AGPL-3.0-or-later",
|
||||||
|
"dependencies": {
|
||||||
|
"@theia/core": "1.41.0",
|
||||||
|
"@theia/debug": "1.41.0",
|
||||||
|
"@theia/editor": "1.41.0",
|
||||||
|
"@theia/file-search": "1.41.0",
|
||||||
|
"@theia/filesystem": "1.41.0",
|
||||||
|
"@theia/keymaps": "1.41.0",
|
||||||
|
"@theia/messages": "1.41.0",
|
||||||
|
"@theia/monaco": "1.41.0",
|
||||||
|
"@theia/navigator": "1.41.0",
|
||||||
|
"@theia/plugin-ext": "1.41.0",
|
||||||
|
"@theia/plugin-ext-vscode": "1.41.0",
|
||||||
|
"@theia/preferences": "1.41.0",
|
||||||
|
"@theia/process": "1.41.0",
|
||||||
|
"@theia/terminal": "1.41.0",
|
||||||
|
"@theia/workspace": "1.41.0",
|
||||||
|
"arduino-ide-extension": "2.3.5"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@theia/cli": "1.41.0"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"build:dev": "theia build --config webpack.config.js --mode development",
|
||||||
|
"prepare": "theia build --mode development",
|
||||||
|
"start": "theia start",
|
||||||
|
"watch": "theia build --watch --mode development"
|
||||||
|
},
|
||||||
|
"theia": {
|
||||||
|
"frontend": {
|
||||||
|
"config": {
|
||||||
|
"applicationName": "Arduino IDE",
|
||||||
|
"defaultTheme": "arduino-theme",
|
||||||
|
"preferences": {
|
||||||
|
"files.autoSave": "afterDelay",
|
||||||
|
"editor.minimap.enabled": false,
|
||||||
|
"editor.tabSize": 2,
|
||||||
|
"editor.scrollBeyondLastLine": false,
|
||||||
|
"editor.quickSuggestions": {
|
||||||
|
"other": false,
|
||||||
|
"comments": false,
|
||||||
|
"strings": false
|
||||||
|
},
|
||||||
|
"breadcrumbs.enabled": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"backend": {
|
||||||
|
"config": {
|
||||||
|
"configDirName": ".arduinoIDE"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"generator": {
|
||||||
|
"config": {
|
||||||
|
"preloadTemplate": "<div class='theia-preload' style='background-color: rgb(237, 241, 242);'></div>"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
20
browser-app/webpack.config.js
Normal file
20
browser-app/webpack.config.js
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
/**
|
||||||
|
* This file can be edited to customize webpack configuration.
|
||||||
|
* To reset delete this file and rerun theia build again.
|
||||||
|
*/
|
||||||
|
// @ts-check
|
||||||
|
const config = require('./gen-webpack.config.js');
|
||||||
|
|
||||||
|
config[0].resolve.fallback['http'] = false;
|
||||||
|
config[0].resolve.fallback['fs'] = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expose bundled modules on window.theia.moduleName namespace, e.g.
|
||||||
|
* window['theia']['@theia/core/lib/common/uri'].
|
||||||
|
* Such syntax can be used by external code, for instance, for testing.
|
||||||
|
config.module.rules.push({
|
||||||
|
test: /\.js$/,
|
||||||
|
loader: require.resolve('@theia/application-manager/lib/expose-loader')
|
||||||
|
}); */
|
||||||
|
|
||||||
|
module.exports = config;
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "lerna run prepare",
|
"prepare": "lerna run prepare",
|
||||||
"cleanup": "rimraf ./**/node_modules && rm -rf ./node_modules ./.browser_modules ./arduino-ide-extension/build ./arduino-ide-extension/downloads ./arduino-ide-extension/Examples ./arduino-ide-extension/lib ./electron-app/lib ./electron-app/src-gen ./electron-app/gen-webpack.config.js",
|
"cleanup": "rimraf ./**/node_modules && rm -rf ./node_modules ./.browser_modules ./arduino-ide-extension/build ./arduino-ide-extension/downloads ./arduino-ide-extension/Examples ./arduino-ide-extension/lib ./electron-app/lib ./electron-app/src-gen ./electron-app/gen-webpack.config.js ./browser-app/lib ./browser-app/src-gen ./browser-app/gen-webpack.config.js",
|
||||||
"rebuild:browser": "theia rebuild:browser",
|
"rebuild:browser": "theia rebuild:browser",
|
||||||
"rebuild:electron": "theia rebuild:electron",
|
"rebuild:electron": "theia rebuild:electron",
|
||||||
"start": "yarn --cwd ./electron-app start",
|
"start": "yarn --cwd ./electron-app start",
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
"test": "lerna run test",
|
"test": "lerna run test",
|
||||||
"test:slow": "lerna run test:slow",
|
"test:slow": "lerna run test:slow",
|
||||||
"update:version": "node ./scripts/update-version.js",
|
"update:version": "node ./scripts/update-version.js",
|
||||||
"i18n:generate": "theia nls-extract -e vscode -f \"+(arduino-ide-extension|electron-app|plugins)/**/*.ts?(x)\" -o ./i18n/en.json",
|
"i18n:generate": "theia nls-extract -e vscode -f \"+(arduino-ide-extension|browser-app|electron-app|plugins)/**/*.ts?(x)\" -o ./i18n/en.json",
|
||||||
"i18n:check": "yarn i18n:generate && git add -N ./i18n && git diff --exit-code ./i18n",
|
"i18n:check": "yarn i18n:generate && git add -N ./i18n && git diff --exit-code ./i18n",
|
||||||
"i18n:push": "node ./scripts/i18n/transifex-push.js ./i18n/en.json",
|
"i18n:push": "node ./scripts/i18n/transifex-push.js ./i18n/en.json",
|
||||||
"i18n:pull": "node ./scripts/i18n/transifex-pull.js ./i18n/",
|
"i18n:pull": "node ./scripts/i18n/transifex-pull.js ./i18n/",
|
||||||
@@ -74,6 +74,7 @@
|
|||||||
},
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"arduino-ide-extension",
|
"arduino-ide-extension",
|
||||||
"electron-app"
|
"electron-app",
|
||||||
|
"browser-app"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ console.log(
|
|||||||
for (const toUpdate of [
|
for (const toUpdate of [
|
||||||
path.join(repoRootPath, 'package.json'),
|
path.join(repoRootPath, 'package.json'),
|
||||||
path.join(repoRootPath, 'electron-app', 'package.json'),
|
path.join(repoRootPath, 'electron-app', 'package.json'),
|
||||||
|
path.join(repoRootPath, 'browser-app', 'package.json'),
|
||||||
path.join(repoRootPath, 'arduino-ide-extension', 'package.json'),
|
path.join(repoRootPath, 'arduino-ide-extension', 'package.json'),
|
||||||
]) {
|
]) {
|
||||||
process.stdout.write(` Updating ${toUpdate}'...`);
|
process.stdout.write(` Updating ${toUpdate}'...`);
|
||||||
|
|||||||
Reference in New Issue
Block a user