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
EditorGroupView.id
get id(): GroupIdentifier { return this.model.id; }
//#region basics()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L977-L979
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.openEditor
async openEditor(editor: EditorInput, options?: IEditorOptions, internalOptions?: IInternalEditorOpenOptions): Promise<IEditorPane | undefined> { return this.doOpenEditor(editor, options, { // Appply given internal open options ...internalOptions, // Allow to match on a side-by-side editor when same // ed...
//#region openEditor()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L1159-L1168
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.openEditors
async openEditors(editors: { editor: EditorInput; options?: IEditorOptions }[]): Promise<IEditorPane | undefined> { // Guard against invalid editors. Disposed editors // should never open because they emit no events // e.g. to indicate dirty changes. const editorsToOpen = coalesce(editors).filter(({ editor }) ...
//#region openEditors()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L1316-L1362
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.moveEditors
moveEditors(editors: { editor: EditorInput; options?: IEditorOptions }[], target: EditorGroupView): boolean { // Optimization: knowing that we move many editors, we // delay the title update to a later point for this group // through a method that allows for bulk updates but only // when moving to a different ...
//#region moveEditor()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L1368-L1398
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.copyEditors
copyEditors(editors: { editor: EditorInput; options?: IEditorOptions }[], target: EditorGroupView): void { // Optimization: knowing that we move many editors, we // delay the title update to a later point for this group // through a method that allows for bulk updates but only // when moving to a different gro...
//#region copyEditor()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L1497-L1518
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.closeEditor
async closeEditor(editor: EditorInput | undefined = this.activeEditor || undefined, options?: ICloseEditorOptions): Promise<boolean> { return this.doCloseEditorWithConfirmationHandling(editor, options); }
//#region closeEditor()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L1538-L1540
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.closeEditors
async closeEditors(args: EditorInput[] | ICloseEditorsFilter, options?: ICloseEditorOptions): Promise<boolean> { if (this.isEmpty) { return true; } const editors = this.doGetEditorsToClose(args); // Check for confirmation and veto const veto = await this.handleCloseConfirmation(editors.slice(0)); if (v...
//#region closeEditors()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L1867-L1884
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.closeAllEditors
async closeAllEditors(options?: ICloseAllEditorsOptions): Promise<boolean> { if (this.isEmpty) { // If the group is empty and the request is to close all editors, we still close // the editor group is the related setting to close empty groups is enabled for // a convenient way of removing empty editor group...
//#region closeAllEditors()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L1943-L1972
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.replaceEditors
async replaceEditors(editors: EditorReplacement[]): Promise<void> { // Extract active vs. inactive replacements let activeReplacement: EditorReplacement | undefined; const inactiveReplacements: EditorReplacement[] = []; for (let { editor, replacement, forceReplaceDirty, options } of editors) { const index =...
//#region replaceEditors()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L2005-L2073
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.isLocked
get isLocked(): boolean { return this.model.isLocked; }
//#region Locking
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L2079-L2081
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.createEditorActions
createEditorActions(disposables: DisposableStore): IActiveEditorActions { let actions: PrimaryAndSecondaryActions = { primary: [], secondary: [] }; let onDidChange; // Editor actions require the editor control to be there, so we retrieve it via service const activeEditorPane = this.activeEditorPane; if (act...
//#region Editor Actions
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L2091-L2119
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.updateStyles
override updateStyles(): void { const isEmpty = this.isEmpty; // Container if (isEmpty) { this.element.style.backgroundColor = this.getColor(EDITOR_GROUP_EMPTY_BACKGROUND) || ''; } else { this.element.style.backgroundColor = ''; } // Title control const borderColor = this.getColor(EDITOR_GROUP_HEA...
//#region Themable
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L2125-L2150
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupView.dispose
override dispose(): void { this._disposed = true; this._onWillDispose.fire(); super.dispose(); }
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorGroupView.ts#L2210-L2216
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorPanes.minimumWidth
get minimumWidth() { return this._activeEditorPane?.minimumWidth ?? DEFAULT_EDITOR_MIN_DIMENSIONS.width; }
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorPanes.ts#L78-L78
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorPart.minimumWidth
get minimumWidth(): number { return Math.min(this.centeredLayoutWidget.minimumWidth, this.layoutService.getMaximumEditorDimensions(this.layoutService.getContainer(getWindow(this.container))).width); }
// TODO @sbatten @joao find something better to prevent editor taking over #79897
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorPart.ts#L948-L948
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorParts.getOrCreatePreviewEditorPart
getOrCreatePreviewEditorPart(options?: IPreviewEditorPartOpenOptions): IPreviewEditorPart { const { part, instantiationService, disposables } = this.previewPartService.getOrCreateEditorGroupPart(this, undefined); if (!this.didInitializePreviewEditor) { // Keep instantiation service this.mapPartToInstantiati...
// @g-danna will improve on this.
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorParts.ts#L129-L145
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorParts.registerPart
override registerPart(part: EditorPart): IDisposable { const disposables = this._register(new DisposableStore()); disposables.add(super.registerPart(part)); this.registerEditorPartListeners(part, disposables); return disposables; }
//#region Registration
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorParts.ts#L151-L158
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorParts.activeGroup
get activeGroup(): IEditorGroupView { return this.activePart.activeGroup; }
//#region Group Management
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorParts.ts#L517-L519
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorParts.partOptions
get partOptions() { return this.mainPart.partOptions; }
//#region Main Editor Part Only
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/editorParts.ts#L839-L839
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
showContextMenu
const showContextMenu = (e: Event) => { EventHelper.stop(e); // Find target anchor let anchor: HTMLElement | StandardMouseEvent = tabsContainer; if (isMouseEvent(e)) { anchor = new StandardMouseEvent(getWindow(this.parent), e); } // Show it this.contextMenuService.showContextMenu({ getAnc...
// Context menu
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts#L448-L467
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
makeTabHoverBackgroundRule
const makeTabHoverBackgroundRule = (color: Color, colorDrag: Color, hasFocus = false) => ` .monaco-workbench .part.editor > .content:not(.dragged-over) .editor-group-container${hasFocus ? '.active' : ''} > .title .tabs-container > .tab.sizing-shrink:not(.dragged):not(.sticky-compact):hover > .tab-label > .monaco-ico...
// Adjust gradient for focused and unfocused hover background
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts#L2449-L2459
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
SideBySideEditor.minimumPrimaryWidth
private get minimumPrimaryWidth() { return this.primaryEditorPane ? this.primaryEditorPane.minimumWidth : 0; }
//#region Layout Constraints
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/sideBySideEditor.ts#L72-L72
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TextEditorPaneSelection.constructor
constructor( private readonly textSelection: Selection ) { }
// number of lines to move in editor to justify for significant change
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/editor/textEditor.ts#L354-L356
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PreviewEditorPart.activeGroup
get activeGroup() { const editorPart = this.assertEditorPartIsDefined(); return editorPart.activeGroup; }
// If you want to easily retrieve the "activeGroup" or create a new one here:
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/preview/previewPart.ts#L138-L141
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PreviewEditorPartImpl.removeGroup
override removeGroup(group: number | IEditorGroupView, preserveFocus?: boolean): void { if (this.count === 1 && this.activeGroup === this.assertGroupView(group)) { // If removing the last group, do something special (close the part?) // e.g. this.closePreview(); } else { super.removeGroup(group, preserveFo...
// you can override removeGroup(...) similarly to AuxiliaryEditorPartImpl:
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/preview/previewPart.ts#L201-L208
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
PreviewEditorPartImpl.loadState
protected override loadState() { return this.state; }
// group layouts as the main editor does.
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/preview/previewPart.ts#L212-L214
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
SidebarPart.constructor
constructor( @INotificationService notificationService: INotificationService, @IStorageService storageService: IStorageService, @IContextMenuService contextMenuService: IContextMenuService, @IWorkbenchLayoutService layoutService: IWorkbenchLayoutService, @IKeybindingService keybindingService: IKeybindingServi...
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/sidebar/sidebarPart.ts#L69-L116
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
StatusbarViewModel.entries
get entries(): IStatusbarViewModelEntry[] { return this._entries.slice(0); }
// Intentionally not using a map here since multiple entries can have the same ID
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/statusbar/statusbarModel.ts#L31-L31
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
StatusbarService.createAuxiliaryStatusbarPart
createAuxiliaryStatusbarPart(container: HTMLElement): IAuxiliaryStatusbarPart { // Container const statusbarPartContainer = document.createElement('footer'); statusbarPartContainer.classList.add('part', 'statusbar'); statusbarPartContainer.setAttribute('role', 'status'); statusbarPartContainer.style.position...
//#region Auxiliary Statusbar Parts
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts#L754-L777
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
updateActions
const updateActions = (menuActions: readonly IAction[], target: IAction[], topLevelTitle: string) => { target.splice(0); for (const menuItem of menuActions) { this.insertActionsBefore(menuItem, target); if (menuItem instanceof Separator) { target.push(menuItem); } else if (menuItem instanceof S...
// Update the menu actions
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/titlebar/menubarControl.ts#L623-L665
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BrowserTitleService.createAuxiliaryTitlebarPart
createAuxiliaryTitlebarPart(container: HTMLElement, editorGroupsContainer: IEditorGroupsContainer): IAuxiliaryTitlebarPart { const titlebarPartContainer = document.createElement('div'); titlebarPartContainer.classList.add('part', 'titlebar'); titlebarPartContainer.setAttribute('role', 'none'); titlebarPartConta...
//#region Auxiliary Titlebar Parts
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts#L151-L177
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
WindowTitle.getWindowTitle
getWindowTitle(): string { const editor = this.editorService.activeEditor; const workspace = this.contextService.getWorkspace(); // Compute root let root: URI | undefined; if (workspace.configuration) { root = workspace.configuration; } else if (workspace.folders.length) { root = workspace.folders[0]...
/** * Possible template values: * * {activeEditorLong}: e.g. /Users/Development/myFolder/myFileFolder/myFile.txt * {activeEditorMedium}: e.g. myFolder/myFileFolder/myFile.txt * {activeEditorShort}: e.g. myFile.txt * {activeFolderLong}: e.g. /Users/Development/myFolder/myFileFolder * {activeFolderMedium}: ...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/titlebar/windowTitle.ts#L290-L383
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TreeRenderer.constructor
constructor( private treeViewId: string, private menus: TreeMenus, private labels: ResourceLabels, private actionViewItemProvider: IActionViewItemProvider, private aligner: Aligner, private checkboxStateHandler: CheckboxStateHandler, private readonly manuallyManageCheckboxes: () => boolean, @IThemeServi...
// tree item handle to template data
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/views/treeView.ts#L1252-L1275
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TreeMenus.getResourceActions
getResourceActions(elements: ITreeItem[]): IAction[] { const actions = this.getActions(this.getMenuId(), elements); return actions.primary; }
/** * Gets only the actions that apply to all of the given elements. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/views/treeView.ts#L1646-L1649
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
TreeMenus.getResourceContextActions
getResourceContextActions(elements: ITreeItem[]): IAction[] { return this.getActions(this.getMenuId(), elements).secondary; }
/** * Gets only the actions that apply to all of the given elements. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/views/treeView.ts#L1654-L1656
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
FilterWidget.handleKeyboardEvent
private handleKeyboardEvent(event: StandardKeyboardEvent) { if (event.equals(KeyCode.Space) || event.equals(KeyCode.LeftArrow) || event.equals(KeyCode.RightArrow) || event.equals(KeyCode.Home) || event.equals(KeyCode.End) ) { event.stopPropagation(); } }
// Action toolbar is swallowing some keys for action items which should not be for an input box
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/browser/parts/views/viewFilter.ts#L230-L239
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
SaveSourceFactory.registerSource
registerSource(id: string, label: string): SaveSource { let sourceDescriptor = this.mapIdToSaveSource.get(id); if (!sourceDescriptor) { sourceDescriptor = { source: id, label }; this.mapIdToSaveSource.set(id, sourceDescriptor); } return sourceDescriptor.source; }
/** * Registers a `SaveSource` with an identifier and label * to the registry so that it can be used in save operations. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor.ts#L710-L718
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
fireNotificationChangeEvent
const fireNotificationChangeEvent = (kind: NotificationChangeType, detail?: NotificationViewItemContentChangeKind) => { const index = this._notifications.indexOf(item); if (index >= 0) { this._onDidChangeNotification.fire({ item, index, kind, detail }); } };
// Item Events
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/notifications.ts#L254-L259
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BinaryEditorModel.getName
getName(): string { return this.name; }
/** * The name of the binary resource. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/binaryEditorModel.ts#L32-L34
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BinaryEditorModel.getSize
getSize(): number | undefined { return this.size; }
/** * The size of the binary resource if known. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/binaryEditorModel.ts#L39-L41
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BinaryEditorModel.getMime
getMime(): string { return this.mime; }
/** * The mime of the binary resource if known. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/binaryEditorModel.ts#L46-L48
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BinaryEditorModel.getETag
getETag(): string | undefined { return this.etag; }
/** * The etag of the binary resource if known. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/binaryEditorModel.ts#L53-L55
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorGroupModel.active
private get active(): EditorInput | null { return this.selection[0] ?? null; }
// editors in selected state, first one is active
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/editorGroupModel.ts#L225-L227
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorModel.resolve
async resolve(): Promise<void> { this.resolved = true; }
/** * Causes this model to resolve returning a promise when loading is completed. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/editorModel.ts#L24-L26
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorModel.isResolved
isResolved(): boolean { return this.resolved; }
/** * Returns whether this model was loaded or not. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/editorModel.ts#L31-L33
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorModel.isDisposed
isDisposed(): boolean { return this._store.isDisposed; }
/** * Find out if this model has been disposed. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/editorModel.ts#L38-L40
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
EditorModel.dispose
override dispose(): void { this._onWillDispose.fire(); super.dispose(); }
/** * Subclasses should implement to free resources that have been claimed through loading. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/editorModel.ts#L45-L49
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BaseTextEditorModel.createTextEditorModel
protected createTextEditorModel(value: ITextBufferFactory, resource: URI | undefined, preferredLanguageId?: string): ITextModel { const firstLineText = this.getFirstLineText(value); const languageSelection = this.getOrCreateLanguage(resource, this.languageService, preferredLanguageId, firstLineText); return this...
/** * Creates the text editor model with the provided value, optional preferred language * (can be comma separated for multiple values) and optional resource URL. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/textEditorModel.ts#L161-L166
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BaseTextEditorModel.getOrCreateLanguage
protected getOrCreateLanguage(resource: URI | undefined, languageService: ILanguageService, preferredLanguage: string | undefined, firstLineText?: string): ILanguageSelection { // lookup language via resource path if the provided language is unspecific if (!preferredLanguage || preferredLanguage === PLAINTEXT_LANG...
/** * Gets the language for the given identifier. Subclasses can override to provide their own implementation of this lookup. * * @param firstLineText optional first line of the text buffer to set the language on. This can be used to guess a language from content. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/textEditorModel.ts#L203-L212
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BaseTextEditorModel.updateTextEditorModel
updateTextEditorModel(newValue?: ITextBufferFactory, preferredLanguageId?: string): void { if (!this.isResolved()) { return; } // contents if (newValue) { this.modelService.updateModel(this.textEditorModel, newValue); } // language (only if specific and changed) if (preferredLanguageId && preferre...
/** * Updates the text editor model with the provided value. If the value is the same as the model has, this is a no-op. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/common/editor/textEditorModel.ts#L217-L231
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInputPart.acceptInput
async acceptInput(isUserQuery?: boolean): Promise<void> { if (isUserQuery) { const userQuery = this._inputEditor.getValue(); const entry: IChatHistoryEntry = { text: userQuery, state: this.getInputState() }; this.history.replaceLast(entry); this.history.add({ text: '' }); this.resetCurrentLanguageModel...
/** * Reset the input and update history. * @param userQuery If provided, this will be added to the history. Followups and programmatic queries should not be passed. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/aideAgentInputPart.ts#L418-L436
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInputPart.createImageElements
private createImageElements(buffer: ArrayBuffer | Uint8Array, widget: HTMLElement, hoverElement: HTMLElement) { const blob = new Blob([buffer], { type: 'image/png' }); const url = URL.createObjectURL(blob); const pillImg = dom.$('img.chat-attached-context-pill-image', { src: url, alt: '' }); const pill = dom.$(...
// Helper function to create and replace image
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/aideAgentInputPart.ts#L1009-L1028
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatListItemRenderer.basicRenderElement
private basicRenderElement(element: ChatTreeItem, index: number, templateData: IChatListItemTemplate) { let value: IChatRendererContent[] = []; if (isRequestVM(element) && !element.confirmation) { const markdown = 'message' in element.message ? element.message.message : this.markdownDecorationsRenderer.c...
/* private renderAvatar(element: ChatTreeItem, templateData: IChatListItemTemplate): void { const icon = isResponseVM(element) ? this.getAgentIcon(element.agent?.metadata) : (element.avatarIcon ?? Codicon.account); if (icon instanceof URI) { const avatarIcon = dom.$<HTMLImageElement>('img.icon'); avata...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/aideAgentListRenderer.ts#L420-L495
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatListItemRenderer.doNextProgressiveRender
private doNextProgressiveRender(element: IChatResponseViewModel, index: number, templateData: IChatListItemTemplate, isInRenderElement: boolean): boolean { if (!this._isVisible) { return true; } if (element.isCanceled) { this.traceLayout('doNextProgressiveRender', `canceled, index=${index}`); element.re...
/** * @returns true if progressive rendering should be considered complete- the element's data is fully rendered or the view is not visible */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/aideAgentListRenderer.ts#L510-L537
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatListItemRenderer.getNextProgressiveRenderContent
private getNextProgressiveRenderContent(element: IChatResponseViewModel): IChatRendererContent[] { const renderableResponse = annotateSpecialMarkdownContent(element.response.value); const partsToRender: IChatRendererContent[] = []; // Simply add all parts to render partsToRender.push(...renderableResponse); ...
/** * Returns all content parts that should be rendered, and trimmed markdown content. We will diff this with the current rendered set. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/aideAgentListRenderer.ts#L584-L611
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
AideAgentTerminalService.doShowTerminal
private doShowTerminal(): void { if (!this.nextTerminalToShow) { return; } for (const terminal of this.terminalGroupService.instances) { if (terminal.metadata && terminal.metadata.hasOwnProperty('codestoryId')) { if (this.nextTerminalToShow === terminal.metadata.codestoryId) { this.terminalGroupSer...
// when we create a new terminal from the extension and we call aideAgentTerminals.showTerminal()
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/aideAgentTerminalServiceImpl.ts#L44-L58
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatWidget.setVisible
setVisible(visible: boolean): void { const wasVisible = this._visible; this._visible = visible; this.visibleChangeCount++; this.renderer.setVisible(visible); this.input.setVisible(visible); if (visible) { this._register(disposableTimeout(() => { // Progressive rendering paused while hidden, so start...
/* TODO(@ghostwriternr): Remove this when we get rid of followups private async renderFollowups(items: IChatFollowup[] | undefined, response?: IChatResponseViewModel): Promise<void> { this.inputPart.renderFollowups(items, response); if (this.bodyDimension) { this.layout(this.bodyDimension.height, this.bodyDime...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/aideAgentWidget.ts#L535-L553
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatWidget.setDynamicChatTreeItemLayout
setDynamicChatTreeItemLayout(numOfChatTreeItems: number, maxHeight: number) { this._dynamicMessageLayoutData = { numOfMessages: numOfChatTreeItems, maxHeight, enabled: true }; this._register(this.renderer.onDidChangeItemHeight(() => this.layoutDynamicChatTreeItemMode())); const mutableDisposable = this._register...
// TODO@TylerLeonhardt: This could use some refactoring to make it clear which layout strategy is being used
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/aideAgentWidget.ts#L1078-L1107
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
getChatFocusKeybindingLabel
function getChatFocusKeybindingLabel(keybindingService: IKeybindingService, type: 'panelChat' | 'inlineChat', focusInput?: boolean): string | undefined { let kbs; const fallback = ' (unassigned keybinding)'; if (focusInput) { kbs = keybindingService.lookupKeybindings('workbench.action.chat.focusInput'); } else { ...
// The when clauses for actions may not be true when we invoke the accessible view, so we need to provide the keybinding label manually
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/actions/aideAgentAccessibilityHelp.ts#L97-L117
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/aideAgent/browser/contrib/aideAgentInputCompletions.ts#L232-L237
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
BuiltinStaticCompletions.constructor
constructor( @ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService, @IAideAgentWidgetService private readonly chatWidgetService: IAideAgentWidgetService, ) { super(); this._register(this.languageFeaturesService.completionProvider.register({ scheme: ChatInputPart.INPUT_SC...
// MUST be using `g`-flag
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/contrib/aideAgentInputCompletions.ts#L337-L365
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
VariableCompletions.constructor
constructor( @ILanguageFeaturesService private readonly languageFeaturesService: ILanguageFeaturesService, @IAideAgentWidgetService private readonly chatWidgetService: IAideAgentWidgetService, @IAideAgentVariablesService private readonly chatVariablesService: IAideAgentVariablesService, @IConfigurationService c...
// MUST be using `g`-flag
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/browser/contrib/aideAgentInputCompletions.ts#L806-L884
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/aideAgent/common/aideAgentAgents.ts#L394-L398
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/aideAgent/common/aideAgentAgents.ts#L656-L661
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/aideAgent/common/aideAgentModel.ts#L488-L490
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/aideAgent/common/aideAgentModel.ts#L495-L502
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatModel.autoAcceptLastExchange
private autoAcceptLastExchange() { const editingSession = this.aideAgentCodeEditingService.getExistingCodeEditingSession(this.sessionId); if (editingSession) { editingSession.accept(); } }
// TODO(@ghostwriternr): This might break if we do proactive agent?
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/common/aideAgentModel.ts#L1083-L1088
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatModel.cancelResponse
cancelResponse(response: ChatResponseModel): void { if (response) { response.cancel(); } }
/* TODO(@ghostwriternr): This method was used to remove/resend requests. We can add it back in if we need it. removeRequest(id: string, reason: ChatRequestRemovalReason = ChatRequestRemovalReason.Removal): void { const index = this._exchanges.findIndex(request => request.id === id); const request = this._exchanges...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/common/aideAgentModel.ts#L1189-L1193
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatModel.completeResponse
completeResponse(response: ChatResponseModel): void { if (!response) { throw new Error('Call setResponse before completeResponse'); } response.complete(); this.lastExchangeComplete.set(true); }
/* TODO(@ghostwriternr): This method was used to link a response with a request. We may need this, but I'm assuming the shape will be a bit different? setResponse(request: ChatRequestModel, result: IChatAgentResult): void { if (!request.response) { request.response = new ChatResponseModel([], this, undefined, und...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/common/aideAgentModel.ts#L1205-L1212
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatModel.toExport
toExport(): IExportableChatData { return { requesterUsername: this.requesterUsername, requesterAvatarIconUri: this.requesterAvatarIconUri, responderUsername: this.responderUsername, responderAvatarIconUri: this.responderAvatarIcon, initialLocation: this.initialLocation, exchanges: this._exchanges.ma...
/* TODO(@ghostwriternr): Honestly, don't care about followups at the moment. setFollowups(request: ChatRequestModel, followups: IChatFollowup[] | undefined): void { if (!request.response) { // Maybe something went wrong? return; } request.response.setFollowups(followups); } */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/common/aideAgentModel.ts#L1225-L1278
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatService.getHistory
getHistory(): IChatDetail[] { const persistedSessions = Object.values(this._persistedSessions) .filter(session => session.exchanges.length > 0) .filter(session => !this._sessionModels.has(session.sessionId)); const persistedSessionItems = persistedSessions .filter(session => !session.isImported) .map(s...
/** * 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/aideAgent/common/aideAgentServiceImpl.ts#L317-L345
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatService.sendRequest
async sendRequest(sessionId: string, request: string, options?: IChatSendRequestOptions): Promise<IChatSendRequestData | undefined> { this.trace('sendRequest', `sessionId: ${sessionId}, message: ${request.substring(0, 20)}${request.length > 20 ? '[...]' : ''}}`); if (!request.trim() && !options?.slashCommand && !op...
/* TODO(@ghostwriternr): This method already seems unused. Remove it? async resendRequest(request: IChatRequestModel, options?: IChatSendRequestOptions): Promise<void> { const model = this._sessionModels.get(request.session.sessionId); if (!model && model !== request.session) { throw new Error(`Unknown session:...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/common/aideAgentServiceImpl.ts#L486-L526
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
completeResponseCreated
function completeResponseCreated(): void { /* TODO(@ghostwriternr): Debug this when something breaks (this comment sounds useless because I don't yet know what will break, I just know something will) if (!responseCreatedComplete && request?.response) { responseCreated.complete(request.response); responseC...
// let responseCreatedComplete = false;
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/common/aideAgentServiceImpl.ts#L561-L568
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatService.initiateResponse
async initiateResponse(sessionId: string): Promise<{ responseId: string; callback: (p: IChatProgress) => void; token: CancellationToken }> { const model = this._sessionModels.get(sessionId); if (!model) { throw new Error(`Unknown session: ${sessionId}`); } await model.waitForInitialization(); const respo...
/* TODO(@ghostwriternr): Remove this if we no longer need to remove requests. async removeRequest(sessionId: string, requestId: string): Promise<void> { const model = this._sessionModels.get(sessionId); if (!model) { throw new Error(`Unknown session: ${sessionId}`); } await model.waitForInitialization(); ...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/common/aideAgentServiceImpl.ts#L754-L776
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatResponseViewModel.isStale
get isStale() { return this._model.isStale; }
/* TODO(@ghostwriternr): Once we have a clear picture of how requests and responses are going to be linked, we can remove this entirely. get requestId() { return this._model.requestId; } */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/aideAgent/common/aideAgentViewModel.ts#L497-L499
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
makeGroupMoreMinimal
const makeGroupMoreMinimal = async (start: number, end: number) => { const oldEdits = edits.slice(start, end); const newEdits = await this._editorWorker.computeMoreMinimalEdits(ref.object.textEditorModel.uri, oldEdits.map(e => e.textEdit), false); if (!newEdits) { oldEdits.forEach(task.addEdit, tas...
// group edits by type (snippet, metadata, or simple) and make simple groups more minimal
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.ts#L250-L258
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
onDidChangeModel
const onDidChangeModel = (model: ITextModel) => { // conflict if (_workspaceEditResources.has(model.uri)) { this._conflicts.set(model.uri, true); this._onDidConflict.fire(this); } };
// listen to model changes...?
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/bulkEdit/browser/conflicts.ts#L76-L83
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
DiffHunkWidget.reject
reject(): void { if (this._versionId === this._editor.getModel()?.getVersionId()) { this.entry.rejectHunk(this._change); } }
// ---
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatEditorController.ts#L774-L778
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInputPart.hasInstructionAttachments
public get hasInstructionAttachments(): boolean { return !this.instructionAttachmentsPart.empty; }
/** * Check if the chat input part has any prompt instruction attachments. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatInputPart.ts#L218-L220
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInputPart.attemptedWorkingSetEntriesCount
public get attemptedWorkingSetEntriesCount() { return this._attemptedWorkingSetEntriesCount; }
/** * The number of working set entries that the user actually wanted to attach. * This is less than or equal to {@link ChatInputPart.chatEditWorkingSetFiles}. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatInputPart.ts#L318-L320
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInputPart.acceptInput
async acceptInput(isUserQuery?: boolean): Promise<void> { if (isUserQuery) { const userQuery = this._inputEditor.getValue(); const entry: IChatHistoryEntry = { text: userQuery, state: this.getInputState() }; this.history.replaceLast(entry); this.history.add({ text: '' }); } // Clear attached context,...
/** * Reset the input and update history. * @param userQuery If provided, this will be added to the history. Followups and programmatic queries should not be passed. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatInputPart.ts#L628-L645
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatInputPart.createImageElements
private createImageElements(buffer: ArrayBuffer | Uint8Array, widget: HTMLElement, hoverElement: HTMLElement) { const blob = new Blob([buffer], { type: 'image/png' }); const url = URL.createObjectURL(blob); const pillImg = dom.$('img.chat-attached-context-pill-image', { src: url, alt: '' }); const pill = dom.$(...
// Helper function to create and replace image
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatInputPart.ts#L1154-L1173
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatListItemRenderer.getProgressiveRenderRate
private getProgressiveRenderRate(element: IChatResponseViewModel): number { if (element.isComplete) { return 80; } if (element.contentUpdateTimings && element.contentUpdateTimings.impliedWordLoadRate) { const minRate = 5; const maxRate = 80; const rate = element.contentUpdateTimings.impliedWordLoadR...
/** * Compute a rate to render at in words/s. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatListRenderer.ts#L189-L203
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatListItemRenderer.doNextProgressiveRender
private doNextProgressiveRender(element: IChatResponseViewModel, index: number, templateData: IChatListItemTemplate, isInRenderElement: boolean): boolean { if (!this._isVisible) { return true; } if (element.isCanceled) { this.traceLayout('doNextProgressiveRender', `canceled, index=${index}`); element.re...
/** * @returns true if progressive rendering should be considered complete- the element's data is fully rendered or the view is not visible */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatListRenderer.ts#L616-L670
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatListItemRenderer.getNextProgressiveRenderContent
private getNextProgressiveRenderContent(element: IChatResponseViewModel): { content: IChatRendererContent[]; moreContentAvailable: boolean } { const data = this.getDataForProgressiveRender(element); const renderableResponse = annotateSpecialMarkdownContent(element.response.value); this.traceLayout('getNextProgr...
/** * Returns all content parts that should be rendered, and trimmed markdown content. We will diff this with the current rendered set. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatListRenderer.ts#L717-L777
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
refreshTokens
function refreshTokens(commandService: ICommandService): void { // ugly, but we need to signal to the extension that entitlements changed commandService.executeCommand('github.copilot.signIn'); commandService.executeCommand('github.copilot.refreshToken'); }
//#endregion
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatSetup.ts#L1367-L1371
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
ChatWidget.setDynamicChatTreeItemLayout
setDynamicChatTreeItemLayout(numOfChatTreeItems: number, maxHeight: number) { this._dynamicMessageLayoutData = { numOfMessages: numOfChatTreeItems, maxHeight, enabled: true }; this._register(this.renderer.onDidChangeItemHeight(() => this.layoutDynamicChatTreeItemMode())); const mutableDisposable = this._register...
// TODO@TylerLeonhardt: This could use some refactoring to make it clear which layout strategy is being used
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatWidget.ts#L1234-L1263
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
getChatFocusKeybindingLabel
function getChatFocusKeybindingLabel(keybindingService: IKeybindingService, type: 'panelChat' | 'inlineChat' | 'quickChat', focusInput?: boolean): string | undefined { let kbs; const fallback = ' (unassigned keybinding)'; if (focusInput) { kbs = keybindingService.lookupKeybindings('workbench.action.chat.focusInput...
// The when clauses for actions may not be true when we invoke the accessible view, so we need to provide the keybinding label manually
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.ts#L147-L174
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
isPromptInstructionsQuickPickItem
function isPromptInstructionsQuickPickItem(obj: unknown): obj is IPromptInstructionsQuickPickItem { if (!obj || typeof obj !== 'object') { return false; } return ('kind' in obj && obj.kind === 'prompt-instructions'); }
/** * Checks is a provided object is a prompt instructions quick pick item. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.ts#L130-L136
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InstructionAttachmentsWidget.onAttachmentsCountChange
public onAttachmentsCountChange(callback: () => unknown): this { this._register(this._onAttachmentsCountChange.event(callback)); return this; }
/** * Subscribe to the `onAttachmentsCountChange` event. * @param callback Function to invoke when number of attachments change. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/attachments/instructionsAttachment/instructionAttachments.ts#L36-L40
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InstructionAttachmentsWidget.references
public get references(): readonly URI[] { return this.model.references; }
/** * 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/attachments/instructionsAttachment/instructionAttachments.ts#L51-L53
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InstructionAttachmentsWidget.chatAttachments
public get chatAttachments() { return this.model.chatAttachments; }
/** * 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/attachments/instructionsAttachment/instructionAttachments.ts#L59-L61
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InstructionAttachmentsWidget.empty
public get empty(): boolean { return this.children.length === 0; }
/** * Check if child widget list is empty (no attachments present). */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/attachments/instructionsAttachment/instructionAttachments.ts#L66-L68
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InstructionAttachmentsWidget.handleAttachmentDispose
public handleAttachmentDispose(widget: InstructionsAttachmentWidget): this { // common prefix for all log messages const logPrefix = `[onChildDispose] Widget for instructions attachment '${widget.uri.path}'`; // flag to check if the widget was found in the children list let widgetExists = false; // filter o...
/** * Handle child widget disposal. * @param widget The child widget that was disposed. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/attachments/instructionsAttachment/instructionAttachments.ts#L108-L151
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InstructionAttachmentsWidget.render
private render(): this { // set visibility of the root node based on the presence of attachments dom.setVisibility(!this.empty, this.domNode); return this; }
/** * Render this widget. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/attachments/instructionsAttachment/instructionAttachments.ts#L156-L161
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InstructionAttachmentsWidget.dispose
public override dispose(): void { for (const child of this.children) { child.dispose(); } super.dispose(); }
/** * Dispose of the widget, including all the child * widget instances. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/attachments/instructionsAttachment/instructionAttachments.ts#L167-L173
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InstructionsAttachmentWidget.uri
public get uri(): URI { return this.model.reference.uri; }
/** * Get the `URI` associated with the model reference. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/attachments/instructionsAttachment/instructionsAttachment.ts#L42-L44
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InstructionsAttachmentWidget.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/attachments/instructionsAttachment/instructionsAttachment.ts#L56-L60
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
InstructionsAttachmentWidget.render
private render() { dom.clearNode(this.domNode); this.renderDisposables.clear(); this.domNode.classList.remove('warning', 'error', 'disabled'); const { topError } = this.model; const label = this.resourceLabels.create(this.domNode, { supportIcons: true }); const file = this.model.reference.uri; const fi...
/** * Render this widget. */
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/attachments/instructionsAttachment/instructionsAttachment.ts#L95-L176
1a8578f21ace8c9381461d295ed31c3500be43bf
aide
github_2023
codestoryai
typescript
toChatVariable
const toChatVariable = ( reference: Pick<IPromptFileReference, 'uri' | 'isPromptSnippet'>, isRoot: boolean, ): IChatRequestVariableEntry => { const { uri } = reference; // default `id` is the stringified `URI` let id = `${uri}`; // for prompt files, we add a prefix to the `id` if (reference.isPromptSnippet) { ...
/** * Utility to convert a {@link reference} to a chat variable entry. * The `id` of the chat variable can be one of the following: * * - `vscode.prompt.instructions__<URI>`: for all non-root prompt file references * - `vscode.prompt.instructions.root__<URI>`: for *root* prompt file references * - `<URI>`: for th...
https://github.com/codestoryai/aide/blob/1a8578f21ace8c9381461d295ed31c3500be43bf/src/vs/workbench/contrib/chat/browser/chatAttachmentModel/chatInstructionAttachmentsModel.ts#L29-L62
1a8578f21ace8c9381461d295ed31c3500be43bf