Skip to content

Commit e4aa317

Browse files
committed
Merge branch 'main' into robo/enable_wco_macOS
2 parents 3aab462 + 86bc5fa commit e4aa317

File tree

124 files changed

+3166
-1950
lines changed

Some content is hidden

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

124 files changed

+3166
-1950
lines changed

.eslint-plugin-local/vscode-dts-region-comments.ts

-40
This file was deleted.

eslint.config.js

-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,6 @@ export default tseslint.config(
268268
'local/vscode-dts-cancellation': 'warn',
269269
'local/vscode-dts-use-export': 'warn',
270270
'local/vscode-dts-use-thenable': 'warn',
271-
'local/vscode-dts-region-comments': 'warn',
272271
'local/vscode-dts-vscode-in-comments': 'warn',
273272
'local/vscode-dts-provider-naming': [
274273
'warn',

extensions/git/src/historyProvider.ts

+4
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,10 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
408408
const references: SourceControlHistoryItemRef[] = [];
409409

410410
for (const ref of commit.refNames) {
411+
if (ref === 'refs/remotes/origin/HEAD') {
412+
continue;
413+
}
414+
411415
switch (true) {
412416
case ref.startsWith('HEAD -> refs/heads/'):
413417
references.push({

extensions/terminal-suggest/src/terminalSuggestMain.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export async function activate(context: vscode.ExtensionContext) {
116116
}
117117

118118
if (result.cwd && (result.filesRequested || result.foldersRequested)) {
119-
return new vscode.TerminalCompletionList(result.items, { filesRequested: result.filesRequested, foldersRequested: result.foldersRequested, cwd: result.cwd, pathSeparator: isWindows ? '\\' : '/', env: terminal.shellIntegration?.env });
119+
return new vscode.TerminalCompletionList(result.items, { filesRequested: result.filesRequested, foldersRequested: result.foldersRequested, cwd: result.cwd, env: terminal.shellIntegration?.env });
120120
}
121121
return result.items;
122122
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "code-oss-dev",
33
"version": "1.98.0",
4-
"distro": "4e8c47ac95d95aa744f78305db0f163dcd407126",
4+
"distro": "41de7f370f100ee0374fe780e73a995803da6a9c",
55
"author": {
66
"name": "Microsoft Corporation"
77
},
@@ -237,4 +237,4 @@
237237
"optionalDependencies": {
238238
"windows-foreground-love": "0.5.0"
239239
}
240-
}
240+
}

src/vs/base/common/product.ts

-2
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,6 @@ export interface IProductConfiguration {
9595

9696
readonly extensionsGallery?: {
9797
readonly serviceUrl: string;
98-
readonly servicePPEUrl?: string;
99-
readonly searchUrl?: string;
10098
readonly itemUrl: string;
10199
readonly publisherUrl: string;
102100
readonly resourceUrlTemplate: string;

src/vs/base/common/types.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,9 @@ export function assertOneOf<TType, TSubtype extends TType>(
202202
}
203203

204204
/**
205-
* Simple compile-time type check function to validate a type of
206-
* a provided object.
205+
* Compile-time type check of a variable.
207206
*/
208-
export function typeCheck<T extends unknown>(_thing: T): asserts _thing is T { }
207+
export function typeCheck<T = never>(_thing: NoInfer<T>): void { }
209208

210209
const hasOwnProperty = Object.prototype.hasOwnProperty;
211210

src/vs/code/electron-utility/sharedProcess/contrib/defaultExtensionsInitializer.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class DefaultExtensionsInitializer extends Disposable {
5050
return;
5151
}
5252

53-
const vsixs = stat.children.filter(child => child.name.endsWith('.vsix'));
53+
const vsixs = stat.children.filter(child => child.name.toLowerCase().endsWith('.vsix'));
5454
if (vsixs.length === 0) {
5555
this.logService.debug('There are no default extensions to initialize', extensionsLocation.toString());
5656
return;

src/vs/editor/browser/services/hoverService/hoverService.ts

+33-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ import { ManagedHoverWidget } from './updatableHoverWidget.js';
2626
import { timeout, TimeoutTimer } from '../../../../base/common/async.js';
2727
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.js';
2828
import { isNumber } from '../../../../base/common/types.js';
29-
import { KeyCode } from '../../../../base/common/keyCodes.js';
29+
import { KeyChord, KeyCode, KeyMod } from '../../../../base/common/keyCodes.js';
30+
import { KeybindingsRegistry, KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js';
31+
import { EditorContextKeys } from '../../../common/editorContextKeys.js';
3032

3133
export class HoverService extends Disposable implements IHoverService {
3234
declare readonly _serviceBrand: undefined;
@@ -41,6 +43,9 @@ export class HoverService extends Disposable implements IHoverService {
4143

4244
private _lastFocusedElementBeforeOpen: HTMLElement | undefined;
4345

46+
private readonly _delayedHovers = new Map<HTMLElement, { show: (focus: boolean) => void }>();
47+
private readonly _managedHovers = new Map<HTMLElement, IManagedHover>();
48+
4449
constructor(
4550
@IInstantiationService private readonly _instantiationService: IInstantiationService,
4651
@IConfigurationService private readonly _configurationService: IConfigurationService,
@@ -53,6 +58,14 @@ export class HoverService extends Disposable implements IHoverService {
5358

5459
this._register(contextMenuService.onDidShowContextMenu(() => this.hideHover()));
5560
this._contextViewHandler = this._register(new ContextViewHandler(this._layoutService));
61+
62+
this._register(KeybindingsRegistry.registerCommandAndKeybindingRule({
63+
id: 'workbench.action.showHover',
64+
weight: KeybindingWeight.WorkbenchContrib - 1,
65+
when: EditorContextKeys.editorTextFocus.negate(),
66+
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KeyK, KeyMod.CtrlCmd | KeyCode.KeyI),
67+
handler: () => { this._showAndFocusHoverForActiveElement(); },
68+
}));
5669
}
5770

5871
showHover(options: IHoverOptions, focus?: boolean, skipLastFocusedUpdate?: boolean, dontShow?: boolean): IHoverWidget | undefined {
@@ -160,6 +173,10 @@ export class HoverService extends Disposable implements IHoverService {
160173
}
161174
}));
162175
}
176+
177+
this._delayedHovers.set(target, { show: (focus: boolean) => { this.showHover(resolveHoverOptions(), focus); } });
178+
store.add(toDisposable(() => this._delayedHovers.delete(target)));
179+
163180
return store;
164181
}
165182

@@ -301,6 +318,21 @@ export class HoverService extends Disposable implements IHoverService {
301318
this.showHover(this._lastHoverOptions, true, true);
302319
}
303320

321+
private _showAndFocusHoverForActiveElement(): void {
322+
// TODO: if hover is visible, focus it to avoid flickering
323+
324+
let activeElement = getActiveElement() as HTMLElement | null;
325+
while (activeElement) {
326+
const hover = this._delayedHovers.get(activeElement) ?? this._managedHovers.get(activeElement);
327+
if (hover) {
328+
hover.show(true);
329+
return;
330+
}
331+
332+
activeElement = activeElement.parentElement;
333+
}
334+
}
335+
304336
private _keyDown(e: KeyboardEvent, hover: HoverWidget, hideOnKeyDown: boolean) {
305337
if (e.key === 'Alt') {
306338
hover.isLocked = true;
@@ -328,8 +360,6 @@ export class HoverService extends Disposable implements IHoverService {
328360
}
329361
}
330362

331-
private readonly _managedHovers = new Map<HTMLElement, IManagedHover>();
332-
333363
// TODO: Investigate performance of this function. There seems to be a lot of content created
334364
// and thrown away on start up
335365
setupManagedHover(hoverDelegate: IHoverDelegate, targetElement: HTMLElement, content: IManagedHoverContentOrFactory, options?: IManagedHoverOptions | undefined): IManagedHover {

src/vs/editor/browser/services/hoverService/hoverWidget.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import './hover.css';
7-
import { DisposableStore, MutableDisposable } from '../../../../base/common/lifecycle.js';
7+
import { DisposableStore, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';
88
import { Event, Emitter } from '../../../../base/common/event.js';
99
import * as dom from '../../../../base/browser/dom.js';
1010
import { IKeybindingService } from '../../../../platform/keybinding/common/keybinding.js';
@@ -165,7 +165,7 @@ export class HoverWidget extends Widget implements IHoverWidget {
165165
{ codeBlockFontFamily: this._configurationService.getValue<IEditorOptions>('editor').fontFamily || EDITOR_FONT_DEFAULTS.fontFamily }
166166
);
167167

168-
const { element } = mdRenderer.render(markdown, {
168+
const { element, dispose } = mdRenderer.render(markdown, {
169169
actionHandler: {
170170
callback: (content) => this._linkHandler(content),
171171
disposables: this._messageListeners
@@ -178,6 +178,7 @@ export class HoverWidget extends Widget implements IHoverWidget {
178178
}
179179
});
180180
contentsElement.appendChild(element);
181+
this._register(toDisposable(dispose));
181182
}
182183
rowElement.appendChild(contentsElement);
183184
this._hover.contentsDomNode.appendChild(rowElement);
@@ -188,15 +189,15 @@ export class HoverWidget extends Widget implements IHoverWidget {
188189
options.actions.forEach(action => {
189190
const keybinding = this._keybindingService.lookupKeybinding(action.commandId);
190191
const keybindingLabel = keybinding ? keybinding.getLabel() : null;
191-
HoverAction.render(actionsElement, {
192+
this._register(HoverAction.render(actionsElement, {
192193
label: action.label,
193194
commandId: action.commandId,
194195
run: e => {
195196
action.run(e);
196197
this.dispose();
197198
},
198199
iconClass: action.iconClass
199-
}, keybindingLabel);
200+
}, keybindingLabel));
200201
});
201202
statusBarElement.appendChild(actionsElement);
202203
this._hover.containerDomNode.appendChild(statusBarElement);

src/vs/editor/browser/widget/diffEditor/features/gutterFeature.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ class DiffToolBar extends Disposable implements IGutterItemView {
245245
},
246246
overflowBehavior: { maxItems: this._isSmall.read(reader) ? 1 : 3 },
247247
hiddenItemStrategy: HiddenItemStrategy.Ignore,
248-
actionRunner: new ActionRunnerWithContext(() => {
248+
actionRunner: store.add(new ActionRunnerWithContext(() => {
249249
const item = this._item.get();
250250
const mapping = item.mapping;
251251
return {
@@ -254,7 +254,7 @@ class DiffToolBar extends Disposable implements IGutterItemView {
254254
originalUri: item.originalUri,
255255
modifiedUri: item.modifiedUri,
256256
} satisfies DiffEditorSelectionHunkToolbarContext;
257-
}),
257+
})),
258258
menuOptions: {
259259
shouldForwardArgs: true,
260260
},

src/vs/editor/common/languages/highlights/typescript.scm

+2-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@
306306

307307
(rest_pattern) @keyword.operator.rest
308308

309-
(spread_element) @keyword.operator.spread
309+
(spread_element
310+
("...") @keyword.operator.spread)
310311

311312
; Language constants
312313

src/vs/editor/common/services/treeSitter/treeSitterParserService.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,8 @@ export class TreeSitterParseResult implements IDisposable, ITreeSitterParseResul
271271
}
272272
return c?.hasChanges;
273273
});
274-
if (changedChildren.length >= 1) {
275-
next = gotoNthChild(indexChangedChildren[0]);
276-
} else if (changedChildren.length === 0) {
274+
// If we have changes and we *had* an error, the whole node should be refreshed.
275+
if ((changedChildren.length === 0) || oldCursor.currentNode.hasError) {
277276
// walk up again until we get to the first one that's named as unnamed nodes can be too granular
278277
while (newCursor.currentNode.parent && !newCursor.currentNode.isNamed && next) {
279278
next = gotoParent();
@@ -293,6 +292,8 @@ export class TreeSitterParseResult implements IDisposable, ITreeSitterParseResul
293292

294293
changedRanges.push({ newStartPosition, newEndPosition, oldStartIndex, oldEndIndex, newNodeId: newNode.id, newStartIndex, newEndIndex: newNode.endIndex });
295294
next = nextSiblingOrParentSibling();
295+
} else if (changedChildren.length >= 1) {
296+
next = gotoNthChild(indexChangedChildren[0]);
296297
}
297298
} else {
298299
next = nextSiblingOrParentSibling();

src/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.ts

+4
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ export class StandaloneQuickInputService implements IQuickInputService {
160160
setAlignment(alignment: 'top' | 'center' | { top: number; left: number }): void {
161161
return this.activeService.setAlignment(alignment);
162162
}
163+
164+
toggleHover(): void {
165+
return this.activeService.toggleHover();
166+
}
163167
}
164168

165169
export class QuickInputEditorContribution implements IEditorContribution {

src/vs/platform/actions/browser/menuEntryActionViewItem.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ export class DropdownWithDefaultActionViewItem extends BaseActionViewItem {
468468
...options,
469469
menuAsChild: options?.menuAsChild ?? true,
470470
classNames: options?.classNames ?? ['codicon', 'codicon-chevron-down'],
471-
actionRunner: options?.actionRunner ?? new ActionRunner(),
471+
actionRunner: options?.actionRunner ?? this._register(new ActionRunner()),
472472
};
473473

474474
this._dropdown = new DropdownMenuActionViewItem(submenuAction, submenuAction.actions, this._contextMenuService, dropdownOptions);

src/vs/platform/contextview/browser/contextMenuHandler.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class ContextMenuHandler {
8181

8282
const menuDisposables = new DisposableStore();
8383

84-
const actionRunner = delegate.actionRunner || new ActionRunner();
84+
const actionRunner = delegate.actionRunner || menuDisposables.add(new ActionRunner());
8585
actionRunner.onWillRun(evt => this.onActionRun(evt, !delegate.skipTelemetry), this, menuDisposables);
8686
actionRunner.onDidRun(this.onDidActionRun, this, menuDisposables);
8787
menu = new Menu(container, actions, {

0 commit comments

Comments
 (0)