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
ChatInstructionAttachmentsModel.references
public get references(): readonly URI[] { const result = []; for (const child of this.attachments.values()) { result.push(...child.references); } return result; }
/** * Get all `URI`s of all valid references, including all * the possible references nested inside the children. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts#L84-L92
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionAttachmentsModel.chatAttachments
public get chatAttachments(): readonly IChatRequestVariableEntry[] { const result = []; const attachments = [...this.attachments.values()]; for (const attachment of attachments) { const { reference } = attachment; // the usual URIs list of prompt instructions is `bottom-up`, therefore // we do the same...
/** * Get the list of all prompt instruction attachment variables, including all * nested child references of each attachment explicitly attached by user. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts#L98-L120
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionAttachmentsModel.allSettled
public async allSettled(): Promise<void> { const attachments = [...this.attachments.values()]; await Promise.allSettled( attachments.map((attachment) => { return attachment.allSettled; }), ); }
/** * Promise that resolves when parsing of all attached prompt instruction * files completes, including parsing of all its possible child references. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts#L126-L134
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionAttachmentsModel.onUpdate
public onUpdate(callback: () => unknown): this { this._register(this._onUpdate.event(callback)); return this; }
/** * Subscribe to the `onUpdate` event. * @param callback Function to invoke on update. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts#L146-L150
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionAttachmentsModel.onAdd
public onAdd(callback: (attachment: ChatInstructionsAttachmentModel) => unknown): this { this._register(this._onAdd.event(callback)); return this; }
/** * The `onAdd` event fires when a new prompt instruction attachment is added. * * @param callback Function to invoke on add. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts#L162-L166
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionAttachmentsModel.add
public add(uri: URI): this { // if already exists, nothing to do if (this.attachments.has(uri.path)) { return this; } const instruction = this.initService.createInstance(ChatInstructionsAttachmentModel, uri) .onUpdate(this._onUpdate.fire) .onDispose(() => { // note! we have to use `deleteAndLeak` ...
/** * Add a prompt instruction attachment instance with the provided `URI`. * @param uri URI of the prompt instruction attachment to add. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts#L182-L204
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionAttachmentsModel.remove
public remove(uri: URI): this { // if does not exist, nothing to do if (!this.attachments.has(uri.path)) { return this; } this.attachments.deleteAndDispose(uri.path); return this; }
/** * Remove a prompt instruction attachment instance by provided `URI`. * @param uri URI of the prompt instruction attachment to remove. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts#L210-L219
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionAttachmentsModel.listNonAttachedFiles
public async listNonAttachedFiles(): Promise<readonly URI[]> { return await this.instructionsFileReader.listFiles(this.references); }
/** * List prompt instruction files available and not attached yet. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts#L224-L226
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionAttachmentsModel.featureEnabled
public get featureEnabled(): boolean { return PromptFilesConfig.enabled(this.configService); }
/** * Checks if the prompt instructions feature is enabled in the user settings. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts#L231-L233
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionsAttachmentModel.reference
public get reference(): FilePromptParser { return this._reference; }
/** * Get the prompt instructions reference instance. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionsAttachment.ts#L24-L26
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionsAttachmentModel.references
public get references(): readonly URI[] { const { reference } = this; const { errorCondition } = this.reference; // return no references if the attachment is disabled // or if this object itself has an error if (errorCondition) { return []; } // otherwise return `URI` for the main reference and // ...
/** * Get `URI` for the main reference and `URI`s of all valid child * references it may contain, including reference of this model itself. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionsAttachment.ts#L32-L48
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionsAttachmentModel.allSettled
public get allSettled(): Promise<FilePromptParser> { return this.reference.allSettled(); }
/** * Promise that resolves when the prompt is fully parsed, * including all its possible nested child references. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionsAttachment.ts#L54-L56
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionsAttachmentModel.topError
public get topError() { return this.reference.topError; }
/** * Get the top-level error of the prompt instructions * reference, if any. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionsAttachment.ts#L62-L64
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionsAttachmentModel.onUpdate
public onUpdate(callback: () => unknown): this { this._register(this._onUpdate.event(callback)); return this; }
/** * Subscribe to the `onUpdate` event. * @param callback Function to invoke on update. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionsAttachment.ts#L77-L81
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionsAttachmentModel.onDispose
public onDispose(callback: () => unknown): this { this._register(this._onDispose.event(callback)); return this; }
/** * Subscribe to the `onDispose` event. * @param callback Function to invoke on dispose. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionsAttachment.ts#L93-L97
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionsAttachmentModel.resolve
public resolve(): this { this._reference.start(); return this; }
/** * Start resolving the prompt instructions reference and child references * that it may contain. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionsAttachment.ts#L114-L118
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionsFileLocator.listFiles
public async listFiles(exclude: ReadonlyArray<URI>): Promise<readonly URI[]> { // create a set from the list of URIs for convenience const excludeSet: Set<string> = new Set(); for (const excludeUri of exclude) { excludeSet.add(excludeUri.path); } // filter out the excluded paths from the locations list ...
/** * List all prompt instructions files from the filesystem. * * @param exclude List of `URIs` to exclude from the result. * @returns List of prompt instructions files found in the workspace. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionsFileLocator.ts#L30-L44
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionsFileLocator.getSourceLocations
private getSourceLocations(): readonly URI[] { const state = this.workspaceService.getWorkbenchState(); // nothing to do if the workspace is empty if (state === WorkbenchState.EMPTY) { return []; } const sourceLocations = PromptFilesConfig.sourceLocations(this.configService); const result = []; // o...
/** * Get all possible prompt instructions file locations based on the current * workspace folder structure. * * @returns List of possible prompt instructions file locations. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionsFileLocator.ts#L52-L85
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInstructionsFileLocator.findInstructionFiles
private async findInstructionFiles( locations: readonly URI[], exclude: ReadonlySet<string>, ): Promise<readonly URI[]> { const results = await this.fileService.resolveAll( locations.map((location) => { return { resource: location }; }), ); const files = []; for (const result of results) { co...
/** * Finds all existent prompt instruction files in the provided locations. * * @param locations List of locations to search for prompt instruction files in. * @param exclude Map of `path -> boolean` to exclude from the result. * @returns List of prompt instruction files found in the provided locations. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionsFileLocator.ts#L94-L137
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatAttachmentsContentPart.createImageElements
private async createImageElements(buffer: ArrayBuffer | Uint8Array, widget: HTMLElement, hoverElement: HTMLElement) { const blob = new Blob([buffer], { type: 'image/png' }); const url = URL.createObjectURL(blob); const img = dom.$('img.chat-attached-context-image', { src: url, alt: '' }); const pillImg = dom.$(...
// Helper function to create and replace image
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.ts#L284-L298
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
observeArrayChanges
function observeArrayChanges<T>(obs: IObservable<T[]>, compare: (a: T, b: T) => number, store: DisposableStore): Event<T[]> { const emitter = store.add(new Emitter<T[]>()); store.add(runOnChange(obs, (newArr, oldArr) => { const change = delta(oldArr || [], newArr, compare); const changedElements = ([] as T[]).con...
/** * Emits an event containing the added or removed elements of the observable. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.ts#L474-L482
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatEditingSession._getOrCreateModifiedFileEntry
private async _getOrCreateModifiedFileEntry(resource: URI, responseModel: IModifiedEntryTelemetryInfo): Promise<ChatEditingModifiedFileEntry> { const existingEntry = this._entriesObs.get().find(e => isEqual(e.modifiedURI, resource)); if (existingEntry) { if (responseModel.requestId !== existingEntry.telemetryInf...
/** * Retrieves or creates a modified file entry. * * @returns The modified file entry. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.ts#L752-L798
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatDynamicVariableModel.disposeVariables
private disposeVariables(): void { for (const variable of this._variables) { if ('dispose' in variable && typeof variable.dispose === 'function') { variable.dispose(); } } }
/** * Dispose all existing variables. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts#L177-L183
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
isDynamicVariable
function isDynamicVariable(obj: any): obj is IDynamicVariable { return obj && typeof obj.id === 'string' && Range.isIRange(obj.range) && 'data' in obj; }
/** * Loose check to filter objects that are obviously missing data */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts#L194-L199
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
getFilterText
const getFilterText = (agent: IChatAgentData, command: string) => { // This is hacking the filter algorithm to make @terminal /explain match worse than @workspace /explain by making its match index later in the string. // When I type `/exp`, the workspace one should be sorted over the terminal one. const...
// When the input is only `/`, items are sorted by sortText.
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.ts#L233-L238
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
VariableCompletions.constructor
constructor( @ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService, @IChatWidgetService private readonly chatWidgetService: IChatWidgetService, @IChatVariablesService private readonly chatVariablesService: IChatVariablesService, @IConfigurationService configService: IConfi...
// MUST be using `g`-flag
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.ts#L772-L839
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatFileReference.constructor
constructor( public readonly reference: IDynamicVariable, @IInstantiationService initService: IInstantiationService, @IConfigurationService configService: IConfigurationService, @ILogService logService: ILogService, ) { const { data } = reference; assert( data instanceof URI, `Variable data must be ...
/** * @throws if the `data` reference is no an instance of `URI`. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables/chatFileReference.ts#L24-L38
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatFileReference.id
public get id() { return this.reference.id; }
/** * Note! below are the getters that simply forward to the underlying `IDynamicVariable` object; * while we could implement the logic generically using the `Proxy` class here, it's hard * to make Typescript to recognize this generic implementation correctly */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables/chatFileReference.ts#L46-L48
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatAgentService.getAgents
getAgents(): IChatAgentData[] { return Array.from(this._agents.values()) .map(entry => entry.data) .filter(a => this._agentIsEnabled(a.id)); }
/** * Returns all agent datas that exist- static registered and dynamic ones. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/chatAgents.ts#L471-L475
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatAgentNameService.getAgentNameRestriction
getAgentNameRestriction(chatAgentData: IChatAgentData): boolean { // TODO would like to use observables here but nothing uses it downstream and I'm not sure how to combine these two const nameAllowed = this.checkAgentNameRestriction(chatAgentData.name, chatAgentData).get(); const fullNameAllowed = !chatAgentData....
/** * Returns true if the agent is allowed to use this name */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/chatAgents.ts#L737-L742
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
Response.getMarkdown
getMarkdown(): string { return this._markdownContent; }
/** * _Just_ the content of markdown parts in the response */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/chatModel.ts#L345-L347
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatResponseModel.updateContent
updateContent(responsePart: IChatProgressResponseContent | IChatTextEdit, quiet?: boolean) { this._response.updateContent(responsePart, quiet); }
/** * Apply a progress update to the actual response content. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/chatModel.ts#L653-L655
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatResponseModel.applyReference
applyReference(progress: IChatUsedContext | IChatContentReference) { if (progress.kind === 'usedContext') { this._usedContext = progress; } else if (progress.kind === 'reference') { this._contentReferences.push(progress); this._onDidChange.fire(); } }
/** * Apply one of the progress updates that are not part of the actual response content. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/chatModel.ts#L660-L667
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatService.getHistory
getHistory(): IChatDetail[] { const persistedSessions = Object.values(this._persistedSessions) .filter(session => session.requests.length > 0) .filter(session => !this._sessionModels.has(session.sessionId)); const persistedSessionItems = persistedSessions .filter(session => !session.isImported && session....
/** * Returns an array of chat details for all persisted chat sessions that have at least one request. * The array is sorted by creation date in descending order. * Chat sessions that have already been loaded into the chat view are excluded from the result. * Imported chat sessions are also excluded from the re...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/chatServiceImpl.ts#L340-L368
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RecursiveReference.recursivePathString
public get recursivePathString(): string { return this.recursivePath.join(' -> '); }
/** * Returns a string representation of the recursive path. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptFileReferenceErrors.ts#L124-L126
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RecursiveReference.equal
public override equal(other: unknown): other is this { if (!this.sameTypeAs(other)) { return false; } if (this.uri.toString() !== other.uri.toString()) { return false; } return this.recursivePathString === other.recursivePathString; }
/** * Check if provided object is of the same type as this * error, contains the same recursive path and URI. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptFileReferenceErrors.ts#L132-L142
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RecursiveReference.toString
public override toString(): string { return `"${this.message}"(${this.uri})`; }
/** * Returns a string representation of the error object. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptFileReferenceErrors.ts#L147-L149
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PartialPromptFileReference.tokens
public override get tokens(): readonly (Hash | Word | Colon)[] { return [...this.fileReferenceTokens, ...this.currentTokens]; }
/** * List of tokens that were accumulated so far. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/chatPromptDecoder.ts#L120-L122
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PartialPromptFileReference.asFileReference
public asFileReference(): FileReference { // use only tokens in the `currentTokens` list to // create the path component of the file reference const path = this.currentTokens .map((token) => { return token.text; }) .join(''); const firstToken = this.tokens[0]; const range = new Range( firstToken.ra...
/** * Return the `FileReference` instance created from the current object. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/chatPromptDecoder.ts#L127-L144
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileReference.text
public get text(): string { return `${TOKEN_START}${this.path}`; }
/** * Get full text of the file reference token. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/fileReference.ts#L35-L37
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileReference.fromWord
public static fromWord(word: Word): FileReference { const { text } = word; assert( text.startsWith(TOKEN_START), `The reference must start with "${TOKEN_START}", got ${text}.`, ); const maybeReference = text.split(TOKEN_START); assert( maybeReference.length === 2, `The expected reference format...
/** * Create a file reference token out of a generic `Word`. * @throws if the word does not conform to the expected format or if * the reference is an invalid `URI`. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/fileReference.ts#L44-L79
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileReference.equals
public override equals<T extends BaseToken>(other: T): boolean { if (!super.sameRange(other.range)) { return false; } if (!(other instanceof FileReference)) { return false; } return this.text === other.text; }
/** * Check if this token is equal to another one. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/fileReference.ts#L84-L94
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileReference.linkRange
public get linkRange(): IRange | undefined { if (this.path.length === 0) { return undefined; } const { range } = this; return new Range( range.startLineNumber, range.startColumn + TOKEN_START.length, range.endLineNumber, range.endColumn, ); }
/** * Get the range of the `link part` of the token (e.g., * the `/path/to/file.md` part of `#file:/path/to/file.md`). */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/fileReference.ts#L100-L112
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FileReference.toString
public override toString(): string { return `file-ref("${this.text}")${this.range}`; }
/** * Return a string representation of the token. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/codecs/tokens/fileReference.ts#L117-L119
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FilePromptContentProvider.getContentsStream
protected async getContentsStream( _event: FileChangesEvent | 'full', cancellationToken?: CancellationToken, ): Promise<VSBufferReadableStream> { assert( !cancellationToken?.isCancellationRequested, new CancellationError(), ); // get the binary stream of the file contents let fileStream; try { ...
/** * Creates a stream of lines from the file based on the changes listed in * the provided event. * * @param event - event that describes the changes in the file; `'full'` is * the special value that means that all contents have changed * @param cancellationToken - token that cancels this operation ...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/filePromptContentsProvider.ts#L55-L91
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FilePromptContentProvider.toString
public override toString() { return `file-prompt-contents-provider:${this.uri.path}`; }
/** * String representation of this object. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/filePromptContentsProvider.ts#L96-L98
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TextModelContentsProvider.getContentsStream
protected override async getContentsStream( _event: IModelContentChangedEvent | 'full', cancellationToken?: CancellationToken, ): Promise<ReadableStream<VSBuffer>> { const stream = newWriteableStream<VSBuffer>(null); const linesCount = this.model.getLineCount(); // provide the changed lines to the stream in...
/** * Creates a stream of binary data from the text model based on the changes * listed in the provided event. * * Note! this method implements a basic logic which does not take into account * the `_event` argument for incremental updates. This needs to be improved. * * @param _event - event that descr...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.ts#L43-L93
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TextModelContentsProvider.toString
public override toString() { return `text-model-prompt-contents-provider:${this.uri.path}`; }
/** * String representation of this object. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.ts#L98-L100
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PromptLinkProvider.createParser
private createParser( model: ITextModel, ): TextModelPromptParser & { disposed: false } { const parser: TextModelPromptParser = this.initService.createInstance( TextModelPromptParser, model, [], ); parser.assertNotDisposed( 'Created prompt parser must not be disposed.', ); return parser; }
/** * Create new prompt parser instance for the provided text model. * * @param model - text model to create the parser for * @param initService - the instantiation service */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkProvider.ts#L55-L69
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PromptLinkProvider.provideLinks
public async provideLinks( model: ITextModel, token: CancellationToken, ): Promise<ILinksList> { assert( !token.isCancellationRequested, new CancellationError(), ); const parser = this.parserProvider.get(model); assert( !parser.disposed, 'Prompt parser must not be disposed.', ); // start ...
/** * Provide list of links for the provided text model. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkProvider.ts#L74-L130
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PromptFileReference.linkRange
public get linkRange(): IRange | undefined { // `#file:` references if (this.token instanceof FileReference) { return this.token.linkRange; } // `markdown link` references if (this.token instanceof MarkdownLink) { return this.token.linkRange; } return undefined; }
/** * Get the range of the `link` part of the reference. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/basePromptParser.ts#L572-L584
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PromptFileReference.toString
public override toString() { const prefix = (this.token instanceof FileReference) ? FileReference.TOKEN_START : 'md-link:'; return `${prefix}${this.uri.path}`; }
/** * Returns a string representation of this object. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/basePromptParser.ts#L589-L595
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PromptFileReference.getErrorMessage
protected override getErrorMessage(error: ParseError): string { // if failed to open a file, return approprivate message and the file path if (error instanceof FileOpenFailed) { return `${errorMessages.fileOpenFailed} '${error.uri.path}'.`; } return super.getErrorMessage(error); }
/** * @inheritdoc */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/basePromptParser.ts#L600-L607
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FirstParseResult.gotFirstResult
public get gotFirstResult(): boolean { return this._gotResult; }
/** * Whether we've received at least one result. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/basePromptParser.ts#L624-L626
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FirstParseResult.promise
public get promise(): Promise<void> { return this.p; }
/** * Get underlying promise reference. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/basePromptParser.ts#L631-L633
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FirstParseResult.complete
public override complete() { this._gotResult = true; return super.complete(void 0); }
/** * Complete the underlying promise. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/basePromptParser.ts#L638-L641
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FilePromptParser.toString
public override toString() { return `file-prompt:${this.uri.path}`; }
/** * Returns a string representation of this object. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/filePromptParser.ts#L32-L34
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TextModelPromptParser.toString
public override toString() { return `text-model-prompt:${this.uri.path}`; }
/** * Returns a string representation of this object. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.ts#L32-L34
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
supportsKeywordActivation
function supportsKeywordActivation(configurationService: IConfigurationService, speechService: ISpeechService, chatAgentService: IChatAgentService): boolean { if (!speechService.hasSpeechProvider || !chatAgentService.getDefaultAgent(ChatAgentLocation.Panel)) { return false; } const value = configurationService.ge...
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts#L1033-L1041
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
MockChatService.sendRequest
sendRequest(sessionId: string, message: string): Promise<IChatSendRequestData | undefined> { throw new Error('Method not implemented.'); }
/** * Returns whether the request was accepted. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/test/common/mockChatService.ts#L48-L50
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ExpectedReference.toString
public toString(): string { return `file-prompt:${this.uri.path}`; }
/** * String representation of the expected reference. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/test/common/promptSyntax/promptFileReference.test.ts#L73-L75
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TestPromptFileReference.run
public async run() { // create the files structure on the disk await this.createFolder( this.fileService, this.fileStructure, ); // randomly test with and without delay to ensure that the file // reference resolution is not suseptible to race conditions if (randomBoolean()) { await waitRandom(5); ...
/** * Run the test. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/test/common/promptSyntax/promptFileReference.test.ts#L99-L168
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TestPromptFileReference.createFolder
async createFolder( fileService: IFileService, folder: IFolder, parentFolder?: URI, ): Promise<void> { const folderUri = parentFolder ? URI.joinPath(parentFolder, folder.name) : URI.file(folder.name); if (await fileService.exists(folderUri)) { await fileService.del(folderUri); } await fileServi...
/** * Create the provided filesystem folder structure. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/test/common/promptSyntax/promptFileReference.test.ts#L173-L198
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
createTestFileReference
const createTestFileReference = ( filePath: string, lineNumber: number, startColumnNumber: number, ): FileReference => { const range = new Range( lineNumber, startColumnNumber, lineNumber, startColumnNumber + `#file:${filePath}`.length, ); return new FileReference(range, filePath); };
/** * Create expected file reference for testing purposes. * * @param filePath The expected path of the file reference (without the `#file:` prefix). * @param lineNumber The expected line number of the file reference. * @param startColumnNumber The expected start column number of the file reference. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/test/common/promptSyntax/promptFileReference.test.ts#L208-L221
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
GutterActionsRegistryImpl.registerGutterActionsGenerator
public registerGutterActionsGenerator(gutterActionsGenerator: IGutterActionsGenerator): IDisposable { this._registeredGutterActionsGenerators.add(gutterActionsGenerator); return { dispose: () => { this._registeredGutterActionsGenerators.delete(gutterActionsGenerator); } }; }
/** * * This exists solely to allow the debug and test contributions to add actions to the gutter context menu * which cannot be trivially expressed using when clauses and therefore cannot be statically registered. * If you want an action to show up in the gutter context menu, you should generally use MenuId.Ed...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu.ts#L32-L39
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TrimFinalNewLinesParticipant.findLastNonEmptyLine
private findLastNonEmptyLine(model: ITextModel): number { for (let lineNumber = model.getLineCount(); lineNumber >= 1; lineNumber--) { const lineLength = model.getLineLength(lineNumber); if (lineLength > 0) { // this line has content return lineNumber; } } // no line has content return 0; }
/** * returns 0 if the entire file is empty */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.ts#L168-L178
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
languageOnClickOrTap
const languageOnClickOrTap = async (e: UIEvent) => { e.stopPropagation(); // Need to focus editor before so current editor becomes active and the command is properly executed this.editor.focus(); this.telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbench...
// the actual command handlers...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.ts#L343-L353
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
GotoSymbolQuickAccessProvider.configuration
private get configuration() { const editorConfig = this.configurationService.getValue<IWorkbenchEditorConfiguration>().workbench?.editor; return { openEditorPinned: !editorConfig?.enablePreviewFromQuickOpen || !editorConfig?.enablePreview, openSideBySideDirection: editorConfig?.openSideBySideDirection }; ...
//#region DocumentSymbols (text editor required)
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts#L57-L64
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
GotoSymbolQuickAccessProvider.provideWithoutTextEditor
protected override provideWithoutTextEditor(picker: IQuickPick<IGotoSymbolQuickPickItem, { useSeparators: true }>): IDisposable { if (this.canPickWithOutlineService()) { return this.doGetOutlinePicks(picker); } return super.provideWithoutTextEditor(picker); }
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.ts#L126-L131
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
walkDirectoryAndReindent
function walkDirectoryAndReindent(directory: string, languageId: string) { const files = fs.readdirSync(directory, { withFileTypes: true }); const directoriesToRecurseOn: string[] = []; for (const file of files) { if (file.isDirectory()) { directoriesToRecurseOn.push(path.join(directory, file.name)); ...
// ./scripts/test.sh --inspect --grep='Find Cases of Incorrect Indentation with the Reindent Lines Command' --timeout=15000
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/codeEditor/test/node/autoindent.test.ts#L126-L175
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
RunCommands.run
async run(accessor: ServicesAccessor, args: unknown) { const notificationService = accessor.get(INotificationService); if (!this._isCommandArgs(args)) { notificationService.error(nls.localize('runCommands.invalidArgs', "'runCommands' has received an argument with incorrect type. Please, review the argument pas...
// - and we want to be able to take on different other arguments in future, e.g., `runMode : 'serial' | 'concurrent'`
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/commands/common/commands.contribution.ts#L80-L114
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
CommentReply.createCommentWidgetFormActions
private createCommentWidgetFormActions(container: HTMLElement, model: ITextModel) { const menu = this._commentMenus.getCommentThreadActions(this._contextKeyService); this._register(menu); this._register(menu.onDidChange(() => { this._commentFormActions.setActions(menu); })); this._commentFormActions = ne...
/** * Command based actions. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/comments/browser/commentReply.ts#L275-L297
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
CommentService.constructor
constructor( @IInstantiationService protected readonly instantiationService: IInstantiationService, @IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService, @IConfigurationService private readonly configurationService: IConfigurationService, @IContextKeyService contextKeyService: IConte...
// schemes
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/comments/browser/commentService.ts#L181-L240
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
CommentService.setCurrentCommentThread
setCurrentCommentThread(commentThread: CommentThread | undefined) { this._onDidChangeCurrentCommentThread.fire(commentThread); }
/** * The current comment thread is the thread that has focus or is being hovered. * @param commentThread */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/comments/browser/commentService.ts#L291-L293
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
CommentService.setActiveEditingCommentThread
setActiveEditingCommentThread(commentThread: CommentThread | null) { this._onDidChangeActiveEditingCommentThread.fire(commentThread); }
/** * The active comment thread is the the thread that is currently being edited. * @param commentThread */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/comments/browser/commentService.ts#L299-L301
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
CustomEditorInfoCollection.defaultEditor
public get defaultEditor(): CustomEditorInfo | undefined { return this.allEditors.find(editor => { switch (editor.priority) { case RegisteredEditorPriority.default: case RegisteredEditorPriority.builtin: // A default editor must have higher priority than all other contributed editors. return this...
/** * Find the single default editor to use (if any) by looking at the editor's priority and the * other contributed editors. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/customEditor/common/customEditor.ts#L132-L145
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
CustomEditorInfoCollection.bestAvailableEditor
public get bestAvailableEditor(): CustomEditorInfo | undefined { const editors = Array.from(this.allEditors).sort((a, b) => { return priorityToRank(a.priority) - priorityToRank(b.priority); }); return editors[0]; }
/** * Find the best available editor to use. * * Unlike the `defaultEditor`, a bestAvailableEditor can exist even if there are other editors with * the same priority. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/customEditor/common/customEditor.ts#L153-L158
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BreakpointEditorContribution.getContextMenuActionsAtPosition
public getContextMenuActionsAtPosition(lineNumber: number, model: ITextModel) { if (!this.debugService.getAdapterManager().hasEnabledDebuggers()) { return []; } if (!this.debugService.canSetBreakpointsIn(model)) { return []; } const breakpoints = this.debugService.getModel().getBreakpoints({ lineNumbe...
/** * Returns context menu actions at the line number if breakpoints can be * set. This is used by the {@link TestingDecorations} to allow breakpoint * setting on lines where breakpoint "run" actions are present. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts#L242-L253
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BreakpointEditorContribution.showBreakpointWidget
showBreakpointWidget(lineNumber: number, column: number | undefined, context?: BreakpointWidgetContext): void { this.breakpointWidget?.dispose(); this.breakpointWidget = this.instantiationService.createInstance(BreakpointWidget, this.editor, lineNumber, column, context); this.breakpointWidget.show({ lineNumber, ...
// breakpoint widget
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts#L664-L670
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
CallStackWidget.setFrames
public setFrames(frames: AnyStackFrame[]): void { // cancel any existing load this.currentFramesDs.clear(); this.cts = new CancellationTokenSource(); this._register(toDisposable(() => this.cts!.dispose(true))); this.list.splice(0, this.list.length, this.mapFrames(frames)); }
/** Replaces the call frames display in the view. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/callStackWidget.ts#L167-L174
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
registerDebugViewMenuItem
const registerDebugViewMenuItem = (menuId: MenuId, id: string, title: string | ICommandActionTitle, order: number, when?: ContextKeyExpression, precondition?: ContextKeyExpression, group = 'navigation', icon?: Icon) => { MenuRegistry.appendMenuItem(menuId, { group, when, order, icon, command: { id, tit...
// Debug callstack context menu
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debug.contribution.ts#L156-L169
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
changeColor
function changeColor(colorType: 'foreground' | 'background' | 'underline', color?: RGBA | string): void { if (colorType === 'foreground') { customFgColor = color; } else if (colorType === 'background') { customBgColor = color; } else if (colorType === 'underline') { customUnderlineColor = color; } st...
/** * Change the foreground or background color by clearing the current color * and adding the new one. * @param colorType If `'foreground'`, will change the foreground color, if * `'background'`, will change the background color, and if `'underline'` * will set the underline color. * @param color Color to...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts#L126-L138
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
reverseForegroundAndBackgroundColors
function reverseForegroundAndBackgroundColors(): void { const oldFgColor = customFgColor; changeColor('foreground', customBgColor); changeColor('background', oldFgColor); }
/** * Swap foreground and background colors. Used for color inversion. Caller should check * [] flag to make sure it is appropriate to turn ON or OFF (if it is already inverted don't call */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts#L144-L148
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
setBasicFormatters
function setBasicFormatters(styleCodes: number[]): void { for (const code of styleCodes) { switch (code) { case 0: { // reset (everything) styleNames = []; customFgColor = undefined; customBgColor = undefined; break; } case 1: { // bold styleNames = styleNames.filter(style => ...
/** * Calculate and set basic ANSI formatting. Supports ON/OFF of bold, italic, underline, * double underline, crossed-out/strikethrough, overline, dim, blink, rapid blink, * reverse/invert video, hidden, superscript, subscript and alternate font codes, * clearing/resetting of foreground, background and underl...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts#L163-L305
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
set24BitColor
function set24BitColor(styleCodes: number[], colorType: 'foreground' | 'background' | 'underline'): void { if (styleCodes.length >= 5 && styleCodes[2] >= 0 && styleCodes[2] <= 255 && styleCodes[3] >= 0 && styleCodes[3] <= 255 && styleCodes[4] >= 0 && styleCodes[4] <= 255) { const customColor = new RGBA(st...
/** * Calculate and set styling for complicated 24-bit ANSI color codes. * @param styleCodes Full list of integer codes that make up the full ANSI * sequence, including the two defining codes and the three RGB codes. * @param colorType If `'foreground'`, will set foreground color, if * `'background'`, will se...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts#L316-L324
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
set8BitColor
function set8BitColor(styleCodes: number[], colorType: 'foreground' | 'background' | 'underline'): void { let colorNumber = styleCodes[2]; const color = calcANSI8bitColor(colorNumber); if (color) { changeColor(colorType, color); } else if (colorNumber >= 0 && colorNumber <= 15) { if (colorType === 'under...
/** * Calculate and set styling for advanced 8-bit ANSI color codes. * @param styleCodes Full list of integer codes that make up the ANSI * sequence, including the two defining codes and the one color code. * @param colorType If `'foreground'`, will set foreground color, if * `'background'`, will set backgrou...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts#L335-L359
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
setBasicColor
function setBasicColor(styleCode: number): void { let colorType: 'foreground' | 'background' | undefined; let colorIndex: number | undefined; if (styleCode >= 30 && styleCode <= 37) { colorIndex = styleCode - 30; colorType = 'foreground'; } else if (styleCode >= 90 && styleCode <= 97) { colorIndex = (...
/** * Calculate and set styling for basic bright and dark ANSI color codes. Uses * theme colors if available. Automatically distinguishes between foreground * and background colors; does not support color-clearing codes 39 and 49. * @param styleCode Integer color code on one of the following ranges: * [30-37,...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugANSIHandling.ts#L369-L391
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
findNextVisibleFrame
function findNextVisibleFrame(down: boolean, callStack: readonly IStackFrame[], startIndex: number) { if (startIndex >= callStack.length) { startIndex = callStack.length - 1; } else if (startIndex < 0) { startIndex = 0; } let index = startIndex; let currFrame; do { if (down) { if (index === callStack....
/** * Finds next frame that is not skipped by SkipFiles. Skips frame at index and starts searching at next. * Must satisfy `0 <= startIndex <= callStack - 1` * @param down specifies whether to search downwards if the current file is skipped. * @param callStack the call stack to search * @param startIndex the index...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugCommands.ts#L269-L302
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ConfigurationManager.hasDebugConfigurationProvider
hasDebugConfigurationProvider(debugType: string, triggerKind?: DebugConfigurationProviderTriggerKind): boolean { if (triggerKind === undefined) { triggerKind = DebugConfigurationProviderTriggerKind.Initial; } // check if there are providers for the given type that contribute a provideDebugConfigurations method...
/** * if scope is not specified,a value of DebugConfigurationProvideTrigger.Initial is assumed. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts#L118-L125
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DebugEditorContribution.onEditorMouseDown
private onEditorMouseDown(mouseEvent: IEditorMouseEvent): void { this.mouseDown = true; if (mouseEvent.target.type === MouseTargetType.CONTENT_WIDGET && mouseEvent.target.detail === DebugHoverWidget.ID) { return; } this.hideHoverWidget(); }
// hover business
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts#L451-L458
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DebugEditorContribution.toggleExceptionWidget
private async toggleExceptionWidget(): Promise<void> { // Toggles exception widget based on the state of the current editor model and debug stack frame const model = this.editor.getModel(); const focusedSf = this.debugService.getViewModel().focusedStackFrame; const callStack = focusedSf ? focusedSf.thread.getCa...
// exception widget
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts#L513-L539
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WordsToLineNumbersCache.ensureRangePopulated
public ensureRangePopulated(range: Range) { for (let lineNumber = range.startLineNumber; lineNumber <= range.endLineNumber; lineNumber++) { const bin = lineNumber >> 3; /* Math.floor(i / 8) */ const bit = 1 << (lineNumber & 0b111); /* 1 << (i % 8) */ if (!(this.intervals[bin] & bit)) { getWordToLineNumb...
/** Ensures that variables names in the given range have been identified. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts#L865-L874
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DebugHoverWidget.isInSafeTriangle
isInSafeTriangle(x: number, y: number) { return this._isVisible && !!this.safeTriangle?.contains(x, y); }
/** * Gets whether the given coordinates are in the safe triangle formed from * the position at which the hover was initiated. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugHover.ts#L239-L241
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DebugMemoryFileSystemProvider.stat
public stat(file: URI): Promise<IStat> { const { readOnly } = this.parseUri(file); return Promise.resolve({ type: FileType.File, mtime: 0, ctime: 0, size: 0, permissions: readOnly ? FilePermission.Readonly : undefined, }); }
/** @inheritdoc */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugMemory.ts#L73-L82
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DebugMemoryFileSystemProvider.mkdir
public mkdir(): never { throw createFileSystemProviderError(`Not allowed`, FileSystemProviderErrorCode.NoPermissions); }
/** @inheritdoc */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugMemory.ts#L85-L87
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DebugMemoryFileSystemProvider.readdir
public readdir(): never { throw createFileSystemProviderError(`Not allowed`, FileSystemProviderErrorCode.NoPermissions); }
/** @inheritdoc */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugMemory.ts#L90-L92
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DebugMemoryFileSystemProvider.delete
public delete(): never { throw createFileSystemProviderError(`Not allowed`, FileSystemProviderErrorCode.NoPermissions); }
/** @inheritdoc */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugMemory.ts#L95-L97
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DebugMemoryFileSystemProvider.rename
public rename(): never { throw createFileSystemProviderError(`Not allowed`, FileSystemProviderErrorCode.NoPermissions); }
/** @inheritdoc */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugMemory.ts#L100-L102
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DebugMemoryFileSystemProvider.open
public open(resource: URI, _opts: IFileOpenOptions): Promise<number> { const { session, memoryReference, offset } = this.parseUri(resource); const fd = this.memoryFdCounter++; let region = session.getMemory(memoryReference); if (offset) { region = new MemoryRegionView(region, offset); } this.fdMemory.se...
/** @inheritdoc */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugMemory.ts#L105-L115
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DebugMemoryFileSystemProvider.close
public close(fd: number) { this.fdMemory.get(fd)?.region.dispose(); this.fdMemory.delete(fd); return Promise.resolve(); }
/** @inheritdoc */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/debug/browser/debugMemory.ts#L118-L122
1a8578f21ace8c9381461d295ed31c3500be43bf