repo_name
string
dataset
string
owner
string
lang
string
func_name
string
code
string
docstring
string
url
string
sha
string
aide
github_2023
codestoryai
typescript
TestDecorations.push
public push(value: T) { const searchIndex = binarySearch(this.value, value, (a, b) => a.line - b.line); this.value.splice(searchIndex < 0 ? ~searchIndex : searchIndex, 0, value); }
/** * Adds a new value to the decorations. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/testing/common/testingDecorations.ts#L76-L79
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TestDecorations.lines
public *lines(): Iterable<[number, T[]]> { if (!this.value.length) { return; } let startIndex = 0; let startLine = this.value[0].line; for (let i = 1; i < this.value.length; i++) { const v = this.value[i]; if (v.line !== startLine) { yield [startLine, this.value.slice(startIndex, i)]; startL...
/** * Gets decorations on each line. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/testing/common/testingDecorations.ts#L84-L101
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TypeHierarchyController.startTypeHierarchyFromEditor
async startTypeHierarchyFromEditor(): Promise<void> { this._sessionDisposables.clear(); if (!this._editor.hasModel()) { return; } const document = this._editor.getModel(); const position = this._editor.getPosition(); if (!TypeHierarchyProviderRegistry.has(document)) { return; } const cts = new ...
// Peek
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.ts#L77-L95
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
UpdateContribution.onUpdateAvailable
private onUpdateAvailable(update: IUpdate): void { if (!this.shouldShowNotification()) { return; } const productVersion = update.productVersion; if (!productVersion) { return; } this.notificationService.prompt( severity.Info, nls.localize('thereIsUpdateAvailable', "There is an available update...
// linux
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/update/browser/update.ts#L296-L322
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
UpdateContribution.onUpdateDownloaded
private onUpdateDownloaded(update: IUpdate): void { if (isMacintosh) { return; } if (this.configurationService.getValue('update.enableWindowsBackgroundUpdates') && this.productService.target === 'user') { return; } if (!this.shouldShowNotification()) { return; } const productVersion = update.pr...
// windows fast updates
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/update/browser/update.ts#L325-L358
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
UpdateContribution.onUpdateReady
private onUpdateReady(update: IUpdate): void { if (!(isWindows && this.productService.target !== 'user') && !this.shouldShowNotification()) { return; } const actions = [{ label: nls.localize('updateNow', "Update Now"), run: () => this.updateService.quitAndInstall() }, { label: nls.localize('later',...
// windows and mac
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/update/browser/update.ts#L361-L391
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
normalizeURL
function normalizeURL(url: string | URI): string { 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); ...
/** * Case-normalize some case-insensitive URLs, such as github. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/url/browser/trustedDomainService.ts#L68-L78
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WebviewElement.find
public find(value: string, previous: boolean): void { if (!this.element) { return; } this._send('find', { value, previous }); }
/** * Webviews expose a stateful find API. * Successive calls to find will move forward or backward through onFindResults * depending on the supplied options. * * @param value The string to search for. Empty strings are ignored. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/webview/browser/webviewElement.ts#L880-L886
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ElectronWebviewElement.find
public override find(value: string, previous: boolean): void { if (!this.element) { return; } if (!this._findStarted) { this.updateFind(value); } else { // continuing the find, so set findNext to false const options: FindInFrameOptions = { forward: !previous, findNext: false, matchCase: false }; ...
/** * Webviews expose a stateful find API. * Successive calls to find will move forward or backward through onFindResults * depending on the supplied options. * * @param value The string to search for. Empty strings are ignored. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/webview/electron-sandbox/webviewElement.ts#L118-L130
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
GettingStartedPage.shouldAnimate
private shouldAnimate() { if (this.configurationService.getValue(REDUCED_MOTION_KEY)) { return false; } if (this.accessibilityService.isMotionReduced()) { return false; } return true; }
// remove when 'workbench.welcomePage.preferReducedMotion' deprecated
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.ts#L322-L330
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspaceTrustUXHandler.doShowModal
private async doShowModal(question: string, trustedOption: { label: string; sublabel: string }, untrustedOption: { label: string; sublabel: string }, markdownStrings: string[], trustParentString?: string): Promise<void> { await this.dialogService.prompt({ type: Severity.Info, message: question, checkbox: tru...
//#region Dialog
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts#L380-L418
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspaceTrustUXHandler.getBannerItem
private getBannerItem(restrictedMode: boolean): IBannerItem | undefined { const dismissedRestricted = this.storageService.getBoolean(BANNER_RESTRICTED_MODE_DISMISSED_KEY, StorageScope.WORKSPACE, false); // never show the banner if (this.bannerSetting === 'never') { return undefined; } // info has been di...
//#region Banner
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts#L487-L524
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspaceTrustUXHandler.getRestrictedModeStatusbarEntry
private getRestrictedModeStatusbarEntry(): IStatusbarEntry { let ariaLabel = ''; let toolTip: IMarkdownString | string | undefined; switch (this.workspaceContextService.getWorkbenchState()) { case WorkbenchState.EMPTY: { ariaLabel = localize('status.ariaUntrustedWindow', "Restricted Mode: Some features are...
//#region Statusbar
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/workspace/browser/workspace.contribution.ts#L564-L620
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
fixBadLocalizedLinks
function fixBadLocalizedLinks(badString: string): string { const regex = /(.*)\[(.+)\]\s*\((.+)\)(.*)/; // markdown link match with spaces return badString.replace(regex, '$1[$2]($3)$4'); }
// Highly scoped fix for #126614
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/workspace/browser/workspaceTrustEditor.ts#L1148-L1151
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeWindow.onBeforeShutdown
private onBeforeShutdown({ veto, reason }: BeforeShutdownEvent): void { if (reason === ShutdownReason.CLOSE) { const confirmBeforeCloseSetting = this.configurationService.getValue<'always' | 'never' | 'keyboardOnly'>('window.confirmBeforeClose'); const confirmBeforeClose = confirmBeforeCloseSetting === 'always...
//#region Window Lifecycle
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/electron-sandbox/window.ts#L451-L488
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeWindow.updateDocumentEdited
private updateDocumentEdited(documentEdited: true | undefined): void { let setDocumentEdited: boolean; if (typeof documentEdited === 'boolean') { setDocumentEdited = documentEdited; } else { setDocumentEdited = this.workingCopyService.hasDirty; } if ((!this.isDocumentedEdited && setDocumentEdited) || (...
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/electron-sandbox/window.ts#L574-L587
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeWindow.onAddRemoveFoldersRequest
private onAddRemoveFoldersRequest(request: IAddRemoveFoldersRequest): void { // Buffer all pending requests this.pendingFoldersToAdd.push(...request.foldersToAdd.map(folder => URI.revive(folder))); this.pendingFoldersToRemove.push(...request.foldersToRemove.map(folder => URI.revive(folder))); // Delay the add...
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/electron-sandbox/window.ts#L968-L978
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeWindow.dispose
override dispose(): void { super.dispose(); for (const [, entry] of this.mapWindowIdToZoomStatusEntry) { entry.dispose(); } }
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/electron-sandbox/window.ts#L1137-L1143
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeTitlebarPart.minimumHeight
override get minimumHeight(): number { if (!isMacintosh) { return super.minimumHeight; } return (this.isCommandCenterVisible ? DEFAULT_CUSTOM_TITLEBAR_HEIGHT : this.macTitlebarSize) / (this.preventZoom ? getZoomFactor(getWindow(this.element)) : 1); }
//#region IView
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts#L39-L45
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AIModelsService.validateProviders
private validateProviders(providers: Record<string, ProviderConfig>): Record<string, ProviderConfig> { const validated: Record<string, ProviderConfig> = {}; for (const [key, provider] of Object.entries(providers)) { if (this.isValidOpenAICompatibleProvider(key, provider)) { validated[key] = provider; } el...
/** Validate and filter providers based on their required configurations. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/aiModel/browser/aiModelService.ts#L162-L174
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AIModelsService.validateModels
private validateModels( models: Record<string, ILanguageModelItem>, validatedProviders: Record<string, ProviderConfig> ): Record<string, ILanguageModelItem> { const result: Record<string, ILanguageModelItem> = {}; for (const [key, model] of Object.entries(models)) { if (result[key]) { // Duplicate detec...
/** Validate and filter models. Check duplicates and ensure each model references a valid provider. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/aiModel/browser/aiModelService.ts#L177-L193
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AIModelsService.isValidOpenAICompatibleProvider
private isValidOpenAICompatibleProvider(key: string, provider: ProviderConfig): provider is OpenAICompatibleProviderConfig { return openAICompatibleProvider.includes(key as typeof openAICompatibleProvider[number]) && typeof (provider as OpenAICompatibleProviderConfig).apiBase === 'string' && (provider as OpenAI...
/** Check if a provider key and config is valid for openAI-compatible providers. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/aiModel/browser/aiModelService.ts#L196-L202
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AIModelsService.isValidApiKeyOnlyProvider
private isValidApiKeyOnlyProvider(key: string, provider: ProviderConfig): provider is ApiKeyOnlyProviderConfig { return apiKeyOnlyProviders.includes(key as typeof apiKeyOnlyProviders[number]) && typeof (provider as ApiKeyOnlyProviderConfig).apiKey === 'string' && (provider as ApiKeyOnlyProviderConfig).apiKey.le...
/** Check if a provider key and config is valid for apiKey-only providers. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/aiModel/browser/aiModelService.ts#L205-L209
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AIModelsService.isNoConfigurationProvider
private isNoConfigurationProvider(key: string): boolean { return noConfigurationProviders.includes(key as typeof noConfigurationProviders[number]); }
/** Check if a provider requires no configuration. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/aiModel/browser/aiModelService.ts#L212-L214
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AIModelsService.isValidModel
private isValidModel(model: ILanguageModelItem, validatedProviders: Record<string, ProviderConfig>): boolean { // Basic checks const baseChecks = model.name.length > 0 && model.contextLength > 0 && model.temperature >= 0 && model.temperature <= 2 && model.provider && validatedProviders[model.provider.ty...
/** Validate a single model against required constraints and ensure its provider is validated. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/aiModel/browser/aiModelService.ts#L217-L233
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkbenchAssignmentServiceTelemetry.setSharedProperty
setSharedProperty(name: string, value: string): void { if (name === this.productService.tasConfig?.assignmentContextTelemetryPropertyName) { this._lastAssignmentContext = value; } this.telemetryService.setExperimentProperty(name, value); }
// __GDPR__COMMON__ "abexp.assignmentcontext" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/assignment/common/assignmentService.ts#L58-L64
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AuthenticationExtensionsService.updateAccountPreference
updateAccountPreference(extensionId: string, providerId: string, account: AuthenticationSessionAccount): void { const realExtensionId = ExtensionIdentifier.toKey(extensionId); const parentExtensionId = this._inheritAuthAccountPreferenceChildToParent[realExtensionId] ?? realExtensionId; const key = this._getKey(pa...
//#region Account/Session Preference
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/authentication/browser/authenticationExtensionsService.ts#L156-L170
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AuthenticationExtensionsService.updateSessionPreference
updateSessionPreference(providerId: string, extensionId: string, session: AuthenticationSession): void { const realExtensionId = ExtensionIdentifier.toKey(extensionId); // The 3 parts of this key are important: // * Extension id: The extension that has a preference // * Provider id: The provider that the prefer...
// TODO@TylerLeonhardt: Remove all of this after a couple iterations
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/authentication/browser/authenticationExtensionsService.ts#L198-L211
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AuthenticationExtensionsService.showGetSessionPrompt
private async showGetSessionPrompt(provider: IAuthenticationProvider, accountName: string, extensionId: string, extensionName: string): Promise<boolean> { enum SessionPromptChoice { Allow = 0, Deny = 1, Cancel = 2 } const { result } = await this.dialogService.prompt<SessionPromptChoice>({ type: Severi...
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/authentication/browser/authenticationExtensionsService.ts#L248-L278
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AuthenticationExtensionsService.selectSession
async selectSession(providerId: string, extensionId: string, extensionName: string, scopes: string[], availableSessions: AuthenticationSession[]): Promise<AuthenticationSession> { const allAccounts = await this._authenticationService.getAccounts(providerId); if (!allAccounts.length) { throw new Error('No account...
/** * This function should be used only when there are sessions to disambiguate. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/authentication/browser/authenticationExtensionsService.ts#L283-L353
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspaceService.getCompleteWorkspace
public async getCompleteWorkspace(): Promise<Workspace> { await this.completeWorkspaceBarrier.wait(); return this.getWorkspace(); }
// Workspace Context Service Impl
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/configuration/browser/configurationService.ts#L174-L177
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspaceService.getConfigurationData
getConfigurationData(): IConfigurationData { return this._configuration.toData(); }
// Workspace Configuration Service Impl
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/configuration/browser/configurationService.ts#L320-L322
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspaceService.initialize
async initialize(arg: IAnyWorkspaceIdentifier): Promise<void> { mark('code/willInitWorkspaceService'); const trigger = this.initialized; this.initialized = false; const workspace = await this.createWorkspace(arg); await this.updateWorkspaceAndInitializeConfiguration(workspace, trigger); this.checkAndMarkWo...
/** * At present, all workspaces (empty, single-folder, multi-root) in local and remote * can be initialized without requiring extension host except following case: * * A multi root workspace with .code-workspace file that has to be resolved by an extension. * Because of readonly `rootPath` property in extens...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/configuration/browser/configurationService.ts#L439-L449
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspaceService.toValidWorkspaceFolders
private async toValidWorkspaceFolders(workspaceFolders: WorkspaceFolder[]): Promise<WorkspaceFolder[]> { const validWorkspaceFolders: WorkspaceFolder[] = []; for (const workspaceFolder of workspaceFolders) { try { const result = await this.fileService.stat(workspaceFolder.uri); if (!result.isDirectory) {...
// Workspace folders those cannot be resolved are not filtered because they are handled by the Explorer.
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/configuration/browser/configurationService.ts#L983-L997
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
getFilePath
const getFilePath = (variableKind: VariableKind): string => { const filePath = this._context.getFilePath(); if (filePath) { return normalizeDriveLetter(filePath); } throw new VariableError(variableKind, (localize('canNotResolveFile', "Variable {0} can not be resolved. Please open an editor.", match)));...
// common error handling for all variables that require an open editor
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/configurationResolver/common/variableResolver.ts#L194-L201
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
getFolderPathForFile
const getFolderPathForFile = (variableKind: VariableKind): string => { const filePath = getFilePath(variableKind); // throws error if no editor open if (this._context.getWorkspaceFolderPathForFile) { const folderPath = this._context.getWorkspaceFolderPathForFile(); if (folderPath) { return normaliz...
// common error handling for all variables that require an open editor
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/configurationResolver/common/variableResolver.ts#L204-L214
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
getFolderUri
const getFolderUri = (variableKind: VariableKind): uri => { if (argument) { const folder = this._context.getFolderUri(argument); if (folder) { return folder; } throw new VariableError(variableKind, localize('canNotFindFolder', "Variable {0} can not be resolved. No such folder '{1}'.", match, ar...
// common error handling for all variables that require an open folder and accept a folder name argument
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/configurationResolver/common/variableResolver.ts#L217-L235
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileDecorationChangeEvent.constructor
constructor(all: URI | URI[]) { this._data.fill(true, asArray(all)); }
// events ignore all path casings
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/decorations/browser/decorationsService.ts#L223-L225
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
removeAll
const removeAll = () => { const uris: URI[] = []; for (const [uri, map] of this._data) { if (map.delete(provider)) { uris.push(uri); } } if (uris.length > 0) { this._onDidChangeDecorationsDelayed.fire(uris); } };
// remove everything what came from this provider
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/decorations/browser/decorationsService.ts#L283-L293
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
SimpleFileDialog.updateItems
private async updateItems(newFolder: URI, force: boolean = false, trailing?: string): Promise<boolean> { this.busy = true; this.autoCompletePathSegment = ''; const wasDotDot = trailing === '..'; trailing = wasDotDot ? undefined : trailing; const isSave = !!trailing; let result = false; const updatingProm...
// Returns true if there is a file at the end of the URI.
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/dialogs/browser/simpleFileDialog.ts#L869-L927
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
CodeEditorService.doOpenCodeEditor
private async doOpenCodeEditor(input: IResourceEditorInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> { // Special case: we want to detect the request to open an editor that // is different from the current one to decide whether the current editor // should be pinned or not. ...
// Open using our normal editor service
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/codeEditorService.ts#L76-L113
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorResolverService._flattenEditorsMap
private _flattenEditorsMap() { // If we shouldn't be re-flattening (due to lack of update) then return early if (!this._shouldReFlattenEditors) { return this._flattenedEditors; } this._shouldReFlattenEditors = false; const editors = new Map<string | glob.IRelativePattern, RegisteredEditors>(); for (const...
/** * Given the nested nature of the editors map, we merge factories of the same glob and id to make it flat * and easier to work with */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorResolverService.ts#L304-L336
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorResolverService._registeredEditors
private get _registeredEditors(): RegisteredEditors { return Array.from(this._flattenedEditors.values()).flat(); }
/** * Returns all editors as an array. Possible to contain duplicates */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorResolverService.ts#L341-L343
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorResolverService.getEditor
private getEditor(resource: URI, editorId: string | EditorResolution.EXCLUSIVE_ONLY | undefined): { editor: RegisteredEditor | undefined; conflictingDefault: boolean } { const findMatchingEditor = (editors: RegisteredEditors, viewType: string) => { return editors.find((editor) => { if (editor.options && edito...
/** * Given a resource and an editorId selects the best possible editor * @returns The editor and whether there was another default which conflicted with it */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorResolverService.ts#L401-L450
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorResolverService.moveExistingEditorForResource
private async moveExistingEditorForResource( existingEditorsForResource: Array<{ editor: EditorInput; group: IEditorGroup }>, targetGroup: IEditorGroup, ): Promise<EditorInput | undefined> { const editorToUse = existingEditorsForResource[0]; // We should only have one editor but if there are multiple we close...
/** * Moves the first existing editor for a resource to the target group unless already opened there. * Additionally will close any other editors that are open for that resource and viewtype besides the first one found * @param resource The resource of the editor * @param viewType the viewtype of the editor *...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorResolverService.ts#L539-L564
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorResolverService.findExistingEditorsForResource
private findExistingEditorsForResource( resource: URI, editorId: string, ): Array<{ editor: EditorInput; group: IEditorGroup }> { const out: Array<{ editor: EditorInput; group: IEditorGroup }> = []; const orderedGroups = distinct([ ...this.editorGroupService.groups, ]); for (const group of orderedGroup...
/** * Given a resource and an editorId, returns all editors open for that resource and editorId. * @param resource The resource specified * @param editorId The editorID * @returns A list of editors */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorResolverService.ts#L572-L589
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
writeCurrentEditorsToStorage
const writeCurrentEditorsToStorage = () => { storedChoices[globForResource] = []; editors.forEach(editor => storedChoices[globForResource].push(editor.editorInfo.id)); this.storageService.store(EditorResolverService.conflictingDefaultsStorageID, JSON.stringify(storedChoices), StorageScope.PROFILE, StorageTarge...
// Writes to the storage service that a choice has been made for the currently installed editors
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorResolverService.ts#L599-L603
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorService.onDidRunFileOperation
private async onDidRunFileOperation(e: FileOperationEvent): Promise<void> { // Handle moves specially when file is opened if (e.isOperation(FileOperation.MOVE)) { this.handleMovedFile(e.resource, e.target.resource); } // Handle deletes if (e.isOperation(FileOperation.DELETE) || e.isOperation(FileOperatio...
//#region File Changes: Move & Deletes to move or close opend editors
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorService.ts#L236-L247
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorService.isOpened
isOpened(editor: IResourceEditorInputIdentifier): boolean { return this.editorsObserver.hasEditor({ resource: this.uriIdentityService.asCanonicalUri(editor.resource), typeId: editor.typeId, editorId: editor.editorId }); }
//#region isOpened() / isVisible()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorService.ts#L747-L753
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorService.closeEditor
async closeEditor({ editor, groupId }: IEditorIdentifier, options?: ICloseEditorOptions): Promise<void> { const group = this.editorGroupsContainer.getGroup(groupId); await group?.closeEditor(editor, options); }
//#region closeEditor()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorService.ts#L769-L773
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorService.closeEditors
async closeEditors(editors: IEditorIdentifier[], options?: ICloseEditorOptions): Promise<void> { const mapGroupToEditors = new Map<IEditorGroup, EditorInput[]>(); for (const { editor, groupId } of editors) { const group = this.editorGroupsContainer.getGroup(groupId); if (!group) { continue; } let ...
//#region closeEditors()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorService.ts#L779-L800
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorService.save
async save(editors: IEditorIdentifier | IEditorIdentifier[], options?: ISaveEditorsOptions): Promise<ISaveEditorsResult> { // Convert to array if (!Array.isArray(editors)) { editors = [editors]; } // Make sure to not save the same editor multiple times // by using the `matches()` method to find duplicate...
//#region save/revert
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorService.ts#L945-L1027
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorService.dispose
override dispose(): void { super.dispose(); // Dispose remaining watchers if any this.activeOutOfWorkspaceWatchers.forEach(disposable => dispose(disposable)); this.activeOutOfWorkspaceWatchers.clear(); }
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/editor/browser/editorService.ts#L1103-L1109
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WebExtensionsScannerService.readSystemExtensions
private async readSystemExtensions(): Promise<IExtension[]> { const systemExtensions = await this.builtinExtensionsScannerService.scanBuiltinExtensions(); const cachedSystemExtensions = await Promise.all((await this.readSystemExtensionsCache()).map(e => this.toScannedExtension(e, true, ExtensionType.System))); c...
/** * All system extensions bundled with the product */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.ts#L197-L213
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WebExtensionsScannerService.readCustomBuiltinExtensions
private async readCustomBuiltinExtensions(scanOptions?: ScanOptions): Promise<IScannedExtension[]> { const [customBuiltinExtensionsFromLocations, customBuiltinExtensionsFromGallery] = await Promise.all([ this.getCustomBuiltinExtensionsFromLocations(scanOptions), this.getCustomBuiltinExtensionsFromGallery(scanOp...
/** * All extensions defined via `additionalBuiltinExtensions` API */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensionManagement/browser/webExtensionsScannerService.ts#L218-L226
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ExtensionUrlHandler.garbageCollect
private garbageCollect(): void { const now = new Date().getTime(); const uriBuffer = new Map<string, { timestamp: number; uri: URI }[]>(); this.uriBuffer.forEach((uris, extensionId) => { uris = uris.filter(({ timestamp }) => now - timestamp < FIVE_MINUTES); if (uris.length > 0) { uriBuffer.set(extensi...
// forget about all uris buffered more than 5 minutes ago
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensions/browser/extensionUrlHandler.ts#L321-L334
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FetchFileSystemProvider.readFile
async readFile(resource: URI): Promise<Uint8Array> { try { const res = await fetch(resource.toString(true)); if (res.status === 200) { return new Uint8Array(await res.arrayBuffer()); } throw createFileSystemProviderError(res.statusText, FileSystemProviderErrorCode.Unknown); } catch (err) { throw ...
// working implementations
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.ts#L19-L29
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FetchFileSystemProvider.stat
async stat(_resource: URI): Promise<IStat> { return { type: FileType.File, size: 0, mtime: 0, ctime: 0 }; }
// fake implementations
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.ts#L32-L39
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FetchFileSystemProvider.writeFile
writeFile(_resource: URI, _content: Uint8Array, _opts: IFileWriteOptions): Promise<void> { throw new NotSupportedError(); }
// error implementations
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensions/browser/webWorkerFileSystemProvider.ts#L46-L48
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
extensionCmp
function extensionCmp(a: IExtensionDescription, b: IExtensionDescription): number { const aSortBucket = (a.isBuiltin ? SortBucket.Builtin : a.isUnderDevelopment ? SortBucket.Dev : SortBucket.User); const bSortBucket = (b.isBuiltin ? SortBucket.Builtin : b.isUnderDevelopment ? SortBucket.Dev : SortBucket.User); if (a...
/** * Ensure that: * - first are builtin extensions * - second are user extensions * - third are extensions under development * * In each bucket, extensions must be sorted alphabetically by their folder name. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.ts#L402-L417
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ExtensionRunningLocationTracker.deltaExtensions
public deltaExtensions(toAdd: IExtensionDescription[], toRemove: ExtensionIdentifier[]): ExtensionIdentifierMap<ExtensionRunningLocation | null> { // Remove old running location const removedRunningLocation = new ExtensionIdentifierMap<ExtensionRunningLocation | null>(); for (const extensionId of toRemove) { c...
/** * Returns the running locations for the removed extensions. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.ts#L278-L291
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ExtensionRunningLocationTracker._updateRunningLocationForAddedExtensions
private _updateRunningLocationForAddedExtensions(toAdd: IExtensionDescription[]): void { // Determine new running location const localProcessExtensions: IExtensionDescription[] = []; const localWebWorkerExtensions: IExtensionDescription[] = []; for (const extension of toAdd) { const extensionKind = this.read...
/** * Update `this._runningLocation` with running locations for newly enabled/installed extensions. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.ts#L296-L326
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeLocalProcessExtensionHost._tryFindDebugPort
private async _tryFindDebugPort(): Promise<number> { if (typeof this._environmentService.debugExtensionHost.port !== 'number') { return 0; } const expected = this._environmentService.debugExtensionHost.port; const port = await this._nativeHostService.findFreePort(expected, 10 /* try 10 ports */, 5000 /* tr...
/** * Find a free port if extension host debugging is enabled. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensions/electron-sandbox/localProcessExtensionHost.ts#L328-L353
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeExtensionService._resolveAuthority
protected async _resolveAuthority(remoteAuthority: string): Promise<ResolverResult> { const authorityPlusIndex = remoteAuthority.indexOf('+'); if (authorityPlusIndex === -1) { // This authority does not need to be resolved, simply parse the port number const { host, port } = parseAuthorityWithPort(remoteAuth...
// --- impl
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts#L272-L292
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.onDidChangeCapabilities
get onDidChangeCapabilities(): Event<void> { return this.provider.onDidChangeCapabilities; }
//#region File Capabilities
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/files/electron-sandbox/diskFileSystemProvider.ts#L57-L57
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.stat
stat(resource: URI): Promise<IStat> { return this.provider.stat(resource); }
//#region File Metadata Resolving
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/files/electron-sandbox/diskFileSystemProvider.ts#L65-L67
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.readFile
readFile(resource: URI, opts?: IFileAtomicReadOptions): Promise<Uint8Array> { return this.provider.readFile(resource, opts); }
//#region File Reading/Writing
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/files/electron-sandbox/diskFileSystemProvider.ts#L77-L79
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.mkdir
mkdir(resource: URI): Promise<void> { return this.provider.mkdir(resource); }
//#region Move/Copy/Delete/Create Folder
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/files/electron-sandbox/diskFileSystemProvider.ts#L109-L111
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.cloneFile
cloneFile(from: URI, to: URI): Promise<void> { return this.provider.cloneFile(from, to); }
//#region Clone File
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/files/electron-sandbox/diskFileSystemProvider.ts#L129-L131
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.createUniversalWatcher
protected createUniversalWatcher( onChange: (changes: IFileChange[]) => void, onLogMessage: (msg: ILogMessage) => void, verboseLogging: boolean ): AbstractUniversalWatcherClient { return new UniversalWatcherClient(changes => onChange(changes), msg => onLogMessage(msg), verboseLogging, this.utilityProcessWorker...
//#region File Watching
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/files/electron-sandbox/diskFileSystemProvider.ts#L137-L143
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
HistoryService.getLastActiveWorkspaceRoot
getLastActiveWorkspaceRoot(schemeFilter?: string, authorityFilter?: string): URI | undefined { // No Folder: return early const folders = this.contextService.getWorkspace().folders; if (folders.length === 0) { return undefined; } // Single Folder: return early if (folders.length === 1) { const resou...
//#region Last Active Workspace/File
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/history/browser/historyService.ts#L1117-L1164
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
HistoryService.dispose
override dispose(): void { super.dispose(); for (const [, stack] of this.editorGroupScopedNavigationStacks) { stack.disposable.dispose(); } for (const [, editors] of this.editorScopedNavigationStacks) { for (const [, stack] of editors) { stack.disposable.dispose(); } } for (const [, listener...
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/history/browser/historyService.ts#L1185-L1201
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorNavigationStack.notifyNavigation
notifyNavigation(editorPane: IEditorPane | undefined, event?: IEditorPaneSelectionChangeEvent): void { this.trace('notifyNavigation()', editorPane?.input, event); const isSelectionAwareEditorPane = isEditorPaneWithSelection(editorPane); const hasValidEditor = editorPane?.input && !editorPane.input.isDisposed(); ...
//#region Stack Mutation
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/history/browser/historyService.ts#L1557-L1599
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorNavigationStack.canGoForward
canGoForward(): boolean { return this.stack.length > this.index + 1; }
//#region Navigation
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/history/browser/historyService.ts#L1835-L1837
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BrowserHostService.restart
async restart(): Promise<void> { this.reload(); }
//#region Lifecycle
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/host/browser/browserHostService.ts#L549-L551
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BrowserHostService.getScreenshot
async getScreenshot(): Promise<ArrayBufferLike | undefined> { // Gets a screenshot from the browser. This gets the screenshot via the browser's display // media API which will typically offer a picker of all available screens and windows for // the user to select. Using the video stream provided by the display me...
//#region Screenshots
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/host/browser/browserHostService.ts#L590-L650
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BrowserHostService.getNativeWindowHandle
async getNativeWindowHandle(_windowId: number) { return undefined; }
//#region Native Handle
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/host/browser/browserHostService.ts#L656-L658
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkbenchHostService.focus
focus(targetWindow: Window, options?: { force: boolean }): Promise<void> { return this.nativeHostService.focusWindow({ force: options?.force, targetWindowId: getWindowId(targetWindow) }); }
//#region Lifecycle
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts#L165-L170
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkbenchHostService.getScreenshot
getScreenshot(): Promise<ArrayBufferLike | undefined> { return this.nativeHostService.getScreenshot(); }
//#region Screenshots
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/host/electron-sandbox/nativeHostService.ts#L192-L194
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
KeybindingsJsonSchema.updateSchema
updateSchema(additionalContributions: readonly IJSONSchema[]) { this.commandsSchemas.length = 0; this.commandsEnum.length = 0; this.removalCommandsEnum.length = 0; this.commandsEnumDescriptions.length = 0; const knownCommands = new Set<string>(); const addKnownCommand = (commandId: string, description?: st...
// - can `CommandsRegistry.getCommands` and `MenuRegistry.getCommands` return different values at different times? ie would just pushing new schemas from `additionalContributions` not be enough?
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/keybinding/browser/keybindingService.ts#L933-L995
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BrowserKeyboardMapperFactoryBase._validateCurrentKeyboardMapping
private _validateCurrentKeyboardMapping(keyboardEvent: IKeyboardEvent): boolean { if (!this._initialized) { return true; } const standardKeyboardEvent = keyboardEvent as StandardKeyboardEvent; const currentKeymap = this._activeKeymapInfo; if (!currentKeymap) { return true; } if (standardKeyboardEv...
//#region Browser API
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts#L340-L396
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MacLinuxKeyboardMapper.getCharCode
public static getCharCode(char: string): number { if (char.length === 0) { return 0; } const charCode = char.charCodeAt(0); switch (charCode) { case CharCode.U_Combining_Grave_Accent: return CharCode.U_GRAVE_ACCENT; case CharCode.U_Combining_Acute_Accent: return CharCode.U_ACUTE_ACCENT; case CharCod...
/** * Attempt to map a combining character to a regular one that renders the same way. * * https://www.compart.com/en/unicode/bidiclass/NSM */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.ts#L1042-L1061
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
_registerLetterIfMissing
const _registerLetterIfMissing = (charCode: CharCode, keyCode: KeyCode): void => { if (!producesLetter[charCode]) { this._keyCodeToLabel[keyCode] = String.fromCharCode(charCode); } };
// Handle keyboard layouts where latin characters are not produced e.g. Cyrillic
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts#L270-L274
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
_registerLabel
const _registerLabel = (keyCode: KeyCode, charCode: CharCode): void => { // const existingLabel = this._keyCodeToLabel[keyCode]; // const existingCharCode = (existingLabel ? existingLabel.charCodeAt(0) : CharCode.Null); // if (existingCharCode < 32 || existingCharCode > 126) { this._keyCodeToLabel[keyCo...
// Since this keyboard layout produces no latin letters at all, most of the UI will use the
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.ts#L306-L312
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
LanguageDetectionSimpleWorker.adjustLanguageConfidence
private adjustLanguageConfidence(modelResult: ModelResult): ModelResult { switch (modelResult.languageId) { // For the following languages, we increase the confidence because // these are commonly used languages in VS Code and supported // by the model. case 'js': case 'html': case 'json': case '...
// * Languages with 'problematic' syntaxes that have caused incorrect language detection
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/languageDetection/browser/languageDetectionSimpleWorker.ts#L176-L224
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
LanguageDetectionService.initEditorOpenedListeners
private initEditorOpenedListeners(storageService: IStorageService) { try { const globalLangHistoryData = JSON.parse(storageService.get(LanguageDetectionService.globalOpenedLanguagesStorageKey, StorageScope.PROFILE, '[]')); this.historicalGlobalOpenedLanguageIds.fromJSON(globalLangHistoryData); } catch (e) { c...
// only gives history for a workspace... where this takes advantage of history at a global level as well.
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/languageDetection/browser/languageDetectionWorkerServiceImpl.ts#L155-L177
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NotificationService.info
info(message: NotificationMessage | NotificationMessage[]): void { if (Array.isArray(message)) { for (const messageEntry of message) { this.info(messageEntry); } return; } this.model.addNotification({ severity: Severity.Info, message }); }
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/notification/common/notificationService.ts#L175-L185
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PreferencesService.handleURL
async handleURL(uri: URI): Promise<boolean> { if (compareIgnoreCase(uri.authority, SETTINGS_AUTHORITY) !== 0) { return false; } const settingInfo = uri.path.split('/').filter(part => !!part); const settingId = ((settingInfo.length > 0) ? settingInfo[0] : undefined); if (!settingId) { this.openSettings(...
/** * Should be of the format: * code://settings/settingName * Examples: * code://settings/files.autoSave * */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/preferences/browser/preferencesService.ts#L674-L701
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
Settings2EditorModel.filterGroups
protected override get filterGroups(): ISettingsGroup[] { return this.settingsGroups.slice(1); }
/** Doesn't include the "Commonly Used" group */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/preferences/common/preferencesModels.ts#L244-L246
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
Settings2EditorModel.setAdditionalGroups
setAdditionalGroups(groups: ISettingsGroup[]) { this.additionalGroups = groups; }
/** For programmatically added groups outside of registered configurations */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/preferences/common/preferencesModels.ts#L255-L257
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DefaultSettingsEditorModel.writeResultGroups
private writeResultGroups(groups: ISearchResultGroup[], startLine: number): { matches: IRange[]; settingsGroups: ISettingsGroup[] } { const contentBuilderOffset = startLine - 1; const builder = new SettingsContentBuilder(contentBuilderOffset); const settingsGroups: ISettingsGroup[] = []; const matches: IRange[...
/** * Translate the ISearchResultGroups to text, and write it to the editor model */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/preferences/common/preferencesModels.ts#L862-L894
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
updateNotification
const updateNotification = (step?: IProgressStep): void => { // full message (inital or update) if (step?.message && options.title) { titleAndMessage = `${options.title}: ${step.message}`; // always prefix with overall title if we have it (https://github.com/microsoft/vscode/issues/50932) } else { tit...
// hoisted to make sure a delayed notification shows the most recent message
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/progress/browser/progressService.ts#L380-L410
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TunnelModel.updateInResponseToCandidates
private updateInResponseToCandidates(candidates: CandidatePort[]): Map<string, { host: string; port: number }> { const removedCandidates = this._candidates ?? new Map(); const candidatesMap = new Map(); this._candidates = candidatesMap; candidates.forEach(value => { const addressKey = makeAddress(value.host,...
// Returns removed candidates
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/remote/common/tunnelModel.ts#L898-L939
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
reviveMatch
const reviveMatch = (result: IFileMatch<UriComponents>): IFileMatch => ({ resource: URI.revive(result.resource), results: revive(result.results) });
// force resource to revive using URI.revive.
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/search/browser/searchService.ts#L107-L110
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
IgnoreFile.updateContents
updateContents(contents: string) { this.isPathIgnored = this.parseIgnoreFile(contents, this.location, this.parent); }
/** * Updates the contents of the ignorefile. Preservering the location and parent * @param contents The new contents of the gitignore file */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/search/common/ignoreFile.ts#L30-L32
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
IgnoreFile.isPathIncludedInTraversal
isPathIncludedInTraversal(path: string, isDir: boolean): boolean { if (path[0] !== '/' || path[path.length - 1] === '/') { throw Error('Unexpected path format, expectred to begin with slash and end without. got:' + path); } const ignored = this.isPathIgnored(path, isDir); return !ignored; }
/** * Returns true if a path in a traversable directory has not been ignored. * * Note: For performance reasons this does not check if the parent directories have been ignored, * so it should always be used in tandem with `shouldTraverseDir` when walking a directory. * * In cases where a path must be tested...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/search/common/ignoreFile.ts#L42-L50
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
IgnoreFile.isArbitraryPathIgnored
isArbitraryPathIgnored(path: string, isDir: boolean): boolean { if (path[0] !== '/' || path[path.length - 1] === '/') { throw Error('Unexpected path format, expectred to begin with slash and end without. got:' + path); } const segments = path.split('/').filter(x => x); let ignored = false; let walkingPat...
/** * Returns true if an arbitrary path has not been ignored. * This is an expensive operation and should only be used ouside of traversals. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/search/common/ignoreFile.ts#L56-L79
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
QueryBuilder.getContentPattern
private getContentPattern(inputPattern: IPatternInfo, options: ITextQueryBuilderOptions): IPatternInfo { const searchConfig = this.configurationService.getValue<ISearchConfiguration>(); if (inputPattern.isRegExp) { inputPattern.pattern = inputPattern.pattern.replace(/\r?\n/g, '\\n'); } const newPattern = {...
/** * Adjusts input pattern for config */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/search/common/queryBuilder.ts#L167-L216
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
QueryBuilder.isCaseSensitive
private isCaseSensitive(contentPattern: IPatternInfo, options: ITextQueryBuilderOptions): boolean { if (options.isSmartCase) { if (contentPattern.isRegExp) { // Consider it case sensitive if it contains an unescaped capital letter if (strings.containsUppercaseCharacter(contentPattern.pattern, true)) { ...
/** * Resolve isCaseSensitive flag based on the query and the isSmartCase flag, for search providers that don't support smart case natively. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/search/common/queryBuilder.ts#L337-L350
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
QueryBuilder.parseSearchPaths
parseSearchPaths(pattern: string | string[]): ISearchPathsInfo { const isSearchPath = (segment: string) => { // A segment is a search path if it is an absolute path or starts with ./, ../, .\, or ..\ return path.isAbsolute(segment) || /^\.\.?([\/\\]|$)/.test(segment); }; const patterns = Array.isArray(patt...
/** * Take the includePattern as seen in the search viewlet, and split into components that look like searchPaths, and * glob patterns. Glob patterns are expanded from 'foo/bar' to '{foo/bar/**, **\/foo/bar}. * * Public for test. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/services/search/common/queryBuilder.ts#L374-L417
1a8578f21ace8c9381461d295ed31c3500be43bf