Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
swordensen committed Apr 5, 2024
2 parents 7b96d0e + f144cce commit 78ed36c
Show file tree
Hide file tree
Showing 82 changed files with 808 additions and 461 deletions.
2 changes: 1 addition & 1 deletion .vscode/notebooks/my-work.github-issues
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
{
"kind": 2,
"language": "github-issues",
"value": "repo:microsoft/vscode is:open assignee:@me label:triage-needed\n"
"value": "$REPOS is:open assignee:@me label:triage-needed\n"
},
{
"kind": 1,
Expand Down
6 changes: 6 additions & 0 deletions build/lib/stylelint/vscode-known-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,9 @@
"--vscode-panelTitle-activeBorder",
"--vscode-panelTitle-activeForeground",
"--vscode-panelTitle-inactiveForeground",
"--vscode-panelStickyScroll-background",
"--vscode-panelStickyScroll-border",
"--vscode-panelStickyScroll-shadow",
"--vscode-peekView-border",
"--vscode-peekViewEditor-background",
"--vscode-peekViewEditor-matchHighlightBackground",
Expand Down Expand Up @@ -567,6 +570,9 @@
"--vscode-sideBarSectionHeader-foreground",
"--vscode-sideBarTitle-background",
"--vscode-sideBarTitle-foreground",
"--vscode-sideBarStickyScroll-background",
"--vscode-sideBarStickyScroll-border",
"--vscode-sideBarStickyScroll-shadow",
"--vscode-sideBySideEditor-horizontalBorder",
"--vscode-sideBySideEditor-verticalBorder",
"--vscode-simpleFindWidget-sashBorder",
Expand Down
4 changes: 2 additions & 2 deletions extensions/markdown-language-features/server/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vscode-markdown-languageserver",
"description": "Markdown language server",
"version": "0.5.0-alpha.3",
"version": "0.5.0-alpha.4",
"author": "Microsoft Corporation",
"license": "MIT",
"engines": {
Expand All @@ -18,7 +18,7 @@
"vscode-languageserver": "^8.1.0",
"vscode-languageserver-textdocument": "^1.0.8",
"vscode-languageserver-types": "^3.17.3",
"vscode-markdown-languageservice": "^0.5.0-alpha.3",
"vscode-markdown-languageservice": "^0.5.0-alpha.4",
"vscode-uri": "^3.0.7"
},
"devDependencies": {
Expand Down
8 changes: 4 additions & 4 deletions extensions/markdown-language-features/server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ vscode-languageserver@^8.1.0:
dependencies:
vscode-languageserver-protocol "3.17.3"

vscode-markdown-languageservice@^0.5.0-alpha.3:
version "0.5.0-alpha.3"
resolved "https://registry.yarnpkg.com/vscode-markdown-languageservice/-/vscode-markdown-languageservice-0.5.0-alpha.3.tgz#417e853c73ce2e1a2460e52d8868576365d6cb05"
integrity sha512-wD9LO4CWtrp7dqbQBoQ6HbQpDpN2lUTC6SvDDjhZVDqRU0XqJP5YyO4FsvY+MWwz75b3QwapYYv4635EY4xhrA==
vscode-markdown-languageservice@^0.5.0-alpha.4:
version "0.5.0-alpha.4"
resolved "https://registry.yarnpkg.com/vscode-markdown-languageservice/-/vscode-markdown-languageservice-0.5.0-alpha.4.tgz#900faff6cb0784495117399bc6215691f7800d9b"
integrity sha512-Df6GzywR5cJ3LfBio3Fx45MfJJwDBVg5tcfpzH9XTvExYeHd1pHOUKssJLW4LBSX4bXwiFsNqrOB8va03d8LQQ==
dependencies:
"@vscode/l10n" "^0.0.10"
node-html-parser "^6.1.5"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "code-oss-dev",
"version": "1.89.0",
"distro": "340432a8308f66007779ec2133ee39e6995006cb",
"distro": "51cc447f78b8a92b468906c0718cda74314ba794",
"author": {
"name": "Microsoft Corporation"
},
Expand Down
4 changes: 2 additions & 2 deletions product.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
},
{
"name": "ms-vscode.vscode-js-profile-table",
"version": "1.0.8",
"sha256": "ca30069e21fbf576b49638ff8ff7c316b028c2faca924c23526737c65b8762bf",
"version": "1.0.9",
"sha256": "3b62ee4276a2bbea3fe230f94b1d5edd915b05966090ea56f882e1e0ab53e1a6",
"repo": "https://github.com/microsoft/vscode-js-profile-visualizer",
"metadata": {
"id": "7e52b41b-71ad-457b-ab7e-0620f1fc4feb",
Expand Down
2 changes: 1 addition & 1 deletion resources/linux/code.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Name=@@NAME_LONG@@
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=@@EXEC@@ --unity-launch %F
Exec=@@EXEC@@ %F
Icon=@@ICON@@
Type=Application
StartupNotify=false
Expand Down
26 changes: 13 additions & 13 deletions src/vs/base/browser/touch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,28 +192,28 @@ export class Gesture extends Disposable {
holdTime = Date.now() - data.initialTimeStamp;

if (holdTime < Gesture.HOLD_DELAY
&& Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)) < 30
&& Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)) < 30) {
&& Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)!) < 30
&& Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)!) < 30) {

const evt = this.newGestureEvent(EventType.Tap, data.initialTarget);
evt.pageX = arrays.tail(data.rollingPageX);
evt.pageY = arrays.tail(data.rollingPageY);
evt.pageX = arrays.tail(data.rollingPageX)!;
evt.pageY = arrays.tail(data.rollingPageY)!;
this.dispatchEvent(evt);

} else if (holdTime >= Gesture.HOLD_DELAY
&& Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)) < 30
&& Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)) < 30) {
&& Math.abs(data.initialPageX - arrays.tail(data.rollingPageX)!) < 30
&& Math.abs(data.initialPageY - arrays.tail(data.rollingPageY)!) < 30) {

const evt = this.newGestureEvent(EventType.Contextmenu, data.initialTarget);
evt.pageX = arrays.tail(data.rollingPageX);
evt.pageY = arrays.tail(data.rollingPageY);
evt.pageX = arrays.tail(data.rollingPageX)!;
evt.pageY = arrays.tail(data.rollingPageY)!;
this.dispatchEvent(evt);

} else if (activeTouchCount === 1) {
const finalX = arrays.tail(data.rollingPageX);
const finalY = arrays.tail(data.rollingPageY);
const finalX = arrays.tail(data.rollingPageX)!;
const finalY = arrays.tail(data.rollingPageY)!;

const deltaT = arrays.tail(data.rollingTimestamps) - data.rollingTimestamps[0];
const deltaT = arrays.tail(data.rollingTimestamps)! - data.rollingTimestamps[0];
const deltaX = finalX - data.rollingPageX[0];
const deltaY = finalY - data.rollingPageY[0];

Expand Down Expand Up @@ -345,8 +345,8 @@ export class Gesture extends Disposable {
const data = this.activeTouches[touch.identifier];

const evt = this.newGestureEvent(EventType.Change, data.initialTarget);
evt.translationX = touch.pageX - arrays.tail(data.rollingPageX);
evt.translationY = touch.pageY - arrays.tail(data.rollingPageY);
evt.translationX = touch.pageX - arrays.tail(data.rollingPageX)!;
evt.translationY = touch.pageY - arrays.tail(data.rollingPageY)!;
evt.pageX = touch.pageX;
evt.pageY = touch.pageY;
this.dispatchEvent(evt);
Expand Down
8 changes: 7 additions & 1 deletion src/vs/base/browser/ui/list/listWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,9 @@ export interface IListStyles {
listHoverOutline: string | undefined;
treeIndentGuidesStroke: string | undefined;
treeInactiveIndentGuidesStroke: string | undefined;
treeStickyScrollBackground: string | undefined;
treeStickyScrollBorder: string | undefined;
treeStickyScrollShadow: string | undefined;
tableColumnsBorder: string | undefined;
tableOddRowsBackgroundColor: string | undefined;
}
Expand Down Expand Up @@ -1124,7 +1127,10 @@ export const unthemedListStyles: IListStyles = {
listFocusOutline: undefined,
listInactiveFocusOutline: undefined,
listSelectionOutline: undefined,
listHoverOutline: undefined
listHoverOutline: undefined,
treeStickyScrollBackground: undefined,
treeStickyScrollBorder: undefined,
treeStickyScrollShadow: undefined
};

const DefaultOptions: IListOptions<any> = {
Expand Down
17 changes: 14 additions & 3 deletions src/vs/base/browser/ui/tree/abstractTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2772,9 +2772,20 @@ export abstract class AbstractTree<T, TFilterData, TRef> implements IDisposable
}

// Sticky Scroll Background
if (styles.listBackground) {
content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${styles.listBackground}; }`);
content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${styles.listBackground}; }`);
const stickyScrollBackground = styles.treeStickyScrollBackground ?? styles.listBackground;
if (stickyScrollBackground) {
content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container { background-color: ${stickyScrollBackground}; }`);
content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-row { background-color: ${stickyScrollBackground}; }`);
}

