Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build/lib/stylelint/vscode-known-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@
"--vscode-window-inactiveBorder"
],
"others": [
"--editor-font-size",
"--background-dark",
"--background-light",
"--chat-editing-last-edit-shift",
Expand Down
1 change: 0 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,6 @@ export default tseslint.config(
],
'verbs': [
'accept',
'archive',
'change',
'close',
'collapse',
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
"v8-inspect-profiler": "^0.1.1",
"vscode-oniguruma": "1.7.0",
"vscode-regexpp": "^3.1.0",
"vscode-textmate": "^9.3.0",
"vscode-textmate": "^9.3.1",
"yauzl": "^3.0.0",
"yazl": "^2.4.3"
},
Expand Down
8 changes: 4 additions & 4 deletions remote/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion remote/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"tas-client": "0.3.1",
"vscode-oniguruma": "1.7.0",
"vscode-regexpp": "^3.1.0",
"vscode-textmate": "^9.3.0",
"vscode-textmate": "^9.3.1",
"yauzl": "^3.0.0",
"yazl": "^2.4.3"
},
Expand Down
8 changes: 4 additions & 4 deletions remote/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion remote/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
"katex": "^0.16.22",
"tas-client": "0.3.1",
"vscode-oniguruma": "1.7.0",
"vscode-textmate": "^9.3.0"
"vscode-textmate": "^9.3.1"
}
}
4 changes: 4 additions & 0 deletions src/vs/editor/browser/widget/codeEditor/codeEditorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
this._configuration = this._register(this._createConfiguration(codeEditorWidgetOptions.isSimpleWidget || false,
codeEditorWidgetOptions.contextMenuId ?? (codeEditorWidgetOptions.isSimpleWidget ? MenuId.SimpleEditorContext : MenuId.EditorContext),
options, accessibilityService));
this._domElement.style?.setProperty('--editor-font-size', this._configuration.options.get(EditorOption.fontSize) + 'px');
this._register(this._configuration.onDidChange((e) => {
this._onDidChangeConfiguration.fire(e);

Expand All @@ -294,6 +295,9 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
const layoutInfo = options.get(EditorOption.layoutInfo);
this._onDidLayoutChange.fire(layoutInfo);
}
if (e.hasChanged(EditorOption.fontSize)) {
this._domElement.style.setProperty('--editor-font-size', options.get(EditorOption.fontSize) + 'px');
}
}));

this._contextKeyService = this._register(contextKeyService.createScoped(this._domElement));
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 @@ -72,8 +72,8 @@ export interface IFontToken {
readonly startIndex: number;
readonly endIndex: number;
readonly fontFamily: string | null;
readonly fontSize: string | null;
readonly lineHeight: number | null;
readonly fontSizeMultiplier: number | null;
readonly lineHeightMultiplier: number | null;
}

/**
Expand Down
25 changes: 19 additions & 6 deletions src/vs/editor/common/languages/supports/tokenization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -429,10 +429,10 @@ export function generateTokensCSSForFontMap(fontMap: readonly IFontTokenOptions[
const fonts = new Set<string>();
for (let i = 1, len = fontMap.length; i < len; i++) {
const font = fontMap[i];
if (!font.fontFamily && !font.fontSize) {
if (!font.fontFamily && !font.fontSizeMultiplier) {
continue;
}
const className = classNameForFontTokenDecorations(font.fontFamily ?? '', font.fontSize ?? '');
const className = classNameForFontTokenDecorations(font.fontFamily ?? '', font.fontSizeMultiplier ?? 0);
if (fonts.has(className)) {
continue;
}
Expand All @@ -441,15 +441,28 @@ export function generateTokensCSSForFontMap(fontMap: readonly IFontTokenOptions[
if (font.fontFamily) {
rule += `font-family: ${font.fontFamily};`;
}
if (font.fontSize) {
rule += `font-size: ${font.fontSize};`;
if (font.fontSizeMultiplier) {
rule += `font-size: calc(var(--editor-font-size)*${font.fontSizeMultiplier});`;
}
rule += `}`;
rules.push(rule);
}
return rules.join('\n');
}

export function classNameForFontTokenDecorations(fontFamily: string, fontSize: string): string {
return `font-decoration-${fontFamily.toLowerCase()}-${fontSize.toLowerCase()}`;
export function classNameForFontTokenDecorations(fontFamily: string, fontSize: number): string {
const safeFontFamily = sanitizeFontFamilyForClassName(fontFamily);
return cleanClassName(`font-decoration-${safeFontFamily}-${fontSize}`);
}

function sanitizeFontFamilyForClassName(fontFamily: string): string {
const normalized = fontFamily.toLowerCase().trim();
if (!normalized) {
return 'default';
}
return cleanClassName(normalized);
}

function cleanClassName(className: string): string {
return className.replace(/[^a-z0-9_-]/gi, '-');
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export class TokenizationFontDecorationProvider extends Disposable implements De
};
TokenizationFontDecorationProvider.DECORATION_COUNT++;

if (annotation.annotation.lineHeight) {
affectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, annotation.annotation.lineHeight));
if (annotation.annotation.lineHeightMultiplier) {
affectedLineHeights.add(new LineHeightChangingDecoration(0, decorationId, lineNumber, annotation.annotation.lineHeightMultiplier));
}
affectedLineFonts.add(new LineFontChangingDecoration(0, decorationId, lineNumber));

Expand Down Expand Up @@ -135,8 +135,8 @@ export class TokenizationFontDecorationProvider extends Disposable implements De
const annotationEndPosition = this.textModel.getPositionAt(annotation.range.endExclusive);
const range = Range.fromPositions(annotationStartPosition, annotationEndPosition);
const anno = annotation.annotation;
const className = classNameForFontTokenDecorations(anno.fontToken.fontFamily ?? '', anno.fontToken.fontSize ?? '');
const affectsFont = !!(anno.fontToken.fontFamily || anno.fontToken.fontSize);
const className = classNameForFontTokenDecorations(anno.fontToken.fontFamily ?? '', anno.fontToken.fontSizeMultiplier ?? 0);
const affectsFont = !!(anno.fontToken.fontFamily || anno.fontToken.fontSizeMultiplier);
const id = anno.decorationId;
decorations.push({
id: id,
Expand Down
18 changes: 9 additions & 9 deletions src/vs/editor/common/textModelEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,11 @@ export interface IFontTokenOption {
/**
* Font size of the token.
*/
readonly fontSize?: string;
readonly fontSizeMultiplier?: number;
/**
* Line height of the token.
*/
readonly lineHeight?: number;
readonly lineHeightMultiplier?: number;
}

