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
14 changes: 7 additions & 7 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 @@ -30,7 +30,7 @@
"license": "ISC",
"devDependencies": {
"@cloudflare/workers-types": "^4.20250109.0",
"@github1s/vscode-web": "0.24.0",
"@github1s/vscode-web": "0.25.1",
"chokidar": "^4.0.3",
"clean-css": "^5.3.3",
"copy-webpack-plugin": "^12.0.2",
Expand Down
2 changes: 1 addition & 1 deletion vscode-web/.VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.97.2
1.99.1
4 changes: 2 additions & 2 deletions vscode-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 vscode-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@github1s/vscode-web",
"version": "0.24.0",
"version": "0.25.1",
"description": "VS Code web for GitHub1s",
"author": "github1s",
"license": "MIT",
Expand Down
12 changes: 6 additions & 6 deletions vscode-web/scripts/.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"src/vs/workbench/browser/parts/activitybar/activitybarPart.ts": "533dd320519e7523e9bfd102ab35b2329223c1cf6fa909210d47ebbb75e7cf41",
"src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css": "654fa16577a5fcf83f2601f1e22e0a6ac67a9710980d6a762ee68074423a74cc",
"src/vs/workbench/browser/parts/activitybar/activitybarPart.ts": "a195c8b4170a58eca301c3044ae278fa3b811539a7274830691afc73f6da86b8",
"src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css": "6be71e59eeb2e650262bb6d15a05dbd7636928fbbae7f33998f1554b436b4108",
"src/vs/workbench/browser/web.main.ts": "0cf354b9221fdb15a738366043fbf69d8f8373891faf9f5e66a033de935eba79",
"src/vs/workbench/contrib/files/browser/editors/fileEditorInput.ts": "e986095a30dbea54af56c25fa1b184b55f34f8914129b27e2f20d8c4ea9fd16b",
"src/vs/workbench/contrib/webview/browser/pre/index.html": "09664522d7c6b0fdb7728be06b1a1f6ec8bb82c4fd6f2d13a7e84a0fd7d667af",
"src/vs/workbench/contrib/webview/browser/pre/index.html": "a325d58526d8ac86f3460afdb63787e09ea71d10e95c20518b92586ed028834c",
"src/vs/workbench/services/extensionManagement/browser/builtinExtensionsScannerService.ts": "c220568141adf6ed560bab754ea7769795465c6fa93ecd461e9b59f05ca56377",
"src/vs/workbench/services/label/common/labelService.ts": "72d72581bd521c2edadd60d4458de4d1c6a9a2cc2cf83820034c82815a2eae6a",
"src/vs/workbench/services/textfile/browser/textFileService.ts": "b5ce3f8032cd2fe5a871b33d67f578d209bbae3f42007998559138326fd16b04",
"src/vs/base/common/network.ts": "10cb07268d9805b102cf8ab9d5e03f97d935a42304c7bdc5e8c54013038bd9ad",
"src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html": "1b7956deade55aa1420516b62251d412fb578bb1165e2580b21d3d8ace968a67"
"src/vs/workbench/services/textfile/browser/textFileService.ts": "fbb6ae9a1d9ed4d57ce8b0f91e54c5a9505a293a8b15c72e09773ee54fb5cd28",
"src/vs/base/common/network.ts": "34fc2461d4b6029e71b60a3bf5d7438585e9d2b66ccdcab0893cc69d77fab5b5",
"src/vs/workbench/contrib/webview/browser/pre/index-no-csp.html": "40d576ad2307d28012b34b86858ba36ba49ae10e5aedb394bd06b14a35b869a5"
}
2 changes: 1 addition & 1 deletion vscode-web/scripts/clone.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const main = () => {
}

const url = 'https://github.com/microsoft/vscode.git';
const ref = cp.execSync(`cat ${PROJECT_ROOT}/.VERSION`).toString();
const ref = cp.execSync(`cat ${PROJECT_ROOT}/.VERSION`).toString().trim();
executeCommand('git', ['clone', '--depth', '1', '-b', ref, url, 'lib/vscode'], PROJECT_ROOT);

