jiebi/CodeConvo huggingface dataset:
testLink('./foo'); testLink('../foo'); testLink('/a/long/path'); <ins> testLink('a/relative/path'); }); }); suite('preprocessPath', () => { test('Windows', () => { const linkHandler = new TestTerminalLinkHandler(null, new TestXterm(), Platform.Windows, null, new WorkspaceContextService(new TestWorkspace('C:base'))); let stub = sinon.stub(path, 'join', function (arg1, arg2) { return arg1 + '' + arg2; }); assert.equal(linkHandler.preprocessPath('./src/file1'), 'C:base./src/file1'); assert.equal(linkHandler.preprocessPath('srcfile2'), 'C:basesrcfile2'); assert.equal(linkHandler.preprocessPath('C:absolutepathfile3'), 'C:absolutepathfile3'); stub.restore(); }); test('Linux', () => { const linkHandler = new TestTerminalLinkHandler(null, new TestXterm(), Platform.Linux, null, new WorkspaceContextService(new TestWorkspace('/base'))); let stub = sinon.stub(path, 'join', function (arg1, arg2) { return arg1 + '/' + arg2; }); assert.equal(linkHandler.preprocessPath('./src/file1'), '/base/./src/file1'); assert.equal(linkHandler.preprocessPath('src/file2'), '/base/src/file2'); assert.equal(linkHandler.preprocessPath('/absolute/path/file3'), '/absolute/path/file3'); stub.restore(); }); test('No Workspace', () => { const linkHandler = new TestTerminalLinkHandler(null, new TestXterm(), Platform.Linux, null, new WorkspaceContextService(null)); assert.equal(linkHandler.preprocessPath('./src/file1'), null); assert.equal(linkHandler.preprocessPath('src/file2'), null); assert.equal(linkHandler.preprocessPath('/absolute/path/file3'), '/absolute/path/file3'); </ins> }); }); });  No newline at end of file
} public sendText(text: string, addNewLine: boolean): void { <del> if (addNewLine && text.substr(text.length - os.EOL.length) !== os.EOL) { text += os.EOL; </del> <ins> text = this._sanitizeInput(text); if (addNewLine && text.substr(text.length - 1) !== 'r') { text += 'r'; </ins> } this._process.send({ event: 'input',
} private _sanitizeInput(data: any) { <del> return typeof data === 'string' ? data.replace(TerminalInstance.EOL_REGEX, os.EOL) : data; </del> <ins> return typeof data === 'string' ? data.replace(TerminalInstance.WINDOWS_EOL_REGEX, 'r') : data; </ins> } protected _getCwd(shell: IShellLaunchConfig, workspace: IWorkspace): string {
return TPromise.wrapError(localize('unable', "Unable to resolve the resource without a debug session")); } const source = process.sources.get(resource.toString()); <del> const rawSource = source ? source.raw : { path: paths.normalize(resource.fsPath, true) }; </del> <ins> let rawSource: DebugProtocol.Source; if (source) { rawSource = source.raw; } else { // Remove debug: scheme rawSource = { path: resource.with({ scheme: '' }).toString(true) }; } </ins> return process.session.source({ sourceReference: source ? source.reference : undefined, source: rawSource }).then(response => { const mime = response.body.mimeType || guessMimeTypes(resource.toString())[0];
return ''; } <ins> private get selectedText(): string { const activeEditor = this.editorService.getActiveEditor(); if (activeEditor) { const editorControl = (<ICodeEditor>activeEditor.getControl()); if (editorControl) { const editorModel = editorControl.getModel(); const editorSelection = editorControl.getSelection(); if (editorModel && editorSelection) { return editorModel.getValueInRange(editorSelection); } } } return ''; } </ins> private getFilePath(): string { let input = this.editorService.getActiveEditorInput(); if (input instanceof DiffEditorInput) {
assert.strictEqual(configurationResolverService.resolve(workspace, 'abc ${lineNumber} xyz'), `abc ${editorService.mockLineNumber} xyz`); }); <ins> test('current selected text', () => { assert.strictEqual(configurationResolverService.resolve(workspace, 'abc ${selectedText} xyz'), `abc ${editorService.mockSelectedText} xyz`); }); </ins> test('substitute many', () => { if (platform.isWindows) { assert.strictEqual(configurationResolverService.resolve(workspace, '${workspaceFolder} - ${workspaceFolder}'), 'VSCodeworkspaceLocation - VSCodeworkspaceLocation');
public activeEditorOptions: IEditorOptions; public activeEditorPosition: Position; public mockLineNumber: number; <ins> public mockSelectedText: string; </ins> private callback: (method: string) => void; constructor(callback?: (method: string) => void) { this.callback = callback || ((s: string) => { }); this.mockLineNumber = 15; <ins> this.mockSelectedText = 'selected text'; </ins> } public openEditors(inputs: any[]): Promise {
getId: () => { return null; }, getControl: () => { return { <del> getSelection: () => { return { positionLineNumber: this.mockLineNumber }; } </del> <ins> getSelection: () => { return { positionLineNumber: this.mockLineNumber }; }, getModel: () => { return { getValueInRange: () => this.mockSelectedText }; } </ins> }; }, focus: () => { },
) { super(null, action, [], 0); <del> this.toDispose.push(this.outputService.onOutputChannel(() => this.setOptions(this.getOptions(), this.getSelected(undefined)))); </del> <ins> this.toDispose.push(this.outputService.onOutputChannel(() => { const activeChannelIndex = this.getSelected(this.outputService.getActiveChannel().id); this.setOptions(this.getOptions(), activeChannelIndex); })); </ins> this.toDispose.push(this.outputService.onActiveOutputChannel(activeChannelId => this.setOptions(this.getOptions(), this.getSelected(activeChannelId)))); this.toDispose.push(attachSelectBoxStyler(this.selectBox, themeService));
* * @param listener The listener function which takes the processes' data stream (including * ANSI escape sequences). <ins> * * @deprecated onLineData will replace this. </ins> */ onData(listener: (data: string) => void): IDisposable; /** <ins> * Attach a listener to listen for new lines added to this terminal instance. * * @param listener The listener function which takes new line strings added to the terminal, * excluding ANSI escape sequences. The line event will fire when an LF character is added to * the terminal (ie. the line is not wrapped), note that this means taht the line data will * never fire for the last line, until the line is ended with a LF character. The lineData * string will contain the fully wrapped line, not containing any LF/CR characters. */ onLineData(listener: (lineData: string) => void): IDisposable; /** </ins> * Attach a listener that fires when the terminal's pty process exits. * * @param listener The listener function which takes the processes' exit code, an exit code of
}; } <ins> public onLineData(listener: (lineData: string) => void): lifecycle.IDisposable { if (!this._xterm) { throw new Error('xterm must be initialized'); } const lineFeedListener = () => { const buffer = (<any>this._xterm.buffer); const newLine = buffer.lines.get(buffer.ybase + buffer.y); if (!newLine.isWrapped) { let i = buffer.ybase + buffer.y - 1; let lineData = buffer.translateBufferLineToString(i, true); while (i >= 0 && buffer.lines.get(i--).isWrapped) { lineData = buffer.translateBufferLineToString(i, true) + lineData; } listener(lineData); } }; this._xterm.on('lineFeed', lineFeedListener); return { dispose: () => { if (this._xterm) { this._xterm.off('lineFeed', lineFeedListener); } } }; } </ins> public onExit(listener: (exitCode: number) => void): lifecycle.IDisposable { if (this._process) { this._process.on('exit', listener);
const text = data.contents.join('n'); const newDocument = new DOMParser().parseFromString(text, 'text/html'); <ins> newDocument.querySelectorAll('a').forEach(a => { if (!a.title) { a.title = a.href; } }); </ins> // set base-url if applicable if (initData.baseUrl && newDocument.head.getElementsByTagName('base').length === 0) { const baseElement = newDocument.createElement('base');
} const padding = parseInt(getComputedStyle(document.querySelector('.terminal-outer-container')).paddingLeft.split('px')[0], 10); <ins> const paddingBottom = parseInt(getComputedStyle(document.querySelector('.terminal-wrapper.active')).paddingBottom.split('px')[0], 10); </ins> // Use left padding as right padding, right padding is not defined in CSS just in case // xterm.js causes an unexpected overflow. const innerWidth = width - padding * 2; <del> TerminalInstance._lastKnownDimensions = new Dimension(innerWidth, height); </del> <ins> const innerHeight = height - paddingBottom; TerminalInstance._lastKnownDimensions = new Dimension(innerWidth, innerHeight); </ins> return TerminalInstance._lastKnownDimensions; }
dom.addClass(this._wrapperElement, 'terminal-wrapper'); this._xtermElement = document.createElement('div'); <ins> // Attach the xterm object to the DOM, exposing it to the smoke tests (<any>this._wrapperElement).xterm = this._xterm; </ins> this._xterm.open(this._xtermElement); this._xterm.attachCustomKeyEventHandler((event: KeyboardEvent) => { // Disable all input if the terminal is exiting
import { SpectronApplication } from '../../spectron/application'; <del> export class Terminal { static TERMINAL_SELECTOR = '.panel.integrated-terminal'; static TERMINAL_ROWS_SELECTOR = `${Terminal.TERMINAL_SELECTOR} .xterm-rows > div`; static TERMINAL_CURSOR = `${Terminal.TERMINAL_SELECTOR} .terminal-cursor`; </del> <ins> const PANEL_SELECTOR = 'div[id="workbench.panel.terminal"]'; const XTERM_SELECTOR = `${PANEL_SELECTOR} .terminal-wrapper`; export class Terminal { </ins> constructor(private spectron: SpectronApplication) { } public async showTerminal(): Promise<void> { if (!await this.isVisible()) { await this.spectron.workbench.quickopen.runCommand('View: Toggle Integrated Terminal'); <del> await this.spectron.client.waitForElement(Terminal.TERMINAL_CURSOR); </del> <ins> await this.spectron.client.waitForElement(XTERM_SELECTOR); </ins> await this.waitForTerminalText(text => text.length > 0, 'Waiting for Terminal to be ready'); } } public async isVisible(): Promise<boolean> { <del> const element = await this.spectron.client.element(Terminal.TERMINAL_SELECTOR); </del> <ins> const element = await this.spectron.client.element(PANEL_SELECTOR); </ins> return !!element; }
} private async getTerminalText(): Promise<string[]> { <del> const linesText: string[] = await this.spectron.webclient.selectorExecute<string[]>(Terminal.TERMINAL_ROWS_SELECTOR, div => (Array.isArray(div) ? div : [div]) .map(element => { function getTextFromAll(spanElements: NodeList): string { let text = ''; for (let i = 0; i < spanElements.length; i++) { text += getText(spanElements.item(i) as HTMLElement); } return text; } function getText(spanElement: HTMLElement): string { if (spanElement.hasChildNodes()) { return getTextFromAll(spanElement.childNodes); } return spanElement.textContent || ''; } return getTextFromAll(element.querySelectorAll('span')); })); let lastLineIndex = 0; for (let index = 0; index < linesText.length; index++) { if (linesText[index].trim()) { lastLineIndex = index; </del> <ins> return await this.spectron.webclient.selectorExecute(XTERM_SELECTOR, div => { const xterm = (<any>(Array.isArray(div) ? div[0] : div)).xterm; const buffer = xterm.buffer; const lines: string[] = []; for (let i = 0; i < buffer.lines.length; i++) { lines.push(buffer.translateBufferLineToString(i, true)); } return lines; </ins> } <del> } return linesText.slice(0, lastLineIndex + 1); </del> <ins> ); </ins> } }  No newline at end of file
if (ref === '~') { const fileUri = Uri.file(path); const uriString = fileUri.toString(); <del> const [indexStatus] = repository.indexGroup.resourceStates.filter(r => r.original.toString() === uriString); </del> <ins> const [indexStatus] = repository.indexGroup.resourceStates.filter(r => r.resourceUri.toString() === uriString); </ins> ref = indexStatus ? '' : 'HEAD'; }
if (offset + needleLength > haystackLength) { return false; } <ins> const haystackUpper = haystack.toUpperCase(); const needleUpper = needle.toUpperCase(); </ins> for (let i = 0; i < needleLength; i++) { <del> if (haystack.charCodeAt(offset + i) !== needle.charCodeAt(i)) { </del> <ins> if (haystackUpper.charCodeAt(offset + i) !== needleUpper.charCodeAt(i)) { </ins> return false; } }
: nls.localize('links.command', "Ctrl + click to execute command") ); <del> const HOVER_MESSAGE_GENERAL_ALT = new MarkdownString().appendText(nls.localize('links.navigate.al', "Alt + click to follow link")); const HOVER_MESSAGE_COMMAND_ALT = new MarkdownString().appendText(nls.localize('links.command.al', "Alt + click to execute command")); </del> <ins> const HOVER_MESSAGE_GENERAL_ALT = new MarkdownString().appendText( platform.isMacintosh ? nls.localize('links.navigate.al.mac', "Option + click to follow link") : nls.localize('links.navigate.al', "Alt + click to follow link") ); const HOVER_MESSAGE_COMMAND_ALT = new MarkdownString().appendText( platform.isMacintosh ? nls.localize('links.command.al.mac', "Option + click to execute command") : nls.localize('links.command.al', "Alt + click to execute command") ); </ins> const decoration = { meta: ModelDecorationOptions.register({
const position = this.validatePosition(_position); const lineContent = this.getLineContent(position.lineNumber); const lineTokens = this._getLineTokens(position.lineNumber); <del> const offset = position.column - 1; const tokenIndex = lineTokens.findTokenIndexAtOffset(offset); </del> <ins> const tokenIndex = lineTokens.findTokenIndexAtOffset(position.column - 1); // (1). First try checking right biased word const [rbStartOffset, rbEndOffset] = TextModel._findLanguageBoundaries(lineTokens, tokenIndex); const rightBiasedWord = getWordAtText( position.column, LanguageConfigurationRegistry.getWordDefinition(lineTokens.getLanguageId(tokenIndex)), lineContent.substring(rbStartOffset, rbEndOffset), rbStartOffset ); if (rightBiasedWord) { return rightBiasedWord; } // (2). Else, if we were at a language boundary, check the left biased word if (tokenIndex > 0 && rbStartOffset === position.column - 1) { // edge case, where `position` sits between two tokens belonging to two different languages const [lbStartOffset, lbEndOffset] = TextModel._findLanguageBoundaries(lineTokens, tokenIndex - 1); const leftBiasedWord = getWordAtText( position.column, LanguageConfigurationRegistry.getWordDefinition(lineTokens.getLanguageId(tokenIndex - 1)), lineContent.substring(lbStartOffset, lbEndOffset), lbStartOffset ); if (leftBiasedWord) { return leftBiasedWord; } } return null; } private static _findLanguageBoundaries(lineTokens: LineTokens, tokenIndex: number): [number, number] { </ins> const languageId = lineTokens.getLanguageId(tokenIndex); // go left until a different language is hit
import * as assert from 'assert'; import { Event } from 'vs/base/common/event'; import URI from 'vs/base/common/uri'; <del> import { IDisposable, dispose } from 'vs/base/common/lifecycle'; </del> <ins> import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; </ins> import { TextModel } from 'vs/editor/common/model/textModel'; import { Handler } from 'vs/editor/common/editorCommon'; <del> import { ISuggestSupport, ISuggestResult, SuggestRegistry, SuggestTriggerKind } from 'vs/editor/common/modes'; </del> <ins> import { ISuggestSupport, ISuggestResult, SuggestRegistry, SuggestTriggerKind, LanguageIdentifier, TokenizationRegistry, IState, MetadataConsts } from 'vs/editor/common/modes'; </ins> import { SuggestModel, LineContext } from 'vs/editor/contrib/suggest/suggestModel'; import { TestCodeEditor, MockScopeLocation } from 'vs/editor/test/browser/testCodeEditor'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IStorageService, NullStorageService } from 'vs/platform/storage/common/storage'; import { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2'; import { ISelectedSuggestion } from 'vs/editor/contrib/suggest/suggestWidget'; <ins> import { MockMode } from 'vs/editor/test/common/mocks/mockMode'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { TokenizationResult2 } from 'vs/editor/common/core/token'; import { NULL_STATE } from 'vs/editor/common/modes/nullMode'; </ins> function createMockEditor(model: TextModel): TestCodeEditor { const contextKeyService = new MockContextKeyService();
ModelRawLinesDeleted, ModelRawLinesInserted } from 'vs/editor/common/model/textModelEvents'; import { TextModel } from 'vs/editor/common/model/textModel'; <ins> import { LanguageIdentifier, TokenizationRegistry, IState, MetadataConsts } from 'vs/editor/common/modes'; import { MockMode } from 'vs/editor/test/common/mocks/mockMode'; import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageConfigurationRegistry'; import { TokenizationResult2 } from 'vs/editor/common/core/token'; import { NULL_STATE } from 'vs/editor/common/modes/nullMode'; import { dispose, Disposable } from 'vs/base/common/lifecycle'; </ins> // --------- utils
suite('Editor Model - Words', () => { <del> var thisModel: TextModel; </del> <ins> const OUTER_LANGUAGE_ID = new LanguageIdentifier('outerMode', 3); const INNER_LANGUAGE_ID = new LanguageIdentifier('innerMode', 4); class OuterMode extends MockMode { constructor() { super(OUTER_LANGUAGE_ID); this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), {})); this._register(TokenizationRegistry.register(this.getLanguageIdentifier().language, { getInitialState: (): IState => NULL_STATE, tokenize: undefined, tokenize2: (line: string, state: IState): TokenizationResult2 => { const tokensArr: number[] = []; let prevLanguageId: LanguageIdentifier = undefined; for (let i = 0; i < line.length; i++) { const languageId = (line.charAt(i) === 'x' ? INNER_LANGUAGE_ID : OUTER_LANGUAGE_ID); if (prevLanguageId !== languageId) { tokensArr.push(i); tokensArr.push((languageId.id << MetadataConsts.LANGUAGEID_OFFSET)); } prevLanguageId = languageId; } const tokens = new Uint32Array(tokensArr.length); for (let i = 0; i < tokens.length; i++) { tokens[i] = tokensArr[i]; } return new TokenizationResult2(tokens, state); } })); } } class InnerMode extends MockMode { constructor() { super(INNER_LANGUAGE_ID); this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), {})); } } let disposables: Disposable[] = []; </ins> setup(() => { <del> var text = ['This text has some  words. ']; thisModel = TextModel.createFromString(text.join('n')); </del> <ins> disposables = []; </ins> }); teardown(() => { <del> thisModel.dispose(); </del> <ins> dispose(disposables); disposables = []; </ins> }); test('Get word at position', () => { <ins> const text = ['This text has some  words. ']; const thisModel = TextModel.createFromString(text.join('n')); disposables.push(thisModel); </ins> assert.deepEqual(thisModel.getWordAtPosition(new Position(1, 1)), { word: 'This', startColumn: 1, endColumn: 5 }); assert.deepEqual(thisModel.getWordAtPosition(new Position(1, 2)), { word: 'This', startColumn: 1, endColumn: 5 }); assert.deepEqual(thisModel.getWordAtPosition(new Position(1, 4)), { word: 'This', startColumn: 1, endColumn: 5 });
assert.deepEqual(thisModel.getWordAtPosition(new Position(1, 27)), null); assert.deepEqual(thisModel.getWordAtPosition(new Position(1, 28)), null); }); <ins> test('getWordAtPosition at embedded language boundaries', () => { const outerMode = new OuterMode(); const innerMode = new InnerMode(); disposables.push(outerMode, innerMode); const model = TextModel.createFromString('ab<xx>ab<x>', undefined, outerMode.getLanguageIdentifier()); disposables.push(model); assert.deepEqual(model.getWordAtPosition(new Position(1, 1)), { word: 'ab', startColumn: 1, endColumn: 3 }); assert.deepEqual(model.getWordAtPosition(new Position(1, 2)), { word: 'ab', startColumn: 1, endColumn: 3 }); assert.deepEqual(model.getWordAtPosition(new Position(1, 3)), { word: 'ab', startColumn: 1, endColumn: 3 }); assert.deepEqual(model.getWordAtPosition(new Position(1, 4)), { word: 'xx', startColumn: 4, endColumn: 6 }); assert.deepEqual(model.getWordAtPosition(new Position(1, 5)), { word: 'xx', startColumn: 4, endColumn: 6 }); assert.deepEqual(model.getWordAtPosition(new Position(1, 6)), { word: 'xx', startColumn: 4, endColumn: 6 }); assert.deepEqual(model.getWordAtPosition(new Position(1, 7)), { word: 'ab', startColumn: 7, endColumn: 9 }); }); </ins> });
import { toDisposable, DisposableStore, dispose } from 'vs/base/common/lifecycle'; import { StableEditorScrollState } from 'vs/editor/browser/core/editorState'; import { ICodeEditor, MouseTargetType, IViewZoneChangeAccessor, IActiveCodeEditor } from 'vs/editor/browser/editorBrowser'; <del> import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; </del> <ins> import { registerEditorContribution, EditorCommand, ServicesAccessor } from 'vs/editor/browser/editorExtensions'; </ins> import { IEditorContribution } from 'vs/editor/common/editorCommon'; import { IModelDecorationsChangeAccessor } from 'vs/editor/common/model'; import { CodeLensProviderRegistry, CodeLens } from 'vs/editor/common/modes';
import { EditorOption } from 'vs/editor/common/config/editorOptions'; import * as dom from 'vs/base/browser/dom'; import { hash } from 'vs/base/common/hash'; <ins> import { IQuickInputService, IQuickPickItem, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput'; </ins> export class CodeLensContribution implements IEditorContribution {
} }); } <ins> public getLenses(): CodeLensWidget[] { return this._lenses; } } export class ShowLensesInCurrentLineCommand extends EditorCommand { public runEditorCommand(accessor: ServicesAccessor, editor: ICodeEditor, args: any): void | Promise<void> { const quickInputService = accessor.get(IQuickInputService); const commandService = accessor.get(ICommandService); const notificationService = accessor.get(INotificationService); const lineNumber = editor.getSelection()?.positionLineNumber; const codelensController = editor.getContribution(CodeLensContribution.ID) as CodeLensContribution; const activeLensesWidgets = codelensController.getLenses().filter(lens => lens.getLineNumber() === lineNumber); const commandArguments: Map<string, any[] | undefined> = new Map(); const items: (IQuickPickItem | IQuickPickSeparator)[] = []; activeLensesWidgets.forEach(widget => { widget.getItems().forEach(codelens => { const command = codelens.symbol.command; if (!command) { return; } items.push({ id: command.id, label: command.title }); commandArguments.set(command.id, command.arguments); }); }); // We dont want an empty picker if (!items.length) { return; } quickInputService.pick(items, { canPickMany: false }).then(item => { const id = item.id!; commandService.executeCommand(id, ...(commandArguments.get(id) || [])).catch(err => notificationService.error(err)); }); } </ins> } registerEditorContribution(CodeLensContribution.ID, CodeLensContribution); <ins> const showLensesInCurrentLineCommand = new ShowLensesInCurrentLineCommand({ id: 'codelens.showLensesInCurrentLine', precondition: undefined }); showLensesInCurrentLineCommand.register(); </ins>
import { CancellationToken } from 'vs/base/common/cancellation'; import { IQuickPickItem, IPickOptions, IInputOptions, IQuickNavigateConfiguration, IQuickPick, IQuickInputButton, IInputBox, QuickPickInput } from 'vs/base/parts/quickinput/common/quickInput'; <del> export { IQuickPickItem, IPickOptions, IInputOptions, IQuickNavigateConfiguration, IQuickPick, IQuickInput, IQuickInputButton, IInputBox, IQuickPickItemButtonEvent, QuickPickInput, IQuickPickSeparator, IKeyMods } from 'vs/base/parts/quickinput/common/quickInput'; </del> <ins> export * from 'vs/base/parts/quickinput/common/quickInput'; </ins> export const IQuickInputService = createDecorator<IQuickInputService>('quickInputService');
configHelper: ITerminalConfigHelper, shellLaunchConfig: IShellLaunchConfig ): ITerminalInstance { <ins> const newTerminalSize = ((this._panelPosition === Position.BOTTOM ? this._container.clientWidth : this._container.clientHeight) / (this._terminalInstances.length + 1)); if (newTerminalSize < TERMINAL_MIN_USEFUL_SIZE) { return undefined; } </ins> const instance = this._terminalService.createInstance( terminalFocusContextKey, configHelper,