Skip to content

Commit

Permalink
Rebase against the upstream 29d9391
Browse files Browse the repository at this point in the history
vscode-upstream-sha1: 29d9391
  • Loading branch information
Eclipse Che Sync committed Mar 28, 2023
2 parents 3106f8e + 29d9391 commit e91fe13
Show file tree
Hide file tree
Showing 17 changed files with 91 additions and 41 deletions.
2 changes: 1 addition & 1 deletion code/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "VS Code",
"name": "Code - OSS with X11/Wayland",
"build": {
"dockerfile": "Dockerfile"
},
Expand Down
2 changes: 1 addition & 1 deletion code/.devcontainer/prebuilt/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Code - OSS",
"name": "Code - OSS with VNC",

// Image contents: https://github.com/microsoft/vscode-dev-containers/blob/master/repository-containers/images/github.com/microsoft/vscode/.devcontainer/base.Dockerfile
"image": "mcr.microsoft.com/vscode/devcontainers/repos/microsoft/vscode:branch-main",
Expand Down
2 changes: 1 addition & 1 deletion code/.vscode/notebooks/api.github-issues
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"kind": 2,
"language": "github-issues",
"value": "$repo=repo:microsoft/vscode\n$milestone=milestone:\"March 2023\""
"value": "$repo=repo:microsoft/vscode\n$milestone=milestone:\"April 2023\""
},
{
"kind": 1,
Expand Down
2 changes: 1 addition & 1 deletion code/.vscode/notebooks/endgame.github-issues
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"kind": 2,
"language": "github-issues",
"value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev repo:microsoft/vscode-unpkg repo:microsoft/vscode-references-view repo:microsoft/vscode-anycode repo:microsoft/vscode-hexeditor repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-livepreview repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remote-repositories-github repo:microsoft/monaco-editor repo:microsoft/vscode-vsce repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-livepreview repo:microsoft/vscode-livepreview repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n repo:microsoft/vscode-remote-tunnels\n\n$MILESTONE=milestone:\"March 2023\""
"value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev repo:microsoft/vscode-unpkg repo:microsoft/vscode-references-view repo:microsoft/vscode-anycode repo:microsoft/vscode-hexeditor repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-livepreview repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remote-repositories-github repo:microsoft/monaco-editor repo:microsoft/vscode-vsce repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-livepreview repo:microsoft/vscode-livepreview repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n repo:microsoft/vscode-remote-tunnels\n\n$MILESTONE=milestone:\"April 2023\""
},
{
"kind": 1,
Expand Down
2 changes: 1 addition & 1 deletion code/.vscode/notebooks/my-endgame.github-issues
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"kind": 2,
"language": "github-issues",
"value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev repo:microsoft/vscode-unpkg repo:microsoft/vscode-references-view repo:microsoft/vscode-anycode repo:microsoft/vscode-hexeditor repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-livepreview repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remote-repositories-github repo:microsoft/monaco-editor repo:microsoft/vscode-vsce repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-livepreview repo:microsoft/vscode-livepreview repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n repo:microsoft/vscode-remote-tunnels\n\n$MILESTONE=milestone:\"March 2023\"\n\n$MINE=assignee:@me"
"value": "$REPOS=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev repo:microsoft/vscode-unpkg repo:microsoft/vscode-references-view repo:microsoft/vscode-anycode repo:microsoft/vscode-hexeditor repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-livepreview repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remote-repositories-github repo:microsoft/monaco-editor repo:microsoft/vscode-vsce repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-livepreview repo:microsoft/vscode-livepreview repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n repo:microsoft/vscode-remote-tunnels\n\n$MILESTONE=milestone:\"April 2023\"\n\n$MINE=assignee:@me"
},
{
"kind": 1,
Expand Down
2 changes: 1 addition & 1 deletion code/.vscode/notebooks/my-work.github-issues
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{
"kind": 2,
"language": "github-issues",
"value": "// list of repos we work in\n$repos=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev repo:microsoft/vscode-unpkg repo:microsoft/vscode-references-view repo:microsoft/vscode-anycode repo:microsoft/vscode-hexeditor repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-livepreview repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remote-repositories-github repo:microsoft/monaco-editor repo:microsoft/vscode-vsce repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-markdown-languageservice\n\n// current milestone name\n$milestone=milestone:\"March 2023\""
"value": "// list of repos we work in\n$repos=repo:microsoft/vscode repo:microsoft/vscode-remote-release repo:microsoft/vscode-js-debug repo:microsoft/vscode-pull-request-github repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-internalbacklog repo:microsoft/vscode-dev repo:microsoft/vscode-unpkg repo:microsoft/vscode-references-view repo:microsoft/vscode-anycode repo:microsoft/vscode-hexeditor repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-livepreview repo:microsoft/vscode-remotehub repo:microsoft/vscode-settings-sync-server repo:microsoft/vscode-remote-repositories-github repo:microsoft/monaco-editor repo:microsoft/vscode-vsce repo:microsoft/vscode-dev-chrome-launcher repo:microsoft/vscode-emmet-helper repo:microsoft/vscode-python repo:microsoft/vscode-jupyter repo:microsoft/vscode-jupyter-internal repo:microsoft/vscode-github-issue-notebooks repo:microsoft/vscode-l10n repo:microsoft/vscode-remote-tunnels repo:microsoft/vscode-markdown-tm-grammar repo:microsoft/vscode-markdown-languageservice\n\n// current milestone name\n$milestone=milestone:\"April 2023\""
},
{
"kind": 1,
Expand Down
8 changes: 4 additions & 4 deletions code/cli/Cargo.lock

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

2 changes: 1 addition & 1 deletion code/extensions/lua/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"git": {
"name": "sumneko/lua.tmbundle",
"repositoryUrl": "https://github.com/sumneko/lua.tmbundle",
"commitHash": "57be7c5cf8fa173f5f39806822725e503932ab45"
"commitHash": "dfdf6c33f33b7d478c474afbe1b6b3cd2e99b716"
}
},
"licenseDetail": [
Expand Down
14 changes: 11 additions & 3 deletions code/extensions/lua/syntaxes/lua.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/sumneko/lua.tmbundle/commit/57be7c5cf8fa173f5f39806822725e503932ab45",
"version": "https://github.com/sumneko/lua.tmbundle/commit/dfdf6c33f33b7d478c474afbe1b6b3cd2e99b716",
"name": "Lua",
"scopeName": "source.lua",
"patterns": [
Expand Down Expand Up @@ -77,15 +77,23 @@
]
},
{
"match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(\\.[0-9A-Fa-f]+)?([eE]-?\\d*)?([pP][-+]\\d+)?",
"match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(\\.[0-9A-Fa-f]*)?([eE]-?\\d*)?([pP][-+]\\d+)?",
"name": "constant.numeric.float.hexadecimal.lua"
},
{
"match": "(?<![\\w\\d.])0[xX]\\.[0-9A-Fa-f]+([eE]-?\\d*)?([pP][-+]\\d+)?",
"name": "constant.numeric.float.hexadecimal.lua"
},
{
"match": "(?<![\\w\\d.])0[xX][0-9A-Fa-f]+(?![pPeE.0-9])",
"name": "constant.numeric.integer.hexadecimal.lua"
},
{
"match": "(?<![\\w\\d.])\\d+(\\.\\d+)?([eE]-?\\d*)?",
"match": "(?<![\\w\\d.])\\d+(\\.\\d*)?([eE]-?\\d*)?",
"name": "constant.numeric.float.lua"
},
{
"match": "(?<![\\w\\d.])\\.\\d+([eE]-?\\d*)?",
"name": "constant.numeric.float.lua"
},
{
Expand Down
4 changes: 1 addition & 3 deletions code/src/vs/base/browser/keyboardEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ function extractKeyCode(e: KeyboardEvent): KeyCode {
if (platform.isMacintosh) { return KeyCode.Meta; }
}
} else if (browser.isWebKit) {
if (keyCode === 91) {
return KeyCode.Meta;
} else if (platform.isMacintosh && keyCode === 93) {
if (platform.isMacintosh && keyCode === 93) {
// the two meta keys in the Mac have different key codes (91 and 93)
return KeyCode.Meta;
} else if (!platform.isMacintosh && keyCode === 92) {
Expand Down
7 changes: 4 additions & 3 deletions code/src/vs/base/browser/ui/menu/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,8 @@ ${formatRule(Codicon.menuSubmenu)}
flex-direction: row-reverse;
}
.monaco-menu .monaco-action-bar .action-item {
:host-context(.monaco-workbench:not(.reduce-motion)) .monaco-menu .monaco-action-bar .action-item,
.monaco-workbench:not(.reduce-motion) .monaco-menu .monaco-action-bar .action-item {
cursor: pointer;
display: inline-block;
transition: transform 50ms ease;
Expand Down Expand Up @@ -1309,7 +1310,7 @@ ${formatRule(Codicon.menuSubmenu)}
font-size: 11px !important;
}
.monaco-scrollable-element > .visible {
:host-context(.monaco-workbench:not(.reduce-motion)) .monaco-scrollable-element > .visible {
opacity: 1;
/* Background rule added for IE9 - to allow clicks on dom node */
Expand All @@ -1321,7 +1322,7 @@ ${formatRule(Codicon.menuSubmenu)}
opacity: 0;
pointer-events: none;
}
.monaco-scrollable-element > .invisible.fade {
:host-context(.monaco-workbench:not(.reduce-motion)) .monaco-scrollable-element > .invisible.fade {
transition: opacity 800ms linear;
}
Expand Down
2 changes: 1 addition & 1 deletion code/src/vs/base/common/keyCodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ for (let i = 0; i <= KeyCode.MAX_VALUE; i++) {
[5, 1, ScanCode.None, empty, KeyCode.Ctrl, 'Ctrl', 17, 'VK_CONTROL', empty, empty],
[4, 1, ScanCode.None, empty, KeyCode.Shift, 'Shift', 16, 'VK_SHIFT', empty, empty],
[6, 1, ScanCode.None, empty, KeyCode.Alt, 'Alt', 18, 'VK_MENU', empty, empty],
[57, 1, ScanCode.None, empty, KeyCode.Meta, 'Meta', 0, 'VK_COMMAND', empty, empty],
[57, 1, ScanCode.None, empty, KeyCode.Meta, 'Meta', 91, 'VK_COMMAND', empty, empty],
[5, 1, ScanCode.ControlLeft, 'ControlLeft', KeyCode.Ctrl, empty, 0, 'VK_LCONTROL', empty, empty],
[4, 1, ScanCode.ShiftLeft, 'ShiftLeft', KeyCode.Shift, empty, 0, 'VK_LSHIFT', empty, empty],
[6, 1, ScanCode.AltLeft, 'AltLeft', KeyCode.Alt, empty, 0, 'VK_LMENU', empty, empty],
Expand Down
10 changes: 5 additions & 5 deletions code/src/vs/editor/browser/services/editorWorkerService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost';
import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures';
import { IChange } from 'vs/editor/common/diff/smartLinesDiffComputer';
import { IDocumentDiff, IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider';
import { LineRangeMapping, RangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
import { ILinesDiffComputerOptions, LineRangeMapping, RangeMapping } from 'vs/editor/common/diff/linesDiffComputer';
import { LineRange } from 'vs/editor/common/core/lineRange';

/**
Expand Down Expand Up @@ -153,13 +153,13 @@ export class EditorWorkerService extends Disposable implements IEditorWorkerServ
return Promise.resolve(edits); // File too large
}
const sw = StopWatch.create(true);
const result = this._workerManager.withWorker().then(client => client.computeHumanReadableDiff(resource, edits)).catch((err) => {
const result = this._workerManager.withWorker().then(client => client.computeHumanReadableDiff(resource, edits, { ignoreTrimWhitespace: false, maxComputationTimeMs: 1000 })).catch((err) => {
onUnexpectedError(err);
// In case of an exception, fall back to computeMoreMinimalEdits
return this.computeMoreMinimalEdits(resource, edits, true);
});
result.finally(() => this._logService.trace('FORMAT#computeHumanReadableDiff', resource.toString(true), sw.elapsed()));
return Promise.race([result, timeout(1000).then(() => edits)]);
return result;

} else {
return Promise.resolve(undefined);
Expand Down Expand Up @@ -554,9 +554,9 @@ export class EditorWorkerClient extends Disposable implements IEditorWorkerClien
});
}

public computeHumanReadableDiff(resource: URI, edits: languages.TextEdit[]): Promise<languages.TextEdit[]> {
public computeHumanReadableDiff(resource: URI, edits: languages.TextEdit[], options: ILinesDiffComputerOptions): Promise<languages.TextEdit[]> {
return this._withSyncedResources([resource]).then(proxy => {
return proxy.computeHumanReadableDiff(resource.toString(), edits);
return proxy.computeHumanReadableDiff(resource.toString(), edits, options);
});
}

Expand Down
20 changes: 13 additions & 7 deletions code/src/vs/editor/common/diff/algorithms/diffAlgorithm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,28 @@ export class InfiniteTimeout implements ITimeout {

export class DateTimeout implements ITimeout {
private readonly startTime = Date.now();
private valid = true;

constructor(private readonly timeout: number) {
// Recommendation: Set a log-point `{this.debuggerDisable()}` here
constructor(private timeout: number) {
if (timeout <= 0) {
throw new BugIndicatingError('timeout must be positive');
}
}

// Recommendation: Set a log-point `{this.disable()}` in the body
public isValid(): boolean {
const now = Date.now();
// eslint-disable-next-line no-debugger
debugger; // WARNING, call `this.debuggerDisable()` to not get different results when debugging
return now - this.startTime < this.timeout;
const valid = Date.now() - this.startTime < this.timeout;
if (!valid && this.valid) {
this.valid = false; // timeout reached
// eslint-disable-next-line no-debugger
debugger; // WARNING: Most likely debugging caused the timeout. Call `this.disable()` to continue without timing out.
}
return this.valid;
}

public debuggerDisable() {
public disable() {
this.timeout = Number.MAX_SAFE_INTEGER;
this.isValid = () => true;
this.valid = true;
}
}
14 changes: 9 additions & 5 deletions code/src/vs/editor/common/diff/standardLinesDiffComputer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ export class StandardLinesDiffComputer implements ILinesDiffComputer {
seq2LastStart = diff.seq2Range.endExclusive;

const characterDiffs = this.refineDiff(originalLines, modifiedLines, diff, timeout, considerWhitespaceChanges);
if (characterDiffs.hitTimeout) {
hitTimeout = true;
}
for (const a of characterDiffs.mappings) {
alignments.push(a);
}
Expand Down Expand Up @@ -271,7 +274,7 @@ export function lineRangeMappingFromRangeMappings(alignments: RangeMapping[], or
return changes;
}

function getLineRangeMapping(rangeMapping: RangeMapping, originalLines: string[], modifiedLines: string[]): LineRangeMapping {
export function getLineRangeMapping(rangeMapping: RangeMapping, originalLines: string[], modifiedLines: string[]): LineRangeMapping {
let lineStartDelta = 0;
let lineEndDelta = 0;

Expand All @@ -281,14 +284,15 @@ function getLineRangeMapping(rangeMapping: RangeMapping, originalLines: string[]
// modified: xxx[ \n
if (rangeMapping.modifiedRange.startColumn - 1 >= modifiedLines[rangeMapping.modifiedRange.startLineNumber - 1].length
&& rangeMapping.originalRange.startColumn - 1 >= originalLines[rangeMapping.originalRange.startLineNumber - 1].length) {
lineStartDelta = 1;
lineStartDelta = 1; // +1 is always possible, as startLineNumber < endLineNumber + 1
}

// original: ]xxx \n <- this line is not modified
// modified: ]xx \n
if (rangeMapping.modifiedRange.endColumn === 1 && rangeMapping.originalRange.endColumn === 1) {
// the end line is not touched, as the last line in `newText` is empty
lineEndDelta = -1;
if (rangeMapping.modifiedRange.endColumn === 1 && rangeMapping.originalRange.endColumn === 1
&& rangeMapping.originalRange.startLineNumber + lineStartDelta <= rangeMapping.originalRange.endLineNumber
&& rangeMapping.modifiedRange.startLineNumber + lineStartDelta <= rangeMapping.modifiedRange.endLineNumber) {
lineEndDelta = -1; // We can only do this if the range is not empty yet
}

const originalLineRange = new LineRange(
Expand Down
6 changes: 3 additions & 3 deletions code/src/vs/editor/common/services/editorSimpleWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { IEditorWorkerHost } from 'vs/editor/common/services/editorWorkerHost';
import { StopWatch } from 'vs/base/common/stopwatch';
import { UnicodeTextModelHighlighter, UnicodeHighlighterOptions } from 'vs/editor/common/services/unicodeTextModelHighlighter';
import { DiffComputer, IChange } from 'vs/editor/common/diff/smartLinesDiffComputer';
import { ILinesDiffComputer } from 'vs/editor/common/diff/linesDiffComputer';
import { ILinesDiffComputer, ILinesDiffComputerOptions } from 'vs/editor/common/diff/linesDiffComputer';
import { linesDiffComputers } from 'vs/editor/common/diff/linesDiffComputers';
import { createProxyObject, getAllMethodNames } from 'vs/base/common/objects';
import { IDocumentDiffProviderOptions } from 'vs/editor/common/diff/documentDiffProvider';
Expand Down Expand Up @@ -531,7 +531,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable {
return result;
}

public async computeHumanReadableDiff(modelUrl: string, edits: TextEdit[]): Promise<TextEdit[]> {
public async computeHumanReadableDiff(modelUrl: string, edits: TextEdit[], options: ILinesDiffComputerOptions): Promise<TextEdit[]> {
const model = this._getModel(modelUrl);
if (!model) {
return edits;
Expand Down Expand Up @@ -580,7 +580,7 @@ export class EditorSimpleWorker implements IRequestHandler, IDisposable {
const originalLines = original.split(/\r\n|\n|\r/);
const modifiedLines = text.split(/\r\n|\n|\r/);

const diff = linesDiffComputers.experimental.computeDiff(originalLines, modifiedLines, { maxComputationTimeMs: 1000, ignoreTrimWhitespace: false });
const diff = linesDiffComputers.experimental.computeDiff(originalLines, modifiedLines, options);

const start = Range.lift(range).getStartPosition();

Expand Down
Loading

0 comments on commit e91fe13

Please sign in to comment.