// Sticky Scroll Border
if (styles.treeStickyScrollBorder) {
content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container { border-bottom: 1px solid ${styles.treeStickyScrollBorder}; }`);
}

// Sticky Scroll Shadow
if (styles.treeStickyScrollShadow) {
content.push(`.monaco-list${suffix} .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow { box-shadow: ${styles.treeStickyScrollShadow} 0 6px 6px -6px inset; height: 3px; }`);
}

// Sticky Scroll Focus
Expand Down
9 changes: 4 additions & 5 deletions src/vs/base/browser/ui/tree/media/tree.css
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
height: 0;
z-index: 13; /* Settings editor uses z-index: 12 */

/* TODO@benibenj temporary solution, all lists should provide their background */
/* Backup color in case the tree does not provide the background color */
background-color: var(--vscode-sideBar-background);
}

Expand All @@ -147,7 +147,7 @@
opacity: 1 !important; /* Settings editor uses opacity < 1 */
overflow: hidden;

/* TODO@benibenj temporary solution, all lists should provide their background */
/* Backup color in case the tree does not provide the background color */
background-color: var(--vscode-sideBar-background);
}

Expand All @@ -161,13 +161,12 @@
display: none;
}

.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow{
.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container .monaco-tree-sticky-container-shadow {
position: absolute;
bottom: -3px;
left: 0px;
height: 3px;
height: 0px; /* heigt is 3px and only set when there is a treeStickyScrollShadow color */
width: 100%;
box-shadow: var(--vscode-scrollbar-shadow) 0 6px 6px -6px inset;
}

.monaco-list .monaco-scrollable-element .monaco-tree-sticky-container[tabindex="0"]:focus{
Expand Down
2 changes: 1 addition & 1 deletion src/vs/base/common/arrays.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { findFirstIdxMonotonousOrArrLen } from './arraysFind';
* @param array The array.
* @param n Which element from the end (default is zero).
*/
export function tail<T>(array: ArrayLike<T>, n: number = 0): T {
export function tail<T>(array: ArrayLike<T>, n: number = 0): T | undefined {
return array[array.length - (1 + n)];
}

Expand Down
5 changes: 5 additions & 0 deletions src/vs/base/common/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ export namespace Schemas {
*/
export const vscodeSourceControl = 'vscode-scm';

/**
* Scheme used for input box for creating comments.
*/
export const commentsInput = 'comment';

/**
* Scheme used for special rendering of settings in the release notes
*/
Expand Down
5 changes: 5 additions & 0 deletions src/vs/base/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,3 +243,8 @@ export type DeepRequiredNonNullable<T> = {
export type DeepPartial<T> = {
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : Partial<T[P]>;
};

/**
* Represents a type that is a partial version of a given type `T`, except a subset.
*/
export type PartialExcept<T, K extends keyof T> = Partial<Omit<T, K>> & Pick<T, K>;
2 changes: 1 addition & 1 deletion src/vs/code/electron-main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ export class CodeApplication extends Disposable {
return windowsMainService.open({
context,
cli: args,
forceNewWindow: args['new-window'] || (!hasCliArgs && args['unity-launch']),
forceNewWindow: args['new-window'],
diffMode: args.diff,
mergeMode: args.merge,
noRecentEntry,
Expand Down
41 changes: 41 additions & 0 deletions src/vs/editor/browser/stableEditorScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,44 @@ export class StableEditorScrollState {
editor.setScrollTop(editor.getScrollTop() + offset);
}
}


export class StableEditorBottomScrollState {

public static capture(editor: ICodeEditor): StableEditorBottomScrollState {
if (editor.hasPendingScrollAnimation()) {
// Never mess with the scroll if there is a pending scroll animation
return new StableEditorBottomScrollState(editor.getScrollTop(), editor.getContentHeight(), null, 0);
}

let visiblePosition: Position | null = null;
let visiblePositionScrollDelta = 0;
const visibleRanges = editor.getVisibleRanges();
if (visibleRanges.length > 0) {
visiblePosition = visibleRanges.at(-1)!.getEndPosition();
const visiblePositionScrollBottom = editor.getBottomForLineNumber(visiblePosition.lineNumber);
visiblePositionScrollDelta = (editor.getScrollTop() + editor.getLayoutInfo().height) - visiblePositionScrollBottom;
}
return new StableEditorBottomScrollState(editor.getScrollTop(), editor.getContentHeight(), visiblePosition, visiblePositionScrollDelta);
}

constructor(
private readonly _initialScrollTop: number,
private readonly _initialContentHeight: number,
private readonly _visiblePosition: Position | null,
private readonly _visiblePositionScrollDelta: number,
) {
}

public restore(editor: ICodeEditor): void {
if (this._initialContentHeight === editor.getContentHeight() && this._initialScrollTop === editor.getScrollTop()) {
// The editor's content height and scroll top haven't changed, so we don't need to do anything
return;
}

if (this._visiblePosition) {
const visiblePositionScrollBottom = editor.getBottomForLineNumber(this._visiblePosition.lineNumber);
editor.setScrollTop(visiblePositionScrollBottom - (this._visiblePositionScrollDelta + editor.getLayoutInfo().height));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
super();

this._domNode = dom.$('div.lightBulbWidget');

this._domNode.role = 'menu';
this._register(Gesture.ignoreTarget(this._domNode));

this._editor.addContentWidget(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class ShowOrFocusStandaloneColorPicker extends EditorAction2 {
super({
id: 'editor.action.showOrFocusStandaloneColorPicker',
title: {
...localize2('showOrFocusStandaloneColorPicker', "Show or Focus Standalone Color Picker"),
...localize2('showOrFocusStandaloneColorPicker', "Show or focus a standalone color picker which uses the default color provider. It displays hex/rgb/hsl colors."),
mnemonicTitle: localize({ key: 'mishowOrFocusStandaloneColorPicker', comment: ['&& denotes a mnemonic'] }, "&&Show or Focus Standalone Color Picker"),
},
precondition: undefined,
Expand Down Expand Up @@ -47,6 +47,9 @@ class HideStandaloneColorPicker extends EditorAction {
kbOpts: {
primary: KeyCode.Escape,
weight: KeybindingWeight.EditorContrib
},
metadata: {
description: localize2('hideColorPickerDescription', "Hide the standalone color picker."),
}
});
}
Expand All @@ -70,6 +73,9 @@ class InsertColorWithStandaloneColorPicker extends EditorAction {
kbOpts: {
primary: KeyCode.Enter,
weight: KeybindingWeight.EditorContrib
},
metadata: {
description: localize2('insertColorWithStandaloneColorPickerDescription', "Insert hex/rgb/hsl colors with the focused standalone color picker."),
}
});
}
Expand Down
Loading

0 comments on commit 78ed36c

Please sign in to comment.