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
8 changes: 5 additions & 3 deletions build/gulpfile.vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ const glob = promisify(globCallback);
const rcedit = promisify(rceditCallback);
const root = path.dirname(import.meta.dirname);
const commit = getVersion(root);
const useVersionedUpdate = process.platform === 'win32' && (product as typeof product & { win32VersionedUpdate?: boolean })?.win32VersionedUpdate;
const versionedResourcesFolder = useVersionedUpdate ? commit!.substring(0, 10) : '';

// Build
const vscodeEntryPoints = [
Expand Down Expand Up @@ -325,6 +323,7 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d

const task = () => {
const out = sourceFolderName;
const versionedResourcesFolder = util.getVersionedResourcesFolder(platform, commit!);

const checksums = computeChecksums(out, [
'vs/base/parts/sandbox/electron-browser/preload.js',
Expand Down Expand Up @@ -528,10 +527,12 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
platform,
arch: arch === 'armhf' ? 'arm' : arch,
ffmpegChromium: false,
darwinAssetsCar: 'resources/darwin/code.car',
...(embedded ? {
darwinMiniAppName: embedded.nameShort,
darwinMiniAppBundleIdentifier: embedded.darwinBundleIdentifier,
darwinMiniAppIcon: 'resources/darwin/sessions.icns',
darwinMiniAppAssetsCar: 'resources/darwin/sessions.car',
darwinMiniAppBundleURLTypes: [{
role: 'Viewer',
name: embedded.nameLong,
Expand Down Expand Up @@ -568,7 +569,7 @@ function packageTask(platform: string, arch: string, sourceFolderName: string, d
if (platform === 'win32') {
result = es.merge(result, gulp.src('resources/win32/bin/code.js', { base: 'resources/win32', allowEmpty: true }));

if (useVersionedUpdate) {
if (versionedResourcesFolder) {
result = es.merge(result, gulp.src('resources/win32/versioned/bin/code.cmd', { base: 'resources/win32/versioned' })
.pipe(replace('@@NAME@@', product.nameShort))
.pipe(replace('@@VERSIONFOLDER@@', versionedResourcesFolder))
Expand Down Expand Up @@ -646,6 +647,7 @@ function patchWin32DependenciesTask(destinationFolderName: string) {
const cwd = path.join(path.dirname(root), destinationFolderName);

return async () => {
const versionedResourcesFolder = util.getVersionedResourcesFolder('win32', commit!);
const deps = (await Promise.all([
glob('**/*.node', { cwd, ignore: 'extensions/node_modules/@parcel/watcher/**' }),
glob('**/rg.exe', { cwd }),
Expand Down
6 changes: 6 additions & 0 deletions build/lib/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ export function getElectronVersion(): Record<string, string> {
return { electronVersion, msBuildId };
}

export function getVersionedResourcesFolder(platform: string, commit: string): string {
const productJson = JSON.parse(fs.readFileSync(path.join(root, 'product.json'), 'utf8'));
const useVersionedUpdate = platform === 'win32' && productJson.win32VersionedUpdate;
return useVersionedUpdate ? commit.substring(0, 10) : '';
}

export class VinylStat implements fs.Stats {

readonly dev: number;
Expand Down
125 changes: 80 additions & 45 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"@typescript/native-preview": "^7.0.0-dev.20260306",
"@vscode/component-explorer": "^0.1.1-24",
"@vscode/component-explorer-cli": "^0.1.1-20",
"@vscode/gulp-electron": "1.40.1",
"@vscode/gulp-electron": "1.41.0",
"@vscode/l10n-dev": "0.0.35",
"@vscode/telemetry-extractor": "^1.20.2",
"@vscode/test-cli": "^0.0.6",
Expand Down Expand Up @@ -245,4 +245,4 @@
"optionalDependencies": {
"windows-foreground-love": "0.6.1"
}
}
}
14 changes: 6 additions & 8 deletions src/vs/editor/browser/view/domLineBreaksComputer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import { CharCode } from '../../../base/common/charCode.js';
import * as strings from '../../../base/common/strings.js';
import { assertReturnsDefined } from '../../../base/common/types.js';
import { applyFontInfo } from '../config/domFontInfo.js';
import { EditorOption, IComputedEditorOptions, WrappingIndent } from '../../common/config/editorOptions.js';
import { WrappingIndent } from '../../common/config/editorOptions.js';
import { StringBuilder } from '../../common/core/stringBuilder.js';
import { InjectedTextOptions } from '../../common/model.js';
import { ILineBreaksComputer, ILineBreaksComputerContext, ILineBreaksComputerFactory, ModelLineProjectionData } from '../../common/modelLineProjectionData.js';
import { LineInjectedText } from '../../common/textModelEvents.js';
import { FontInfo } from '../../common/config/fontInfo.js';

const ttPolicy = createTrustedTypesPolicy('domLineBreaksComputer', { createHTML: value => value });

Expand All @@ -25,20 +26,20 @@ export class DOMLineBreaksComputerFactory implements ILineBreaksComputerFactory
constructor(private targetWindow: WeakRef<Window>) {
}

public createLineBreaksComputer(context: ILineBreaksComputerContext, options: IComputedEditorOptions, tabSize: number): ILineBreaksComputer {
public createLineBreaksComputer(context: ILineBreaksComputerContext, fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll', wrapOnEscapedLineFeeds: boolean): ILineBreaksComputer {
const lineNumbers: number[] = [];
return {
addRequest: (lineNumber: number, previousLineBreakData: ModelLineProjectionData | null) => {
lineNumbers.push(lineNumber);
},
finalize: () => {
return createLineBreaks(assertReturnsDefined(this.targetWindow.deref()), context, lineNumbers, options, tabSize);
return createLineBreaks(assertReturnsDefined(this.targetWindow.deref()), context, lineNumbers, fontInfo, tabSize, wrappingColumn, wrappingIndent, wordBreak);
}
};
}
}

function createLineBreaks(targetWindow: Window, context: ILineBreaksComputerContext, lineNumbers: number[], options: IComputedEditorOptions, tabSize: number): (ModelLineProjectionData | null)[] {
function createLineBreaks(targetWindow: Window, context: ILineBreaksComputerContext, lineNumbers: number[], fontInfo: FontInfo, tabSize: number, firstLineBreakColumn: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll'): (ModelLineProjectionData | null)[] {
function createEmptyLineBreakWithPossiblyInjectedText(lineNumber: number): ModelLineProjectionData | null {
const injectedTexts = context.getLineInjectedText(lineNumber);
if (injectedTexts) {
Expand All @@ -55,10 +56,7 @@ function createLineBreaks(targetWindow: Window, context: ILineBreaksComputerCont
return null;
}
}
const wrappingIndent = options.get(EditorOption.wrappingIndent);
const fontInfo = options.get(EditorOption.fontInfo);
const wordBreak = options.get(EditorOption.wordBreak);
const firstLineBreakColumn = options.get(EditorOption.wrappingInfo).wrappingColumn;

if (firstLineBreakColumn === -1) {
const result: (ModelLineProjectionData | null)[] = [];
for (let i = 0, len = lineNumbers.length; i < len; i++) {
Expand Down
5 changes: 3 additions & 2 deletions src/vs/editor/common/modelLineProjectionData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
*--------------------------------------------------------------------------------------------*/

import { assertNever } from '../../base/common/assert.js';
import { IComputedEditorOptions } from './config/editorOptions.js';
import { WrappingIndent } from './config/editorOptions.js';
import { FontInfo } from './config/fontInfo.js';
import { Position } from './core/position.js';
import { InjectedTextCursorStops, InjectedTextOptions, PositionAffinity } from './model.js';
import { LineInjectedText } from './textModelEvents.js';
Expand Down Expand Up @@ -333,7 +334,7 @@ export interface ILineBreaksComputerContext {
}

export interface ILineBreaksComputerFactory {
createLineBreaksComputer(context: ILineBreaksComputerContext, options: IComputedEditorOptions, tabSize: number): ILineBreaksComputer;
createLineBreaksComputer(context: ILineBreaksComputerContext, fontInfo: FontInfo, tabSize: number, wrappingColumn: number, wrappingIndent: WrappingIndent, wordBreak: 'normal' | 'keepAll', wrapOnEscapedLineFeeds: boolean): ILineBreaksComputer;
}

export interface ILineBreaksComputer {
Expand Down
Loading
Loading