@@ -21,7 +21,7 @@ exports.assign = function assign(destination, source) {
2121 *
2222 * @param {string[] } modulePaths
2323 * @param {(result, configuration: object) => any } resultCallback
24- * @param {{ forceEnableDeveloperKeybindings?: boolean, removeDeveloperKeybindingsAfterLoad?: boolean, canModifyDOM?: (config: object) => void, beforeLoaderConfig?: (config: object, loaderConfig: object) => void, beforeRequire?: () => void }= } options
24+ * @param {{ forceEnableDeveloperKeybindings?: boolean, disallowReloadKeybinding?: boolean, removeDeveloperKeybindingsAfterLoad?: boolean, canModifyDOM?: (config: object) => void, beforeLoaderConfig?: (config: object, loaderConfig: object) => void, beforeRequire?: () => void }= } options
2525 */
2626exports . load = function ( modulePaths , resultCallback , options ) {
2727
@@ -58,7 +58,7 @@ exports.load = function (modulePaths, resultCallback, options) {
5858 const enableDeveloperTools = ( process . env [ 'VSCODE_DEV' ] || ! ! configuration . extensionDevelopmentPath ) && ! configuration . extensionTestsPath ;
5959 let developerToolsUnbind ;
6060 if ( enableDeveloperTools || ( options && options . forceEnableDeveloperKeybindings ) ) {
61- developerToolsUnbind = registerDeveloperKeybindings ( ) ;
61+ developerToolsUnbind = registerDeveloperKeybindings ( options && options . disallowReloadKeybinding ) ;
6262 }
6363
6464 // Correctly inherit the parent's environment
@@ -159,9 +159,10 @@ function parseURLQueryArgs() {
159159}
160160
161161/**
162+ * @param {boolean } disallowReloadKeybinding
162163 * @returns {() => void }
163164 */
164- function registerDeveloperKeybindings ( ) {
165+ function registerDeveloperKeybindings ( disallowReloadKeybinding ) {
165166
166167 // @ts -ignore
167168 const ipc = require ( 'electron' ) . ipcRenderer ;
@@ -185,7 +186,7 @@ function registerDeveloperKeybindings() {
185186 const key = extractKey ( e ) ;
186187 if ( key === TOGGLE_DEV_TOOLS_KB || key === TOGGLE_DEV_TOOLS_KB_ALT ) {
187188 ipc . send ( 'vscode:toggleDevTools' ) ;
188- } else if ( key === RELOAD_KB ) {
189+ } else if ( key === RELOAD_KB && ! disallowReloadKeybinding ) {
189190 ipc . send ( 'vscode:reloadWindow' ) ;
190191 }
191192 } ;
0 commit comments