Skip to content

Commit

Permalink
Merge branch 'main' into merogge/terminal-chat-widget-hint
Browse files Browse the repository at this point in the history
  • Loading branch information
meganrogge committed May 3, 2024
2 parents 5a68b64 + db964c5 commit d0463b6
Show file tree
Hide file tree
Showing 90 changed files with 1,271 additions and 1,135 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test/automation/out/**": true,
"test/integration/browser/out/**": true,
"src/vs/base/test/common/filters.perf.data.js": true,
"src/vs/base/test/node/uri.test.data.txt": true,
"src/vs/base/test/node/uri.perf.data.txt": true,
"src/vs/workbench/api/test/browser/extHostDocumentData.test.perf-data.ts": true,
"src/vs/editor/test/node/diffing/fixtures/**": true,
},
Expand Down
2 changes: 1 addition & 1 deletion build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
"optionalDependencies": {
"tree-sitter": "^0.20.5",
"tree-sitter-typescript": "^0.20.3",
"tree-sitter-typescript": "^0.20.5",
"vscode-gulp-watch": "^5.0.3"
}
}
29 changes: 19 additions & 10 deletions build/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2025,16 +2025,16 @@ mute-stream@~0.0.4:
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d"
integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==

nan@^2.14.0:
version "2.15.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee"
integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==

nan@^2.17.0:
version "2.18.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.18.0.tgz#26a6faae7ffbeb293a39660e88a76b82e30b7554"
integrity sha512-W7tfG7vMOGtD30sHoZSSc/JVYiyDPEyQVso/Zz+/uQd0B0L46gtC+pHha5FFMRpil6fm/AoEcRWyOVi4+E/f8w==

nan@^2.18.0:
version "2.19.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.19.0.tgz#bb58122ad55a6c5bc973303908d5b16cfdd5a8c0"
integrity sha512-nO1xXxfh/RWNxfd/XPfbIfFk5vgLsAxUR9y5O0cHMJu/AW9U95JLXqthYHjEp+8gQ5p96K9jUp8nbVOxCdRbtw==

napi-build-utils@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806"
Expand Down Expand Up @@ -2578,12 +2578,13 @@ tr46@~0.0.3:
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=

tree-sitter-typescript@^0.20.3:
version "0.20.3"
resolved "https://registry.yarnpkg.com/tree-sitter-typescript/-/tree-sitter-typescript-0.20.3.tgz#454560314c419f5364cd4585a48d675e44f55edc"
integrity sha512-5+RZ9G3/VOxxSzyniVc5dfNhfan1eOxQvUdTgXhpsGIYlmSW3HwIuPEJ7r65FWH2WnJWirOu11Pm0usmkx2JOg==
tree-sitter-typescript@^0.20.5:
version "0.20.5"
resolved "https://registry.yarnpkg.com/tree-sitter-typescript/-/tree-sitter-typescript-0.20.5.tgz#29e30c052bcb06cb992ffd2d392e010b0e1768b3"
integrity sha512-RzK/Pc6k4GiXvInIBlo8ZggekP6rODfW2P6KHFCTSUHENsw6ynh+iacFhfkJRa4MT8EIN2WHygFJ7076/+eHKg==
dependencies:
nan "^2.14.0"
nan "^2.18.0"
tree-sitter "^0.20.6"

tree-sitter@^0.20.5:
version "0.20.5"
Expand All @@ -2593,6 +2594,14 @@ tree-sitter@^0.20.5:
nan "^2.17.0"
prebuild-install "^7.1.1"

tree-sitter@^0.20.6:
version "0.20.6"
resolved "https://registry.yarnpkg.com/tree-sitter/-/tree-sitter-0.20.6.tgz#fec52e5d7cc6c583135756479f2440dd89b25cbe"
integrity sha512-GxJodajVpfgb3UREzzIbtA1hyRnTxVbWVXrbC6sk4xTMH5ERMBJk9HJNq4c8jOJeUaIOmLcwg+t6mez/PDvGqg==
dependencies:
nan "^2.18.0"
prebuild-install "^7.1.1"

tslib@^1.10.0:
version "1.14.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
Expand Down
4 changes: 2 additions & 2 deletions extensions/debug-server-ready/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ interface ServerReadyAction {
killOnServerStop?: boolean;
}

// Escape codes, compiled from https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_
const CSI_SEQUENCE = /(:?\x1b\[|\x9B)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~]/g;
// From src/vs/base/common/strings.ts
const CSI_SEQUENCE = /(?:(?:\x1b\[|\x9B)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~])|(:?\x1b\].*?\x07)/g;

/**
* Froms vs/base/common/strings.ts in core
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.90.0",
"distro": "25c9442cad1fee4c5b7fd96dd526ae00022f881b",
"distro": "5d328d131fa6f8c6923e6bdec0b6f538318c18e8",
"author": {
"name": "Microsoft Corporation"
},
Expand Down Expand Up @@ -132,7 +132,7 @@
"@typescript-eslint/experimental-utils": "^5.57.0",
"@typescript-eslint/parser": "^6.21.0",
"@vscode/gulp-electron": "^1.36.0",
"@vscode/l10n-dev": "0.0.30",
"@vscode/l10n-dev": "0.0.35",
"@vscode/telemetry-extractor": "^1.10.2",
"@vscode/test-cli": "^0.0.6",
"@vscode/test-electron": "^2.3.8",
Expand Down
2 changes: 1 addition & 1 deletion resources/server/bin/helpers/browser.cmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@echo off
setlocal
set ROOT_DIR=%~dp0..\..
call "%ROOT_DIR%\node.exe" "%ROOT_DIR%\out\server-cli.js" "@@APPNAME@@" "@@VERSION@@" "@@COMMIT@@" "@@APPNAME@@.cmd" "--openExternal" %*
start "Open Browser" /B "%ROOT_DIR%\node.exe" "%ROOT_DIR%\out\server-cli.js" "@@APPNAME@@" "@@VERSION@@" "@@COMMIT@@" "@@APPNAME@@.cmd" "--openExternal" "%*"
endlocal
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/grid/gridview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ export class GridView implements IDisposable {
return {
node: this._deserializeNode(serializedChild, orthogonal(orientation), deserializer, node.size),
visible: (serializedChild as { visible?: boolean }).visible
} as INodeDescriptor;
} satisfies INodeDescriptor;
});

result = new BranchNode(orientation, this.layoutController, this.styles, this.proportionalLayout, node.size, orthogonalSize, undefined, children);
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/splitview/splitview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ export class SplitView<TLayoutContext = undefined, TView extends IView<TLayoutCo
if (options.descriptor) {
this.size = options.descriptor.size;
options.descriptor.views.forEach((viewDescriptor, index) => {
const sizing = types.isUndefined(viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: 'invisible', cachedVisibleSize: viewDescriptor.size } as InvisibleSizing;
const sizing = types.isUndefined(viewDescriptor.visible) || viewDescriptor.visible ? viewDescriptor.size : { type: 'invisible', cachedVisibleSize: viewDescriptor.size } satisfies InvisibleSizing;

const view = viewDescriptor.view;
this.doAddView(view, sizing, index, true);
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/tree/asyncDataTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ export class AsyncDataTree<TInput, T, TFilterData = void> implements IDisposable

this.root.element = input!;

const viewStateContext = viewState && { viewState, focus: [], selection: [] } as IAsyncDataTreeViewStateContext<TInput, T>;
const viewStateContext: IAsyncDataTreeViewStateContext<TInput, T> | undefined = viewState && { viewState, focus: [], selection: [] };

await this._updateChildren(input, true, false, viewStateContext);

Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/browser/ui/tree/objectTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class CompressibleStickyScrollDelegate<T, TFilterData> implements IStickyScrollD
// Compress the elements
const lastStickyNode = stickyNodes[stickyNodes.length - 1];
const compressedElement: ICompressedTreeNode<T> = { elements, incompressible: false };
const compressedNode = { ...lastStickyNode.node, children: [], element: compressedElement } as ITreeNode<ICompressedTreeNode<T>, TFilterData>;
const compressedNode: ITreeNode<ICompressedTreeNode<T>, TFilterData> = { ...lastStickyNode.node, children: [], element: compressedElement };

const stickyTreeNode = new Proxy(stickyNodes[0].node, {});

Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/common/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export namespace Schemas {
/** Scheme used for code blocks in chat. */
export const vscodeChatCodeBlock = 'vscode-chat-code-block';
/** Scheme used for LHS of code compare (aka diff) blocks in chat. */
export const vscodeChatCodeCompreBlock = 'vscode-chat-code-compare-block';
export const vscodeChatCodeCompareBlock = 'vscode-chat-code-compare-block';
/** Scheme used for the chat input editor. */
export const vscodeChatSesssion = 'vscode-chat-editor';