const locUrl = 'https://github.com/microsoft/vscode-loc.git';
Expand Down
11 changes: 9 additions & 2 deletions vscode-web/src/vs/base/common/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class FileAccessImpl {
return uri;
}

private toUri(uriOrModule: URI | string, moduleIdToUrl?: { toUrl(moduleId: string): string }): URI {
private toUri(uriOrModule: URI | string): URI {
if (URI.isUri(uriOrModule)) {
return uriOrModule;
}
Expand All @@ -354,12 +354,19 @@ class FileAccessImpl {
return URI.file(modulePath);
}

return URI.parse(moduleIdToUrl!.toUrl(uriOrModule));
throw new Error('Cannot determine URI for module id!');
}
}

export const FileAccess = new FileAccessImpl();

export const CacheControlheaders: Record<string, string> = Object.freeze({
'Cache-Control': 'no-cache, no-store'
});

export const DocumentPolicyheaders: Record<string, string> = Object.freeze({
'Document-Policy': 'include-js-call-stacks-in-crash-reports'
});

export namespace COI {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,7 @@ export class ActivityBarCompositeBar extends PaneCompositeBar {
return; // prevent menu bar from installing twice #110720
}

this.menuBarContainer = document.createElement('div');
this.menuBarContainer.classList.add('menubar');
this.menuBarContainer = $('.menubar');

const content = assertIsDefined(this.element);
/* below codes are changed by github1s */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,6 @@
width: calc(100vw - env(titlebar-area-width, 100vw) - env(titlebar-area-x, 0px));
}

.monaco-workbench.linux:not(.web) .part.titlebar .titlebar-container.counter-zoom .window-controls-container.wco-enabled {
width: calc(100vw - env(titlebar-area-width, 100vw) - env(titlebar-area-x, 0px));
}

.monaco-workbench:not(.web):not(.mac) .part.titlebar .titlebar-container:not(.counter-zoom) .window-controls-container * {
zoom: calc(1 / var(--zoom-factor, 1));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
return reject(new Error('Service Workers are not enabled. Webviews will not work. Try disabling private/incognito mode.'));
}

