@@ -29,6 +29,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
2929import { INavigatorWithKeyboard } from 'vs/workbench/services/keybinding/common/navigatorKeyboard' ;
3030import { INotificationService , Severity } from 'vs/platform/notification/common/notification' ;
3131import { ICommandService } from 'vs/platform/commands/common/commands' ;
32+ import { StorageScope , IStorageService } from 'vs/platform/storage/common/storage' ;
3233
3334export class BrowserKeyboardMapperFactoryBase {
3435 // keyboard mapper
@@ -72,6 +73,7 @@ export class BrowserKeyboardMapperFactoryBase {
7273
7374 protected constructor (
7475 private _notificationService : INotificationService ,
76+ private _storageService : IStorageService ,
7577 private _commandService : ICommandService
7678 ) {
7779 this . _keyboardMapper = null ;
@@ -180,14 +182,23 @@ export class BrowserKeyboardMapperFactoryBase {
180182 let score = matchedKeyboardLayout . score ;
181183
182184 if ( keymap && score < 0 ) {
185+ const donotAskUpdateKey = 'missing.keyboardlayout.donotask' ;
186+ if ( this . _storageService . getBoolean ( donotAskUpdateKey , StorageScope . GLOBAL ) ) {
187+ return ;
188+ }
189+
183190 // the keyboard layout doesn't actually match the key event or the keymap from chromium
184191 this . _notificationService . prompt (
185192 Severity . Info ,
186193 nls . localize ( 'missing.keyboardlayout' , 'Fail to find matching keyboard layout' ) ,
187194 [ {
188195 label : nls . localize ( 'keyboardLayoutMissing.configure' , "Configure" ) ,
189196 run : ( ) => this . _commandService . executeCommand ( 'workbench.action.openKeyboardLayoutPicker' )
190- } ] ,
197+ } , {
198+ label : nls . localize ( 'neverAgain' , "Don't Show Again" ) ,
199+ isSecondary : true ,
200+ run : ( ) => this . _storageService . store ( donotAskUpdateKey , true , StorageScope . GLOBAL )
201+ } ]
191202 ) ;
192203
193204 return ;
@@ -413,8 +424,8 @@ export class BrowserKeyboardMapperFactoryBase {
413424}
414425
415426export class BrowserKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBase {
416- constructor ( notificationService : INotificationService , commandService : ICommandService ) {
417- super ( notificationService , commandService ) ;
427+ constructor ( notificationService : INotificationService , storageService : IStorageService , commandService : ICommandService ) {
428+ super ( notificationService , storageService , commandService ) ;
418429
419430 const platform = isWindows ? 'win' : isMacintosh ? 'darwin' : 'linux' ;
420431
@@ -549,13 +560,14 @@ class BrowserKeymapService extends Disposable implements IKeymapService {
549560 @IEnvironmentService environmentService : IEnvironmentService ,
550561 @IFileService fileService : IFileService ,
551562 @INotificationService notificationService : INotificationService ,
563+ @IStorageService storageService : IStorageService ,
552564 @ICommandService commandService : ICommandService ,
553565 @IConfigurationService private configurationService : IConfigurationService ,
554566 ) {
555567 super ( ) ;
556568 const keyboardConfig = configurationService . getValue < { layout : string } > ( 'keyboard' ) ;
557569 const layout = keyboardConfig . layout ;
558- this . _factory = new BrowserKeyboardMapperFactory ( notificationService , commandService ) ;
570+ this . _factory = new BrowserKeyboardMapperFactory ( notificationService , storageService , commandService ) ;
559571
560572 this . registerKeyboardListener ( ) ;
561573
0 commit comments