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
QuickInputTree.showHover
private showHover(element: QuickPickItemElement): void { if (this._lastHover && !this._lastHover.isDisposed) { this.hoverDelegate.onDidHideHover?.(); this._lastHover?.dispose(); } if (!element.element || !element.saneTooltip) { return; } this._lastHover = this.hoverDelegate.showHover({ content: e...
/** * Disposes of the hover and shows a new one for the given index if it has a tooltip. * @param element The element to show the hover for */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/quickinput/browser/quickInputTree.ts#L1547-L1570
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
setupWaitTilShownListener
async function setupWaitTilShownListener(controller: QuickInputController): Promise<void> { const result = await raceTimeout(new Promise<boolean>(resolve => { const event = controller.onShow(_ => { event.dispose(); resolve(true); }); }), 2000); if (!result) { throw new Error('Cancelled'); } }
// Sets up an `onShow` listener to allow us to wait until the quick pick is shown (useful when triggering an `accept()` right after launching a quick pick)
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/quickinput/test/browser/quickinput.test.ts#L40-L51
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
createInitialConnection
async function createInitialConnection<T extends PersistentConnection, O extends RemoteConnection>(options: IConnectionOptions<O>, connectionFactory: (simpleOptions: ISimpleConnectionOptions<O>) => Promise<T>): Promise<T> { const MAX_ATTEMPTS = 5; for (let attempt = 1; ; attempt++) { try { const reconnectionTok...
/** * Will attempt to connect 5 times. If it fails 5 consecutive times, it will give up. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/remote/common/remoteAgentConnection.ts#L437-L458
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
getLxssManagerDllPath
function getLxssManagerDllPath(): string | undefined { return getSystem32Path('lxss\\LxssManager.dll'); }
/** * In builds < 22000 this dll inidcates that WSL is installed */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/remote/node/wsl.ts#L74-L76
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BaseSecretStorageService.type
get type() { return this._type; }
/** * @Note initialize must be called first so that this can be resolved properly * otherwise it will return 'unknown'. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/secrets/common/secrets.ts#L56-L58
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TestEncryptionService.setUsePlainTextEncryption
setUsePlainTextEncryption(): Promise<void> { return Promise.resolve(); }
// prefix to simulate encryption
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/secrets/test/common/secrets.test.ts#L17-L19
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspaceStorageDatabaseClient.constructor
constructor(channel: IChannel, workspace: IAnyWorkspaceIdentifier) { super(channel, undefined, workspace); }
// unsupported for workspace storage because we only ever write from one window
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/storage/common/storageIpc.ts#L153-L155
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
StorageDatabaseChannel.registerStorageChangeListeners
private registerStorageChangeListeners(storage: IStorageMain, emitter: Emitter<ISerializableItemsChangeEvent>): void { // Listen for changes in provided storage to send to listeners // that are listening. Use a debouncer to reduce IPC traffic. this._register(Event.debounce(storage.onDidChangeStorage, (prev: ISt...
//#region Storage Change Events
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/storage/electron-main/storageIpc.ts#L36-L54
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
StorageDatabaseChannel.call
async call(_: unknown, command: string, arg: IBaseSerializableStorageRequest): Promise<any> { const profile = arg.profile ? revive<IUserDataProfile>(arg.profile) : undefined; const workspace = reviveIdentifier(arg.workspace); // Get storage to be ready const storage = await this.withStorageInitialized(profile,...
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/storage/electron-main/storageIpc.ts#L101-L142
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
StorageMainService.isUsed
isUsed(path: string): boolean { const pathUri = URI.file(path); for (const storage of [this.applicationStorage, ...this.mapProfileToStorage.values(), ...this.mapWorkspaceToStorage.values()]) { if (!storage.path) { continue; } if (this.uriIdentityService.extUri.isEqualOrParent(URI.file(storage.path), ...
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/storage/electron-main/storageMainService.ts#L268-L282
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ServerTelemetryChannel.dispose
public override dispose(): void { this.telemetryService.updateInjectedTelemetryLevel(TelemetryLevel.NONE); super.dispose(); }
/** * Disposing the channel also disables the telemetryService as there is * no longer a way to control it */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/telemetry/common/remoteTelemetryChannel.ts#L65-L68
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
anonymizeFilePaths
function anonymizeFilePaths(stack: string, cleanupPatterns: RegExp[]): string { // Fast check to see if it is a file path to avoid doing unnecessary heavy regex work if (!stack || (!stack.includes('/') && !stack.includes('\\'))) { return stack; } let updatedStack = stack; const cleanUpIndexes: [number, number...
//#region Telemetry Cleaning
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/telemetry/common/telemetryUtils.ts#L277-L322
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
removePropertiesWithPossibleUserInfo
function removePropertiesWithPossibleUserInfo(property: string): string { // If for some reason it is undefined we skip it (this shouldn't be possible); if (!property) { return property; } const userDataRegexes = [ { label: 'Google API Key', regex: /AIza[A-Za-z0-9_\\\-]{35}/ }, { label: 'Slack Token', regex:...
/** * Attempts to remove commonly leaked PII * @param property The property which will be removed if it contains user data * @returns The new value for the property */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/telemetry/common/telemetryUtils.ts#L329-L353
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
makeTelemetryRequest
async function makeTelemetryRequest(options: IRequestOptions, requestService: IRequestService): Promise<IResponseData> { const response = await requestService.request(options, CancellationToken.None); const responseData = (await streamToBuffer(response.stream)).toString(); const statusCode = response.res.statusCode ...
/** * Completes a request to submit telemetry to the server utilizing the request service * @param options The options which will be used to make the request * @param requestService The request service * @returns An object containing the headers, statusCode, and responseData */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/telemetry/node/1dsAppender.ts#L28-L38
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
makeLegacyTelemetryRequest
async function makeLegacyTelemetryRequest(options: IRequestOptions): Promise<IResponseData> { const httpsOptions = { method: options.type, headers: options.headers }; const responsePromise = new Promise<IResponseData>((resolve, reject) => { const req = https.request(options.url ?? '', httpsOptions, res => { ...
/** * Complete a request to submit telemetry to the server utilizing the https module. Only used when the request service is not available * @param options The options which will be used to make the request * @returns An object containing the headers, statusCode, and responseData */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/telemetry/node/1dsAppender.ts#L45-L72
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
mergeTelemetry
const mergeTelemetry = (contents: string, dirName: string) => { const telemetryData = JSON.parse(contents); mergedTelemetry[dirName] = telemetryData; };
// Simple function to merge the telemetry into one json object
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/telemetry/node/telemetry.ts#L14-L17
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
filterScope
function filterScope( mutator: IExtensionOwnedEnvironmentVariableMutator | IExtensionOwnedEnvironmentDescriptionMutator, scope: EnvironmentVariableScope | undefined, strictFilter = false ): boolean { if (!mutator.scope) { if (strictFilter) { return scope === mutator.scope; } return true; } // If a mutato...
/** * Returns whether a mutator matches with the scope provided. * @param mutator Mutator to filter * @param scope Scope to be used for querying * @param strictFilter If true, mutators with global scope is not returned when querying for workspace scope. * i.e whether mutator scope should always exactly match with ...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/common/environmentVariableCollection.ts#L199-L216
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RequestStore.constructor
constructor( timeout: number | undefined, @ILogService private readonly _logService: ILogService ) { super(); this._timeout = timeout === undefined ? 15000 : timeout; this._register(toDisposable(() => { for (const d of this._pendingRequestDisposables.values()) { dispose(d); } })); }
/** * @param timeout How long in ms to allow requests to go unanswered for, undefined will use the * default (15 seconds). */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/common/requestStore.ts#L29-L40
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RequestStore.createRequest
createRequest(args: RequestArgs): Promise<T> { return new Promise<T>((resolve, reject) => { const requestId = ++this._lastRequestId; this._pendingRequests.set(requestId, resolve); this._onCreateRequest.fire({ requestId, ...args }); const tokenSource = new CancellationTokenSource(); timeout(this._timeou...
/** * Creates a request. * @param args The arguments to pass to the onCreateRequest event. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/common/requestStore.ts#L46-L55
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RequestStore.acceptReply
acceptReply(requestId: number, data: T) { const resolveRequest = this._pendingRequests.get(requestId); if (resolveRequest) { this._pendingRequests.delete(requestId); dispose(this._pendingRequestDisposables.get(requestId) || []); this._pendingRequestDisposables.delete(requestId); resolveRequest(data); ...
/** * Accept a reply to a request. * @param requestId The request ID originating from the onCreateRequest event. * @param data The reply data. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/common/requestStore.ts#L62-L72
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
CommandDetectionCapability.setPromptTerminator
setPromptTerminator(promptTerminator: string, lastPromptLine: string) { this._logService.debug('CommandDetectionCapability#setPromptTerminator', promptTerminator); this._promptTerminator = promptTerminator; this._promptInputModel.setLastPromptLine(lastPromptLine); }
// TODO: Simplify this, can everything work off the last line?
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.ts#L197-L201
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
CwdDetectionCapability.cwds
get cwds(): string[] { return Array.from(this._cwds.keys()); }
/** * Gets the list of cwds seen in this session in order of last accessed. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.ts#L18-L20
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PromptInputModel._scanForGhostText
private _scanForGhostText(buffer: IBuffer, line: IBufferLine, cursorIndex: number): number { // Check last non-whitespace character has non-ghost text styles let ghostTextIndex = -1; let proceedWithGhostTextCheck = false; let x = buffer.cursorX; while (x > 0) { const cell = line.getCell(--x); if (!cell)...
/** * Detect ghost text by looking for italic or dim text in or after the cursor and * non-italic/dim text in the cell closest non-whitespace cell before the cursor. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.ts#L414-L449
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ShellIntegrationAddon._doHandleSetCwd
private _doHandleSetCwd(data: string): boolean { if (!this._terminal) { return false; } const [command] = data.split(';'); if (command.match(/^file:\/\/.*\//)) { const uri = URI.parse(command); if (uri.path && uri.path.length > 0) { this._updateCwd(uri.path); return true; } } // Unrec...
/** * Handles the sequence: `OSC 7 ; scheme://cwd ST` */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts#L627-L644
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChildProcessMonitor.hasChildProcesses
get hasChildProcesses(): boolean { return this._hasChildProcesses; }
/** * Whether the process has child processes. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/node/childProcessMonitor.ts#L43-L43
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChildProcessMonitor.handleInput
handleInput() { this._refreshActive(); }
/** * Input was triggered on the process. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/node/childProcessMonitor.ts#L61-L63
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChildProcessMonitor.handleOutput
handleOutput() { this._refreshInactive(); }
/** * Output was triggered on the process. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/node/childProcessMonitor.ts#L68-L70
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PtyHostService._optionalProxy
private get _optionalProxy(): IPtyService | undefined { return this.__proxy; }
/** * Get the proxy if it exists, otherwise undefined. This is used when calls are not needed to be * passed through to the pty host if it has not yet been spawned. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/node/ptyHostService.ts#L52-L54
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
addEnvMixinPathPrefix
function addEnvMixinPathPrefix(options: ITerminalProcessOptions, envMixin: IProcessEnvironment, shell: string): void { if ((isMacintosh || shell === 'fish') && options.environmentVariableCollections) { // Deserialize and merge const deserialized = deserializeEnvironmentVariableCollections(options.environmentVariab...
/** * There are a few situations where some directories are added to the beginning of the PATH. * 1. On macOS when the profile calls path_helper. * 2. For fish terminals, which always prepend "$fish_user_paths" to the PATH. * * This causes significant problems for the environment variable * collection API as the ...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/node/terminalEnvironment.ts#L246-L268
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TerminalProcess._queueProcessExit
private _queueProcessExit() { if (this._logService.getLevel() === LogLevel.Trace) { this._logService.trace('TerminalProcess#_queueProcessExit', new Error().stack?.replace(/^Error/, '')); } if (this._closeTimeout) { clearTimeout(this._closeTimeout); } this._closeTimeout = setTimeout(() => { this._clos...
// See https://github.com/Tyriar/node-pty/issues/72
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/node/terminalProcess.ts#L353-L364
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WindowsShellHelper.getShellName
async getShellName(): Promise<string> { if (this._store.isDisposed) { return Promise.resolve(''); } // Prevent multiple requests at once, instead return current request if (this._currentRequest) { return this._currentRequest; } if (!windowsProcessTree) { windowsProcessTree = await import('@vscode/w...
/** * Returns the innermost shell executable running in the terminal */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/node/windowsShellHelper.ts#L128-L147
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TerminalAutoResponder.handleResize
handleResize() { if (isWindows) { this._paused = true; } }
/** * No auto response will happen after a resize on Windows in case the resize is a result of * reprinting the screen. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/terminal/node/terminalContrib/autoReplies/terminalAutoResponder.ts#L66-L70
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ignorePathCasing
const ignorePathCasing = (uri: URI): boolean => { let ignorePathCasing = schemeIgnoresPathCasingCache.get(uri.scheme); if (ignorePathCasing === undefined) { // retrieve once and then case per scheme until a change happens ignorePathCasing = _fileService.hasProvider(uri) && !this._fileService.hasCapability...
// assume path casing matters unless the file system provider spec'ed the opposite.
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/uriIdentity/common/uriIdentityService.ts#L44-L52
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
massageIncomingExtension
function massageIncomingExtension(extension: ISyncExtension): ISyncExtension { return { ...extension, ...{ disabled: !!extension.disabled, installed: !!extension.installed } }; }
// massage incoming extension - add optional properties
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/userDataSync/common/extensionsMerge.ts#L399-L401
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
massageOutgoingExtension
function massageOutgoingExtension(extension: ISyncExtension, key: string): ISyncExtension { const massagedExtension: ISyncExtension = { ...extension, identifier: { id: extension.identifier.id, uuid: key.startsWith('uuid:') ? key.substring('uuid:'.length) : undefined }, /* set following always so that to ...
// massage outgoing extension - remove optional properties
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/userDataSync/common/extensionsMerge.ts#L404-L428
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
UserDataAutoSyncService.startAutoSync
protected startAutoSync(): boolean { return true; }
// For tests purpose only
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/userDataSync/common/userDataAutoSyncService.ts#L148-L148
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
UserDataSyncStoreClient.getAllCollections
async getAllCollections(headers: IHeaders = {}): Promise<string[]> { if (!this.userDataSyncStoreUrl) { throw new Error('No settings sync store url configured.'); } const url = joinPath(this.userDataSyncStoreUrl, 'collection').toString(); headers = { ...headers }; headers['Content-Type'] = 'application/jso...
// #region Collection
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts#L238-L250
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
UserDataSyncStoreClient.getAllResourceRefs
async getAllResourceRefs(resource: ServerResource, collection?: string): Promise<IResourceRefHandle[]> { if (!this.userDataSyncStoreUrl) { throw new Error('No settings sync store url configured.'); } const uri = this.getResourceUrl(this.userDataSyncStoreUrl, collection, resource); const headers: IHeaders = ...
// #region Resource
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts#L284-L296
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
UserDataSyncStoreClient.manifest
async manifest(oldValue: IUserDataManifest | null, headers: IHeaders = {}): Promise<IUserDataManifest | null> { if (!this.userDataSyncStoreUrl) { throw new Error('No settings sync store url configured.'); } const url = joinPath(this.userDataSyncStoreUrl, 'manifest').toString(); headers = { ...headers }; h...
// #endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/userDataSync/common/userDataSyncStoreService.ts#L394-L447
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
shouldTriggerDefaultSystemContextMenu
const shouldTriggerDefaultSystemContextMenu = () => { // Use the custom context menu when over the title bar, but not over the app icon // The app icon is estimated to be 30px wide // The title bar is estimated to be the max of 35px and 15% of the window height if (cx > 30 && cy >= 0 && cy <= Math.m...
// In some cases, show the default system context menu
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/windows/electron-main/windowImpl.ts#L171-L180
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WindowsStateHandler.onBeforeShutdown
private onBeforeShutdown(): void { this.shuttingDown = true; this.saveWindowsState(); }
//
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/windows/electron-main/windowsStateHandler.ts#L140-L144
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WindowsStateHandler.onBeforeCloseWindow
private onBeforeCloseWindow(window: ICodeWindow): void { if (this.lifecycleMainService.quitRequested) { return; // during quit, many windows close in parallel so let it be handled in the before-quit handler } // On Window close, update our stored UI state of this window const state: IWindowState = this.toWi...
// See note on #onBeforeShutdown() for details how these events are flowing
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/windows/electron-main/windowsStateHandler.ts#L225-L255
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspacesHistoryMainService.addRecentlyOpened
async addRecentlyOpened(recentToAdd: IRecent[]): Promise<void> { let workspaces: Array<IRecentFolder | IRecentWorkspace> = []; let files: IRecentFile[] = []; for (const recent of recentToAdd) { // Workspace if (isRecentWorkspace(recent)) { if (!this.workspacesManagementMainService.isUntitledWorkspace(...
//#region Workspaces History
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/workspaces/electron-main/workspacesHistoryMainService.ts#L78-L133
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspacesMainService.enterWorkspace
async enterWorkspace(windowId: number, path: URI): Promise<IEnterWorkspaceResult | undefined> { const window = this.windowsMainService.getWindowById(windowId); if (window) { return this.workspacesManagementMainService.enterWorkspace(window, this.windowsMainService.getWindows(), path); } return undefined; }
//#region Workspace Management
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/workspaces/electron-main/workspacesMainService.ts#L30-L37
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WorkspacesMainService.getDirtyWorkspaces
async getDirtyWorkspaces(): Promise<Array<IWorkspaceBackupInfo | IFolderBackupInfo>> { return this.backupMainService.getDirtyWorkspaces(); }
//#region Dirty Workspaces
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/platform/workspaces/electron-main/workspacesMainService.ts#L78-L80
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RemoteExtensionHostAgentServer._getRemoteAddress
private _getRemoteAddress(socket: NodeSocket | WebSocketNodeSocket): string { let _socket: net.Socket; if (socket instanceof NodeSocket) { _socket = socket.socket; } else { _socket = socket.socket.socket; } return _socket.remoteAddress || `<unknown>`; }
// Eventually cleanup
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/remoteExtensionHostAgentServer.ts#L273-L281
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RemoteExtensionHostAgentServer._handleWebSocketConnection
private _handleWebSocketConnection(socket: NodeSocket | WebSocketNodeSocket, isReconnection: boolean, reconnectionToken: string): void { const remoteAddress = this._getRemoteAddress(socket); const logPrefix = `[${remoteAddress}][${reconnectionToken.substr(0, 8)}]`; const protocol = new PersistentProtocol({ socket...
/** * NOTE: Avoid using await in this method! * The problem is that await introduces a process.nextTick due to the implicit Promise.then * This can lead to some bytes being received and interpreted and a control message being emitted before the next listener has a chance to be registered. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/remoteExtensionHostAgentServer.ts#L301-L425
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RemoteExtensionHostAgentServer._delayShutdown
private _delayShutdown(): void { if (this.shutdownTimer) { console.log('Got delay-shutdown request while in shutdown timeout, delaying'); this._logService.info('Got delay-shutdown request while in shutdown timeout, delaying'); this._cancelShutdown(); this._waitThenShutdown(); } }
/** * If the server is in a shutdown timeout, cancel it and start over */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/remoteExtensionHostAgentServer.ts#L641-L648
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
initUnexpectedErrorHandler
function initUnexpectedErrorHandler(handler: (err: any) => void) { setUnexpectedErrorHandler(err => { // See https://github.com/microsoft/vscode-remote-release/issues/6481 // In some circumstances, console.error will throw an asynchronous error. This asynchronous error // will end up here, and then it will b...
// setting up error handlers, first with console.error, then, once available, using the log service
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/remoteExtensionHostAgentServer.ts#L689-L700
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RemoteAgentFileSystemProviderChannel.createSessionFileWatcher
protected createSessionFileWatcher(uriTransformer: IURITransformer, emitter: Emitter<IFileChange[] | string>): ISessionFileWatcher { return new SessionFileWatcher(uriTransformer, emitter, this.logService, this.environmentService, this.configurationService); }
//#region File Watching
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/remoteFileSystemProviderServer.ts#L56-L58
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
pathToURI
function pathToURI(input: string): url.URL { input = input.trim(); input = resolve(preferredCwd, input); return url.pathToFileURL(input); }
// prefer process.env.PWD as it does not follow symlinks
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/server.cli.ts#L477-L482
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
cleanupOlderLogs
async function cleanupOlderLogs(logsPath: string): Promise<void> { const currentLog = path.basename(logsPath); const logsRoot = path.dirname(logsPath); const children = await Promises.readdir(logsRoot); const allSessions = children.filter(name => /^\d{8}T\d{6}$/.test(name)); const oldSessions = allSessions.sort()....
/** * Cleans up older logs, while keeping the 10 most recent ones. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/serverServices.ts#L350-L359
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WebClientServer.handle
async handle(req: http.IncomingMessage, res: http.ServerResponse, parsedUrl: url.UrlWithParsedQuery, pathname: string): Promise<void> { try { if (pathname.startsWith(STATIC_PATH) && pathname.charCodeAt(STATIC_PATH.length) === CharCode.Slash) { return this._handleStatic(req, res, pathname.substring(STATIC_PATH....
/** * Handle web resources (i.e. only needed by the web client). * **NOTE**: This method is only invoked when the server has web bits. * **NOTE**: This method is only invoked after the connection token has been validated. * @param parsedUrl The URL to handle, including base and product path * @param pathname ...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/webClientServer.ts#L124-L148
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WebClientServer._handleStatic
private async _handleStatic(req: http.IncomingMessage, res: http.ServerResponse, resourcePath: string): Promise<void> { const headers: Record<string, string> = Object.create(null); // Strip the this._staticRoute from the path const normalizedPathname = decodeURIComponent(resourcePath); // support paths that are ...
/** * Handle HTTP requests for /static/* * @param resourcePath The path after /static/ */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/webClientServer.ts#L153-L165
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WebClientServer._handleWebExtensionResource
private async _handleWebExtensionResource(req: http.IncomingMessage, res: http.ServerResponse, resourcePath: string): Promise<void> { if (!this._webExtensionResourceUrlTemplate) { return serveError(req, res, 500, 'No extension gallery service configured.'); } const normalizedPathname = decodeURIComponent(reso...
/** * Handle extension resources * @param resourcePath The path after /web-extension-resource/ */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/webClientServer.ts#L176-L236
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WebClientServer._handleRoot
private async _handleRoot(req: http.IncomingMessage, res: http.ServerResponse, parsedUrl: url.UrlWithParsedQuery): Promise<void> { const queryConnectionToken = parsedUrl.query[connectionTokenQueryName]; if (typeof queryConnectionToken === 'string') { // We got a connection token as a query parameter. // We wa...
/** * Handle HTTP requests for / */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/webClientServer.ts#L241-L450
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WebClientServer._handleCallback
private async _handleCallback(res: http.ServerResponse): Promise<void> { const filePath = FileAccess.asFileUri('vs/code/browser/workbench/callback.html').fsPath; const data = (await promises.readFile(filePath)).toString(); const cspDirectives = [ 'default-src \'self\';', 'img-src \'self\' https: data: blob:...
/** * Handle HTTP requests for /callback */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/server/node/webClientServer.ts#L474-L491
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadAideAgentTerminals.constructor
constructor( extHostContext: IExtHostContext, @IAideAgentTerminalService private readonly _aideAgentTerminalService: IAideAgentTerminalService ) { super(); //this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostAideAgentTerminals); }
//private readonly _proxy: ExtHostAideAgentTerminalsShape;
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadAideAgentTerminals.ts#L15-L21
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadAuthentication._getAccountPreference
private _getAccountPreference(extensionId: string, providerId: string, scopes: string[], sessions: ReadonlyArray<AuthenticationSession>): AuthenticationSession | undefined { if (sessions.length === 0) { return undefined; } const accountNamePreference = this.authenticationExtensionsService.getAccountPreference(...
// TODO@TylerLeonhardt: Update this after a few iterations to no longer fallback to the session preference
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadAuthentication.ts#L358-L378
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorWebviewZone.constructor
constructor( readonly editor: IActiveCodeEditor, readonly line: number, readonly height: number, readonly webview: IWebviewElement, ) { this.domNode = document.createElement('div'); this.domNode.style.zIndex = '10'; // without this, the webview is not interactive this.afterLineNumber = line; this.after...
// onComputedHeight?: ((height: number) => void) | undefined;
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadCodeInsets.ts#L34-L48
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
_generateMarkdown
function _generateMarkdown(description: string | Dto<ICommandMetadata> | ICommandMetadata): string { if (typeof description === 'string') { return description; } else { const descriptionString = isString(description.description) ? description.description // Our docs website is in English, so keep the origin...
// --- command doc
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadCommands.ts#L102-L123
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadComments.registerViewListeners
private registerViewListeners(commentsPanelAlreadyConstructed: boolean) { if (!commentsPanelAlreadyConstructed) { this.registerViewOpenedListener(); } this._register(this._viewDescriptorService.onDidChangeContainer(e => { if (e.views.find(view => view.id === COMMENTS_VIEW_ID)) { this.setComments(); ...
/** * If the comments view has never been opened, the constructor for it has not yet run so it has * no listeners for comment threads being set or updated. Listen for the view opening for the * first time and send it comments then. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadComments.ts#L752-L770
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadCustomEditors.onWillRunWorkingCopyFileOperation
private async onWillRunWorkingCopyFileOperation(e: WorkingCopyFileEvent) { if (e.operation !== FileOperation.MOVE) { return; } e.waitUntil((async () => { const models = []; for (const file of e.files) { if (file.source) { models.push(...(await this._customEditorService.models.getAllModels(file.s...
//#region Working Copy
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadCustomEditors.ts#L279-L300
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadCustomEditorModel.toWorkingCopyResource
private static toWorkingCopyResource(viewType: string, resource: URI) { const authority = viewType.replace(/[^a-z0-9\-_]/gi, '-'); const path = `/${multibyteAwareBtoa(resource.with({ query: null, fragment: null }).toString(true))}`; return URI.from({ scheme: Schemas.vscodeCustomEditor, authority: authority,...
// Make sure each custom editor has a unique resource for backup and edits
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadCustomEditors.ts#L421-L430
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadCustomEditorModel.isReadonly
public isReadonly(): boolean { return !this._editable; }
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadCustomEditors.ts#L467-L469
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadDebugService.createDebugAdapter
createDebugAdapter(session: IDebugSession): IDebugAdapter { const handle = this._debugAdaptersHandleCounter++; const da = new ExtensionHostDebugAdapter(this, handle, this._proxy, session); this._debugAdapters.set(handle, da); return da; }
// interface IDebugAdapterProvider
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadDebugService.ts#L189-L194
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadDebugService.$registerDebugTypes
public $registerDebugTypes(debugTypes: string[]) { this._toDispose.add(this.debugService.getAdapterManager().registerDebugAdapterFactory(debugTypes, this)); }
// RPC methods (MainThreadDebugServiceShape)
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadDebugService.ts#L206-L208
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadDebugService.$sessionCached
public $sessionCached(sessionID: string) { // remember that the EH has cached the session and we do not have to send it again this._extHostKnownSessions.add(sessionID); }
// dto helpers
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadDebugService.ts#L414-L417
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
dispose
const dispose = () => { const idx = this._data.indexOf(entry); if (idx >= 0) { this._length -= length; ref.dispose(); clearTimeout(handle); this._data.splice(idx, 1); } };
// const length = ref.object.textEditorModel.getValueLength();
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadDocuments.ts#L54-L62
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadDocuments.$trySaveDocument
async $trySaveDocument(uri: UriComponents): Promise<boolean> { const target = await this._textFileService.save(URI.revive(uri)); return Boolean(target); }
// --- from extension host process
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadDocuments.ts#L208-L211
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._buildTabObject
private _buildTabObject(group: IEditorGroup, editor: EditorInput, editorIndex: number): IEditorTabDto { const editorId = editor.editorId; const tab: IEditorTabDto = { id: this._generateTabId(editor, group.id), label: editor.getName(), editorId, input: this._editorInputToDto(editor), isPinned: group.i...
/** * Creates a tab object with the correct properties * @param editor The editor input represented by the tab * @param group The group the tab is in * @returns A tab object */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L94-L107
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._generateTabId
private _generateTabId(editor: EditorInput, groupId: number) { let resourceString: string | undefined; // Properly get the resource and account for side by side editors const resource = EditorResourceAccessor.getCanonicalUri(editor, { supportSideBySide: SideBySideEditor.BOTH }); if (resource instanceof URI) { ...
/** * Generates a unique id for a tab * @param editor The editor input * @param groupId The group id * @returns A unique identifier for a specific tab */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L234-L244
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._onDidGroupActivate
private _onDidGroupActivate() { const activeGroupId = this._editorGroupsService.activeGroup.id; const activeGroup = this._groupLookup.get(activeGroupId); if (activeGroup) { // Ok not to loop as exthost accepts last active group activeGroup.isActive = true; this._proxy.$acceptTabGroupUpdate(activeGroup); ...
/** * Called whenever a group activates, updates the model by marking the group as active an notifies the extension host */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L249-L257
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._onDidTabLabelChange
private _onDidTabLabelChange(groupId: number, editorInput: EditorInput, editorIndex: number) { const tabId = this._generateTabId(editorInput, groupId); const tabInfo = this._tabInfoLookup.get(tabId); // If tab is found patch, else rebuild if (tabInfo) { tabInfo.tab.label = editorInput.getName(); this._pro...
/** * Called when the tab label changes * @param groupId The id of the group the tab exists in * @param editorInput The editor input represented by the tab */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L264-L280
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._onDidTabOpen
private _onDidTabOpen(groupId: number, editorInput: EditorInput, editorIndex: number) { const group = this._editorGroupsService.getGroup(groupId); // Even if the editor service knows about the group the group might not exist yet in our model const groupInModel = this._groupLookup.get(groupId) !== undefined; // ...
/** * Called when a new tab is opened * @param groupId The id of the group the tab is being created in * @param editorInput The editor input being opened * @param editorIndex The index of the editor within that group */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L288-L330
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._onDidTabClose
private _onDidTabClose(groupId: number, editorIndex: number) { const group = this._editorGroupsService.getGroup(groupId); const tabs = this._groupLookup.get(groupId)?.tabs; // Something is wrong with the model state so we rebuild if (!group || !tabs) { this._createTabsModel(); return; } // Splice tab ...
/** * Called when a tab is closed * @param groupId The id of the group the tab is being removed from * @param editorIndex The index of the editor within that group */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L337-L366
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._onDidTabActiveChange
private _onDidTabActiveChange(groupId: number, editorIndex: number) { // TODO @lramos15 use the tab lookup here if possible. Do we have an editor input?! const tabs = this._groupLookup.get(groupId)?.tabs; if (!tabs) { return; } const activeTab = tabs[editorIndex]; // No need to loop over as the exthost u...
/** * Called when the active tab changes * @param groupId The id of the group the tab is contained in * @param editorIndex The index of the tab */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L373-L390
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._onDidTabDirty
private _onDidTabDirty(groupId: number, editorIndex: number, editor: EditorInput) { const tabId = this._generateTabId(editor, groupId); const tabInfo = this._tabInfoLookup.get(tabId); // Something wrong with the model state so we rebuild if (!tabInfo) { this._logService.error('Invalid model for dirty change,...
/** * Called when the dirty indicator on the tab changes * @param groupId The id of the group the tab is in * @param editorIndex The index of the tab * @param editor The editor input represented by the tab */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L398-L414
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._onDidTabPinChange
private _onDidTabPinChange(groupId: number, editorIndex: number, editor: EditorInput) { const tabId = this._generateTabId(editor, groupId); const tabInfo = this._tabInfoLookup.get(tabId); const group = tabInfo?.group; const tab = tabInfo?.tab; // Something wrong with the model state so we rebuild if (!group...
/** * Called when the tab is pinned/unpinned * @param groupId The id of the group the tab is in * @param editorIndex The index of the tab * @param editor The editor input represented by the tab */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L422-L441
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._onDidTabPreviewChange
private _onDidTabPreviewChange(groupId: number, editorIndex: number, editor: EditorInput) { const tabId = this._generateTabId(editor, groupId); const tabInfo = this._tabInfoLookup.get(tabId); const group = tabInfo?.group; const tab = tabInfo?.tab; // Something wrong with the model state so we rebuild if (!g...
/** * Called when the tab is preview / unpreviewed * @param groupId The id of the group the tab is in * @param editorIndex The index of the tab * @param editor The editor input represented by the tab */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L449-L468
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._createTabsModel
private _createTabsModel(): void { if (this._editorGroupsService.groups.length === 0) { return; // skip this invalid state, it may happen when the entire editor area is transitioning to other state ("editor working sets") } this._tabGroupModel = []; this._groupLookup.clear(); this._tabInfoLookup.clear(); ...
/** * Builds the model from scratch based on the current state of the editor service. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L499-L532
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs._updateTabsModel
private _updateTabsModel(changeEvent: IEditorsChangeEvent): void { const event = changeEvent.event; const groupId = changeEvent.groupId; switch (event.kind) { case GroupModelChangeKind.GROUP_ACTIVE: if (groupId === this._editorGroupsService.activeGroup.id) { this._onDidGroupActivate(); break; ...
/** * The main handler for the tab events * @param events The list of events to process */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L558-L616
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadEditorTabs.$moveTab
$moveTab(tabId: string, index: number, viewColumn: EditorGroupColumn, preserveFocus?: boolean): void { const groupId = columnToEditorGroup(this._editorGroupsService, this._configurationService, viewColumn); const tabInfo = this._tabInfoLookup.get(tabId); const tab = tabInfo?.tab; if (!tab) { throw new Error(...
//#region Messages received from Ext Host
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditorTabs.ts#L618-L657
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadTextEditors.$tryShowTextDocument
async $tryShowTextDocument(resource: UriComponents, options: ITextDocumentShowOptions): Promise<string | undefined> { const uri = URI.revive(resource); const editorOptions: ITextEditorOptions = { preserveFocus: options.preserveFocus, pinned: options.pinned, selection: options.selection, // preserve pre...
// --- from extension host process
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadEditors.ts#L242-L268
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadFileSystem.$stat
$stat(uri: UriComponents): Promise<IStat> { return this._fileService.stat(URI.revive(uri)).then(stat => { return { ctime: stat.ctime, mtime: stat.mtime, size: stat.size, permissions: stat.readonly ? FilePermission.Readonly : undefined, type: MainThreadFileSystem._asFileType(stat) }; }).cat...
// --- consumer fs, vscode.workspace.fs
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadFileSystem.ts#L61-L71
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RemoteFileSystemProvider.stat
stat(resource: URI): Promise<IStat> { return this._proxy.$stat(this._handle, resource).then(undefined, err => { throw err; }); }
// --- forwarding calls
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadFileSystem.ts#L204-L208
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerDocumentSymbolProvider
$registerDocumentSymbolProvider(handle: number, selector: IDocumentFilterDto[], displayName: string): void { this._registrations.set(handle, this._languageFeaturesService.documentSymbolProvider.register(selector, { displayName, provideDocumentSymbols: (model: ITextModel, token: CancellationToken): Promise<langu...
// --- outline
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L163-L170
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerCodeLensSupport
$registerCodeLensSupport(handle: number, selector: IDocumentFilterDto[], eventHandle: number | undefined): void { const provider: languages.CodeLensProvider = { provideCodeLenses: async (model: ITextModel, token: CancellationToken): Promise<languages.CodeLensList | undefined> => { const listDto = await this._...
// --- code lens
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L174-L206
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerDefinitionSupport
$registerDefinitionSupport(handle: number, selector: IDocumentFilterDto[]): void { this._registrations.set(handle, this._languageFeaturesService.definitionProvider.register(selector, { provideDefinition: (model, position, token): Promise<languages.LocationLink[]> => { return this._proxy.$provideDefinition(hand...
// --- declaration
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L217-L223
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerHoverProvider
$registerHoverProvider(handle: number, selector: IDocumentFilterDto[]): void { /* const hoverFinalizationRegistry = new FinalizationRegistry((hoverId: number) => { this._proxy.$releaseHover(handle, hoverId); }); */ this._registrations.set(handle, this._languageFeaturesService.hoverProvider.register(selecto...
// --- extra info
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L251-L270
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerEvaluatableExpressionProvider
$registerEvaluatableExpressionProvider(handle: number, selector: IDocumentFilterDto[]): void { this._registrations.set(handle, this._languageFeaturesService.evaluatableExpressionProvider.register(selector, { provideEvaluatableExpression: (model: ITextModel, position: EditorPosition, token: CancellationToken): Prom...
// --- debug hover
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L274-L280
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerInlineValuesProvider
$registerInlineValuesProvider(handle: number, selector: IDocumentFilterDto[], eventHandle: number | undefined): void { const provider: languages.InlineValuesProvider = { provideInlineValues: (model: ITextModel, viewPort: EditorRange, context: languages.InlineValueContext, token: CancellationToken): Promise<languag...
// --- inline values
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L284-L298
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerDocumentHighlightProvider
$registerDocumentHighlightProvider(handle: number, selector: IDocumentFilterDto[]): void { this._registrations.set(handle, this._languageFeaturesService.documentHighlightProvider.register(selector, { provideDocumentHighlights: (model: ITextModel, position: EditorPosition, token: CancellationToken): Promise<languag...
// --- occurrences
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L309-L315
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerLinkedEditingRangeProvider
$registerLinkedEditingRangeProvider(handle: number, selector: IDocumentFilterDto[]): void { this._registrations.set(handle, this._languageFeaturesService.linkedEditingRangeProvider.register(selector, { provideLinkedEditingRanges: async (model: ITextModel, position: EditorPosition, token: CancellationToken): Promis...
// --- linked editing
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L345-L358
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerReferenceSupport
$registerReferenceSupport(handle: number, selector: IDocumentFilterDto[]): void { this._registrations.set(handle, this._languageFeaturesService.referenceProvider.register(selector, { provideReferences: (model: ITextModel, position: EditorPosition, context: languages.ReferenceContext, token: CancellationToken): Pro...
// --- references
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L362-L368
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerCodeActionSupport
$registerCodeActionSupport(handle: number, selector: IDocumentFilterDto[], metadata: ICodeActionProviderMetadataDto, displayName: string, extensionId: string, supportsResolve: boolean): void { const provider: languages.CodeActionProvider = { provideCodeActions: async (model: ITextModel, rangeOrSelection: EditorRan...
// --- code actions
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L372-L410
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerDocumentFormattingSupport
$registerDocumentFormattingSupport(handle: number, selector: IDocumentFilterDto[], extensionId: ExtensionIdentifier, displayName: string): void { this._registrations.set(handle, this._languageFeaturesService.documentFormattingEditProvider.register(selector, { extensionId, displayName, provideDocumentFormatti...
// --- formatting
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L435-L443
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerNavigateTypeSupport
$registerNavigateTypeSupport(handle: number, supportsResolve: boolean): void { let lastResultId: number | undefined; const provider: search.IWorkspaceSymbolProvider = { provideWorkspaceSymbols: async (search: string, token: CancellationToken): Promise<search.IWorkspaceSymbol[]> => { const result = await thi...
// --- navigate type
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L472-L492
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerRenameSupport
$registerRenameSupport(handle: number, selector: IDocumentFilterDto[], supportResolveLocation: boolean): void { this._registrations.set(handle, this._languageFeaturesService.renameProvider.register(selector, { provideRenameEdits: (model: ITextModel, position: EditorPosition, newName: string, token: CancellationTok...
// --- rename
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L496-L505
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MainThreadLanguageFeatures.$registerDocumentSemanticTokensProvider
$registerDocumentSemanticTokensProvider(handle: number, selector: IDocumentFilterDto[], legend: languages.SemanticTokensLegend, eventHandle: number | undefined): void { let event: Event<void> | undefined = undefined; if (typeof eventHandle === 'number') { const emitter = new Emitter<void>(); this._registratio...
// --- semantic tokens
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/api/browser/mainThreadLanguageFeatures.ts#L518-L526
1a8578f21ace8c9381461d295ed31c3500be43bf