const swPath = encodeURI(`service-worker.js?v=${expectedWorkerVersion}&vscode-resource-base-authority=${searchParams.get('vscode-resource-base-authority')}&remoteAuthority=${searchParams.get('remoteAuthority') ?? ''}`);
const swPath = encodeURI(`service-worker.js?v=${expectedWorkerVersion}&vscode-resource-base-authority=${searchParams.get('vscode-resource-base-authority')}&id=${ID}&remoteAuthority=${searchParams.get('remoteAuthority') ?? ''}`);
navigator.serviceWorker.register(swPath)
.then(async registration => {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
return reject(new Error('Service Workers are not enabled. Webviews will not work. Try disabling private/incognito mode.'));
}

const swPath = encodeURI(`service-worker.js?v=${expectedWorkerVersion}&vscode-resource-base-authority=${searchParams.get('vscode-resource-base-authority')}&remoteAuthority=${searchParams.get('remoteAuthority') ?? ''}`);
const swPath = encodeURI(`service-worker.js?v=${expectedWorkerVersion}&vscode-resource-base-authority=${searchParams.get('vscode-resource-base-authority')}&id=${ID}&remoteAuthority=${searchParams.get('remoteAuthority') ?? ''}`);
navigator.serviceWorker.register(swPath)
.then(async registration => {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
private static readonly TEXTFILE_SAVE_CREATE_SOURCE = SaveSourceRegistry.registerSource('textFileCreate.source', localize('textFileCreate.source', "File Created"));
private static readonly TEXTFILE_SAVE_REPLACE_SOURCE = SaveSourceRegistry.registerSource('textFileOverwrite.source', localize('textFileOverwrite.source', "File Replaced"));

readonly files: ITextFileEditorModelManager = this._register(this.instantiationService.createInstance(TextFileEditorModelManager));
readonly files: ITextFileEditorModelManager;

readonly untitled: IUntitledTextEditorModelManager = this.untitledTextEditorService;
readonly untitled: IUntitledTextEditorModelManager;

constructor(
@IFileService protected readonly fileService: IFileService,
@IUntitledTextEditorService private untitledTextEditorService: IUntitledTextEditorModelManager,
@IUntitledTextEditorService untitledTextEditorService: IUntitledTextEditorModelManager,
@ILifecycleService protected readonly lifecycleService: ILifecycleService,
@IInstantiationService protected readonly instantiationService: IInstantiationService,
@IModelService private readonly modelService: IModelService,
Expand All @@ -77,6 +77,9 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
) {
super();

this.files = this._register(this.instantiationService.createInstance(TextFileEditorModelManager));
this.untitled = untitledTextEditorService;

/* below codes are changed by github1s */
if (!globalThis._VSCODE_WEB?.hideTextFileLabelDecorations) {
this.provideDecorations();
Expand Down Expand Up @@ -274,13 +277,18 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
return this.fileService.writeFile(resource, readable, options);
}

async getEncodedReadable(resource: URI, value: ITextSnapshot): Promise<VSBufferReadable>;
async getEncodedReadable(resource: URI, value: string): Promise<VSBuffer>;
async getEncodedReadable(resource: URI, value?: ITextSnapshot): Promise<VSBufferReadable | undefined>;
async getEncodedReadable(resource: URI, value?: string): Promise<VSBuffer | undefined>;
async getEncodedReadable(resource: URI, value?: string | ITextSnapshot): Promise<VSBuffer | VSBufferReadable | undefined>;
async getEncodedReadable(resource: URI, value: string | ITextSnapshot, options?: IWriteTextFileOptions): Promise<VSBuffer | VSBufferReadable>;
async getEncodedReadable(resource: URI, value?: string | ITextSnapshot, options?: IWriteTextFileOptions): Promise<VSBuffer | VSBufferReadable | undefined> {
getEncoding(resource: URI): string {
const model = resource.scheme === Schemas.untitled ? this.untitled.get(resource) : this.files.get(resource);
return model?.getEncoding() ?? this.encoding.getUnvalidatedEncodingForResource(resource);
}

async getEncodedReadable(resource: URI | undefined, value: ITextSnapshot): Promise<VSBufferReadable>;
async getEncodedReadable(resource: URI | undefined, value: string): Promise<VSBuffer | VSBufferReadable>;
async getEncodedReadable(resource: URI | undefined, value?: ITextSnapshot): Promise<VSBufferReadable | undefined>;
async getEncodedReadable(resource: URI | undefined, value?: string): Promise<VSBuffer | VSBufferReadable | undefined>;
async getEncodedReadable(resource: URI | undefined, value?: string | ITextSnapshot): Promise<VSBuffer | VSBufferReadable | undefined>;
async getEncodedReadable(resource: URI | undefined, value: string | ITextSnapshot, options?: IWriteTextFileOptions): Promise<VSBuffer | VSBufferReadable>;
async getEncodedReadable(resource: URI | undefined, value?: string | ITextSnapshot, options?: IWriteTextFileOptions): Promise<VSBuffer | VSBufferReadable | undefined> {

// check for encoding
const { encoding, addBOM } = await this.encoding.getWriteEncoding(resource, options);
Expand All @@ -298,11 +306,11 @@ export abstract class AbstractTextFileService extends Disposable implements ITex
return toEncodeReadable(snapshot, encoding, { addBOM });
}

async getDecodedStream(resource: URI, value: VSBufferReadableStream, options?: IReadTextFileEncodingOptions): Promise<ReadableStream<string>> {
async getDecodedStream(resource: URI | undefined, value: VSBufferReadableStream, options?: IReadTextFileEncodingOptions): Promise<ReadableStream<string>> {
return (await this.doGetDecodedStream(resource, value, options)).stream;
}

private doGetDecodedStream(resource: URI, stream: VSBufferReadableStream, options?: IReadTextFileEncodingOptions): Promise<IDecodeStreamResult> {
private doGetDecodedStream(resource: URI | undefined, stream: VSBufferReadableStream, options?: IReadTextFileEncodingOptions): Promise<IDecodeStreamResult> {

// read through encoding library
return toDecodeStream(stream, {
Expand Down Expand Up @@ -770,22 +778,22 @@ export class EncodingOracle extends Disposable implements IResourceEncodings {
return defaultEncodingOverrides;
}

async getWriteEncoding(resource: URI, options?: IWriteTextFileOptions): Promise<{ encoding: string; addBOM: boolean }> {
async getWriteEncoding(resource: URI | undefined, options?: IWriteTextFileOptions): Promise<{ encoding: string; addBOM: boolean }> {
const { encoding, hasBOM } = await this.getPreferredWriteEncoding(resource, options ? options.encoding : undefined);

return { encoding, addBOM: hasBOM };
}

async getPreferredWriteEncoding(resource: URI, preferredEncoding?: string): Promise<IResourceEncoding> {
const resourceEncoding = await this.getEncodingForResource(resource, preferredEncoding);
async getPreferredWriteEncoding(resource: URI | undefined, preferredEncoding?: string): Promise<IResourceEncoding> {
const resourceEncoding = await this.getValidatedEncodingForResource(resource, preferredEncoding);

return {
encoding: resourceEncoding,
hasBOM: resourceEncoding === UTF16be || resourceEncoding === UTF16le || resourceEncoding === UTF8_with_bom // enforce BOM for certain encodings
};
}

async getPreferredReadEncoding(resource: URI, options?: IReadTextFileEncodingOptions, detectedEncoding?: string): Promise<IResourceEncoding> {
async getPreferredReadEncoding(resource: URI | undefined, options?: IReadTextFileEncodingOptions, detectedEncoding?: string): Promise<IResourceEncoding> {
let preferredEncoding: string | undefined;

// Encoding passed in as option
Expand All @@ -807,15 +815,15 @@ export class EncodingOracle extends Disposable implements IResourceEncodings {
preferredEncoding = UTF8; // if we did not detect UTF 8 BOM before, this can only be UTF 8 then
}

const encoding = await this.getEncodingForResource(resource, preferredEncoding);
const encoding = await this.getValidatedEncodingForResource(resource, preferredEncoding);

return {
encoding,
hasBOM: encoding === UTF16be || encoding === UTF16le || encoding === UTF8_with_bom // enforce BOM for certain encodings
};
}

private async getEncodingForResource(resource: URI, preferredEncoding?: string): Promise<string> {
getUnvalidatedEncodingForResource(resource: URI | undefined, preferredEncoding?: string): string {
let fileEncoding: string;

const override = this.getEncodingOverride(resource);
Expand All @@ -827,17 +835,20 @@ export class EncodingOracle extends Disposable implements IResourceEncodings {
fileEncoding = this.textResourceConfigurationService.getValue(resource, 'files.encoding'); // and last we check for settings
}

if (fileEncoding !== UTF8) {
if (!fileEncoding || !(await encodingExists(fileEncoding))) {
fileEncoding = UTF8; // the default is UTF-8
}
return fileEncoding || UTF8;
}

private async getValidatedEncodingForResource(resource: URI | undefined, preferredEncoding?: string): Promise<string> {
let fileEncoding = this.getUnvalidatedEncodingForResource(resource, preferredEncoding);
if (fileEncoding !== UTF8 && !(await encodingExists(fileEncoding))) {
fileEncoding = UTF8;
}

return fileEncoding;
}

private getEncodingOverride(resource: URI): string | undefined {
if (this.encodingOverrides?.length) {
private getEncodingOverride(resource: URI | undefined): string | undefined {
if (resource && this.encodingOverrides?.length) {
for (const override of this.encodingOverrides) {

// check if the resource is child of encoding override path
Expand Down
Loading