jiebi/CodeConvo huggingface dataset:
private renderMarkerStatusbar(context: IEditorHoverRenderContext, markerHover: MarkerHover, disposables: DisposableStore): void { if (markerHover.marker.severity === MarkerSeverity.Error || markerHover.marker.severity === MarkerSeverity.Warning || markerHover.marker.severity === MarkerSeverity.Info) { <del> context.statusBar.addAction({ label: nls.localize('view problem', "View Problem"), commandId: NextMarkerAction.ID, run: () => { context.hide(); MarkerController.get(this._editor)?.showAtMarker(markerHover.marker); this._editor.focus(); } }); </del> <ins> const markerController = MarkerController.get(this._editor); if (markerController) { context.statusBar.addAction({ label: nls.localize('view problem', "View Problem"), commandId: NextMarkerAction.ID, run: () => { context.hide(); markerController.showAtMarker(markerHover.marker); this._editor.focus(); } }); } </ins> } if (!this._editor.getOption(EditorOption.readOnly)) {
import { getWindow, runWhenWindowIdle } from 'vs/base/browser/dom'; import { onUnexpectedError } from 'vs/base/common/errors'; <del> import { Disposable, DisposableMap } from 'vs/base/common/lifecycle'; </del> <ins> import { Disposable, DisposableMap, IDisposable } from 'vs/base/common/lifecycle'; </ins> import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; import { EditorContributionInstantiation, IEditorContributionDescription } from 'vs/editor/browser/editorExtensions'; import { IEditorContribution } from 'vs/editor/common/editorCommon';
this._instantiateSome(EditorContributionInstantiation.BeforeFirstInteraction); } <del> public onAfterModelAttached(): void { this._register(runWhenWindowIdle(getWindow(this._editor?.getDomNode()), () => { </del> <ins> public onAfterModelAttached(): IDisposable { return runWhenWindowIdle(getWindow(this._editor?.getDomNode()), () => { </ins> this._instantiateSome(EditorContributionInstantiation.AfterFirstRender); <del> }, 50)); </del> <ins> }, 50); </ins> } private _instantiateSome(instantiation: EditorContributionInstantiation): void {
private _sessionCtor: CancelablePromise<void> | undefined; private _activeSession?: Session; private _warmupRequestCts?: CancellationTokenSource; <ins> private _activeRequestCts?: CancellationTokenSource; </ins> private readonly _ctxHasActiveRequest: IContextKey<boolean>; private readonly _ctxCellWidgetFocused: IContextKey<boolean>; private readonly _ctxUserDidEdit: IContextKey<boolean>;
//TODO: update progress in a newly inserted cell below the widget instead of the fake editor <del> const requestCts = new CancellationTokenSource(); </del> <ins> this._activeRequestCts?.cancel(); this._activeRequestCts = new CancellationTokenSource(); </ins> const progressEdits: TextEdit[][] = []; const progressiveEditsQueue = new Queue(); const progressiveEditsClock = StopWatch.create(); const progressiveEditsAvgDuration = new MovingAverage(); <del> const progressiveEditsCts = new CancellationTokenSource(requestCts.token); </del> <ins> const progressiveEditsCts = new CancellationTokenSource(this._activeRequestCts.token); </ins> let progressiveChatResponse: IInlineChatMessageAppender | undefined; const progress = new AsyncProgress<IInlineChatProgressItem>(async data => { // console.log('received chunk', data, request); <del> if (requestCts.token.isCancellationRequested) { </del> <ins> if (this._activeRequestCts?.token.isCancellationRequested) { </ins> return; }
this._widget?.inlineChatWidget.updateInfo(!this._activeSession.lastExchange ? localize('thinking', "Thinkingu2026") : ''); this._ctxHasActiveRequest.set(true); <del> const reply = await raceCancellationError(Promise.resolve(task), requestCts.token); </del> <ins> const reply = await raceCancellationError(Promise.resolve(task), this._activeRequestCts.token); </ins> if (progressiveEditsQueue.size > 0) { // we must wait for all edits that came in via progress to complete await Event.toPromise(progressiveEditsQueue.onDrained);
this._widget?.inlineChatWidget.updateInfo(''); this._widget?.inlineChatWidget.updateToolbar(true); <del> this._activeSession.addExchange(new SessionExchange(this._activeSession.lastInput, response)); </del> <ins> this._activeSession?.addExchange(new SessionExchange(this._activeSession.lastInput, response)); </ins> this._ctxLastResponseType.set(response instanceof ReplyResponse ? response.raw.type : undefined); }
this._strategy?.cancel(); } <del> if (this._activeSession) { this._inlineChatSessionService.releaseSession(this._activeSession); } this._activeSession = undefined; </del> <ins> this._activeRequestCts?.cancel(); </ins> } discard() { this._strategy?.cancel(); <ins> this._activeRequestCts?.cancel(); </ins> this._widget?.discardChange(); this.dismiss(); }
const titleElement = container.querySelector('.title') as HTMLElement; const setHeader = () => { <del> const workspace = this.contextService.getWorkspace(); const title = workspace.folders.map(folder => folder.name).join(); </del> titleElement.textContent = this.name; <del> this.updateTitle(title); </del> <ins> this.updateTitle(this.name); </ins> this.ariaHeaderLabel = nls.localize('explorerSection', "Explorer Section: {0}", this.name); titleElement.setAttribute('aria-label', this.ariaHeaderLabel); };
.monaco-workbench .interactive-input-part .monaco-action-bar .action-label.codicon-loading.codicon-modifier-spin:not(.disabled)::before, .monaco-workbench .inline-chat .monaco-action-bar .action-label.codicon-loading.codicon-modifier-spin:not(.disabled)::before { content: "ec1c"; <ins> font-family: 'codicon'; </ins> } /*
.monaco-workbench.reduce-motion .interactive-input-part .monaco-action-bar .action-label.codicon-loading.codicon-modifier-spin:not(.disabled)::before, .monaco-workbench.reduce-motion .inline-chat .monaco-action-bar .action-label.codicon-loading.codicon-modifier-spin:not(.disabled)::before { content: "ead7"; <ins> font-family: 'codicon'; </ins> }
private readonly _groupLookup: Map<number, IEditorTabGroupDto> = new Map(); // Lookup table for finding tab by id private readonly _tabInfoLookup: Map<string, TabInfo> = new Map(); <ins> // Tracks the currently open MultiDiffEditorInputs to listen to resource changes private readonly _multiDiffEditorInputListeners: DisposableMap<MultiDiffEditorInput> = new DisposableMap(); </ins> constructor( extHostContext: IExtHostContext,
const tabObject = this._buildTabObject(group, editorInput, editorIndex); tabs.splice(editorIndex, 0, tabObject); // Update lookup <del> this._tabInfoLookup.set(this._generateTabId(editorInput, groupId), { group, editorInput, tab: tabObject }); </del> <ins> const tabId = this._generateTabId(editorInput, groupId); this._tabInfoLookup.set(tabId, { group, editorInput, tab: tabObject }); if (editorInput instanceof MultiDiffEditorInput) { this._multiDiffEditorInputListeners.set(editorInput, Event.fromObservableLight(editorInput.resources)(() => { const tabInfo = this._tabInfoLookup.get(tabId); if (!tabInfo) { return; } tabInfo.tab = this._buildTabObject(group, editorInput, editorIndex); this._proxy.$acceptTabOperation({ groupId, index: editorIndex, tabDto: tabInfo.tab, kind: TabModelOperationKind.TAB_UPDATE }); })); } </ins> this._proxy.$acceptTabOperation({ groupId,
return false; } <del> private readonly _resources = derived(this, reader => this._resolvedSource.cachedPromiseResult.read(reader)?.data?.resources.read(reader)); private readonly _isDirtyObservables = mapObservableArrayCached(this, this._resources.map(r => r ?? []), res => { </del> <ins> public readonly resources = derived(this, reader => this._resolvedSource.cachedPromiseResult.read(reader)?.data?.resources.read(reader)); private readonly _isDirtyObservables = mapObservableArrayCached(this, this.resources.map(r => r ?? []), res => { </ins> const isModifiedDirty = res.modified ? isUriDirty(this._textFileService, res.modified) : constObservable(false); const isOriginalDirty = res.original ? isUriDirty(this._textFileService, res.original) : constObservable(false); return derived(reader => /** @description modifiedDirty||originalDirty */ isModifiedDirty.read(reader) || isOriginalDirty.read(reader));
}, 500, false, true)(async (markerEvent) => { markerChanged?.dispose(); markerChanged = undefined; <del> if (!markerEvent.includes(modelEvent.uri) || (this.markerService.read({ resource: modelEvent.uri }).length !== 0)) { </del> <ins> if (!markerEvent || !markerEvent.includes(modelEvent.uri) || (this.markerService.read({ resource: modelEvent.uri }).length !== 0)) { </ins> return; } const oldLines = Array.from(this.lines);
if (this.extensionManagementServerService.localExtensionManagementServer === this.extension.server) { if (this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)) { if (this.extensionManagementServerService.remoteExtensionManagementServer) { <del> message = new MarkdownString(`${localize('Install in remote server to enable', "This extension is disabled in this workspace because it is defined to run in the Remote Extension Host. Please install the extension in '{0}' to enable.", this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${localize('learn more', "Learn More")}](https://aka.ms/vscode-remote/developing-extensions/architecture)`); </del> <ins> message = new MarkdownString(`${localize('Install in remote server to enable', "This extension is disabled in this workspace because it is defined to run in the Remote Extension Host. Please install the extension in '{0}' to enable.", this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${localize('learn more', "Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`); </ins> } } }
else if (this.extensionManagementServerService.remoteExtensionManagementServer === this.extension.server) { if (this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)) { if (this.extensionManagementServerService.localExtensionManagementServer) { <del> message = new MarkdownString(`${localize('Install in local server to enable', "This extension is disabled in this workspace because it is defined to run in the Local Extension Host. Please install the extension locally to enable.", this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${localize('learn more', "Learn More")}](https://aka.ms/vscode-remote/developing-extensions/architecture)`); </del> <ins> message = new MarkdownString(`${localize('Install in local server to enable', "This extension is disabled in this workspace because it is defined to run in the Local Extension Host. Please install the extension locally to enable.", this.extensionManagementServerService.remoteExtensionManagementServer.label)} [${localize('learn more', "Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`); </ins> } else if (isWeb) { <del> message = new MarkdownString(`${localize('Defined to run in desktop', "This extension is disabled because it is defined to run only in {0} for the Desktop.", this.productService.nameLong)} [${localize('learn more', "Learn More")}](https://aka.ms/vscode-remote/developing-extensions/architecture)`); </del> <ins> message = new MarkdownString(`${localize('Defined to run in desktop', "This extension is disabled because it is defined to run only in {0} for the Desktop.", this.productService.nameLong)} [${localize('learn more', "Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`); </ins> } } } // Extension on Web Server else if (this.extensionManagementServerService.webExtensionManagementServer === this.extension.server) { <del> message = new MarkdownString(`${localize('Cannot be enabled', "This extension is disabled because it is not supported in {0} for the Web.", this.productService.nameLong)} [${localize('learn more', "Learn More")}](https://aka.ms/vscode-remote/developing-extensions/architecture)`); </del> <ins> message = new MarkdownString(`${localize('Cannot be enabled', "This extension is disabled because it is not supported in {0} for the Web.", this.productService.nameLong)} [${localize('learn more', "Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`); </ins> } if (message) { this.updateStatus({ icon: warningIcon, message }, true);
const runningExtensionServer = runningExtension ? this.extensionManagementServerService.getExtensionManagementServer(toExtension(runningExtension)) : null; if (this.extension.server === this.extensionManagementServerService.localExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.remoteExtensionManagementServer) { if (this.extensionManifestPropertiesService.prefersExecuteOnWorkspace(this.extension.local.manifest)) { <del> this.updateStatus({ icon: infoIcon, message: new MarkdownString(`${localize('enabled remotely', "This extension is enabled in the Remote Extension Host because it prefers to run there.")} [${localize('learn more', "Learn More")}](https://aka.ms/vscode-remote/developing-extensions/architecture)`) }, true); </del> <ins> this.updateStatus({ icon: infoIcon, message: new MarkdownString(`${localize('enabled remotely', "This extension is enabled in the Remote Extension Host because it prefers to run there.")} [${localize('learn more', "Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`) }, true); </ins> } return; } if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.localExtensionManagementServer) { if (this.extensionManifestPropertiesService.prefersExecuteOnUI(this.extension.local.manifest)) { <del> this.updateStatus({ icon: infoIcon, message: new MarkdownString(`${localize('enabled locally', "This extension is enabled in the Local Extension Host because it prefers to run there.")} [${localize('learn more', "Learn More")}](https://aka.ms/vscode-remote/developing-extensions/architecture)`) }, true); </del> <ins> this.updateStatus({ icon: infoIcon, message: new MarkdownString(`${localize('enabled locally', "This extension is enabled in the Local Extension Host because it prefers to run there.")} [${localize('learn more', "Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`) }, true); </ins> } return; } if (this.extension.server === this.extensionManagementServerService.remoteExtensionManagementServer && runningExtensionServer === this.extensionManagementServerService.webExtensionManagementServer) { if (this.extensionManifestPropertiesService.canExecuteOnWeb(this.extension.local.manifest)) { <del> this.updateStatus({ icon: infoIcon, message: new MarkdownString(`${localize('enabled in web worker', "This extension is enabled in the Web Worker Extension Host because it prefers to run there.")} [${localize('learn more', "Learn More")}](https://aka.ms/vscode-remote/developing-extensions/architecture)`) }, true); </del> <ins> this.updateStatus({ icon: infoIcon, message: new MarkdownString(`${localize('enabled in web worker', "This extension is enabled in the Web Worker Extension Host because it prefers to run there.")} [${localize('learn more', "Learn More")}](https://code.visualstudio.com/api/advanced-topics/remote-extensions#architecture-and-extension-kinds)`) }, true); </ins> } return; }
when: ContextKeyExpr.or(ContextKeyExpr.and(CONTEXT_IN_CHAT_SESSION, CONTEXT_IN_CHAT_INPUT.negate()), accessibleViewInCodeBlock), primary: KeyMod.CtrlCmd | KeyCode.Enter, mac: { primary: KeyMod.WinCtrl | KeyCode.Enter }, <del> weight: KeybindingWeight.WorkbenchContrib </del> <ins> weight: KeybindingWeight.ExternalExtension + 1 </ins> }, }); }
// Only allow history navigation when the input is empty. // (If this model change happened as a result of a history navigation, this is canceled out by a call in this.navigateHistory) const model = this._inputEditor.getModel(); <del> const inputHasText = !!model && model.getValueLength() > 0; </del> <ins> const inputHasText = !!model && model.getValue().trim().length > 0; </ins> this.inputEditorHasText.set(inputHasText); // If the user is typing on a history entry, then reset the onHistoryEntry flag so that history navigation can be disabled
import { editorBackground, editorForeground, inputBackground } from 'vs/platform/theme/common/colorRegistry'; import { ChatModel } from 'vs/workbench/contrib/chat/common/chatModel'; import { Range } from 'vs/editor/common/core/range'; <ins> import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; </ins> export class InlineChatContentWidget implements IContentWidget {
constructor( private readonly _editor: ICodeEditor, @IInstantiationService instaService: IInstantiationService, <ins> @IContextKeyService contextKeyService: IContextKeyService, </ins> ) { this._defaultChatModel = this._store.add(instaService.createInstance(ChatModel, `inlineChatDefaultModel/editorContentWidgetPlaceholder`, undefined)); <del> this._widget = instaService.createInstance( </del> <ins> const scopedInstaService = instaService.createChild( new ServiceCollection([ IContextKeyService, this._store.add(contextKeyService.createScoped(this._domNode)) ]) ); this._widget = scopedInstaService.createInstance( </ins> ChatWidget, ChatAgentLocation.Editor, { resource: true },
// if agent has a refer command, massage the input to include the agent name await this._instaService.invokeFunction(sendRequest, massagedInput); <del> if (!this._session.lastExchange) { // DONE when there wasn't any exchange yet. We used the inline chat only as trampoline return State.ACCEPT; } return State.WAIT_FOR_INPUT; </del> <ins> return State.ACCEPT; </ins> } this._session.addInput(new SessionPrompt(input, this._nextAttempt, this._nextWithIntentDetection));
import { IChatService } from 'vs/workbench/contrib/chat/common/chatService'; import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget'; import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory'; <ins> import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; </ins> export interface InlineChatWidgetViewState {
this._store.add(this._progressBar); let allowRequests = false; <del> this._chatWidget = _instantiationService.createInstance( </del> <ins> const scopedInstaService = _instantiationService.createChild( new ServiceCollection([ IContextKeyService, this._store.add(_contextKeyService.createScoped(this._elements.chatWidget)) ]) ); this._chatWidget = scopedInstaService.createInstance( </ins> ChatWidget, location, { resource: true },
get contentHeight(): number { const data = { followUpsHeight: getTotalHeight(this._elements.followUps), <del> chatWidgetHeight: this._chatWidget.contentHeight, </del> <ins> chatWidgetContentHeight: this._chatWidget.contentHeight, </ins> progressHeight: getTotalHeight(this._elements.progress), statusHeight: getTotalHeight(this._elements.status), extraHeight: this._getExtraHeight() }; <del> const result = data.progressHeight + data.chatWidgetHeight + data.followUpsHeight + data.statusHeight + data.extraHeight; // console.log(`InlineChat#contentHeight ${result}`, data); </del> <ins> const result = data.progressHeight + data.chatWidgetContentHeight + data.followUpsHeight + data.statusHeight + data.extraHeight; </ins> return result; } <ins> get minHeight(): number { // The chat widget is variable height and supports scrolling. It // should be at least 100px high and at most the content height. let value = this.contentHeight; value -= this._chatWidget.contentHeight; value += Math.min(100, this._chatWidget.contentHeight); return value; } </ins> protected _getExtraHeight(): number { return 12 /* padding */ + 2 /*border*/ + 12 /*shadow*/; }
const chatContentHeight = this.widget.contentHeight; const editorHeight = this.editor.getLayoutInfo().height; <del> const contentHeight = Math.min(chatContentHeight, editorHeight * 0.42); </del> <ins> const contentHeight = Math.min(chatContentHeight, Math.max(this.widget.minHeight, editorHeight * 0.42)); </ins> const heightInLines = contentHeight / this.editor.getOption(EditorOption.lineHeight); <del> // console.log('ZONE#_computeHeightInLines', { chatContentHeight, editorHeight, contentHeight, heightInLines }); </del> return heightInLines; }
background-color: var(--vscode-chat-list-background); } <ins> .interactive-item-container.interactive-request .header .monaco-toolbar { /* Take the partially-transparent background color override for request rows */ background-color: inherit; } </ins> .interactive-item-container .header .monaco-toolbar .checked.action-label, .interactive-item-container .header .monaco-toolbar .checked.action-label:hover { color: var(--vscode-inputOption-activeForeground) !important;
background-color: var(--vscode-inlineChat-regionHighlight); } <del> .monaco-workbench .inline-chat-slash-command { </del> <ins> .monaco-workbench .interactive-session .interactive-input-and-execute-toolbar .monaco-editor .inline-chat-slash-command { </ins> background-color: var(--vscode-chat-slashCommandBackground); <del> color: var(--vscode-chat-slashCommandForeground); </del> <ins> color: var(--vscode-chat-slashCommandForeground); /* Overrides the foreground color rule in chat.css */ </ins> border-radius: 4px; padding: 1px; }
private _getAccessibleViewHelpDialogContent(providerHasSymbols?: boolean): string { const navigationHint = this._getNavigationHint(); const goToSymbolHint = this._getGoToSymbolHint(providerHasSymbols); <del> const toolbarHint = localize('toolbar', "Navigate to the toolbar (Shift+Tab))."); </del> <ins> const toolbarHint = localize('toolbar', "Navigate to the toolbar (Shift+Tab)."); </ins> const chatHints = this._getChatHints(); let hint = localize('intro', "In the accessible view, you can:n");
if (insertIntoNewFileKb) { hint += localize('insertIntoNewFile', " - Insert the code block into a new file ({0}).n", insertIntoNewFileKb); } else { <del> hint += localize('insertIntoNewFileNoKb', " - Insert the code block into a new file by configuring a keybinding for the Chat: Insert at Cursor command.n"); </del> <ins> hint += localize('insertIntoNewFileNoKb', " - Insert the code block into a new file by configuring a keybinding for the Chat: Insert into New File command.n"); </ins> } if (runInTerminalKb) { hint += localize('runInTerminal', " - Run the code block in the terminal ({0}).n", runInTerminalKb);
let goToSymbolHint = ''; if (providerHasSymbols) { if (goToSymbolKb) { <del> goToSymbolHint = localize('goToSymbolHint', 'Go to a symbol ({0})', goToSymbolKb); </del> <ins> goToSymbolHint = localize('goToSymbolHint', 'Go to a symbol ({0}).', goToSymbolKb); </ins> } else { goToSymbolHint = localize('goToSymbolHintNoKb', 'To go to a symbol, configure a keybinding for the command Go To Symbol in Accessible View'); }