Skip to content

Commit fcfef87

Browse files
authored
Merge branch 'main' into fix-183445
2 parents 677be08 + aaadde5 commit fcfef87

File tree

71 files changed

+2904
-265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+2904
-265
lines changed

.configurations/configuration.dsc.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ properties:
2828
settings:
2929
Name: 'yarn'
3030
Global: true
31+
PackageDirectory: '${WinGetConfigRoot}\..\'
3132
- resource: Microsoft.WinGet.DSC/WinGetPackage
3233
directives:
3334
description: Install Python 3.10
@@ -55,4 +56,12 @@ properties:
5556
includeRecommended: true
5657
components:
5758
- Microsoft.VisualStudio.Workload.VCTools
59+
- resource: YarnDsc/YarnInstall
60+
dependsOn:
61+
- npm
62+
directives:
63+
description: Install dependencies
64+
allowPrerelease: true
65+
settings:
66+
PackageDirectory: '${WinGetConfigRoot}\..\'
5867
configurationVersion: 0.2.0

build/lib/stylelint/vscode-known-variables.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
"--vscode-commandCenter-foreground",
5252
"--vscode-commandCenter-inactiveBorder",
5353
"--vscode-commandCenter-inactiveForeground",
54+
"--vscode-commentsView-resolvedIcon",
55+
"--vscode-commentsView-unresolvedIcon",
5456
"--vscode-contrastActiveBorder",
5557
"--vscode-contrastBorder",
5658
"--vscode-debugConsole-errorForeground",
@@ -97,6 +99,7 @@
9799
"--vscode-diffEditor-removedLineBackground",
98100
"--vscode-diffEditor-removedTextBackground",
99101
"--vscode-diffEditor-removedTextBorder",
102+
"--vscode-diffEditor-unchangedRegionBackground",
100103
"--vscode-diffEditorGutter-insertedLineBackground",
101104
"--vscode-diffEditorGutter-removedLineBackground",
102105
"--vscode-diffEditorOverview-insertedForeground",
@@ -233,6 +236,8 @@
233236
"--vscode-editorOverviewRuler-background",
234237
"--vscode-editorOverviewRuler-border",
235238
"--vscode-editorOverviewRuler-bracketMatchForeground",
239+
"--vscode-editorOverviewRuler-commentForeground",
240+
"--vscode-editorOverviewRuler-commentUnresolvedForeground",
236241
"--vscode-editorOverviewRuler-commonContentForeground",
237242
"--vscode-editorOverviewRuler-currentContentForeground",
238243
"--vscode-editorOverviewRuler-deletedForeground",
@@ -309,6 +314,8 @@
309314
"--vscode-interactiveEditor-border",
310315
"--vscode-interactiveEditor-regionHighlight",
311316
"--vscode-interactiveEditor-shadow",
317+
"--vscode-interactiveEditorDiff-inserted",
318+
"--vscode-interactiveEditorDiff-removed",
312319
"--vscode-interactiveEditorInput-background",
313320
"--vscode-interactiveEditorInput-border",
314321
"--vscode-interactiveEditorInput-focusBorder",
@@ -457,7 +464,6 @@
457464
"--vscode-problemsErrorIcon-foreground",
458465
"--vscode-problemsInfoIcon-foreground",
459466
"--vscode-problemsWarningIcon-foreground",
460-
"--vscode-problemsSuccessIcon-foreground",
461467
"--vscode-profileBadge-background",
462468
"--vscode-profileBadge-foreground",
463469
"--vscode-progressBar-background",
@@ -520,6 +526,8 @@
520526
"--vscode-statusBar-noFolderBackground",
521527
"--vscode-statusBar-noFolderBorder",
522528
"--vscode-statusBar-noFolderForeground",
529+
"--vscode-statusBar-offlineBackground",
530+
"--vscode-statusBar-offlineForeground",
523531
"--vscode-statusBarItem-activeBackground",
524532
"--vscode-statusBarItem-compactHoverBackground",
525533
"--vscode-statusBarItem-errorBackground",
@@ -733,4 +741,4 @@
733741
"--z-index-run-button-container",
734742
"--zoom-factor"
735743
]
736-
}
744+
}

