jiebi/CodeConvo huggingface dataset:
} /** <ins> * An error type for language model specific errors. * * Consumers of language models should check the code property to determine specific * failure causes, like `if(someError.code === vscode.LanguageModelError.NotFound.name) {...}` * for the case of referring to an unknown language model. */ export class LanguageModelError extends Error { /** * The language model does not exist. */ static NotFound(message?: string): LanguageModelError; /** * The requestor does not have permissions to use this * language model */ static NoPermissions(message?: string): LanguageModelError; /** * A code that identifies this error. * * Possible values are names of errors, like {@linkcode LanguageModelError.NotFound NotFound}, * or `Unknown` for unspecified errors from the language model itself. In the latter case the * `cause`-property will contain the actual error. */ readonly code: string; } /** </ins> * Options for making a chat request using a language model. * * @see {@link lm.chatRequest}
* @returns A thenable that resolves to a {@link LanguageModelChatResponse}. The promise will reject when making the request failed. */ // TODO@API refine doc <del> // TODO@API define specific error types? // TODO@API NAME: sendChatRequest, fetchChatResponse, makeChatRequest, chat, chatRequest sendChatRequest </del> // TODO@API ExtensionContext#permission#languageModels: { languageModel: string: LanguageModelAccessInformation} <ins> // TODO@API ✅ define specific error types? // TODO@API ✅ NAME: sendChatRequest, fetchChatResponse, makeChatRequest, chat, chatRequest sendChatRequest </ins> // TODO@API ✅ NAME: LanguageModelChatXYZMessage // TODO@API ✅ errors on everything that prevents us to make the actual request // TODO@API ✅ double auth
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { workbenchConfigurationNodeBase, Extensions as WorkbenchExtensions, IConfigurationMigrationRegistry, ConfigurationKeyValuePairs } from 'vs/workbench/common/configuration'; import { AccessibilityAlertSettingId, AccessibilitySignal } from 'vs/platform/accessibilitySignal/browser/accessibilitySignalService'; <del> import { ISpeechService } from 'vs/workbench/contrib/speech/common/speechService'; </del> <ins> import { ISpeechService, SPEECH_LANGUAGES, SPEECH_LANGUAGE_CONFIG } from 'vs/workbench/contrib/speech/common/speechService'; </ins> import { Disposable } from 'vs/base/common/lifecycle'; import { IWorkbenchContribution } from 'vs/workbench/common/contributions'; import { Event } from 'vs/base/common/event';
export const enum AccessibilityVoiceSettingId { SpeechTimeout = 'accessibility.voice.speechTimeout', <del> SpeechLanguage = 'accessibility.voice.speechLanguage' </del> <ins> SpeechLanguage = SPEECH_LANGUAGE_CONFIG </ins> } export const SpeechTimeoutDefault = 1200; <del> const SpeechLanguageDefault = 'en-US'; </del> export class DynamicSpeechAccessibilityConfiguration extends Disposable implements IWorkbenchContribution {
'tags': ['accessibility'] }, [AccessibilityVoiceSettingId.SpeechLanguage]: { <del> 'markdownDescription': localize('voice.speechLanguage', "The language that voice speech recognition should recognize."), </del> <ins> 'markdownDescription': localize('voice.speechLanguage', "The language that voice speech recognition should recognize. Select `auto` to use the configured display language if possible. Note that not all display languages maybe supported by speech recognition"), </ins> 'type': 'string', 'enum': languagesSorted, <del> 'default': SpeechLanguageDefault, </del> <ins> 'default': 'auto', </ins> 'tags': ['accessibility'], 'enumDescriptions': languagesSorted.map(key => languages[key].name), 'enumItemLabels': languagesSorted.map(key => languages[key].name)
private getLanguages(): { [locale: string]: { name: string } } { return { <del> ['da-DK']: { name: localize('speechLanguage.da-DK', "Danish (Denmark)") </del> <ins> ['auto']: { name: localize('speechLanguage.auto', "Auto (Use Display Language)") </ins> }, <del> ['de-DE']: { name: localize('speechLanguage.de-DE', "German (Germany)") }, ['en-AU']: { name: localize('speechLanguage.en-AU', "English (Australia)") }, ['en-CA']: { name: localize('speechLanguage.en-CA', "English (Canada)") }, ['en-GB']: { name: localize('speechLanguage.en-GB', "English (United Kingdom)") }, ['en-IE']: { name: localize('speechLanguage.en-IE', "English (Ireland)") }, ['en-IN']: { name: localize('speechLanguage.en-IN', "English (India)") }, ['en-NZ']: { name: localize('speechLanguage.en-NZ', "English (New Zealand)") }, [SpeechLanguageDefault]: { name: localize('speechLanguage.en-US', "English (United States)") }, ['es-ES']: { name: localize('speechLanguage.es-ES', "Spanish (Spain)") }, ['es-MX']: { name: localize('speechLanguage.es-MX', "Spanish (Mexico)") }, ['fr-CA']: { name: localize('speechLanguage.fr-CA', "French (Canada)") }, ['fr-FR']: { name: localize('speechLanguage.fr-FR', "French (France)") }, ['hi-IN']: { name: localize('speechLanguage.hi-IN', "Hindi (India)") }, ['it-IT']: { name: localize('speechLanguage.it-IT', "Italian (Italy)") }, ['ja-JP']: { name: localize('speechLanguage.ja-JP', "Japanese (Japan)") }, ['ko-KR']: { name: localize('speechLanguage.ko-KR', "Korean (South Korea)") }, ['nl-NL']: { name: localize('speechLanguage.nl-NL', "Dutch (Netherlands)") }, ['pt-PT']: { name: localize('speechLanguage.pt-PT', "Portuguese (Portugal)") }, ['pt-BR']: { name: localize('speechLanguage.pt-BR', "Portuguese (Brazil)") }, ['ru-RU']: { name: localize('speechLanguage.ru-RU', "Russian (Russia)") }, ['sv-SE']: { name: localize('speechLanguage.sv-SE', "Swedish (Sweden)") }, ['tr-TR']: { name: localize('speechLanguage.tr-TR', "Turkish (Turkey)") }, ['zh-CN']: { name: localize('speechLanguage.zh-CN', "Chinese (Simplified, China)") }, ['zh-HK']: { name: localize('speechLanguage.zh-HK', "Chinese (Traditional, Hong Kong)") }, ['zh-TW']: { name: localize('speechLanguage.zh-TW', "Chinese (Traditional, Taiwan)") } </del> <ins> ...SPEECH_LANGUAGES </ins> }; } }
import { ILogService } from 'vs/platform/log/common/log'; import { IHostService } from 'vs/workbench/services/host/browser/host'; import { DeferredPromise } from 'vs/base/common/async'; <del> import { ISpeechService, ISpeechProvider, HasSpeechProvider, ISpeechToTextSession, SpeechToTextInProgress, IKeywordRecognitionSession, KeywordRecognitionStatus, SpeechToTextStatus } from 'vs/workbench/contrib/speech/common/speechService'; </del> <ins> import { ISpeechService, ISpeechProvider, HasSpeechProvider, ISpeechToTextSession, SpeechToTextInProgress, IKeywordRecognitionSession, KeywordRecognitionStatus, SpeechToTextStatus, speechLanguageConfigToLanguage, SPEECH_LANGUAGE_CONFIG } from 'vs/workbench/contrib/speech/common/speechService'; </ins> import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
this.logService.warn(`Multiple speech providers registered. Picking first one: ${provider.metadata.displayName}`); } <del> const language = this.configurationService.getValue<string>('accessibility.voice.speechLanguage'); </del> <ins> const language = speechLanguageConfigToLanguage(this.configurationService.getValue<unknown>(SPEECH_LANGUAGE_CONFIG)); </ins> const session = this._activeSpeechToTextSession = provider.createSpeechToTextSession(token, typeof language === 'string' ? { language } : undefined); const sessionStart = Date.now();
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions'; import { createDecorator } from 'vs/platform/instantiation/common/instantiation'; <ins> import { language } from 'vs/base/common/platform'; </ins> export const ISpeechService = createDecorator<ISpeechService>('speechService');
*/ recognizeKeyword(token: CancellationToken): Promise<KeywordRecognitionStatus>; } <ins> export const SPEECH_LANGUAGE_CONFIG = 'accessibility.voice.speechLanguage'; export const SPEECH_LANGUAGES = { ['da-DK']: { name: localize('speechLanguage.da-DK', "Danish (Denmark)") }, ['de-DE']: { name: localize('speechLanguage.de-DE', "German (Germany)") }, ['en-AU']: { name: localize('speechLanguage.en-AU', "English (Australia)") }, ['en-CA']: { name: localize('speechLanguage.en-CA', "English (Canada)") }, ['en-GB']: { name: localize('speechLanguage.en-GB', "English (United Kingdom)") }, ['en-IE']: { name: localize('speechLanguage.en-IE', "English (Ireland)") }, ['en-IN']: { name: localize('speechLanguage.en-IN', "English (India)") }, ['en-NZ']: { name: localize('speechLanguage.en-NZ', "English (New Zealand)") }, ['en-US']: { name: localize('speechLanguage.en-US', "English (United States)") }, ['es-ES']: { name: localize('speechLanguage.es-ES', "Spanish (Spain)") }, ['es-MX']: { name: localize('speechLanguage.es-MX', "Spanish (Mexico)") }, ['fr-CA']: { name: localize('speechLanguage.fr-CA', "French (Canada)") }, ['fr-FR']: { name: localize('speechLanguage.fr-FR', "French (France)") }, ['hi-IN']: { name: localize('speechLanguage.hi-IN', "Hindi (India)") }, ['it-IT']: { name: localize('speechLanguage.it-IT', "Italian (Italy)") }, ['ja-JP']: { name: localize('speechLanguage.ja-JP', "Japanese (Japan)") }, ['ko-KR']: { name: localize('speechLanguage.ko-KR', "Korean (South Korea)") }, ['nl-NL']: { name: localize('speechLanguage.nl-NL', "Dutch (Netherlands)") }, ['pt-PT']: { name: localize('speechLanguage.pt-PT', "Portuguese (Portugal)") }, ['pt-BR']: { name: localize('speechLanguage.pt-BR', "Portuguese (Brazil)") }, ['ru-RU']: { name: localize('speechLanguage.ru-RU', "Russian (Russia)") }, ['sv-SE']: { name: localize('speechLanguage.sv-SE', "Swedish (Sweden)") }, ['tr-TR']: { name: localize('speechLanguage.tr-TR', "Turkish (Turkey)") }, ['zh-CN']: { name: localize('speechLanguage.zh-CN', "Chinese (Simplified, China)") }, ['zh-HK']: { name: localize('speechLanguage.zh-HK', "Chinese (Traditional, Hong Kong)") }, ['zh-TW']: { name: localize('speechLanguage.zh-TW', "Chinese (Traditional, Taiwan)") } }; export function speechLanguageConfigToLanguage(config: unknown, lang = language): string { if (typeof config === 'string') { if (config === 'auto') { if (lang !== 'en') { const langParts = lang.split('-'); return speechLanguageConfigToLanguage(`${langParts[0]}-${(langParts[1] ?? langParts[0]).toUpperCase()}`); } } else { if (SPEECH_LANGUAGES[config as keyof typeof SPEECH_LANGUAGES]) { return config; } } } return 'en-US'; } </ins>
<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 assert from 'assert'; import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; import { speechLanguageConfigToLanguage } from 'vs/workbench/contrib/speech/common/speechService'; suite('SpeechService', () => { test('resolve language', async () => { assert.strictEqual(speechLanguageConfigToLanguage(undefined), 'en-US'); assert.strictEqual(speechLanguageConfigToLanguage(3), 'en-US'); assert.strictEqual(speechLanguageConfigToLanguage('foo'), 'en-US'); assert.strictEqual(speechLanguageConfigToLanguage('foo-bar'), 'en-US'); assert.strictEqual(speechLanguageConfigToLanguage('tr-TR'), 'tr-TR'); assert.strictEqual(speechLanguageConfigToLanguage('zh-TW'), 'zh-TW'); assert.strictEqual(speechLanguageConfigToLanguage('auto', 'en'), 'en-US'); assert.strictEqual(speechLanguageConfigToLanguage('auto', 'tr'), 'tr-TR'); assert.strictEqual(speechLanguageConfigToLanguage('auto', 'zh-tw'), 'zh-TW'); }); ensureNoDisposablesAreLeakedInTestSuite(); }); </ins>
left: unset !important; } <del> .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.tab-actions-left::after, .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.close-action-off::after, .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fixed.tab-actions-left::after, .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fixed.close-action-off::after { content: ''; </del> <ins> .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab .tab-fade-hider { display: none; } .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.tab-actions-left .tab-fade-hider, .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-shrink.close-action-off .tab-fade-hider, .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fixed.tab-actions-left .tab-fade-hider, .monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.sizing-fixed.close-action-off .tab-fade-hider { </ins> display: flex; flex: 0; width: 5px; /* reserve space to hide tab fade when close button is left or off (fixes https://github.com/microsoft/vscode/issues/45728) */
const tabActionBarDisposable = combinedDisposable(tabActionBar, tabActionListener, toDisposable(insert(this.tabActionBars, tabActionBar))); <ins> // Tab Fade Hider // Hides the tab fade to the right when tab action left and sizing shrink/fixed, ::after, ::before are already used const tabShadowHider = document.createElement('div'); tabShadowHider.classList.add('tab-fade-hider'); tabContainer.appendChild(tabShadowHider); </ins> // Tab Border Bottom const tabBorderBottomContainer = document.createElement('div'); tabBorderBottomContainer.classList.add('tab-border-bottom-container');
//#region Test Coverage export class TestCoverageCount implements vscode.TestCoverageCount { constructor(public covered: number, public total: number) { <ins> validateTestCoverageCount(this); </ins> } } <del> const validateCC = (cc?: vscode.TestCoverageCount) => { if (cc && cc.covered > cc.total) { </del> <ins> export function validateTestCoverageCount(cc?: vscode.TestCoverageCount) { if (!cc) { return; } if (cc.covered > cc.total) { </ins> throw new Error(`The total number of covered items (${cc.covered}) cannot be greater than the total (${cc.total})`); } <del> }; </del> <ins> if (cc.total < 0) { throw new Error(`The number of covered items (${cc.total}) cannot be negative`); } } </ins> export class FileCoverage implements vscode.FileCoverage { public static fromDetails(uri: vscode.Uri, details: vscode.FileCoverageDetail[]): vscode.FileCoverage {
import * as dom from 'vs/base/browser/dom'; import { HoverWidget } from 'vs/base/browser/ui/hover/hoverWidget'; import { mapFindFirst } from 'vs/base/common/arraysFind'; <ins> import { assertNever } from 'vs/base/common/assert'; </ins> import { CancellationTokenSource } from 'vs/base/common/cancellation'; import { IMarkdownString, MarkdownString } from 'vs/base/common/htmlContent'; import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { testingCoverageMissingBranch } from 'vs/workbench/contrib/testing/browser/icons'; import { FileCoverage } from 'vs/workbench/contrib/testing/common/testCoverage'; import { ITestCoverageService } from 'vs/workbench/contrib/testing/common/testCoverageService'; <del> import { CoverageDetails, DetailType, IStatementCoverage } from 'vs/workbench/contrib/testing/common/testTypes'; </del> <ins> import { CoverageDetails, DetailType, IDeclarationCoverage, IStatementCoverage } from 'vs/workbench/contrib/testing/common/testTypes'; </ins> import { TestingContextKeys } from 'vs/workbench/contrib/testing/common/testingContextKeys'; const MAX_HOVERED_LINES = 30;
/** Gets the markdown description for the given detail */ public describe(detail: CoverageDetailsWithBranch, model: ITextModel): IMarkdownString | undefined { if (detail.type === DetailType.Declaration) { <del> return new MarkdownString().appendMarkdown(localize('coverage.declExecutedCount', '`{0}` was executed {1} time(s).', detail.name, detail.count)); </del> <ins> return namedDetailLabel(detail.name, detail); </ins> } else if (detail.type === DetailType.Statement) { const text = wrapName(model.getValueInRange(tidyLocation(detail.location)).trim() || `<empty statement>`); <del> const str = new MarkdownString(); </del> if (detail.branches?.length) { const covered = detail.branches.filter(b => !!b.count).length; <del> str.appendMarkdown(localize('coverage.branches', '{0} of {1} of branches in {2} were covered.', covered, detail.branches.length, text)); </del> <ins> return new MarkdownString().appendMarkdown(localize('coverage.branches', '{0} of {1} of branches in {2} were covered.', covered, detail.branches.length, text)); </ins> } else { <del> str.appendMarkdown(localize('coverage.codeExecutedCount', '{0} was executed {1} time(s).', text, detail.count)); </del> <ins> return namedDetailLabel(text, detail); </ins> } <del> return str; </del> } else if (detail.type === DetailType.Branch) { const text = wrapName(model.getValueInRange(tidyLocation(detail.detail.location)).trim() || `<empty statement>`); const { count, label } = detail.detail.branches![detail.branch]; const label2 = label ? wrapInBackticks(label) : `#${detail.branch + 1}`; <del> if (count === 0) { </del> <ins> if (!count) { </ins> return new MarkdownString().appendMarkdown(localize('coverage.branchNotCovered', 'Branch {0} in {1} was not covered.', label2, text)); <ins> } else if (count === true) { return new MarkdownString().appendMarkdown(localize('coverage.branchCoveredYes', 'Branch {0} in {1} was executed.', label2, text)); </ins> } else { return new MarkdownString().appendMarkdown(localize('coverage.branchCovered', 'Branch {0} in {1} was executed {2} time(s).', label2, text, count)); } } <del> return undefined; </del> <ins> assertNever(detail); </ins> } } <ins> function namedDetailLabel(name: string, detail: IStatementCoverage | IDeclarationCoverage) { return new MarkdownString().appendMarkdown( !detail.count // 0 or false ? localize('coverage.declExecutedNo', '`{0}` was not executed.', name) : typeof detail.count === 'number' ? localize('coverage.declExecutedCount', '`{0}` was executed {1} time(s).', name, detail.count) : localize('coverage.declExecutedYes', '`{0}` was executed.', name) ); } </ins> // 'tidies' the range by normalizing it into a range and removing leading // and trailing whitespace. function tidyLocation(location: Range | Position): Range {
runHandler: (request: TestRunRequest, token: CancellationToken) => Thenable<void> | void; /** <del> * A function that provides detailed statement and function-level coverage for a file. </del> <ins> * An extension-provided function that provides detailed statement and * function-level coverage for a file. The editor will call this when more * detail is needed for a file, such as when it's opened in an editor or * expanded in the **Test Coverage** view. </ins> * * The {@link FileCoverage} object passed to this function is the same instance * emitted on {@link TestRun.addCoverage} calls associated with this profile.
* @example * // Log all data written to the terminal for a command * const command = term.shellIntegration.executeCommand({ commandLine: 'echo "Hello world"' }); <del> * const stream = command.createDataStream(); </del> <ins> * const stream = command.readData(); </ins> * for await (const data of stream) { *   console.log(data); * } */ <del> createDataStream(): AsyncIterable<string>; </del> <ins> readData(): AsyncIterable<string>; </ins> } export interface Terminal {
overviewRulerWidth: 10, ignoreBracketedPasteMode: config.ignoreBracketedPasteMode, rescaleOverlappingGlyphs: config.rescaleOverlappingGlyphs, <ins> windowOptions: { getWinSizePixels: true, getCellSizePixels: true, getWinSizeChars: true, }, </ins> })); this._updateSmoothScrolling(); this._core = (this.raw as any)._core as IXtermCore;
*  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ <del> import { createCancelablePromise, firstParallel } from 'vs/base/common/async'; </del> <ins> import { createCancelablePromise, firstParallel, timeout } from 'vs/base/common/async'; </ins> import { IDisposable } from 'vs/base/common/lifecycle'; import * as platform from 'vs/base/common/platform'; import * as nls from 'vs/nls';
} else { if (terminal.state.isInteractedWith) { terminal.sendText('u0003'); // Ctrl+C for #106743. Not part of the same command for #107969 <ins> await timeout(200); // mirroring https://github.com/microsoft/vscode/blob/c67ccc70ece5f472ec25464d3eeb874cfccee9f1/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts#L852-L857 </ins> } if (configProvider.getConfiguration('debug.terminal').get<boolean>('clearBeforeReusing')) {
this.handleAndRegisterCustomViewContainers(); this.handleAndRegisterCustomViews(); <ins> // Abstract tree has it's own implementation of triggering custom hover // TreeView uses it's own implementation due to setting focus inside the (markdown) </ins> let showTreeHoverCancellation = new CancellationTokenSource(); KeybindingsRegistry.registerCommandAndKeybindingRule({ id: 'workbench.action.showTreeHover',
} }, true); }, <del> weight: KeybindingWeight.WorkbenchContrib, </del> <ins> weight: KeybindingWeight.WorkbenchContrib + 1, </ins> primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI), when: ContextKeyExpr.and(RawCustomTreeViewContextKey, WorkbenchListFocusContextKey) });
*  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ <del> import { KeyMod, KeyCode } from 'vs/base/common/keyCodes'; </del> <ins> import { KeyMod, KeyCode, KeyChord } from 'vs/base/common/keyCodes'; </ins> import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation'; import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { List } from 'vs/base/browser/ui/list/listWidget';
import { CommandsRegistry } from 'vs/platform/commands/common/commands'; import { Table } from 'vs/base/browser/ui/table/tableWidget'; import { AbstractTree, TreeFindMatchType, TreeFindMode } from 'vs/base/browser/ui/tree/abstractTree'; <del> import { isActiveElement } from 'vs/base/browser/dom'; </del> <ins> import { EventType, getActiveWindow, isActiveElement } from 'vs/base/browser/dom'; </ins> import { Action2, registerAction2 } from 'vs/platform/actions/common/actions'; import { IConfigurationService } from 'vs/platform/configuration/common/configuration'; import { localize, localize2 } from 'vs/nls'; <ins> import { IDisposable } from 'vs/base/common/lifecycle'; </ins> function ensureDOMFocus(widget: ListWidget | undefined): void { // it can happen that one of the commands is executed while