diff --git a/arduino-ide-extension/src/browser/arduino-preferences.ts b/arduino-ide-extension/src/browser/arduino-preferences.ts index 42e6cedf..919cd8e5 100644 --- a/arduino-ide-extension/src/browser/arduino-preferences.ts +++ b/arduino-ide-extension/src/browser/arduino-preferences.ts @@ -1,11 +1,6 @@ import { interfaces } from 'inversify'; -import { - createPreferenceProxy, - PreferenceProxy, - PreferenceService, - PreferenceContribution, - PreferenceSchema -} from '@theia/core/lib/browser/preferences'; +import { createPreferenceProxy, PreferenceProxy, PreferenceService, PreferenceContribution, PreferenceSchema } from '@theia/core/lib/browser/preferences'; +import { CompilerWarningLiterals, CompilerWarnings } from '../common/protocol'; export const ArduinoConfigSchema: PreferenceSchema = { 'type': 'object', @@ -20,6 +15,11 @@ export const ArduinoConfigSchema: PreferenceSchema = { 'description': 'True for verbose compile output. False by default', 'default': false }, + 'arduino.compile.warnings': { + 'enum': [...CompilerWarningLiterals], + 'description': "Tells gcc which warning level to use. It's 'None' by default", + 'default': 'None' + }, 'arduino.upload.verbose': { 'type': 'boolean', 'description': 'True for verbose upload output. False by default.', @@ -50,6 +50,7 @@ export const ArduinoConfigSchema: PreferenceSchema = { export interface ArduinoConfiguration { 'arduino.language.log': boolean; 'arduino.compile.verbose': boolean; + 'arduino.compile.warnings': CompilerWarnings; 'arduino.upload.verbose': boolean; 'arduino.upload.verify': boolean; 'arduino.window.autoScale': boolean; diff --git a/arduino-ide-extension/src/browser/contributions/verify-sketch.ts b/arduino-ide-extension/src/browser/contributions/verify-sketch.ts index d01869fa..7522d594 100644 --- a/arduino-ide-extension/src/browser/contributions/verify-sketch.ts +++ b/arduino-ide-extension/src/browser/contributions/verify-sketch.ts @@ -80,6 +80,7 @@ export class VerifySketch extends SketchContribution { this.sourceOverride() ]); const verbose = this.preferences.get('arduino.compile.verbose'); + const compilerWarnings = this.preferences.get('arduino.compile.warnings'); this.outputChannelManager.getChannel('Arduino').clear(); await this.coreService.compile({ sketchUri: sketch.uri, @@ -87,7 +88,8 @@ export class VerifySketch extends SketchContribution { optimizeForDebug: this.editorMode.compileForDebug, verbose, exportBinaries, - sourceOverride + sourceOverride, + compilerWarnings }); this.messageService.info('Done compiling.', { timeout: 1000 }); } catch (e) { diff --git a/arduino-ide-extension/src/browser/settings.tsx b/arduino-ide-extension/src/browser/settings.tsx index b856ea93..65086840 100644 --- a/arduino-ide-extension/src/browser/settings.tsx +++ b/arduino-ide-extension/src/browser/settings.tsx @@ -18,7 +18,7 @@ import { DisposableCollection } from '@theia/core/lib/common/disposable'; import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state'; import { AbstractDialog, DialogProps, PreferenceService, PreferenceScope, DialogError, ReactWidget } from '@theia/core/lib/browser'; import { Index } from '../common/types'; -import { ConfigService, FileSystemExt, Network, ProxySettings } from '../common/protocol'; +import { CompilerWarnings, CompilerWarningLiterals, ConfigService, FileSystemExt, Network, ProxySettings } from '../common/protocol'; export interface Settings extends Index { editorFontSize: number; // `editor.fontSize` @@ -29,6 +29,7 @@ export interface Settings extends Index { interfaceScale: number; // `arduino.window.zoomLevel` https://github.com/eclipse-theia/theia/issues/8751 checkForUpdates?: boolean; // `arduino.ide.autoUpdate` verboseOnCompile: boolean; // `arduino.compile.verbose` + compilerWarnings: CompilerWarnings; // `arduino.compile.warnings` verboseOnUpload: boolean; // `arduino.upload.verbose` verifyAfterUpload: boolean; // `arduino.upload.verify` enableLsLogs: boolean; // `arduino.language.log` @@ -87,6 +88,7 @@ export class SettingsService { interfaceScale, // checkForUpdates, verboseOnCompile, + compilerWarnings, verboseOnUpload, verifyAfterUpload, enableLsLogs, @@ -99,6 +101,7 @@ export class SettingsService { this.preferenceService.get('arduino.window.zoomLevel', 0), // this.preferenceService.get('arduino.ide.autoUpdate', true), this.preferenceService.get('arduino.compile.verbose', true), + this.preferenceService.get('arduino.compile.warnings', 'None'), this.preferenceService.get('arduino.upload.verbose', true), this.preferenceService.get('arduino.upload.verify', true), this.preferenceService.get('arduino.language.log', true), @@ -114,6 +117,7 @@ export class SettingsService { interfaceScale, // checkForUpdates, verboseOnCompile, + compilerWarnings, verboseOnUpload, verifyAfterUpload, enableLsLogs, @@ -175,6 +179,7 @@ export class SettingsService { interfaceScale, // checkForUpdates, verboseOnCompile, + compilerWarnings, verboseOnUpload, verifyAfterUpload, enableLsLogs, @@ -198,6 +203,7 @@ export class SettingsService { this.preferenceService.set('arduino.window.zoomLevel', interfaceScale, PreferenceScope.User), // this.preferenceService.set('arduino.ide.autoUpdate', checkForUpdates, PreferenceScope.User), this.preferenceService.set('arduino.compile.verbose', verboseOnCompile, PreferenceScope.User), + this.preferenceService.set('arduino.compile.warnings', compilerWarnings, PreferenceScope.User), this.preferenceService.set('arduino.upload.verbose', verboseOnUpload, PreferenceScope.User), this.preferenceService.set('arduino.upload.verify', verifyAfterUpload, PreferenceScope.User), this.preferenceService.set('arduino.language.log', enableLsLogs, PreferenceScope.User), @@ -267,6 +273,7 @@ export class SettingsComponent extends React.ComponentInterface scale:
Theme:
Show verbose output during:
+
Compiler warnings:
@@ -321,6 +328,14 @@ export class SettingsComponent extends React.Component
+
+ +