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
FancyToggleActionViewItem.dispose
override dispose(): void { FancyToggleActionViewItem.lastCheckedState.set(this.action.id, !!this.action.checked); super.dispose(); }
// On dispose, remember the final state
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/actions/browser/fancyToggleActionViewItem.ts#L303-L306
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MenuWorkbenchToolBar.setActions
override setActions(): void { throw new BugIndicatingError('This toolbar is populated from a menu.'); }
/** * @deprecated The WorkbenchToolBar does not support this method because it works with menus. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/actions/browser/toolbar.ts#L391-L393
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MenuId.for
static for(identifier: string): MenuId { return MenuId._instances.get(identifier) ?? new MenuId(identifier); }
/** * Create or reuse a `MenuId` with the given identifier */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/actions/common/actions.ts#L269-L271
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MenuId.constructor
constructor(identifier: string) { if (MenuId._instances.has(identifier)) { throw new TypeError(`MenuId with identifier '${identifier}' already exists. Use MenuId.for(ident) or a unique identifier`); } MenuId._instances.set(identifier, this); this.id = identifier; }
/** * Create a new `MenuId` with the unique identifier. Will throw if a menu * with the identifier already exists, use `MenuId.for(ident)` or a unique * identifier */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/actions/common/actions.ts#L280-L286
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AssignmentFilterProvider.trimVersionSuffix
private static trimVersionSuffix(version: string): string { const regex = /\-[a-zA-Z0-9]+$/; const result = version.split(regex); return result[0]; }
/** * Returns a version string that can be parsed by the TAS client. * The tas client cannot handle suffixes lke "-insider" * Ref: https://github.com/microsoft/tas-client/blob/30340d5e1da37c2789049fcf45928b954680606f/vscode-tas-client/src/vscode-tas-client/VSCodeFilterProvider.ts#L35 * * @param version Versio...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/assignment/common/assignment.ts#L100-L105
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BrowserClipboardService.installWebKitWriteTextWorkaround
private installWebKitWriteTextWorkaround(): void { const handler = () => { const currentWritePromise = new DeferredPromise<string>(); // Cancel the previous promise since we just created a new one in response to this new event if (this.webKitPendingClipboardWritePromise && !this.webKitPendingClipboardWriteP...
// This function sets up some handlers to work around that behavior.
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/clipboard/browser/clipboardService.ts#L85-L113
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BrowserClipboardService.writeText
async writeText(text: string, type?: string): Promise<void> { // Clear resources given we are writing text this.clearResourcesState(); // With type: only in-memory is supported if (type) { this.mapTextToType.set(type, text); return; } if (this.webKitPendingClipboardWritePromise) { // For Safari...
// unsupported in web (only in-memory)
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/clipboard/browser/clipboardService.ts#L117-L147
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BrowserClipboardService.readFindText
async readFindText(): Promise<string> { return this.findText; }
// unsupported in web (only in-memory)
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/clipboard/browser/clipboardService.ts#L192-L194
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ConfigurationModel.addValue
public addValue(key: string, value: any): void { this.updateValue(key, value, true); }
// Update methods
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/configuration/common/configurationModels.ts#L255-L257
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ConfigurationRegistry.getConfigurations
getConfigurations(): IConfigurationNode[] { return this.configurationContributors; }
// TODO: @sandy081 - Remove this method and include required info in getConfigurationProperties
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/configuration/common/configurationRegistry.ts#L699-L701
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
Parser.parse
parse(input: string): ContextKeyExpression | undefined { if (input === '') { this._parsingErrors.push({ message: errorEmptyString, offset: 0, lexeme: '', additionalInfo: hintEmptyString }); return undefined; } this._tokens = this._scanner.reset(input).scan(); // @ulugbekna: we do not stop parsing if the...
/** * Parse a context key expression. * * @param input the expression to parse * @returns the parsed expression or `undefined` if there's an error - call `lexingErrors` and `parsingErrors` to see the errors */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/contextkey/common/contextkey.ts#L204-L232
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
Parser._previous
private _previous() { return this._tokens[this._current - 1]; }
// careful: this can throw if current token is the initial one (ie index = 0)
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/contextkey/common/contextkey.ts#L530-L532
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
eliminateConstantsInArray
function eliminateConstantsInArray(arr: ContextKeyExpression[]): (ContextKeyExpression | undefined)[] { // Allocate array only if there is a difference let newArr: (ContextKeyExpression | undefined)[] | null = null; for (let i = 0, len = arr.length; i < len; i++) { const newExpr = arr[i].substituteConstants(); ...
/** * @returns the same instance if nothing changed. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/contextkey/common/contextkey.ts#L1546-L1573
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
allElementsIncluded
function allElementsIncluded(p: ContextKeyExpression[], q: ContextKeyExpression[]): boolean { let pIndex = 0; let qIndex = 0; while (pIndex < p.length && qIndex < q.length) { const cmp = p[pIndex].cmp(q[qIndex]); if (cmp < 0) { // an element from `p` is missing from `q` return false; } else if (cmp === ...
/** * Returns true if all elements in `p` are also present in `q`. * The two arrays are assumed to be sorted */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/contextkey/common/contextkey.ts#L2136-L2153
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
Scanner._quotedString
private _quotedString() { while (this._peek() !== CharCode.SingleQuote && !this._isAtEnd()) { // TODO@ulugbekna: add support for escaping ' ? this._advance(); } if (this._isAtEnd()) { this._error(hintDidYouForgetToOpenOrCloseQuote); return; } // consume the closing ' this._advance(); this._tok...
// captures the lexeme without the leading and trailing '
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/contextkey/common/scanner.ts#L319-L333
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
Scanner._regex
private _regex() { let p = this._current; let inEscape = false; let inCharacterClass = false; while (true) { if (p >= this._input.length) { this._current = p; this._error(hintDidYouForgetToEscapeSlash); return; } const ch = this._input.charCodeAt(p); if (inEscape) { // parsing an esca...
/* * Lexing a regex expression: /.../[igsmyu]* * Based on https://github.com/microsoft/TypeScript/blob/9247ef115e617805983740ba795d7a8164babf89/src/compiler/scanner.ts#L2129-L2181 * * Note that we want slashes within a regex to be escaped, e.g., /file:\\/\\/\\// should match `file:///` */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/contextkey/common/scanner.ts#L341-L379
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ContextMenuService.showContextMenu
showContextMenu(delegate: IContextMenuDelegate | IContextMenuMenuDelegate): void { delegate = ContextMenuMenuDelegate.transform(delegate, this.menuService, this.contextKeyService); this.contextMenuHandler.showContextMenu({ ...delegate, onHide: (didCancel) => { delegate.onHide?.(didCancel); this._on...
// ContextMenu
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/contextview/browser/contextMenuService.ts#L56-L70
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ContextViewHandler.showContextView
showContextView(delegate: IContextViewDelegate, container?: HTMLElement, shadowRoot?: boolean): IOpenContextView { let domPosition: ContextViewDOMPosition; if (container) { if (container === this.layoutService.getContainer(getWindow(container))) { domPosition = ContextViewDOMPosition.ABSOLUTE; } else if (...
// ContextView
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/contextview/browser/contextViewService.ts#L28-L56
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
replaceNLStrings
function replaceNLStrings(logger: ILogger, extensionManifest: IExtensionManifest, messages: ITranslations, originalMessages?: ITranslations): void { const processEntry = (obj: any, key: string | number, command?: boolean) => { const value = obj[key]; if (isString(value)) { const str = <string>value; const le...
/** * This routine makes the following assumptions: * The root element is an object literal */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/extensionManagement/common/extensionNls.ts#L30-L90
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ExtensionStorageService.removeOutdatedExtensionVersions
static async removeOutdatedExtensionVersions(extensionManagementService: IExtensionManagementService, storageService: IStorageService): Promise<void> { const extensions = await extensionManagementService.getInstalled(); const extensionVersionsToRemove: string[] = []; for (const [id, versions] of ExtensionStorageS...
/* TODO @sandy081: This has to be done across all profiles */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/extensionManagement/common/extensionStorage.ts#L62-L76
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ExtensionsScanner.resolveOriginalMessageBundle
private async resolveOriginalMessageBundle(originalMessageBundle: URI | null, errors: ParseError[]): Promise<{ [key: string]: string } | undefined> { if (originalMessageBundle) { try { const originalBundleContent = (await this.fileService.readFile(originalMessageBundle)).value.toString(); return parse(orig...
/** * Parses original message bundle, returns null if the original message bundle is null. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/extensionManagement/common/extensionsScannerService.ts#L844-L854
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ExtensionsScanner.findMessageBundles
private findMessageBundles(extensionLocation: URI, nlsConfiguration: NlsConfiguration): Promise<{ localized: URI; original: URI | null }> { return new Promise<{ localized: URI; original: URI | null }>((c, e) => { const loop = (locale: string): void => { const toCheck = joinPath(extensionLocation, `package.nls....
/** * Finds localized message bundle and the original (unlocalized) one. * If the localized file is not present, returns null for the original and marks original as localized. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/extensionManagement/common/extensionsScannerService.ts#L860-L882
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ImplicitActivationEventsImpl.readActivationEvents
public readActivationEvents(extensionDescription: IExtensionDescription): string[] { if (!this._cache.has(extensionDescription)) { this._cache.set(extensionDescription, this._readActivationEvents(extensionDescription)); } return this._cache.get(extensionDescription)!; }
/** * This can run correctly only on the renderer process because that is the only place * where all extension points and all implicit activation events generators are known. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/extensionManagement/common/implicitActivationEvents.ts#L26-L31
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ImplicitActivationEventsImpl.createActivationEventsMap
public createActivationEventsMap(extensionDescriptions: IExtensionDescription[]): { [extensionId: string]: string[] } { const result: { [extensionId: string]: string[] } = Object.create(null); for (const extensionDescription of extensionDescriptions) { const activationEvents = this.readActivationEvents(extension...
/** * This can run correctly only on the renderer process because that is the only place * where all extension points and all implicit activation events generators are known. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/extensionManagement/common/implicitActivationEvents.ts#L37-L46
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ExtensionsLifecycle.constructor
constructor( @IUserDataProfilesService private userDataProfilesService: IUserDataProfilesService, @ILogService private readonly logService: ILogService ) { super(); }
// Run max 5 processes in parallel
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/extensionManagement/node/extensionLifecycle.ts#L22-L27
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ExtensionIdentifier.toKey
public static toKey(id: ExtensionIdentifier | string): string { if (typeof id === 'string') { return id.toLowerCase(); } return id._lower; }
/** * Gives the value by which to index (for equality). */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/extensions/common/extensions.ts#L394-L399
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MacExternalTerminalService.openTerminal
public openTerminal(configuration: IExternalTerminalSettings, cwd?: string): Promise<void> { return this.spawnTerminal(cp, configuration, cwd); }
// osascript is the AppleScript interpreter on OS X
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/externalTerminal/node/externalTerminalService.ts#L147-L149
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
improveError
function improveError(err: Error & { errno?: string; path?: string }): Error { if ('errno' in err && err['errno'] === 'ENOENT' && 'path' in err && typeof err['path'] === 'string') { return new Error(nls.localize('ext.term.app.not.found', "can't find terminal application '{0}'", err['path'])); } return err; }
/** * tries to turn OS errors into more meaningful error messages */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/externalTerminal/node/externalTerminalService.ts#L350-L355
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
quote
function quote(args: string[]): string { let r = ''; for (const a of args) { if (a.indexOf(' ') >= 0) { r += '"' + a + '"'; } else { r += a; } r += ' '; } return r; }
/** * Quote args if necessary and combine into a space separated string. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/externalTerminal/node/externalTerminalService.ts#L360-L371
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
HTMLFileSystemProvider.constructor
constructor( private indexedDB: IndexedDB | undefined, private readonly store: string, private logService: ILogService ) { super(); }
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/browser/htmlFileSystemProvider.ts#L52-L58
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
HTMLFileSystemProvider.stat
async stat(resource: URI): Promise<IStat> { try { const handle = await this.getHandle(resource); if (!handle) { throw this.createFileSystemProviderError(resource, 'No such file or directory, stat', FileSystemProviderErrorCode.FileNotFound); } if (WebFileSystemAccess.isFileSystemFileHandle(handle)) { ...
//#region File Metadata Resolving
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/browser/htmlFileSystemProvider.ts#L62-L89
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
HTMLFileSystemProvider.readFileStream
readFileStream(resource: URI, opts: IFileReadStreamOptions, token: CancellationToken): ReadableStreamEvents<Uint8Array> { const stream = newWriteableStream<Uint8Array>(data => VSBuffer.concat(data.map(data => VSBuffer.wrap(data))).buffer, { // Set a highWaterMark to prevent the stream // for file upload to prod...
//#region File Reading/Writing
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/browser/htmlFileSystemProvider.ts#L114-L175
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
HTMLFileSystemProvider.mkdir
async mkdir(resource: URI): Promise<void> { try { const parent = await this.getDirectoryHandle(this.extUri.dirname(resource)); if (!parent) { throw this.createFileSystemProviderError(resource, 'No such parent directory, mkdir', FileSystemProviderErrorCode.FileNotFound); } await parent.getDirectoryHan...
//#region Move/Copy/Delete/Create Folder
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/browser/htmlFileSystemProvider.ts#L235-L246
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
HTMLFileSystemProvider.toFileSystemProviderError
private toFileSystemProviderError(error: Error): FileSystemProviderError { if (error instanceof FileSystemProviderError) { return error; // avoid double conversion } let code = FileSystemProviderErrorCode.Unknown; if (error.name === 'NotAllowedError') { error = new Error(localize('fileSystemNotAllowedErr...
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/browser/htmlFileSystemProvider.ts#L504-L516
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ERR_UNKNOWN_INTERNAL
const ERR_UNKNOWN_INTERNAL = (message: string) => createFileSystemProviderError(localize('internal', "Internal error occurred in IndexedDB File System Provider. ({0})", message), FileSystemProviderErrorCode.Unknown);
// Arbitrary Internal Errors
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/browser/indexedDBFileSystemProvider.ts#L26-L26
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProviderClient.stat
stat(resource: URI): Promise<IStat> { return this.channel.call('stat', [resource]); }
//#region File Metadata Resolving
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/diskFileSystemProviderClient.ts#L77-L79
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProviderClient.readFile
async readFile(resource: URI, opts?: IFileAtomicReadOptions): Promise<Uint8Array> { const { buffer } = await this.channel.call('readFile', [resource, opts]) as VSBuffer; return buffer; }
//#region File Reading/Writing
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/diskFileSystemProviderClient.ts#L89-L93
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProviderClient.mkdir
mkdir(resource: URI): Promise<void> { return this.channel.call('mkdir', [resource]); }
//#region Move/Copy/Delete/Create Folder
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/diskFileSystemProviderClient.ts#L186-L188
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProviderClient.cloneFile
cloneFile(resource: URI, target: URI): Promise<void> { return this.channel.call('cloneFile', [resource, target]); }
//#region Clone File
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/diskFileSystemProviderClient.ts#L206-L208
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileService.canCreateFile
async canCreateFile(resource: URI, options?: ICreateFileOptions): Promise<Error | true> { try { await this.doValidateCreateFile(resource, options); } catch (error) { return error; } return true; }
//#region File Reading/Writing
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/fileService.ts#L336-L344
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileService.canMove
async canMove(source: URI, target: URI, overwrite?: boolean): Promise<Error | true> { return this.doCanMoveCopy(source, target, 'move', overwrite); }
//#region Move/Copy/Delete/Create Folder
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/fileService.ts#L722-L724
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileService.cloneFile
async cloneFile(source: URI, target: URI): Promise<void> { const sourceProvider = await this.withProvider(source); const targetProvider = this.throwIfFileSystemIsReadonly(await this.withWriteProvider(target), target); if (sourceProvider === targetProvider && this.getExtUri(sourceProvider).providerExtUri.isEqual(...
//#region Clone File
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/fileService.ts#L1070-L1099
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileChangesEvent.contains
contains(resource: URI, ...types: FileChangeType[]): boolean { return this.doContains(resource, { includeChildren: false }, ...types); }
/** * Find out if the file change events match the provided resource. * * Note: when passing `FileChangeType.DELETED`, we consider a match * also when the parent of the resource got deleted. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/files.ts#L1022-L1024
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileChangesEvent.affects
affects(resource: URI, ...types: FileChangeType[]): boolean { return this.doContains(resource, { includeChildren: true }, ...types); }
/** * Find out if the file change events either match the provided * resource, or contain a child of this resource. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/files.ts#L1030-L1032
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileChangesEvent.gotAdded
gotAdded(): boolean { return this.rawAdded.length > 0; }
/** * Returns if this event contains added files. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/files.ts#L1080-L1082
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileChangesEvent.gotDeleted
gotDeleted(): boolean { return this.rawDeleted.length > 0; }
/** * Returns if this event contains deleted files. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/files.ts#L1087-L1089
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileChangesEvent.gotUpdated
gotUpdated(): boolean { return this.rawUpdated.length > 0; }
/** * Returns if this event contains updated files. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/files.ts#L1094-L1096
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileChangesEvent.correlates
correlates(correlationId: number): boolean { return this.correlationId === correlationId; }
/** * Returns if this event contains changes that correlate to the * provided `correlationId`. * * File change event correlation is an advanced watch feature that * allows to identify from which watch request the events originate * from. This correlation allows to route events specifically * only to the ...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/files.ts#L1107-L1109
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileChangesEvent.hasCorrelation
hasCorrelation(): boolean { return typeof this.correlationId === 'number'; }
/** * Figure out if the event contains changes that correlate to one * correlation identifier. * * File change event correlation is an advanced watch feature that * allows to identify from which watch request the events originate * from. This correlation allows to route events specifically * only to the ...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/files.ts#L1120-L1122
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InMemoryFileSystemProvider.stat
async stat(resource: URI): Promise<IStat> { return this._lookup(resource, false); }
// --- manage file metadata
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/inMemoryFilesystemProvider.ts#L84-L86
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InMemoryFileSystemProvider.readFile
async readFile(resource: URI): Promise<Uint8Array> { const data = this._lookupAsFile(resource, false).data; if (data) { return data; } throw createFileSystemProviderError('file not found', FileSystemProviderErrorCode.FileNotFound); }
// --- manage file contents
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/inMemoryFilesystemProvider.ts#L97-L103
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InMemoryFileSystemProvider.open
open(resource: URI, opts: IFileOpenOptions): Promise<number> { const data = this._lookupAsFile(resource, false).data; if (data) { const fd = this.memoryFdCounter++; this.fdMemory.set(fd, data); return Promise.resolve(fd); } throw createFileSystemProviderError('file not found', FileSystemProviderErrorCo...
// file open/read/write/close
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/inMemoryFilesystemProvider.ts#L140-L148
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InMemoryFileSystemProvider.rename
async rename(from: URI, to: URI, opts: IFileOverwriteOptions): Promise<void> { if (!opts.overwrite && this._lookup(to, true)) { throw createFileSystemProviderError('file exists already', FileSystemProviderErrorCode.FileExists); } const entry = this._lookup(from, false); const oldParent = this._lookupParentD...
// --- manage files/folders
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/common/inMemoryFilesystemProvider.ts#L179-L198
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProviderChannel.delete
protected override async delete(uriTransformer: IURITransformer, _resource: UriComponents, opts: IFileDeleteOptions): Promise<void> { if (!opts.useTrash) { return super.delete(uriTransformer, _resource, opts); } const resource = this.transformIncoming(uriTransformer, _resource); const filePath = normalize(r...
//#region Delete: override to support Electron's trash support
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/electron-main/diskFileSystemProviderServer.ts#L41-L53
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProviderChannel.createSessionFileWatcher
protected createSessionFileWatcher(uriTransformer: IURITransformer, emitter: Emitter<IFileChange[] | string>): ISessionFileWatcher { return new SessionFileWatcher(uriTransformer, emitter, this.logService, this.environmentService); }
//#region File Watching
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/electron-main/diskFileSystemProviderServer.ts#L59-L61
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.constructor
constructor( logService: ILogService, options?: IDiskFileSystemProviderOptions ) { super(logService, options); }
// not enabled by default because very spammy
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/node/diskFileSystemProvider.ts#L41-L46
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.stat
async stat(resource: URI): Promise<IStat> { try { const { stat, symbolicLink } = await SymlinkSupport.stat(this.toFilePath(resource)); // cannot use fs.stat() here to support links properly return { type: this.toType(stat, symbolicLink), ctime: stat.birthtime.getTime(), // intentionally not using ctime...
//#region File Metadata Resolving
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/node/diskFileSystemProvider.ts#L78-L92
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.mkdir
async mkdir(resource: URI): Promise<void> { try { await promises.mkdir(this.toFilePath(resource)); } catch (error) { throw this.toFileSystemProviderError(error); } }
//#region Move/Copy/Delete/Create Folder
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/node/diskFileSystemProvider.ts#L604-L610
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.cloneFile
async cloneFile(from: URI, to: URI): Promise<void> { return this.doCloneFile(from, to, false /* optimistically assume parent folders exist */); }
//#region Clone File
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/node/diskFileSystemProvider.ts#L765-L767
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); }
//#region File Watching
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/node/diskFileSystemProvider.ts#L808-L814
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiskFileSystemProvider.toFileSystemProviderError
private toFileSystemProviderError(error: NodeJS.ErrnoException): FileSystemProviderError { if (error instanceof FileSystemProviderError) { return error; // avoid double conversion } let resultError: Error | string = error; let code: FileSystemProviderErrorCode; switch (error.code) { case 'ENOENT': ...
//#region Helpers
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/files/node/diskFileSystemProvider.ts#L828-L861
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
Graph.findCycleSlow
findCycleSlow() { for (const [id, node] of this._nodes) { const seen = new Set<string>([id]); const res = this._findCycle(node, seen); if (res) { return res; } } return undefined; }
/** * This is brute force and slow and **only** be used * to trouble shoot. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/instantiation/common/graph.ts#L86-L95
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
listener
const listener = (e: any) => { assert.ok(e instanceof AImpl); eventCount++; };
// subscribing to event doesn't trigger instantiation
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/instantiation/test/common/instantiationService.test.ts#L506-L509
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
KeybindingResolver.handleRemovals
public static handleRemovals(rules: ResolvedKeybindingItem[]): ResolvedKeybindingItem[] { // Do a first pass and construct a hash-map for removals const removals = new Map</* commandId */ string, ResolvedKeybindingItem[]>(); for (let i = 0, len = rules.length; i < len; i++) { const rule = rules[i]; if (rule...
/** * Looks for rules containing "-commandId" and removes them. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/keybinding/common/keybindingResolver.ts#L117-L168
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
KeybindingResolver.whenIsEntirelyIncluded
public static whenIsEntirelyIncluded(a: ContextKeyExpression | null | undefined, b: ContextKeyExpression | null | undefined): boolean { if (!b || b.type === ContextKeyExprType.True) { return true; } if (!a || a.type === ContextKeyExprType.True) { return false; } return implies(a, b); }
/** * Returns true if it is provable `a` implies `b`. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/keybinding/common/keybindingResolver.ts#L246-L255
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
KeybindingResolver.resolve
public resolve(context: IContext, currentChords: string[], keypress: string): ResolutionResult { const pressedChords = [...currentChords, keypress]; this._log(`| Resolving ${pressedChords}`); const kbCandidates = this._map.get(pressedChords[0]); if (kbCandidates === undefined) { // No bindings with such 0...
/** * Looks up a keybinding trigged as a result of pressing a sequence of chords - `[...currentChords, keypress]` * * Example: resolving 3 chords pressed sequentially - `cmd+k cmd+p cmd+i`: * `currentChords = [ 'cmd+k' , 'cmd+p' ]` and `keypress = `cmd+i` - last pressed chord */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/keybinding/common/keybindingResolver.ts#L313-L371
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
KeybindingsRegistryImpl.bindToCurrentPlatform
private static bindToCurrentPlatform(kb: IKeybindings): { primary?: number; secondary?: number[] } { if (OS === OperatingSystem.Windows) { if (kb && kb.win) { return kb.win; } } else if (OS === OperatingSystem.Macintosh) { if (kb && kb.mac) { return kb.mac; } } else { if (kb && kb.linux) { ...
/** * Take current platform into account and reduce to primary & secondary. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/keybinding/common/keybindingsRegistry.ts#L100-L116
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
USLayoutResolvedKeybinding._scanCodeToKeyCode
private static _scanCodeToKeyCode(scanCode: ScanCode): KeyCode { const immutableKeyCode = IMMUTABLE_CODE_TO_KEY_CODE[scanCode]; if (immutableKeyCode !== KeyCode.DependsOnKbLayout) { return immutableKeyCode; } switch (scanCode) { case ScanCode.KeyA: return KeyCode.KeyA; case ScanCode.KeyB: return KeyCo...
/** * *NOTE*: Check return value for `KeyCode.Unknown`. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/keybinding/common/usLayoutResolvedKeybinding.ts#L113-L171
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MockScopableContextKeyService.createScoped
public override createScoped(domNote: HTMLElement): IScopedContextKeyService { return new MockScopableContextKeyService(); }
/** * Don't implement this for all tests since we rarely depend on this behavior and it isn't implemented fully */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/keybinding/test/common/mockKeybindingService.ts#L81-L83
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WebLanguagePacksService.getInstalledLanguages
getInstalledLanguages(): Promise<ILanguagePackItem[]> { return Promise.resolve([]); }
// Web doesn't have a concept of language packs, so we just return an empty array
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/languagePacks/browser/languagePacks.ts#L74-L76
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
beforeQuitListener
const beforeQuitListener = () => { if (this._quitRequested) { return; } this.trace('Lifecycle#app.on(before-quit)'); this._quitRequested = true; // Emit event to indicate that we are about to shutdown this.trace('Lifecycle#onBeforeShutdown.fire()'); this._onBeforeShutdown.fire(); // macOS...
// before-quit: an event that is fired if application quit was
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/lifecycle/electron-main/lifecycleMainService.ts#L278-L296
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
windowAllClosedListener
const windowAllClosedListener = () => { this.trace('Lifecycle#app.on(window-all-closed)'); // Windows/Linux: we quit when all windows have closed // Mac: we only quit when quit was requested if (this._quitRequested || !isMacintosh) { electron.app.quit(); } };
// window-all-closed: an event that only fires when the last window
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/lifecycle/electron-main/lifecycleMainService.ts#L302-L310
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MarkerService._merge
private static _merge(all: (readonly URI[])[]): URI[] { const set = new ResourceMap<boolean>(); for (const array of all) { for (const item of array) { set.set(item, true); } } return Array.from(set.keys()); }
// --- event debounce logic
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/markers/common/markerService.ts#L346-L354
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.windowId
get windowId(): never { throw new Error('Not implemented in electron-main'); }
//#region Properties
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L83-L83
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.installShellCommand
async installShellCommand(windowId: number | undefined): Promise<void> { const { source, target } = await this.getShellCommandLink(); // Only install unless already existing try { const { symbolicLink } = await SymlinkSupport.stat(source); if (symbolicLink && !symbolicLink.dangling) { const linkTargetR...
//#region macOS Shell Command
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L344-L392
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.showMessageBox
async showMessageBox(windowId: number | undefined, options: MessageBoxOptions & INativeHostOptions): Promise<MessageBoxReturnValue> { const window = this.windowById(options?.targetWindowId, windowId); return this.dialogMainService.showMessageBox(options, window?.win ?? undefined); }
//#region Dialog
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L448-L451
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.showItemInFolder
async showItemInFolder(windowId: number | undefined, path: string): Promise<void> { shell.showItemInFolder(path); }
//#region OS
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L507-L509
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.hasWSLFeatureInstalled
async hasWSLFeatureInstalled(): Promise<boolean> { return isWindows && hasWSLFeatureInstalled(); }
// WSL
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L700-L702
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.getScreenshot
async getScreenshot(windowId: number | undefined, options?: INativeHostOptions): Promise<ArrayBufferLike | undefined> { const window = this.windowById(options?.targetWindowId, windowId); const captured = await window?.win?.webContents.capturePage(); return captured?.toJPEG(95); }
//#region Screenshots
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L709-L714
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.getProcessId
async getProcessId(windowId: number | undefined): Promise<number | undefined> { const window = this.windowById(undefined, windowId); return window?.win?.webContents.getOSProcessId(); }
//#region Process
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L721-L724
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.readClipboardText
async readClipboardText(windowId: number | undefined, type?: 'selection' | 'clipboard'): Promise<string> { return clipboard.readText(type); }
//#region Clipboard
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L735-L737
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.newWindowTab
async newWindowTab(): Promise<void> { await this.windowsMainService.open({ context: OpenContext.API, cli: this.environmentMainService.args, forceNewTabbedWindow: true, forceEmpty: true, remoteAuthority: this.environmentMainService.args.remote || undefined }); }
//#region macOS Touchbar
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L772-L780
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.notifyReady
async notifyReady(windowId: number | undefined): Promise<void> { const window = this.codeWindowById(windowId); window?.setReady(); }
//#region Lifecycle
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L812-L815
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.resolveProxy
async resolveProxy(windowId: number | undefined, url: string): Promise<string | undefined> { const window = this.codeWindowById(windowId); const session = window?.win?.webContents?.session; return session?.resolveProxy(url); }
//#region Connectivity
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L874-L879
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.profileRenderer
async profileRenderer(windowId: number | undefined, session: string, duration: number): Promise<IV8Profile> { const window = this.codeWindowById(windowId); if (!window || !window.win) { throw new Error(); } const profiler = new WindowProfiler(window.win, session, this.logService); const result = await pro...
// #region Performance
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L954-L963
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.windowsGetStringRegKey
async windowsGetStringRegKey(windowId: number | undefined, hive: 'HKEY_CURRENT_USER' | 'HKEY_LOCAL_MACHINE' | 'HKEY_CLASSES_ROOT' | 'HKEY_USERS' | 'HKEY_CURRENT_CONFIG', path: string, name: string): Promise<string | undefined> { if (!isWindows) { return undefined; } const Registry = await import('@vscode/wind...
//#region Registry (windows)
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L969-L980
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
NativeHostMainService.windowById
private windowById(windowId: number | undefined, fallbackCodeWindowId?: number): ICodeWindow | IAuxiliaryWindow | undefined { return this.codeWindowById(windowId) ?? this.auxiliaryWindowById(windowId) ?? this.codeWindowById(fallbackCodeWindowId); }
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/native/electron-main/nativeHostMainService.ts#L984-L986
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ProcessMainService.registerListeners
private registerListeners(): void { validatedIpcMain.on('vscode:listProcesses', async event => { const processes = []; try { processes.push({ name: localize('local', "Local"), rootProcess: await listProcesses(process.pid) }); const remoteDiagnostics = await this.diagnosticsMainService.getRemoteDiagnos...
//#region Register Listeners
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/process/electron-main/processMainService.ts#L68-L132
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
computeAggregateTime
const computeAggregateTime = (index: number, nodes: IComputedNode[]): number => { const row = nodes[index]; if (row.aggregateTime) { return row.aggregateTime; } let total = row.selfTime; for (const child of row.children) { total += computeAggregateTime(child, nodes); } return (row.aggregateTime = total); }...
/** * Recursive function that computes and caches the aggregate time for the * children of the computed now. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/profiling/common/profilingModel.ts#L85-L97
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ProtocolMainService.constructor
constructor( @INativeEnvironmentService private readonly environmentService: INativeEnvironmentService, @IUserDataProfilesService userDataProfilesService: IUserDataProfilesService, @ILogService private readonly logService: ILogService ) { super(); // Define an initial set of roots we allow loading from //...
// https://github.com/microsoft/vscode/issues/119384
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/protocol/electron-main/protocolMainService.ts#L29-L47
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ProtocolMainService.handleFileRequest
private handleFileRequest(request: Electron.ProtocolRequest, callback: ProtocolCallback) { const uri = URI.parse(request.url); this.logService.error(`Refused to load resource ${uri.fsPath} from ${Schemas.file}: protocol (original URL: ${request.url})`); return callback({ error: -3 /* ABORTED */ }); }
//#region file://
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/protocol/electron-main/protocolMainService.ts#L82-L88
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ProtocolMainService.handleResourceRequest
private handleResourceRequest(request: Electron.ProtocolRequest, callback: ProtocolCallback): void { const path = this.requestToNormalizedFilePath(request); let headers: Record<string, string> | undefined; if (this.environmentService.crossOriginIsolated) { const pathBasename = basename(path); if (pathBasen...
//#region vscode-file://
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/protocol/electron-main/protocolMainService.ts#L94-L121
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ProtocolMainService.createIPCObjectUrl
createIPCObjectUrl<T>(): IIPCObjectUrl<T> { let obj: T | undefined = undefined; // Create unique URI const resource = URI.from({ scheme: 'vscode', // used for all our IPC communication (vscode:<channel>) path: generateUuid() }); // Install IPC handler const channel = resource.toString(); const han...
//#region IPC Object URLs
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/protocol/electron-main/protocolMainService.ts#L142-L167
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
getSecondary
function getSecondary(primary: number, secondary: number[], options: { withAltMod?: boolean; withCtrlMod?: boolean; withCmdMod?: boolean } = {}): number[] { if (options.withAltMod) { secondary.push(KeyMod.Alt + primary); } if (options.withCtrlMod) { secondary.push(ctrlKeyMod + primary); if (options.withAltMod)...
// This function will generate all the combinations of keybindings for the given primary keybinding
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/quickinput/browser/quickInputActions.ts#L33-L58
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
focusHandler
function focusHandler(focus: QuickPickFocus, focusOnQuickNatigate?: QuickPickFocus): ICommandHandler { return accessor => { // Assuming this is a quick pick due to above when clause const currentQuickPick = accessor.get(IQuickInputService).currentQuickInput as IQuickPick<any> | undefined; if (!currentQuickPick) ...
//#region Navigation
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/quickinput/browser/quickInputActions.ts#L62-L74
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BaseQuickPickItemElement.saneLabel
get saneLabel() { return this._init.value.saneLabel; }
// #region Lazy Getters
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/quickinput/browser/quickInputTree.ts#L111-L113
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
QuickInputTree._registerListeners
private _registerListeners() { this._registerOnKeyDown(); this._registerOnContainerClick(); this._registerOnMouseMiddleClick(); this._registerOnTreeModelChanged(); this._registerOnElementChecked(); this._registerOnContextMenu(); this._registerHoverListeners(); this._registerSelectionChangeListener(); ...
//#region register listeners
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/quickinput/browser/quickInputTree.ts#L859-L869
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
QuickInputTree._registerSeparatorActionShowingListeners
private _registerSeparatorActionShowingListeners() { this._register(this._tree.onDidChangeFocus(e => { const parent = e.elements[0] ? this._tree.getParentElement(e.elements[0]) as QuickPickSeparatorElement // treat null as focus lost and when we have no separators : null; for (const separator of thi...
/** * Register's focus change and mouse events so that we can track when items inside of a * separator's section are focused or hovered so that we can display the separator's actions */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/quickinput/browser/quickInputTree.ts#L976-L1027
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
QuickInputTree.setAllVisibleChecked
setAllVisibleChecked(checked: boolean) { this._elementCheckedEventBufferer.bufferEvents(() => { this._itemElements.forEach(element => { if (!element.hidden && !element.checkboxDisabled) { // Would fire an event if we didn't beffer the events element.checked = checked; } }); }); }
//#region public methods
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/quickinput/browser/quickInputTree.ts#L1048-L1057
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
QuickInputTree._setElementsToTree
private _setElementsToTree(elements: IQuickPickElement[]) { const treeElements = new Array<IObjectTreeElement<IQuickPickElement>>(); for (const element of elements) { if (element instanceof QuickPickSeparatorElement) { treeElements.push({ element, collapsible: false, collapsed: false, chi...
//#region private methods
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/quickinput/browser/quickInputTree.ts#L1495-L1518
1a8578f21ace8c9381461d295ed31c3500be43bf