/**
Expand All @@ -189,8 +189,8 @@ export function serializeFontTokenOptions(): (options: IFontTokenOption) => IFon
return (annotation: IFontTokenOption) => {
return {
fontFamily: annotation.fontFamily ?? '',
fontSize: annotation.fontSize ?? '',
lineHeight: annotation.lineHeight ?? 0
fontSizeMultiplier: annotation.fontSizeMultiplier ?? 0,
lineHeightMultiplier: annotation.lineHeightMultiplier ?? 0
};
};
}
Expand All @@ -202,8 +202,8 @@ export function deserializeFontTokenOptions(): (options: IFontTokenOption) => IF
return (annotation: IFontTokenOption) => {
return {
fontFamily: annotation.fontFamily ? String(annotation.fontFamily) : undefined,
fontSize: annotation.fontSize ? String(annotation.fontSize) : undefined,
lineHeight: annotation.lineHeight ? Number(annotation.lineHeight) : undefined
fontSizeMultiplier: annotation.fontSizeMultiplier ? Number(annotation.fontSizeMultiplier) : undefined,
lineHeightMultiplier: annotation.lineHeightMultiplier ? Number(annotation.lineHeightMultiplier) : undefined
};
};
}
Expand Down Expand Up @@ -348,13 +348,13 @@ export class ModelLineHeightChanged {
/**
* The line height on the line.
*/
public readonly lineHeight: number | null;
public readonly lineHeightMultiplier: number | null;

