Skip to content

Commit 9d72d7a

Browse files
author
Akos Kitta
committed
Reveal the error location after on failed verify.
Closes #608 Signed-off-by: Akos Kitta <[email protected]>
1 parent 4c62431 commit 9d72d7a

25 files changed

+1417
-421
lines changed

Diff for: arduino-ide-extension/src/browser/arduino-ide-frontend-module.ts

+4
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,8 @@ import { PreferenceTreeGenerator } from './theia/preferences/preference-tree-gen
291291
import { PreferenceTreeGenerator as TheiaPreferenceTreeGenerator } from '@theia/preferences/lib/browser/util/preference-tree-generator';
292292
import { AboutDialog } from './theia/core/about-dialog';
293293
import { AboutDialog as TheiaAboutDialog } from '@theia/core/lib/browser/about-dialog';
294+
import { CoreErrorHandler } from './contributions/core-error-handler';
295+
import { CompilerErrors } from './contributions/compiler-errors';
294296

295297
MonacoThemingService.register({
296298
id: 'arduino-theme',
@@ -423,6 +425,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
423425
)
424426
)
425427
.inSingletonScope();
428+
bind(CoreErrorHandler).toSelf().inSingletonScope();
426429

427430
// Serial monitor
428431
bind(MonitorWidget).toSelf();
@@ -670,6 +673,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
670673
Contribution.configure(bind, AddZipLibrary);
671674
Contribution.configure(bind, PlotterFrontendContribution);
672675
Contribution.configure(bind, Format);
676+
Contribution.configure(bind, CompilerErrors);
673677

674678
// Disabled the quick-pick customization from Theia when multiple formatters are available.
675679
// Use the default VS Code behavior, and pick the first one. In the IDE2, clang-format has `exclusive` selectors.

Diff for: arduino-ide-extension/src/browser/arduino-preferences.ts

+9
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ export const ArduinoConfigSchema: PreferenceSchema = {
3333
),
3434
default: false,
3535
},
36+
'arduino.compile.experimental': {
37+
type: 'boolean',
38+
description: nls.localize(
39+
'arduino/preferences/compile.experimental',
40+
'True if the IDE should handle multiple compiler errors. False by default'
41+
),
42+
default: false,
43+
},
3644
'arduino.compile.warnings': {
3745
enum: [...CompilerWarningLiterals],
3846
description: nls.localize(
@@ -180,6 +188,7 @@ export const ArduinoConfigSchema: PreferenceSchema = {
180188
export interface ArduinoConfiguration {
181189
'arduino.language.log': boolean;
182190
'arduino.compile.verbose': boolean;
191+
'arduino.compile.experimental': boolean;
183192
'arduino.compile.warnings': CompilerWarnings;
184193
'arduino.upload.verbose': boolean;
185194
'arduino.upload.verify': boolean;

Diff for: arduino-ide-extension/src/browser/contributions/burn-bootloader.ts

+4-19
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
11
import { inject, injectable } from '@theia/core/shared/inversify';
2-
import { OutputChannelManager } from '@theia/output/lib/browser/output-channel';
3-
import { CoreService } from '../../common/protocol';
42
import { ArduinoMenus } from '../menu/arduino-menus';
53
import { BoardsDataStore } from '../boards/boards-data-store';
64
import { BoardsServiceProvider } from '../boards/boards-service-provider';
75
import {
8-
SketchContribution,
6+
CoreServiceContribution,
97
Command,
108
CommandRegistry,
119
MenuModelRegistry,
1210
} from './contribution';
1311
import { nls } from '@theia/core/lib/common';
1412

1513
@injectable()
16-
export class BurnBootloader extends SketchContribution {
17-
@inject(CoreService)
18-
protected readonly coreService: CoreService;
19-
20-
14+
export class BurnBootloader extends CoreServiceContribution {
2115
@inject(BoardsDataStore)
2216
protected readonly boardsDataStore: BoardsDataStore;
2317

2418
@inject(BoardsServiceProvider)
2519
protected readonly boardsServiceClientImpl: BoardsServiceProvider;
2620

27-
@inject(OutputChannelManager)
28-
protected override readonly outputChannelManager: OutputChannelManager;
29-
3021
override registerCommands(registry: CommandRegistry): void {
3122
registry.registerCommand(BurnBootloader.Commands.BURN_BOOTLOADER, {
3223
execute: () => this.burnBootloader(),
@@ -62,7 +53,7 @@ export class BurnBootloader extends SketchContribution {
6253
...boardsConfig.selectedBoard,
6354
name: boardsConfig.selectedBoard?.name || '',
6455
fqbn,
65-
}
56+
};
6657
this.outputChannelManager.getChannel('Arduino').clear();
6758
await this.coreService.burnBootloader({
6859
board,
@@ -81,13 +72,7 @@ export class BurnBootloader extends SketchContribution {
8172
}
8273
);
8374
} catch (e) {
84-
let errorMessage = "";
85-
if (typeof e === "string") {
86-
errorMessage = e;
87-
} else {
88-
errorMessage = e.toString();
89-
}
90-
this.messageService.error(errorMessage);
75+
this.handleError(e);
9176
}
9277
}
9378
}

0 commit comments

Comments
 (0)