extensions/sql/language-configuration.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
["`", "`"]
2626
],
2727
"folding": {
28+
"offSide": true,
2829
"markers": {
2930
"start": "^\\s*--\\s*#region\\b",
3031
"end": "^\\s*--\\s*#endregion\\b"

src/vs/base/browser/dom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1865,7 +1865,7 @@ export function h(tag: string, ...args: [] | [attributes: { $: string } & Partia
18651865
el.appendChild(c);
18661866
} else if (typeof c === 'string') {
18671867
el.append(c);
1868-
} else {
1868+
} else if ('root' in c) {
18691869
Object.assign(result, c);
18701870
el.appendChild(c.root);
18711871
}

src/vs/base/common/observableImpl/autorun.ts

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,41 @@ export function autorunHandleChanges<TChangeSummary>(
2323
return new AutorunObserver(debugName, fn, options.createEmptyChangeSummary, options.handleChange);
2424
}
2525

26+
// TODO@hediet rename to autorunWithStore
27+
export function autorunWithStore2(
28+
debugName: string,
29+
fn: (reader: IReader, store: DisposableStore) => void,
30+
): IDisposable {
31+
return autorunWithStore(fn, debugName);
32+
}
33+
34+
export function autorunWithStoreHandleChanges<TChangeSummary>(
35+
debugName: string,
36+
options: {
37+
createEmptyChangeSummary?: () => TChangeSummary;
38+
handleChange: (context: IChangeContext, changeSummary: TChangeSummary) => boolean;
39+
},
40+
fn: (reader: IReader, changeSummary: TChangeSummary, store: DisposableStore) => void
41+
): IDisposable {
42+
const store = new DisposableStore();
43+
const disposable = autorunHandleChanges(
44+
debugName,
45+
{
46+
createEmptyChangeSummary: options.createEmptyChangeSummary,
47+
handleChange: options.handleChange,
48+
},
49+
(reader, changeSummary) => {
50+
store.clear();
51+
fn(reader, changeSummary, store);
52+
}
53+
);
54+
return toDisposable(() => {
55+
disposable.dispose();
56+
store.dispose();
57+
});
58+
}
59+
60+
// TODO@hediet deprecate, rename to autorunWithStoreEx
2661
export function autorunWithStore(
2762
fn: (reader: IReader, store: DisposableStore) => void,
2863
debugName: string
@@ -144,13 +179,13 @@ export class AutorunObserver<TChangeSummary = any> implements IObserver, IReader
144179
}
145180

146181
public handlePossibleChange(observable: IObservable<any>): void {
147-
if (this.state === AutorunState.upToDate && this.dependencies.has(observable)) {
182+
if (this.state === AutorunState.upToDate && this.dependencies.has(observable) && !this.dependenciesToBeRemoved.has(observable)) {
148183
this.state = AutorunState.dependenciesMightHaveChanged;
149184
}
150185
}
151186

152187
public handleChange<T, TChange>(observable: IObservable<T, TChange>, change: TChange): void {
153-
if (this.dependencies.has(observable)) {
188+
if (this.dependencies.has(observable) && !this.dependenciesToBeRemoved.has(observable)) {
154189
const shouldReact = this._handleChange ? this._handleChange({
155190
changedObservable: observable,
156191
change,

src/vs/base/common/observableImpl/base.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ import { IDisposable } from 'vs/base/common/lifecycle';
77
import type { derived } from 'vs/base/common/observableImpl/derived';
88
import { getLogger } from 'vs/base/common/observableImpl/logging';
99

10+
/**
11+
* Represents an observable value.
12+
* @template T The type of the value.
13+
* @template TChange The type of delta information (usually `void` and only used in advanced scenarios).
14+
*/
1015
export interface IObservable<T, TChange = unknown> {
1116
/**
1217
* Returns the current value.
@@ -248,6 +253,10 @@ export function getFunctionName(fn: Function): string | undefined {
248253
export interface ISettableObservable<T, TChange = void> extends IObservable<T, TChange>, ISettable<T, TChange> {
249254
}
250255

256+
/**
257+
* Creates an observable value.
258+
* Observers get informed when the value changes.
259+
*/
251260
export function observableValue<T, TChange = void>(name: string, initialValue: T): ISettableObservable<T, TChange> {
252261
return new ObservableValue(name, initialValue);
253262
}

src/vs/base/common/observableImpl/derived.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export class Derived<T, TChangeSummary = any> extends BaseObservable<T, void> im
196196

197197
public handlePossibleChange<T>(observable: IObservable<T, unknown>): void {
198198
// In all other states, observers already know that we might have changed.
199-
if (this.state === DerivedState.upToDate && this.dependencies.has(observable)) {
199+
if (this.state === DerivedState.upToDate && this.dependencies.has(observable) && !this.dependenciesToBeRemoved.has(observable)) {
200200
this.state = DerivedState.dependenciesMightHaveChanged;
201201
for (const r of this.observers) {
202202
r.handlePossibleChange(this);
@@ -205,22 +205,19 @@ export class Derived<T, TChangeSummary = any> extends BaseObservable<T, void> im
205205
}
206206

207207
public handleChange<T, TChange>(observable: IObservable<T, TChange>, change: TChange): void {
208-
const isUpToDate = this.state === DerivedState.upToDate;
209-
let shouldReact = true;
210-
211-
if (this._handleChange && this.dependencies.has(observable)) {
212-
shouldReact = this._handleChange({
208+
if (this.dependencies.has(observable) && !this.dependenciesToBeRemoved.has(observable)) {
209+
const shouldReact = this._handleChange ? this._handleChange({
213210
changedObservable: observable,
214211
change,
215212
didChange: o => o === observable as any,
216-
}, this.changeSummary!);
217-
}
218-
219-
if (shouldReact && (this.state === DerivedState.dependenciesMightHaveChanged || isUpToDate) && this.dependencies.has(observable)) {
220-
this.state = DerivedState.stale;
221-
if (isUpToDate) {
222-
for (const r of this.observers) {
223-
r.handlePossibleChange(this);
213+
}, this.changeSummary!) : true;
214+
const wasUpToDate = this.state === DerivedState.upToDate;
215+
if (shouldReact && (this.state === DerivedState.dependenciesMightHaveChanged || wasUpToDate)) {
216+
this.state = DerivedState.stale;
217+
if (wasUpToDate) {
218+
for (const r of this.observers) {
219+
r.handlePossibleChange(this);
220+
}
224221
}
225222
}
226223
}

src/vs/base/common/observableImpl/utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ class FromEventObservableSignal extends BaseObservable<void> {
198198
}
199199
}
200200

201+
/**
202+
* Creates a signal that can be triggered to invalidate observers.
203+
*/
201204
export function observableSignal<TDelta = void>(
202205
debugName: string
203206
): IObservableSignal<TDelta> {
@@ -287,6 +290,10 @@ export function wasEventTriggeredRecently(event: Event<any>, timeoutMs: number,
287290
export function keepAlive(observable: IObservable<any>, forceRecompute?: boolean): IDisposable {
288291
const o = new KeepAliveObserver(forceRecompute ?? false);
289292
observable.addObserver(o);
293+
if (forceRecompute) {
294+
observable.reportChanges();
295+
}
296+
290297
return toDisposable(() => {
291298
observable.removeObserver(o);
292299
});

src/vs/base/node/pfs.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,13 @@ export enum RimRafMode {
3737
* - `UNLINK`: direct removal from disk
3838
* - `MOVE`: faster variant that first moves the target to temp dir and then
3939
* deletes it in the background without waiting for that to finish.
40+
* the optional `moveToPath` allows to override where to rename the
41+
* path to before deleting it.
4042
*/
41-
async function rimraf(path: string, mode = RimRafMode.UNLINK): Promise<void> {
43+
async function rimraf(path: string, mode: RimRafMode.UNLINK): Promise<void>;
44+
async function rimraf(path: string, mode: RimRafMode.MOVE, moveToPath?: string): Promise<void>;
45+
async function rimraf(path: string, mode?: RimRafMode, moveToPath?: string): Promise<void>;
46+
async function rimraf(path: string, mode = RimRafMode.UNLINK, moveToPath?: string): Promise<void> {
4247
if (isRootOrDriveLetter(path)) {
4348
throw new Error('rimraf - will refuse to recursively delete root');
4449
}
@@ -49,12 +54,11 @@ async function rimraf(path: string, mode = RimRafMode.UNLINK): Promise<void> {
4954
}
5055

5156
// delete: via move
52-
return rimrafMove(path);
57+
return rimrafMove(path, moveToPath);
5358
}
5459

55-
async function rimrafMove(path: string): Promise<void> {
60+
async function rimrafMove(path: string, moveToPath = randomPath(tmpdir())): Promise<void> {
5661
try {
57-
const pathInTemp = randomPath(tmpdir());
5862
try {
5963
// Intentionally using `fs.promises` here to skip
6064
// the patched graceful-fs method that can result
@@ -64,7 +68,7 @@ async function rimrafMove(path: string): Promise<void> {
6468
// than necessary and we have a fallback to delete
6569
// via unlink.
6670
// https://github.com/microsoft/vscode/issues/139908
67-
await fs.promises.rename(path, pathInTemp);
71+
await fs.promises.rename(path, moveToPath);
6872
} catch (error) {
6973
if (error.code === 'ENOENT') {
7074
return; // ignore - path to delete did not exist
@@ -74,7 +78,7 @@ async function rimrafMove(path: string): Promise<void> {
7478
}
7579

7680
// Delete but do not return as promise
77-
rimrafUnlink(pathInTemp).catch(error => {/* ignore */ });
81+
rimrafUnlink(moveToPath).catch(error => {/* ignore */ });
7882
} catch (error) {
7983
if (error.code !== 'ENOENT') {
8084
throw error;

src/vs/base/test/node/pfs/pfs.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { timeout } from 'vs/base/common/async';
1010
import { VSBuffer } from 'vs/base/common/buffer';
1111
import { randomPath } from 'vs/base/common/extpath';
1212
import { FileAccess } from 'vs/base/common/network';
13-
import { join, sep } from 'vs/base/common/path';
13+
import { basename, dirname, join, sep } from 'vs/base/common/path';
1414
import { isWindows } from 'vs/base/common/platform';
1515
import { configureFlushOnWrite, Promises, RimRafMode, rimrafSync, SymlinkSupport, writeFileSync } from 'vs/base/node/pfs';
1616
import { flakySuite, getRandomTestPath } from 'vs/base/test/node/testUtils';
@@ -91,6 +91,14 @@ flakySuite('PFS', function () {
9191
assert.ok(!fs.existsSync(testDir));
9292
});
9393

94+
test('rimraf - simple - move (with moveToPath)', async () => {
95+
fs.writeFileSync(join(testDir, 'somefile.txt'), 'Contents');
96+
fs.writeFileSync(join(testDir, 'someOtherFile.txt'), 'Contents');
97+
98+
await Promises.rm(testDir, RimRafMode.MOVE, join(dirname(testDir), `${basename(testDir)}.vsctmp`));
99+
assert.ok(!fs.existsSync(testDir));
100+
});
101+
94102
test('rimraf - path does not exist - move', async () => {
95103
const nonExistingDir = join(testDir, 'unknown-move');
96104
await Promises.rm(nonExistingDir, RimRafMode.MOVE);

0 commit comments

Comments
 (0)