@codingame/monaco-vscode-quickaccess-service-override
Advanced tools
Comparing version 5.3.0 to 6.0.0
{ | ||
"name": "@codingame/monaco-vscode-quickaccess-service-override", | ||
"version": "5.3.0", | ||
"version": "6.0.0", | ||
"keywords": [], | ||
@@ -29,4 +29,4 @@ "author": { | ||
"dependencies": { | ||
"vscode": "npm:@codingame/monaco-vscode-api@5.3.0" | ||
"vscode": "npm:@codingame/monaco-vscode-api@6.0.0" | ||
} | ||
} |
@@ -49,2 +49,3 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js'; | ||
} | ||
get currentQuickInput() { return this.activeService.currentQuickInput; } | ||
get quickAccess() { return this.activeService.quickAccess; } | ||
@@ -51,0 +52,0 @@ get backButton() { return this.activeService.backButton; } |
@@ -17,3 +17,3 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js'; | ||
import { PickerQuickAccessProvider } from 'vscode/vscode/vs/platform/quickinput/browser/pickerQuickAccess'; | ||
import { WillSaveStateReason } from 'vscode/vscode/vs/platform/storage/common/storage'; | ||
import { WillSaveStateReason, StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage'; | ||
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service'; | ||
@@ -261,3 +261,3 @@ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service'; | ||
load() { | ||
const raw = this.storageService.get(CommandsHistory_1.PREF_KEY_CACHE, 0 ); | ||
const raw = this.storageService.get(CommandsHistory_1.PREF_KEY_CACHE, StorageScope.PROFILE); | ||
let serializedCache; | ||
@@ -283,3 +283,3 @@ if (raw) { | ||
} | ||
CommandsHistory_1.counter = this.storageService.getNumber(CommandsHistory_1.PREF_KEY_COUNTER, 0 , CommandsHistory_1.counter); | ||
CommandsHistory_1.counter = this.storageService.getNumber(CommandsHistory_1.PREF_KEY_COUNTER, StorageScope.PROFILE, CommandsHistory_1.counter); | ||
} | ||
@@ -305,4 +305,4 @@ push(commandId) { | ||
CommandsHistory_1.cache.forEach((value, key) => serializedCache.entries.push({ key, value })); | ||
this.storageService.store(CommandsHistory_1.PREF_KEY_CACHE, JSON.stringify(serializedCache), 0 , 0 ); | ||
this.storageService.store(CommandsHistory_1.PREF_KEY_COUNTER, CommandsHistory_1.counter, 0 , 0 ); | ||
this.storageService.store(CommandsHistory_1.PREF_KEY_CACHE, JSON.stringify(serializedCache), StorageScope.PROFILE, StorageTarget.USER); | ||
this.storageService.store(CommandsHistory_1.PREF_KEY_COUNTER, CommandsHistory_1.counter, StorageScope.PROFILE, StorageTarget.USER); | ||
CommandsHistory_1.hasChanges = false; | ||
@@ -309,0 +309,0 @@ } |
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls'; | ||
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions'; | ||
import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry'; | ||
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes'; | ||
import { KeybindingsRegistry, KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry'; | ||
import { ItemActivation } from 'vscode/vscode/vs/platform/quickinput/common/quickInput'; | ||
@@ -13,11 +14,11 @@ import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service'; | ||
const globalQuickAccessKeybinding = { | ||
primary: 2048 | 46 , | ||
secondary: [2048 | 35 ], | ||
mac: { primary: 2048 | 46 , secondary: undefined } | ||
primary: KeyMod.CtrlCmd | KeyCode.KeyP, | ||
secondary: [KeyMod.CtrlCmd | KeyCode.KeyE], | ||
mac: { primary: KeyMod.CtrlCmd | KeyCode.KeyP, secondary: undefined } | ||
}; | ||
KeybindingsRegistry.registerCommandAndKeybindingRule({ | ||
id: 'workbench.action.closeQuickOpen', | ||
weight: 200 , | ||
weight: KeybindingWeight.WorkbenchContrib, | ||
when: inQuickPickContext, | ||
primary: 9 , secondary: [1024 | 9 ], | ||
primary: KeyCode.Escape, secondary: [KeyMod.Shift | KeyCode.Escape], | ||
handler: accessor => { | ||
@@ -30,3 +31,3 @@ const quickInputService = accessor.get(IQuickInputService); | ||
id: 'workbench.action.acceptSelectedQuickOpenItem', | ||
weight: 200 , | ||
weight: KeybindingWeight.WorkbenchContrib, | ||
when: inQuickPickContext, | ||
@@ -41,3 +42,3 @@ primary: 0, | ||
id: 'workbench.action.alternativeAcceptSelectedQuickOpenItem', | ||
weight: 200 , | ||
weight: KeybindingWeight.WorkbenchContrib, | ||
when: inQuickPickContext, | ||
@@ -52,3 +53,3 @@ primary: 0, | ||
id: 'workbench.action.focusQuickOpen', | ||
weight: 200 , | ||
weight: KeybindingWeight.WorkbenchContrib, | ||
when: inQuickPickContext, | ||
@@ -64,3 +65,3 @@ primary: 0, | ||
id: quickAccessNavigateNextInFilePickerId, | ||
weight: 200 + 50, | ||
weight: KeybindingWeight.WorkbenchContrib + 50, | ||
handler: getQuickNavigateHandler(quickAccessNavigateNextInFilePickerId, true), | ||
@@ -75,9 +76,9 @@ when: defaultQuickAccessContext, | ||
id: quickAccessNavigatePreviousInFilePickerId, | ||
weight: 200 + 50, | ||
weight: KeybindingWeight.WorkbenchContrib + 50, | ||
handler: getQuickNavigateHandler(quickAccessNavigatePreviousInFilePickerId, false), | ||
when: defaultQuickAccessContext, | ||
primary: globalQuickAccessKeybinding.primary | 1024 , | ||
secondary: [globalQuickAccessKeybinding.secondary[0] | 1024 ], | ||
primary: globalQuickAccessKeybinding.primary | KeyMod.Shift, | ||
secondary: [globalQuickAccessKeybinding.secondary[0] | KeyMod.Shift], | ||
mac: { | ||
primary: globalQuickAccessKeybinding.mac.primary | 1024 , | ||
primary: globalQuickAccessKeybinding.mac.primary | KeyMod.Shift, | ||
secondary: undefined | ||
@@ -88,3 +89,3 @@ } | ||
id: 'workbench.action.quickPickManyToggle', | ||
weight: 200 , | ||
weight: KeybindingWeight.WorkbenchContrib, | ||
when: inQuickPickContext, | ||
@@ -99,8 +100,8 @@ primary: 0, | ||
id: 'workbench.action.quickInputBack', | ||
weight: 200 + 50, | ||
weight: KeybindingWeight.WorkbenchContrib + 50, | ||
when: inQuickPickContext, | ||
primary: 0, | ||
win: { primary: 512 | 15 }, | ||
mac: { primary: 256 | 88 }, | ||
linux: { primary: 2048 | 512 | 88 }, | ||
win: { primary: KeyMod.Alt | KeyCode.LeftArrow }, | ||
mac: { primary: KeyMod.WinCtrl | KeyCode.Minus }, | ||
linux: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Minus }, | ||
handler: accessor => { | ||
@@ -126,3 +127,3 @@ const quickInputService = accessor.get(IQuickInputService); | ||
keybinding: { | ||
weight: 200 , | ||
weight: KeybindingWeight.WorkbenchContrib, | ||
primary: globalQuickAccessKeybinding.primary, | ||
@@ -195,6 +196,6 @@ secondary: globalQuickAccessKeybinding.secondary, | ||
super('workbench.action.quickOpenSelectNext', ( localize2WithPath(_moduleId, 4, 'Select Next in Quick Open')), true, false, { | ||
weight: 200 + 50, | ||
weight: KeybindingWeight.WorkbenchContrib + 50, | ||
when: inQuickPickContext, | ||
primary: 0, | ||
mac: { primary: 256 | 44 } | ||
mac: { primary: KeyMod.WinCtrl | KeyCode.KeyN } | ||
}); | ||
@@ -206,6 +207,6 @@ } | ||
super('workbench.action.quickOpenSelectPrevious', ( localize2WithPath(_moduleId, 5, 'Select Previous in Quick Open')), false, false, { | ||
weight: 200 + 50, | ||
weight: KeybindingWeight.WorkbenchContrib + 50, | ||
when: inQuickPickContext, | ||
primary: 0, | ||
mac: { primary: 256 | 46 } | ||
mac: { primary: KeyMod.WinCtrl | KeyCode.KeyP } | ||
}); | ||
@@ -212,0 +213,0 @@ } |
@@ -10,2 +10,4 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js'; | ||
import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions'; | ||
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes'; | ||
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry'; | ||
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service'; | ||
@@ -59,6 +61,6 @@ | ||
keybinding: { | ||
weight: 200 , | ||
weight: KeybindingWeight.WorkbenchContrib, | ||
when: null, | ||
primary: 2048 | 37 , | ||
mac: { primary: 256 | 37 } | ||
primary: KeyMod.CtrlCmd | KeyCode.KeyG, | ||
mac: { primary: KeyMod.WinCtrl | KeyCode.KeyG } | ||
} | ||
@@ -65,0 +67,0 @@ }); |
@@ -6,2 +6,3 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js'; | ||
import { stripIcons } from 'vscode/vscode/vs/base/common/iconLabels'; | ||
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes'; | ||
import { Language } from 'vscode/vscode/vs/base/common/platform'; | ||
@@ -19,2 +20,3 @@ import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables'; | ||
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service'; | ||
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry'; | ||
import { IProductService } from 'vscode/vscode/vs/platform/product/common/productService.service'; | ||
@@ -144,3 +146,3 @@ import { CommandsHistory } from '../../../../platform/quickinput/browser/commandsQuickAccess.js'; | ||
additionalPicks.push({ | ||
label: ( localizeWithPath(_moduleId, 2, "Ask {0}: {1}", defaultAgent.metadata.fullName, filter)), | ||
label: ( localizeWithPath(_moduleId, 2, "Ask {0}: {1}", defaultAgent.fullName, filter)), | ||
commandId: this.configuration.experimental.askChatLocation === 'quickChat' ? ASK_QUICK_QUESTION_ACTION_ID : CHAT_OPEN_ACTION_ID, | ||
@@ -225,6 +227,6 @@ args: [filter] | ||
keybinding: { | ||
weight: 200 , | ||
weight: KeybindingWeight.WorkbenchContrib, | ||
when: undefined, | ||
primary: !isFirefox ? ((2048 | 1024 | 46) ) : undefined, | ||
secondary: [59 ] | ||
primary: !isFirefox ? (KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyP) : undefined, | ||
secondary: [KeyCode.F1] | ||
}, | ||
@@ -231,0 +233,0 @@ f1: true |
@@ -8,5 +8,6 @@ import { localizeWithPath } from 'vscode/vscode/vs/nls'; | ||
import { MenuRegistry, MenuId, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions'; | ||
import { KeyMod } from 'vscode/vscode/vs/base/common/keyCodes'; | ||
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey'; | ||
import { inQuickPickContext, getQuickNavigateHandler } from 'vscode/vscode/vs/workbench/browser/quickaccess'; | ||
import { KeybindingsRegistry } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry'; | ||
import { KeybindingsRegistry, KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry'; | ||
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys'; | ||
@@ -111,3 +112,3 @@ | ||
id: quickAccessNavigateNextInViewPickerId, | ||
weight: 200 + 50, | ||
weight: KeybindingWeight.WorkbenchContrib + 50, | ||
handler: getQuickNavigateHandler(quickAccessNavigateNextInViewPickerId, true), | ||
@@ -122,10 +123,10 @@ when: inViewsPickerContext, | ||
id: quickAccessNavigatePreviousInViewPickerId, | ||
weight: 200 + 50, | ||
weight: KeybindingWeight.WorkbenchContrib + 50, | ||
handler: getQuickNavigateHandler(quickAccessNavigatePreviousInViewPickerId, false), | ||
when: inViewsPickerContext, | ||
primary: viewPickerKeybinding.primary | 1024 , | ||
primary: viewPickerKeybinding.primary | KeyMod.Shift, | ||
linux: viewPickerKeybinding.linux, | ||
mac: { | ||
primary: viewPickerKeybinding.mac.primary | 1024 | ||
primary: viewPickerKeybinding.mac.primary | KeyMod.Shift | ||
} | ||
}); |
@@ -6,2 +6,3 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js'; | ||
import { PickerQuickAccessProvider } from 'vscode/vscode/vs/platform/quickinput/browser/pickerQuickAccess'; | ||
import { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views'; | ||
import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service'; | ||
@@ -16,2 +17,4 @@ import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service'; | ||
import { Action2 } from 'vscode/vscode/vs/platform/actions/common/actions'; | ||
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes'; | ||
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry'; | ||
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories'; | ||
@@ -118,5 +121,5 @@ import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service'; | ||
}; | ||
addPaneComposites(0 , ( localizeWithPath(_moduleId, 1, "Side Bar"))); | ||
addPaneComposites(1 , ( localizeWithPath(_moduleId, 2, "Panel"))); | ||
addPaneComposites(2 , ( localizeWithPath(_moduleId, 3, "Secondary Side Bar"))); | ||
addPaneComposites(ViewContainerLocation.Sidebar, ( localizeWithPath(_moduleId, 1, "Side Bar"))); | ||
addPaneComposites(ViewContainerLocation.Panel, ( localizeWithPath(_moduleId, 2, "Panel"))); | ||
addPaneComposites(ViewContainerLocation.AuxiliaryBar, ( localizeWithPath(_moduleId, 3, "Secondary Side Bar"))); | ||
const addPaneCompositeViews = (location) => { | ||
@@ -131,5 +134,5 @@ const paneComposites = this.paneCompositeService.getPaneComposites(location); | ||
}; | ||
addPaneCompositeViews(0 ); | ||
addPaneCompositeViews(1 ); | ||
addPaneCompositeViews(2 ); | ||
addPaneCompositeViews(ViewContainerLocation.Sidebar); | ||
addPaneCompositeViews(ViewContainerLocation.Panel); | ||
addPaneCompositeViews(ViewContainerLocation.AuxiliaryBar); | ||
this.terminalGroupService.groups.forEach((group, groupIndex) => { | ||
@@ -212,4 +215,4 @@ group.terminalInstances.forEach((terminal, terminalIndex) => { | ||
static { this.KEYBINDING = { | ||
primary: 2048 | 47 , | ||
mac: { primary: 256 | 47 }, | ||
primary: KeyMod.CtrlCmd | KeyCode.KeyQ, | ||
mac: { primary: KeyMod.WinCtrl | KeyCode.KeyQ }, | ||
linux: { primary: 0 } | ||
@@ -224,3 +227,3 @@ }; } | ||
keybinding: { | ||
weight: 200 , | ||
weight: KeybindingWeight.WorkbenchContrib, | ||
when: undefined, | ||
@@ -227,0 +230,0 @@ ...QuickAccessViewPickerAction.KEYBINDING |
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js'; | ||
import { Event } from 'vscode/vscode/vs/base/common/event'; | ||
import { parse } from 'vscode/vscode/vs/base/common/json'; | ||
import { FileType } from 'vscode/vscode/vs/platform/files/common/files'; | ||
import { FileType, FileSystemProviderCapabilities } from 'vscode/vscode/vs/platform/files/common/files'; | ||
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service'; | ||
import { StorageScope, StorageTarget } from 'vscode/vscode/vs/platform/storage/common/storage'; | ||
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service'; | ||
import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer'; | ||
import { TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, readTrustedDomains, TRUSTED_DOMAINS_STORAGE_KEY } from './trustedDomains.js'; | ||
import { TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, readTrustedDomains, TRUSTED_DOMAINS_STORAGE_KEY } from 'vscode/vscode/vs/workbench/contrib/url/browser/trustedDomains'; | ||
import { assertIsDefined } from 'vscode/vscode/vs/base/common/types'; | ||
@@ -41,3 +42,3 @@ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation'; | ||
]`; | ||
function computeTrustedDomainContent(defaultTrustedDomains, trustedDomains, userTrustedDomains, workspaceTrustedDomains, configuring) { | ||
function computeTrustedDomainContent(defaultTrustedDomains, trustedDomains, configuring) { | ||
let content = CONFIG_HELP_TEXT_PRE; | ||
@@ -53,14 +54,2 @@ if (defaultTrustedDomains.length > 0) { | ||
} | ||
if (userTrustedDomains.length) { | ||
content += `//\n// Additionally, the following domains are trusted based on your logged-in Accounts:\n`; | ||
userTrustedDomains.forEach(d => { | ||
content += `// - "${d}"\n`; | ||
}); | ||
} | ||
if (workspaceTrustedDomains.length) { | ||
content += `//\n// Further, the following domains are trusted based on your workspace configuration:\n`; | ||
workspaceTrustedDomains.forEach(d => { | ||
content += `// - "${d}"\n`; | ||
}); | ||
} | ||
content += CONFIG_HELP_TEXT_AFTER; | ||
@@ -82,3 +71,3 @@ content += configuring ? `\n// Currently configuring trust for ${configuring}\n` : ''; | ||
this.instantiationService = instantiationService; | ||
this.capabilities = 2 ; | ||
this.capabilities = FileSystemProviderCapabilities.FileReadWrite; | ||
this.onDidChangeCapabilities = Event.None; | ||
@@ -92,5 +81,5 @@ this.onDidChangeFile = Event.None; | ||
async readFile(resource) { | ||
let trustedDomainsContent = this.storageService.get(TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, -1 ); | ||
let trustedDomainsContent = this.storageService.get(TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, StorageScope.APPLICATION); | ||
const configuring = resource.fragment; | ||
const { defaultTrustedDomains, trustedDomains, userDomains, workspaceDomains } = await this.instantiationService.invokeFunction(readTrustedDomains); | ||
const { defaultTrustedDomains, trustedDomains } = await this.instantiationService.invokeFunction(readTrustedDomains); | ||
if (!trustedDomainsContent || | ||
@@ -100,4 +89,4 @@ trustedDomainsContent.indexOf(CONFIG_HELP_TEXT_PRE) === -1 || | ||
trustedDomainsContent.indexOf(configuring ?? '') === -1 || | ||
( [...defaultTrustedDomains, ...trustedDomains, ...userDomains, ...workspaceDomains].some(d => !assertIsDefined(trustedDomainsContent).includes(d)))) { | ||
trustedDomainsContent = computeTrustedDomainContent(defaultTrustedDomains, trustedDomains, userDomains, workspaceDomains, configuring); | ||
( [...defaultTrustedDomains, ...trustedDomains].some(d => !assertIsDefined(trustedDomainsContent).includes(d)))) { | ||
trustedDomainsContent = computeTrustedDomainContent(defaultTrustedDomains, trustedDomains, configuring); | ||
} | ||
@@ -111,4 +100,4 @@ const buffer = VSBuffer.fromString(trustedDomainsContent).buffer; | ||
const trustedDomains = parse(trustedDomainsContent); | ||
this.storageService.store(TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, trustedDomainsContent, -1 , 0 ); | ||
this.storageService.store(TRUSTED_DOMAINS_STORAGE_KEY, JSON.stringify(trustedDomains) || '', -1 , 0 ); | ||
this.storageService.store(TRUSTED_DOMAINS_CONTENT_STORAGE_KEY, trustedDomainsContent, StorageScope.APPLICATION, StorageTarget.USER); | ||
this.storageService.store(TRUSTED_DOMAINS_STORAGE_KEY, JSON.stringify(trustedDomains) || '', StorageScope.APPLICATION, StorageTarget.USER); | ||
} | ||
@@ -115,0 +104,0 @@ catch (err) { } |
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js'; | ||
import { WindowIdleValue } from 'vscode/vscode/vs/base/browser/dom'; | ||
import { mainWindow } from 'vscode/vscode/vs/base/browser/window'; | ||
import { matchesScheme, Schemas } from 'vscode/vscode/vs/base/common/network'; | ||
@@ -17,7 +15,6 @@ import Severity$1 from 'vscode/vscode/vs/base/common/severity'; | ||
import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service'; | ||
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service'; | ||
import { IWorkspaceTrustManagementService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust.service'; | ||
import { readAuthenticationTrustedDomains, readWorkspaceTrustedDomains, readStaticTrustedDomains, configureOpenerTrustedDomainsHandler } from './trustedDomains.js'; | ||
import { testUrlMatchesGlob } from 'vscode/vscode/vs/workbench/contrib/url/common/urlGlob'; | ||
import { IAuthenticationService } from 'vscode/vscode/vs/workbench/services/authentication/common/authentication.service'; | ||
import { isURLDomainTrusted } from 'vscode/vscode/vs/workbench/contrib/url/browser/trustedDomainService'; | ||
import { ITrustedDomainService } from 'vscode/vscode/vs/workbench/contrib/url/browser/trustedDomainService.service'; | ||
import { readStaticTrustedDomains, configureOpenerTrustedDomainsHandler } from 'vscode/vscode/vs/workbench/contrib/url/browser/trustedDomains'; | ||
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service'; | ||
@@ -27,3 +24,3 @@ | ||
let OpenerValidatorContributions = class OpenerValidatorContributions { | ||
constructor(_openerService, _storageService, _dialogService, _productService, _quickInputService, _editorService, _clipboardService, _telemetryService, _instantiationService, _authenticationService, _workspaceContextService, _configurationService, _workspaceTrustService) { | ||
constructor(_openerService, _storageService, _dialogService, _productService, _quickInputService, _editorService, _clipboardService, _telemetryService, _instantiationService, _configurationService, _workspaceTrustService, _trustedDomainService) { | ||
this._openerService = _openerService; | ||
@@ -38,29 +35,6 @@ this._storageService = _storageService; | ||
this._instantiationService = _instantiationService; | ||
this._authenticationService = _authenticationService; | ||
this._workspaceContextService = _workspaceContextService; | ||
this._configurationService = _configurationService; | ||
this._workspaceTrustService = _workspaceTrustService; | ||
this._trustedDomainService = _trustedDomainService; | ||
this._openerService.registerValidator({ shouldOpen: (uri, options) => this.validateLink(uri, options) }); | ||
this._readAuthenticationTrustedDomainsResult = ( (new WindowIdleValue( | ||
mainWindow, | ||
() => this._instantiationService.invokeFunction(readAuthenticationTrustedDomains) | ||
))); | ||
this._authenticationService.onDidRegisterAuthenticationProvider(() => { | ||
this._readAuthenticationTrustedDomainsResult?.dispose(); | ||
this._readAuthenticationTrustedDomainsResult = ( (new WindowIdleValue( | ||
mainWindow, | ||
() => this._instantiationService.invokeFunction(readAuthenticationTrustedDomains) | ||
))); | ||
}); | ||
this._readWorkspaceTrustedDomainsResult = ( (new WindowIdleValue( | ||
mainWindow, | ||
() => this._instantiationService.invokeFunction(readWorkspaceTrustedDomains) | ||
))); | ||
this._workspaceContextService.onDidChangeWorkspaceFolders(() => { | ||
this._readWorkspaceTrustedDomainsResult?.dispose(); | ||
this._readWorkspaceTrustedDomainsResult = ( (new WindowIdleValue( | ||
mainWindow, | ||
() => this._instantiationService.invokeFunction(readWorkspaceTrustedDomains) | ||
))); | ||
}); | ||
} | ||
@@ -82,11 +56,7 @@ async validateLink(resource, openOptions) { | ||
} | ||
const { scheme, authority, path, query, fragment } = resourceUri; | ||
const domainToOpen = `${scheme}://${authority}`; | ||
const [workspaceDomains, userDomains] = await Promise.all([this._readWorkspaceTrustedDomainsResult.value, this._readAuthenticationTrustedDomainsResult.value]); | ||
const { defaultTrustedDomains, trustedDomains, } = this._instantiationService.invokeFunction(readStaticTrustedDomains); | ||
const allTrustedDomains = [...defaultTrustedDomains, ...trustedDomains, ...userDomains, ...workspaceDomains]; | ||
if (isURLDomainTrusted(resourceUri, allTrustedDomains)) { | ||
if (await this._trustedDomainService.isValid(resourceUri)) { | ||
return true; | ||
} | ||
else { | ||
const { scheme, authority, path, query, fragment } = resourceUri; | ||
let formattedLink = `${scheme}://${authority}${path}`; | ||
@@ -126,2 +96,4 @@ const linkTail = `${query ? '?' + query : ''}${fragment ? '#' + fragment : ''}`; | ||
run: async () => { | ||
const { trustedDomains, } = this._instantiationService.invokeFunction(readStaticTrustedDomains); | ||
const domainToOpen = `${scheme}://${authority}`; | ||
const pickedDomains = await configureOpenerTrustedDomainsHandler(trustedDomains, domainToOpen, resourceUri, this._quickInputService, this._storageService, this._editorService); | ||
@@ -156,50 +128,7 @@ if (pickedDomains.indexOf('*') !== -1) { | ||
( (__param(8, IInstantiationService))), | ||
( (__param(9, IAuthenticationService))), | ||
( (__param(10, IWorkspaceContextService))), | ||
( (__param(11, IConfigurationService))), | ||
( (__param(12, IWorkspaceTrustManagementService))) | ||
( (__param(9, IConfigurationService))), | ||
( (__param(10, IWorkspaceTrustManagementService))), | ||
( (__param(11, ITrustedDomainService))) | ||
], OpenerValidatorContributions))); | ||
const rLocalhost = /^localhost(:\d+)?$/i; | ||
const r127 = /^127.0.0.1(:\d+)?$/; | ||
function isLocalhostAuthority(authority) { | ||
return rLocalhost.test(authority) || r127.test(authority); | ||
} | ||
function normalizeURL(url) { | ||
const caseInsensitiveAuthorities = ['github.com']; | ||
try { | ||
const parsed = typeof url === 'string' ? ( (URI.parse(url, true))) : url; | ||
if (caseInsensitiveAuthorities.includes(parsed.authority)) { | ||
return ( | ||
(parsed.with({ path: parsed.path.toLowerCase() }).toString(true)) | ||
); | ||
} | ||
else { | ||
return ( | ||
(parsed.toString(true)) | ||
); | ||
} | ||
} | ||
catch { | ||
return ( | ||
(url.toString()) | ||
); | ||
} | ||
} | ||
function isURLDomainTrusted(url, trustedDomains) { | ||
url = ( (URI.parse(normalizeURL(url)))); | ||
trustedDomains = ( (trustedDomains.map(normalizeURL))); | ||
if (isLocalhostAuthority(url.authority)) { | ||
return true; | ||
} | ||
for (let i = 0; i < trustedDomains.length; i++) { | ||
if (trustedDomains[i] === '*') { | ||
return true; | ||
} | ||
if (testUrlMatchesGlob(url, trustedDomains[i])) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
export { OpenerValidatorContributions, isURLDomainTrusted }; | ||
export { OpenerValidatorContributions }; |
@@ -5,13 +5,17 @@ import { URI } from 'vscode/vscode/vs/base/common/uri'; | ||
import { CommandsRegistry } from 'vscode/vscode/vs/platform/commands/common/commands'; | ||
import { LifecyclePhase } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle'; | ||
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service'; | ||
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform'; | ||
import { IURLService } from 'vscode/vscode/vs/platform/url/common/url.service'; | ||
import { Extensions, registerWorkbenchContribution2 } from 'vscode/vscode/vs/workbench/common/contributions'; | ||
import { Extensions, registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions'; | ||
import { ExternalUriResolverContribution } from './externalUriResolver.js'; | ||
import { manageTrustedDomainSettingsCommand } from './trustedDomains.js'; | ||
import { manageTrustedDomainSettingsCommand } from 'vscode/vscode/vs/workbench/contrib/url/browser/trustedDomains'; | ||
import { TrustedDomainsFileSystemProvider } from './trustedDomainsFileSystemProvider.js'; | ||
import { OpenerValidatorContributions } from './trustedDomainsValidator.js'; | ||
import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommonCategories'; | ||
import { Extensions as Extensions$1 } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry'; | ||
import { Extensions as Extensions$1, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry'; | ||
import { workbenchConfigurationNodeBase } from 'vscode/vscode/vs/workbench/common/configuration'; | ||
import 'vscode/vscode/vs/workbench/contrib/url/browser/trustedDomainService'; | ||
import 'vscode/vscode/vs/platform/instantiation/common/instantiation'; | ||
import 'vscode/vscode/vs/platform/instantiation/common/extensions'; | ||
@@ -47,5 +51,7 @@ const _moduleId = "vs/workbench/contrib/url/browser/url.contribution"; | ||
}); | ||
( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(OpenerValidatorContributions, 3 ); | ||
registerWorkbenchContribution2(TrustedDomainsFileSystemProvider.ID, TrustedDomainsFileSystemProvider, 2 ); | ||
registerWorkbenchContribution2(ExternalUriResolverContribution.ID, ExternalUriResolverContribution, 2 ); | ||
( (Registry.as(Extensions.Workbench))).registerWorkbenchContribution(OpenerValidatorContributions, LifecyclePhase.Restored); | ||
registerWorkbenchContribution2(TrustedDomainsFileSystemProvider.ID, TrustedDomainsFileSystemProvider, WorkbenchPhase.BlockRestore | ||
); | ||
registerWorkbenchContribution2(ExternalUriResolverContribution.ID, ExternalUriResolverContribution, WorkbenchPhase.BlockRestore | ||
); | ||
const configurationRegistry = ( (Registry.as(Extensions$1.Configuration))); | ||
@@ -56,3 +62,3 @@ configurationRegistry.registerConfiguration({ | ||
'workbench.trustedDomains.promptInTrustedWorkspace': { | ||
scope: 1 , | ||
scope: ConfigurationScope.APPLICATION, | ||
type: 'boolean', | ||
@@ -59,0 +65,0 @@ default: false, |
@@ -9,2 +9,3 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js'; | ||
import { QuickInputService as QuickInputService$1 } from 'vscode/vscode/vs/platform/quickinput/browser/quickInputService'; | ||
import 'vscode/vscode/vs/platform/instantiation/common/extensions'; | ||
import { InQuickPickContextKey } from 'vscode/vscode/vs/workbench/browser/quickaccess'; | ||
@@ -11,0 +12,0 @@ |
93345
17
1823
+ Added@codingame/monaco-vscode-api@6.0.0(transitive)
+ Added@codingame/monaco-vscode-base-service-override@6.0.0(transitive)
+ Added@codingame/monaco-vscode-environment-service-override@6.0.0(transitive)
+ Added@codingame/monaco-vscode-extensions-service-override@6.0.0(transitive)
+ Added@codingame/monaco-vscode-files-service-override@6.0.0(transitive)
+ Added@codingame/monaco-vscode-host-service-override@6.0.0(transitive)
+ Added@codingame/monaco-vscode-layout-service-override@6.0.0(transitive)
- Removed@codingame/monaco-vscode-api@5.3.0(transitive)
- Removed@codingame/monaco-vscode-base-service-override@5.3.0(transitive)
- Removed@codingame/monaco-vscode-environment-service-override@5.3.0(transitive)
- Removed@codingame/monaco-vscode-extensions-service-override@5.3.0(transitive)
- Removed@codingame/monaco-vscode-files-service-override@5.3.0(transitive)
- Removed@codingame/monaco-vscode-host-service-override@5.3.0(transitive)
- Removed@codingame/monaco-vscode-layout-service-override@5.3.0(transitive)