Skip to content

Commit 71ab9cd

Browse files
author
Akos Kitta
committed
fix: remove obsolete select programmer contrib
due to CLI API changes, IDE2 cannot behave reactively, and perform a command on error. `GetDebugConfigRequest` params must be valid. Signed-off-by: Akos Kitta <[email protected]>
1 parent a096c4e commit 71ab9cd

File tree

4 files changed

+7
-134
lines changed

4 files changed

+7
-134
lines changed

arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

-2
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ import { TerminalFrontendContribution as TheiaTerminalFrontendContribution } fro
361361
import { SelectionService } from '@theia/core/lib/common/selection-service';
362362
import { CommandService } from '@theia/core/lib/common/command';
363363
import { CorePreferences } from '@theia/core/lib/browser/core-preferences';
364-
import { SelectProgrammer } from './contributions/select-programmer';
365364
import { AutoSelectProgrammer } from './contributions/auto-select-programmer';
366365
import { HostedPluginSupport } from './hosted/hosted-plugin-support';
367366

@@ -759,7 +758,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
759758
Contribution.configure(bind, CreateCloudCopy);
760759
Contribution.configure(bind, UpdateArduinoState);
761760
Contribution.configure(bind, BoardsDataMenuUpdater);
762-
Contribution.configure(bind, SelectProgrammer);
763761
Contribution.configure(bind, AutoSelectProgrammer);
764762

765763
bindContributionProvider(bind, StartupTaskProvider);

arduino-ide-extension/src/browser/contributions/debug.ts

+5-43
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import { MenuModelRegistry } from '@theia/core/lib/common/menu/menu-model-regist
33
import { nls } from '@theia/core/lib/common/nls';
44
import { MaybePromise } from '@theia/core/lib/common/types';
55
import { inject, injectable } from '@theia/core/shared/inversify';
6-
import {
7-
SelectManually,
8-
noBoardSelected,
9-
noSketchOpened,
10-
} from '../../common/nls';
6+
import { noBoardSelected, noSketchOpened } from '../../common/nls';
117
import {
128
BoardDetails,
139
BoardIdentifier,
@@ -17,7 +13,6 @@ import {
1713
SketchRef,
1814
isBoardIdentifierChangeEvent,
1915
isCompileSummary,
20-
isProgrammer,
2116
} from '../../common/protocol';
2217
import { BoardsDataStore } from '../boards/boards-data-store';
2318
import { BoardsServiceProvider } from '../boards/boards-service-provider';
@@ -225,43 +220,10 @@ export class Debug extends SketchContribution {
225220
const result = await this.debug(params);
226221
return Boolean(result);
227222
} catch (err) {
228-
const yes = nls.localize('vscode/extensionsUtils/yes', 'Yes');
229-
const sketchUri = await this.fileSystemExt.getUri(params.sketchPath);
230-
const sketch = SketchRef.fromUri(sketchUri);
231-
if (err instanceof Error && /missing programmer/gi.test(err.message)) {
232-
const answer = await this.messageService.warn(
233-
nls.localize(
234-
'arduino/debug/programmerNotSelected',
235-
'The debugger requires a programmer. Do you want to select a programmer? You can select it manually from the Tools > Programmer menu.'
236-
),
237-
SelectManually,
238-
yes
239-
);
240-
if (answer === yes) {
241-
const result = await this.commandService.executeCommand(
242-
'arduino-select-programmer'
243-
);
244-
if (isProgrammer(result)) {
245-
return this.startDebug();
246-
}
247-
}
248-
} else if (await this.isSketchNotVerifiedError(err, sketch)) {
249-
const answer = await this.messageService.error(
250-
nls.localize(
251-
'arduino/debug/sketchIsNotCompiled',
252-
"Sketch '{0}' must be verified before starting a debug session.",
253-
sketch.name
254-
),
255-
yes
256-
);
257-
if (answer === yes) {
258-
this.commandService.executeCommand('arduino-verify-sketch');
259-
}
260-
} else {
261-
this.messageService.error(
262-
err instanceof Error ? err.message : String(err)
263-
);
264-
}
223+
console.error(err);
224+
this.messageService.error(
225+
err instanceof Error ? err.message : String(err)
226+
);
265227
}
266228
return false;
267229
}

arduino-ide-extension/src/browser/contributions/select-programmer.ts

-87
This file was deleted.

arduino-ide-extension/src/test/browser/debug.test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { DisposableCollection } from '@theia/core/lib/common/disposable';
99
import { CommandEvent, CommandRegistry } from '@theia/core/lib/common/command';
1010
import { Emitter } from '@theia/core/lib/common/event';
1111
import { deepClone } from '@theia/core/lib/common/objects';
12+
import { wait } from '@theia/core/lib/common/promise-util';
1213
import { Mutable } from '@theia/core/lib/common/types';
1314
import {
1415
Container,
@@ -35,18 +36,17 @@ import { noBoardSelected, noSketchOpened } from '../../common/nls';
3536
import {
3637
BoardsConfigChangeEvent,
3738
BoardsPackage,
39+
CompileSummary,
3840
ExecutableService,
3941
type BoardDetails,
4042
type Programmer,
4143
type Sketch,
42-
CompileSummary,
4344
} from '../../common/protocol';
4445
import {
4546
BoardsConfig,
4647
emptyBoardsConfig,
4748
} from '../../common/protocol/boards-service';
4849
import { bindSketchesContribution } from './browser-test-bindings';
49-
import { wait } from '@theia/core/lib/common/promise-util';
5050
import { aPackage } from './fixtures/boards';
5151

5252
disableJSDOM();

0 commit comments

Comments
 (0)