Expand Down
4 changes: 2 additions & 2 deletions src/vs/base/common/processes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ export interface ProcessItem {
* Sanitizes a VS Code process environment by removing all Electron/VS Code-related values.
*/
export function sanitizeProcessEnvironment(env: IProcessEnvironment, ...preserve: string[]): void {
const set = preserve.reduce((set, key) => {
const set = preserve.reduce<Record<string, boolean>>((set, key) => {
set[key] = true;
return set;
}, {} as Record<string, boolean>);
}, {});
const keysToRemove = [
/^ELECTRON_.+$/,
/^VSCODE_(?!(PORTABLE|SHELL_LOGIN|ENV_REPLACE|ENV_APPEND|ENV_PREPEND)).+$/,
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/common/strings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ export function lcut(text: string, n: number, prefix = '') {

// Escape codes, compiled from https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Functions-using-CSI-_-ordered-by-the-final-character_s_
// Plus additional markers for custom `\x1b]...\x07` instructions.
const CSI_SEQUENCE = /(:?(:?\x1b\[|\x9B)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~])|(:?\x1b\].*?\x07)/g;
const CSI_SEQUENCE = /(?:(?:\x1b\[|\x9B)[=?>!]?[\d;:]*["$#'* ]?[a-zA-Z@^`{}|~])|(:?\x1b\].*?\x07)/g;

/** Iterates over parts of a string with CSI sequences */
export function* forAnsiStringParts(str: string) {
Expand Down
5 changes: 5 additions & 0 deletions src/vs/base/test/common/strings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,11 @@ suite('Strings', () => {
`expect to forAnsiStringParts ${JSON.stringify(sequence)}`
);
}

// #209937
assert.strictEqual(
strings.removeAnsiEscapeCodes(`localhost:\x1b[31m1234`),
'localhost:1234',);
});

test('removeAnsiEscapeCodesFromPrompt', () => {
Expand Down
128 changes: 60 additions & 68 deletions src/vs/base/test/common/timeTravelScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,11 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import { compareBy, numberComparator, tieBreakComparators } from 'vs/base/common/arrays';
import { Emitter, Event } from 'vs/base/common/event';
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
import { setTimeout0, setTimeout0IsFaster } from 'vs/base/common/platform';

interface PriorityQueue<T> {
length: number;
add(value: T): void;
remove(value: T): void;

removeMin(): T | undefined;
toSortedArray(): T[];
}

class SimplePriorityQueue<T> implements PriorityQueue<T> {
private isSorted = false;
private items: T[];

constructor(items: T[], private readonly compare: (a: T, b: T) => number) {
this.items = items;
}

get length(): number {
return this.items.length;
}

add(value: T): void {
this.items.push(value);
this.isSorted = false;
}

remove(value: T): void {
this.items.splice(this.items.indexOf(value), 1);
this.isSorted = false;
}

removeMin(): T | undefined {
this.ensureSorted();
return this.items.shift();
}

getMin(): T | undefined {
this.ensureSorted();
return this.items[0];
}

toSortedArray(): T[] {
this.ensureSorted();
return [...this.items];
}

private ensureSorted() {
if (!this.isSorted) {
this.items.sort(this.compare);
this.isSorted = true;
}
}
}

export type TimeOffset = number;

export interface Scheduler {
Expand All @@ -84,24 +31,15 @@ interface ExtendedScheduledTask extends ScheduledTask {
id: number;
}

function compareScheduledTasks(a: ExtendedScheduledTask, b: ExtendedScheduledTask): number {
if (a.time !== b.time) {
// Prefer lower time
return a.time - b.time;
}

if (a.id !== b.id) {
// Prefer lower id
return a.id - b.id;
}

return 0;
}
const scheduledTaskComparator = tieBreakComparators<ExtendedScheduledTask>(
compareBy(i => i.time, numberComparator),
compareBy(i => i.id, numberComparator),
);

export class TimeTravelScheduler implements Scheduler {
private taskCounter = 0;
private _now: TimeOffset = 0;
private readonly queue: PriorityQueue<ExtendedScheduledTask> = new SimplePriorityQueue([], compareScheduledTasks);
private readonly queue: PriorityQueue<ExtendedScheduledTask> = new SimplePriorityQueue<ExtendedScheduledTask>([], scheduledTaskComparator);

private readonly taskScheduledEmitter = new Emitter<{ task: ScheduledTask }>();
public readonly onTaskScheduled = this.taskScheduledEmitter.event;
Expand Down Expand Up @@ -390,3 +328,57 @@ function createDateClass(scheduler: Scheduler): DateConstructor {

return SchedulerDate as any;
}

interface PriorityQueue<T> {
length: number;
add(value: T): void;
remove(value: T): void;

removeMin(): T | undefined;
toSortedArray(): T[];
}

class SimplePriorityQueue<T> implements PriorityQueue<T> {
private isSorted = false;
private items: T[];

constructor(items: T[], private readonly compare: (a: T, b: T) => number) {
this.items = items;
}

get length(): number {
return this.items.length;
}

add(value: T): void {
this.items.push(value);
this.isSorted = false;
}

remove(value: T): void {
this.items.splice(this.items.indexOf(value), 1);
this.isSorted = false;
}

removeMin(): T | undefined {
this.ensureSorted();
return this.items.shift();
}

getMin(): T | undefined {
this.ensureSorted();
return this.items[0];
}

toSortedArray(): T[] {
this.ensureSorted();
return [...this.items];
}

private ensureSorted() {
if (!this.isSorted) {
this.items.sort(this.compare);
this.isSorted = true;
}
}
}
2 changes: 2 additions & 0 deletions src/vs/editor/browser/services/hoverService/hoverService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,15 @@ export class HoverService extends Disposable implements IHoverService {
hoverDelegate.onDidHideHover?.();
hoverWidget = undefined;
}
htmlElement.removeAttribute('custom-hover-active');
};

const triggerShowHover = (delay: number, focus?: boolean, target?: IHoverDelegateTarget) => {
return new TimeoutTimer(async () => {
if (!hoverWidget || hoverWidget.isDisposed) {
hoverWidget = new UpdatableHoverWidget(hoverDelegate, target || htmlElement, delay > 0);
await hoverWidget.update(typeof content === 'function' ? content() : content, focus, options);
htmlElement.setAttribute('custom-hover-active', 'true');
}
}, delay);
};
Expand Down
4 changes: 2 additions & 2 deletions src/vs/editor/common/languages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1782,9 +1782,9 @@ export interface CommentThreadTemplate {
/**
* @internal
*/
export interface CommentInfo {
export interface CommentInfo<T = IRange> {
extensionId?: string;
threads: CommentThread[];
threads: CommentThread<T>[];
pendingCommentThreads?: PendingCommentThread[];
commentingRanges: CommentingRanges;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vs/editor/contrib/folding/browser/folding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ class FoldRangeFromSelectionAction extends FoldingAction<void> {
--endLineNumber;
}
if (endLineNumber > selection.startLineNumber) {
collapseRanges.push(<FoldRange>{
collapseRanges.push({
startLineNumber: selection.startLineNumber,
endLineNumber: endLineNumber,
type: undefined,
Expand Down

0 comments on commit d0463b6

Please sign in to comment.