jiebi/CodeConvo huggingface dataset:
if (!this.galleryService.isEnabled()) { throw new ExtensionManagementError(nls.localize('MarketPlaceDisabled', "Marketplace is not enabled"), ExtensionManagementErrorCode.Internal); } <del> const compatible = await this.checkAndGetCompatibleVersion(extension, !options.installGivenVersion, !!options.installPreReleaseVersion); </del> <ins> const compatible = await this.checkAndGetCompatibleVersion(extension, !!options.installGivenVersion, !!options.installPreReleaseVersion); </ins> return await this.installExtension(compatible.manifest, compatible.extension, options); } catch (error) { reportTelemetry(this.telemetryService, 'extensionGallery:install', { extensionData: getGalleryExtensionTelemetryData(extension), error });
const isDependency = dependecies.some(id => areSameExtensions({ id }, galleryExtension.identifier)); let compatible; try { <del> compatible = await this.checkAndGetCompatibleVersion(galleryExtension, true, installPreRelease); </del> <ins> compatible = await this.checkAndGetCompatibleVersion(galleryExtension, false, installPreRelease); </ins> } catch (error) { if (error instanceof ExtensionManagementError && error.code === ExtensionManagementErrorCode.IncompatibleTargetPlatform && !isDependency) { this.logService.info('Skipping the packed extension as it cannot be installed', galleryExtension.identifier.id);
return allDependenciesAndPacks.filter(e => !installed.some(i => areSameExtensions(i.identifier, e.gallery.identifier))); } <del> private async checkAndGetCompatibleVersion(extension: IGalleryExtension, fetchCompatibleVersion: boolean, installPreRelease: boolean): Promise<{ extension: IGalleryExtension; manifest: IExtensionManifest }> { </del> <ins> private async checkAndGetCompatibleVersion(extension: IGalleryExtension, sameVersion: boolean, installPreRelease: boolean): Promise<{ extension: IGalleryExtension; manifest: IExtensionManifest }> { </ins> const report = await this.getExtensionsControlManifest(); if (getMaliciousExtensionsSet(report).has(extension.identifier.id)) { throw new ExtensionManagementError(nls.localize('malicious extension', "Can't install '{0}' extension since it was reported to be problematic.", extension.identifier.id), ExtensionManagementErrorCode.Malicious);
throw new ExtensionManagementError(nls.localize('incompatible platform', "The '{0}' extension is not available in {1} for {2}.", extension.identifier.id, this.productService.nameLong, TargetPlatformToString(targetPlatform)), ExtensionManagementErrorCode.IncompatibleTargetPlatform); } <del> const compatibleExtension = await this.getCompatibleVersion(extension, fetchCompatibleVersion, installPreRelease); </del> <ins> const compatibleExtension = await this.getCompatibleVersion(extension, sameVersion, installPreRelease); </ins> if (compatibleExtension) { <del> if (installPreRelease && fetchCompatibleVersion && extension.hasPreReleaseVersion && !compatibleExtension.properties.isPreReleaseVersion) { </del> <ins> if (installPreRelease && !sameVersion && extension.hasPreReleaseVersion && !compatibleExtension.properties.isPreReleaseVersion) { </ins> throw new ExtensionManagementError(nls.localize('notFoundCompatiblePrereleaseDependency', "Can't install pre-release version of '{0}' extension because it is not compatible with the current version of {1} (version {2}).", extension.identifier.id, this.productService.nameLong, this.productService.version), ExtensionManagementErrorCode.IncompatiblePreRelease); } } else {
return { extension: compatibleExtension, manifest }; } <del> protected async getCompatibleVersion(extension: IGalleryExtension, fetchCompatibleVersion: boolean, includePreRelease: boolean): Promise<IGalleryExtension | null> { </del> <ins> protected async getCompatibleVersion(extension: IGalleryExtension, sameVersion: boolean, includePreRelease: boolean): Promise<IGalleryExtension | null> { </ins> const targetPlatform = await this.getTargetPlatform(); let compatibleExtension: IGalleryExtension | null = null; <del> if (fetchCompatibleVersion && extension.hasPreReleaseVersion && extension.properties.isPreReleaseVersion !== includePreRelease) { </del> <ins> if (!sameVersion && extension.hasPreReleaseVersion && extension.properties.isPreReleaseVersion !== includePreRelease) { </ins> compatibleExtension = (await this.galleryService.getExtensions([{ ...extension.identifier, preRelease: includePreRelease }], { targetPlatform, compatible: true }, CancellationToken.None))[0] || null; }
compatibleExtension = extension; } <del> if (!compatibleExtension && fetchCompatibleVersion) { compatibleExtension = await this.galleryService.getCompatibleExtension(extension, includePreRelease, targetPlatform); </del> <ins> if (!compatibleExtension) { if (sameVersion) { compatibleExtension = (await this.galleryService.getExtensions([{ ...extension.identifier, version: extension.version }], { targetPlatform, compatible: true }, CancellationToken.None))[0] || null; } else { compatibleExtension = await this.galleryService.getCompatibleExtension(extension, includePreRelease, targetPlatform); } </ins> } return compatibleExtension;
throw new Error('Missing gallery'); } <del> const [gallery] = await this.galleryService.getExtensions([{ id: extension.gallery.identifier.id, version }], CancellationToken.None); </del> <ins> const targetPlatform = extension.server ? await extension.server.extensionManagementService.getTargetPlatform() : undefined; const [gallery] = await this.galleryService.getExtensions([{ id: extension.gallery.identifier.id, version }], { targetPlatform }, CancellationToken.None); </ins> if (!gallery) { throw new Error(nls.localize('not found', "Unable to install extension '{0}' because the requested version '{1}' is not found.", extension.gallery!.identifier.id, version)); }
return this.installExtension(manifest, location, options); } <del> protected override async getCompatibleVersion(extension: IGalleryExtension, fetchCompatibleVersion: boolean, includePreRelease: boolean): Promise<IGalleryExtension | null> { const compatibleExtension = await super.getCompatibleVersion(extension, fetchCompatibleVersion, includePreRelease); </del> <ins> protected override async getCompatibleVersion(extension: IGalleryExtension, sameVersion: boolean, includePreRelease: boolean): Promise<IGalleryExtension | null> { const compatibleExtension = await super.getCompatibleVersion(extension, sameVersion, includePreRelease); </ins> if (compatibleExtension) { return compatibleExtension; }
constructor() { super({ <del> id: 'workbench.action.clearCommandHistory', title: { value: localize('clearCommandHistory', "Clear Command History"), original: 'Clear Command History' }, </del> <ins> id: 'workbench.action.clearPreviousSessionCommandHistory', title: { value: localize('clearPreviousSessionCommandHistory', "Clear Previous Session Command History"), original: 'Clear Previous Session Command History' }, </ins> f1: true }); }
// Ask for confirmation const { confirmed } = await dialogService.confirm({ <del> message: localize('confirmClearMessage', "Do you want to clear the history of recently used commands?"), </del> <ins> message: localize('confirmClearMessage', "Do you want to clear the previous session command history?"), </ins> detail: localize('confirmClearDetail', "This action is irreversible!"), primaryButton: localize({ key: 'clearButtonLabel', comment: ['&& denotes a mnemonic'] }, "&&Clear"), type: 'warning'
registerAction2(class extends Action2 { constructor() { super({ <del> id: TerminalCommandId.ClearCommandHistory, title: { value: localize('workbench.action.terminal.clearCommandHistory', "Clear Command History"), original: 'Clear Command History' }, </del> <ins> id: TerminalCommandId.ClearPreviousSessionHistory, title: { value: localize('workbench.action.terminal.clearPreviousSessionHistory', "Clear Previous Session History"), original: 'Clear Previous Session History' }, </ins> f1: true, category, precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated)
MoveToEditorInstance = 'workbench.action.terminal.moveToEditorInstance', MoveToTerminalPanel = 'workbench.action.terminal.moveToTerminalPanel', SetDimensions = 'workbench.action.terminal.setDimensions', <del> ClearCommandHistory = 'workbench.action.terminal.clearCommandHistory', </del> <ins> ClearPreviousSessionHistory = 'workbench.action.terminal.clearPreviousSessionHistory', </ins> WriteDataToTerminal = 'workbench.action.terminal.writeDataToTerminal', ShowTextureAtlas = 'workbench.action.terminal.showTextureAtlas', ShowTerminalAccessibilityHelp = 'workbench.action.terminal.showAccessibilityHelp',
} .monaco-workbench .editor-instance .terminal-group .monaco-split-view2.horizontal .split-view-view:first-child .xterm, <del> .monaco-workbench .pane-body.integrated-terminal .terminal-group .monaco-split-view2.horizontal .split-view-view:first-child .xterm { </del> <ins> .monaco-workbench .pane-body.integrated-terminal .terminal-group .monaco-split-view2.horizontal .split-view-view:first-child .xterm, .monaco-workbench .editor-instance .terminal-group .monaco-split-view2.horizontal .split-view-view .xterm.shell-integration, .monaco-workbench .pane-body.integrated-terminal .terminal-group .monaco-split-view2.horizontal .split-view-view .xterm.shell-integration, .monaco-split-view2.vertical .split-view-view .xterm.shell-integration { </ins> padding-left: 20px; } .monaco-workbench .editor-instance .terminal-group .monaco-split-view2.horizontal .split-view-view:last-child .xterm, .monaco-workbench .pane-body.integrated-terminal .terminal-group .monaco-split-view2.horizontal .split-view-view:last-child .xterm { padding-right: 20px;
e.affectsConfiguration(TerminalSettingId.TerminalDescription)) { this._labelComputer?.refreshLabel(); } <ins> if ((e.affectsConfiguration(TerminalSettingId.ShellIntegrationDecorationsEnabled) && !this._configurationService.getValue(TerminalSettingId.ShellIntegrationDecorationsEnabled)) || (e.affectsConfiguration(TerminalSettingId.ShellIntegrationEnabled) && !this._configurationService.getValue(TerminalSettingId.ShellIntegrationEnabled))) { this.xterm?.clearDecorations(); } </ins> })); this._workspaceContextService.onDidChangeWorkspaceFolders(() => this._labelComputer?.refreshLabel());
DefaultColor = 'default', Codicon = 'codicon', XtermDecoration = 'xterm-decoration', <del> FirstSplitContainer = '.pane-body.integrated-terminal .terminal-group .monaco-split-view2.horizontal .split-view-view:first-child .xterm' </del> <ins> ShellIntegration = 'shell-integration' </ins> } const enum DecorationStyles { DefaultDimension = 16, <del> MarginLeftFirstSplit = -17, MarginLeft = -12 </del> <ins> MarginLeft = -17, </ins> } interface IDisposableDecoration { decoration: IDecoration; disposables: IDisposable[]; exitCode?: number }
this._refreshClasses(); } else if (e.affectsConfiguration(TerminalSettingId.FontSize) || e.affectsConfiguration(TerminalSettingId.LineHeight)) { this.refreshLayouts(); <del> } else if (e.affectsConfiguration(TerminalSettingId.ShellIntegrationDecorationsEnabled) && !this._configurationService.getValue(TerminalSettingId.ShellIntegrationDecorationsEnabled)) { this._commandStartedListener?.dispose(); this._commandFinishedListener?.dispose(); this._clearDecorations(); </del> } }); }
} } <del> private _clearDecorations(): void { </del> <ins> public clearDecorations(disposeOfListeners?: boolean): void { if (disposeOfListeners) { this._commandStartedListener?.dispose(); this._commandFinishedListener?.dispose(); } </ins> this._placeholderDecoration?.dispose(); this._placeholderDecoration?.marker.dispose(); for (const value of this._decorations.values()) { <ins> value.decoration.element?.parentElement?.parentElement?.parentElement?.classList.remove(DecorationSelector.ShellIntegration); </ins> value.decoration.dispose(); value.decoration.marker.dispose(); dispose(value.disposables);
if (this._placeholderDecoration?.marker.id) { this._decorations.delete(this._placeholderDecoration?.marker.id); } <ins> if (command.command.trim().toLowerCase() === 'clear' || command.command.trim().toLowerCase() === 'cls') { this.clearDecorations(); return; } </ins> this._placeholderDecoration?.dispose(); this.registerCommandDecoration(command); });
const lineHeight = this._configurationService.inspect(TerminalSettingId.LineHeight).value; if (typeof fontSize === 'number' && typeof defaultFontSize === 'number' && typeof lineHeight === 'number') { const scalar = (fontSize / defaultFontSize) <= 1 ? (fontSize / defaultFontSize) : 1; // must be inlined to override the inlined styles from xterm element.style.width = `${scalar * DecorationStyles.DefaultDimension}px`; element.style.height = `${scalar * DecorationStyles.DefaultDimension * lineHeight}px`; element.style.fontSize = `${scalar * DecorationStyles.DefaultDimension}px`; <del> // the first split terminal in the panel has more room if (element.closest(DecorationSelector.FirstSplitContainer)) { element.style.marginLeft = `${scalar * DecorationStyles.MarginLeftFirstSplit}px`; } else { element.style.marginLeft = `${scalar * DecorationStyles.MarginLeft}px`; } </del> <ins> element.style.marginLeft = `${scalar * DecorationStyles.MarginLeft}px`; </ins> } }
element.classList.remove(classes); } element.classList.add(DecorationSelector.CommandDecoration, DecorationSelector.Codicon, DecorationSelector.XtermDecoration); <ins> element.parentElement?.parentElement?.parentElement?.classList.add(DecorationSelector.ShellIntegration); </ins> if (exitCode === undefined) { element.classList.add(DecorationSelector.DefaultColor); element.classList.add(`codicon-${this._configurationService.getValue(TerminalSettingId.ShellIntegrationDecorationIcon)}`);
.monaco-hover p, .monaco-hover .code, <del> .monaco-hover ul { </del> <ins> .monaco-hover ul, .monaco-hover h1, .monaco-hover h2, .monaco-hover h3, .monaco-hover h4, .monaco-hover h5, .monaco-hover h6 { </ins> margin: 8px 0; } <ins> .monaco-hover h1, .monaco-hover h2, .monaco-hover h3, .monaco-hover h4, .monaco-hover h5, .monaco-hover h6 { line-height: 1.1; } </ins> .monaco-hover code { font-family: var(--monaco-monospace-font); }
let resolverData: Map<string, ResolverData> | undefined; <del> async function quickResolve(that: AbstractTaskService, identifier: string | TaskIdentifier) { </del> <ins> async function quickResolve(that: AbstractTaskService, uri: URI | string, identifier: string | TaskIdentifier) { </ins> const foundTasks = await that._findWorkspaceTasks((task: Task | ConfiguringTask): boolean => { <ins> const taskUri = ((ConfiguringTask.is(task) || CustomTask.is(task)) ? task._source.config.workspaceFolder?.uri : undefined); const originalUri = (typeof uri === 'string' ? uri : uri.toString()); if (taskUri?.toString() !== originalUri) { return false; } </ins> if (Types.isString(identifier)) { return ((task._label === identifier) || (task.configurationProperties.identifier === identifier)); } else {
// of untitled model if it is a valid path name, // otherwise fallback to `basename`. let untitledName = model.name; <del> if (!(await this.pathService.hasValidBasename(joinPath(defaultFilePath, untitledName)))) { </del> <ins> if (!(await this.pathService.hasValidBasename(joinPath(defaultFilePath, untitledName), untitledName))) { </ins> untitledName = basename(resource); }
import * as vscode from 'vscode'; import { CommandManager } from './commandManager'; import * as commands from './commands/index'; <ins> import { MdDefinitionProvider } from './languageFeatures/definitionProvider'; </ins> import { MdLinkProvider } from './languageFeatures/documentLinkProvider'; import { MdDocumentSymbolProvider } from './languageFeatures/documentSymbolProvider'; import { registerDropIntoEditor } from './languageFeatures/dropIntoEditor';
vscode.languages.registerWorkspaceSymbolProvider(new MdWorkspaceSymbolProvider(symbolProvider, workspaceContents)), vscode.languages.registerReferenceProvider(selector, referencesProvider), vscode.languages.registerRenameProvider(selector, new MdRenameProvider(referencesProvider, workspaceContents, githubSlugifier)), <ins> vscode.languages.registerDefinitionProvider(selector, new MdDefinitionProvider(referencesProvider)), </ins> MdPathCompletionProvider.register(selector, engine, linkProvider), registerDropIntoEditor(selector), registerFindFileReferences(commandManager, referencesProvider),
<ins> /*--------------------------------------------------------------------------------------------- *  Copyright (c) Microsoft Corporation. All rights reserved. *  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import * as vscode from 'vscode'; import { Disposable } from '../util/dispose'; import { SkinnyTextDocument } from '../workspaceContents'; import { MdReferencesProvider } from './references'; export class MdDefinitionProvider extends Disposable implements vscode.DefinitionProvider { constructor(private readonly referencesProvider: MdReferencesProvider) { super(); } async provideDefinition(document: SkinnyTextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise<vscode.Definition | undefined> { const allRefs = await this.referencesProvider.getAllReferencesAtPosition(document, position, token); return allRefs.find(ref => ref.kind === 'link' && ref.isDefinition)?.location; } } </ins>
private setViewState(state: IViewState): void { this.viewState = state; this.stylesheet.textContent = ` <del> .monaco-editor .dirty-diff-modified,.monaco-editor .dirty-diff-added{border-left-width:${state.width}px;} </del> <ins> .monaco-editor .dirty-diff-modified { background-size: ${state.width}px 4.5px; } .monaco-editor .dirty-diff-modified, .monaco-editor .dirty-diff-added{border-left-width:${state.width}px;} </ins> .monaco-editor .dirty-diff-modified, .monaco-editor .dirty-diff-added, .monaco-editor .dirty-diff-deleted { opacity: ${state.visibility === 'always' ? 1 : 0}; }
deserialize(serialized: ISerializedCommandDetectionCapability): void; } <ins> export interface IHandleCommandStartOptions { /** * Whether to allow an empty command to be registered. This should be used to support certain * shell integration scripts/features where tracking the command line may not be possible. */ ignoreCommandLine?: boolean; } </ins> export interface INaiveCwdDetectionCapability { readonly type: TerminalCapability.NaiveCwdDetection; readonly onDidChangeCwd: Event<string>;
import { debounce } from 'vs/base/common/decorators'; import { Emitter } from 'vs/base/common/event'; import { ILogService } from 'vs/platform/log/common/log'; <del> import { ICommandDetectionCapability, TerminalCapability, ITerminalCommand } from 'vs/platform/terminal/common/capabilities/capabilities'; </del> <ins> import { ICommandDetectionCapability, TerminalCapability, ITerminalCommand, IHandleCommandStartOptions } from 'vs/platform/terminal/common/capabilities/capabilities'; </ins> import { ISerializedCommand, ISerializedCommandDetectionCapability } from 'vs/platform/terminal/common/terminalProcess'; // Importing types is safe in any layer // eslint-disable-next-line code-import-patterns
private _commandMarkers: IMarker[] = []; private _dimensions: ITerminalDimensions; private __isCommandStorageDisabled: boolean = false; <ins> private _handleCommandStartOptions?: IHandleCommandStartOptions; </ins> get commands(): readonly ITerminalCommand[] { return this._commands; } get executingCommand(): string | undefined { return this._currentCommand.command; } // TODO: as is unsafe here and it duplicates behavor of executingCommand
this._logService.debug('CommandDetectionCapability#handleRightPromptEnd', this._currentCommand.commandRightPromptEndX); } <del> handleCommandStart(): void { </del> <ins> handleCommandStart(options?: IHandleCommandStartOptions): void { this._handleCommandStartOptions = options; </ins> // Only update the column if the line has already been set if (this._currentCommand.commandStartMarker?.line === this._terminal.buffer.active.cursorY) { this._currentCommand.commandStartX = this._terminal.buffer.active.cursorX;
return; } <del> if (command !== undefined && !command.startsWith('')) { </del> <ins> if ((command !== undefined && !command.startsWith('')) || this._handleCommandStartOptions?.ignoreCommandLine) { </ins> const buffer = this._terminal.buffer.active; const timestamp = Date.now(); const executedMarker = this._currentCommand.commandExecutedMarker; const endMarker = this._currentCommand.commandFinishedMarker; const newCommand: ITerminalCommand = { <del> command, </del> <ins> command: this._handleCommandStartOptions?.ignoreCommandLine ? '' : (command || ''), </ins> marker: this._currentCommand.commandStartMarker, endMarker, executedMarker,
*--------------------------------------------------------------------------------------------*/ import { IShellIntegration } from 'vs/platform/terminal/common/terminal'; <del> import { Disposable, toDisposable } from 'vs/base/common/lifecycle'; </del> <ins> import { Disposable, dispose, IDisposable, toDisposable } from 'vs/base/common/lifecycle'; </ins> import { TerminalCapabilityStore } from 'vs/platform/terminal/common/capabilities/terminalCapabilityStore'; import { CommandDetectionCapability } from 'vs/platform/terminal/common/capabilities/commandDetectionCapability'; import { CwdDetectionCapability } from 'vs/platform/terminal/common/capabilities/cwdDetectionCapability';
@ILogService private readonly _logService: ILogService ) { super(); <del> this._register(toDisposable(() => this._clearActivationTimeout())); </del> <ins> this._register(toDisposable(() => { this._clearActivationTimeout(); this._disposeCommonProtocol(); })); } private _disposeCommonProtocol(): void { dispose(this._commonProtocolDisposables); this._commonProtocolDisposables.length = 0; </ins> } activate(xterm: Terminal) { this._terminal = xterm; this.capabilities.add(TerminalCapability.PartialCommandDetection, new PartialCommandDetectionCapability(this._terminal)); this._register(xterm.parser.registerOscHandler(ShellIntegrationOscPs.VSCode, data => this._handleVSCodeSequence(data))); <ins> this._commonProtocolDisposables.push( xterm.parser.registerOscHandler(ShellIntegrationOscPs.FinalTerm, data => this._handleFinalTermSequence(data)) ); </ins> this._ensureCapabilitiesOrAddFailureTelemetry(); } <ins> private _handleFinalTermSequence(data: string): boolean { if (!this._terminal) { return false; } // Pass the sequence along to the capability // It was considered to disable the common protocol in order to not confuse the VS Code // shell integration if both happen for some reason. This doesn't work for powerlevel10k // when instant prompt is enabled though. If this does end up being a problem we could pass // a type flag through the capability calls const [command, ...args] = data.split(';'); switch (command) { case 'A': this._createOrGetCommandDetection(this._terminal).handlePromptStart(); return true; case 'B': // Ignore the command line for these sequences as it's unreliable for example in powerlevel10k this._createOrGetCommandDetection(this._terminal).handleCommandStart({ ignoreCommandLine: true }); return true; case 'C': this._createOrGetCommandDetection(this._terminal).handleCommandExecuted(); return true; case 'D': { const exitCode = args.length === 1 ? parseInt(args[0]) : undefined; this._createOrGetCommandDetection(this._terminal).handleCommandFinished(exitCode); return true; } } return false; } </ins> private _handleVSCodeSequence(data: string): boolean { const didHandle = this._doHandleVSCodeSequence(data); if (!this._hasUpdatedTelemetry && didHandle) {