constructor(ownerId: number, decorationId: string, lineNumber: number, lineHeight: number | null) {
constructor(ownerId: number, decorationId: string, lineNumber: number, lineHeightMultiplier: number | null) {
this.ownerId = ownerId;
this.decorationId = decorationId;
this.lineNumber = lineNumber;
this.lineHeight = lineHeight;
this.lineHeightMultiplier = lineHeightMultiplier;
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/vs/editor/common/viewModel/viewModelImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,10 @@ export class ViewModel extends Disposable implements IViewModel {

this.viewLayout.changeSpecialLineHeights((accessor: ILineHeightChangeAccessor) => {
for (const change of filteredChanges) {
const { decorationId, lineNumber, lineHeight } = change;
const { decorationId, lineNumber, lineHeightMultiplier } = change;
const viewRange = this.coordinatesConverter.convertModelRangeToViewRange(new Range(lineNumber, 1, lineNumber, this.model.getLineMaxColumn(lineNumber)));
if (lineHeight !== null) {
accessor.insertOrChangeCustomLineHeight(decorationId, viewRange.startLineNumber, viewRange.endLineNumber, lineHeight);
if (lineHeightMultiplier !== null) {
accessor.insertOrChangeCustomLineHeight(decorationId, viewRange.startLineNumber, viewRange.endLineNumber, lineHeightMultiplier * this._configuration.options.get(EditorOption.lineHeight));
} else {
accessor.removeCustomLineHeight(decorationId);
}
Expand Down
1 change: 1 addition & 0 deletions src/vs/platform/actions/common/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ export class MenuId {
static readonly AgentSessionsToolbar = new MenuId('AgentSessionsToolbar');
static readonly AgentSessionItemToolbar = new MenuId('AgentSessionItemToolbar');
static readonly AgentSessionSectionToolbar = new MenuId('AgentSessionSectionToolbar');
static readonly AgentsControlMenu = new MenuId('AgentsControlMenu');
static readonly ChatViewSessionTitleNavigationToolbar = new MenuId('ChatViewSessionTitleNavigationToolbar');
static readonly ChatViewSessionTitleToolbar = new MenuId('ChatViewSessionTitleToolbar');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const _allApiProposals = {
},
chatSessionsProvider: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatSessionsProvider.d.ts',
version: 4
version: 3
},
chatStatusItem: {
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.chatStatusItem.d.ts',
Expand Down
9 changes: 9 additions & 0 deletions src/vs/platform/native/common/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ export interface ICommonNativeHostService {

// Registry (Windows only)
windowsGetStringRegKey(hive: 'HKEY_CURRENT_USER' | 'HKEY_LOCAL_MACHINE' | 'HKEY_CLASSES_ROOT' | 'HKEY_USERS' | 'HKEY_CURRENT_CONFIG', path: string, name: string): Promise<string | undefined>;

// Zip
/**
* Creates a zip file at the specified path containing the provided files.
*
* @param zipPath The URI where the zip file should be created.
* @param files An array of file entries to include in the zip, each with a relative path and string contents.
*/
createZipFile(zipPath: URI, files: { path: string; contents: string }[]): Promise<void>;
}

export const INativeHostService = createDecorator<INativeHostService>('nativeHostService');
Expand Down
9 changes: 9 additions & 0 deletions src/vs/platform/native/electron-main/nativeHostMainService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { IV8Profile } from '../../profiling/common/profiling.js';
import { IAuxiliaryWindowsMainService } from '../../auxiliaryWindow/electron-main/auxiliaryWindows.js';
import { IAuxiliaryWindow } from '../../auxiliaryWindow/electron-main/auxiliaryWindow.js';
import { CancellationError } from '../../../base/common/errors.js';
import { zip } from '../../../base/node/zip.js';
import { IConfigurationService } from '../../configuration/common/configuration.js';
import { IProxyAuthService } from './auth.js';
import { AuthInfo, Credentials, IRequestService } from '../../request/common/request.js';
Expand Down Expand Up @@ -1168,6 +1169,14 @@ export class NativeHostMainService extends Disposable implements INativeHostMain

//#endregion

//#region Zip

async createZipFile(windowId: number | undefined, zipPath: URI, files: { path: string; contents: string }[]): Promise<void> {
await zip(zipPath.fsPath, files);
}

//#endregion

private windowById(windowId: number | undefined, fallbackCodeWindowId?: number): ICodeWindow | IAuxiliaryWindow | undefined {
return this.codeWindowById(windowId) ?? this.auxiliaryWindowById(windowId) ?? this.codeWindowById(fallbackCodeWindowId);
}
Expand Down
4 changes: 2 additions & 2 deletions src/vs/platform/theme/common/themeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ export interface IColorTheme {

export class IFontTokenOptions {
fontFamily?: string;
fontSize?: string;
lineHeight?: number;
fontSizeMultiplier?: number;
lineHeightMultiplier?: number;
}

export interface IFileIconTheme {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/api/browser/mainThreadChatSessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@ export class MainThreadChatSessions extends Disposable implements MainThreadChat
));
}


$onDidChangeChatSessionItems(handle: number): void {
this._itemProvidersRegistrations.get(handle)?.onDidChangeItems.fire();
}
Expand Down Expand Up @@ -490,7 +491,6 @@ export class MainThreadChatSessions extends Disposable implements MainThreadChat
resource: uri,
iconPath: session.iconPath,
tooltip: session.tooltip ? this._reviveTooltip(session.tooltip) : undefined,
archived: session.archived,
} satisfies IChatSessionItem;
}));
} catch (error) {
Expand Down
4 changes: 0 additions & 4 deletions src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1530,10 +1530,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
checkProposedApiEnabled(extension, 'chatSessionsProvider');
return extHostChatSessions.registerChatSessionItemProvider(extension, chatSessionType, provider);
},
createChatSessionItemController: (chatSessionType: string, refreshHandler: () => Thenable<void>) => {
checkProposedApiEnabled(extension, 'chatSessionsProvider');
return extHostChatSessions.createChatSessionItemController(extension, chatSessionType, refreshHandler);
},
registerChatSessionContentProvider(scheme: string, provider: vscode.ChatSessionContentProvider, chatParticipant: vscode.ChatParticipant, capabilities?: vscode.ChatSessionCapabilities) {
checkProposedApiEnabled(extension, 'chatSessionsProvider');
return extHostChatSessions.registerChatSessionContentProvider(extension, scheme, chatParticipant, provider, capabilities);
Expand Down
Loading
Loading