Skip to content

Commit

Permalink
Rebase against the upstream 49cbe8c
Browse files Browse the repository at this point in the history
vscode-upstream-sha1: 49cbe8c
  • Loading branch information
Eclipse Che Sync committed Jul 13, 2023
2 parents cbe0e88 + 49cbe8c commit c2004a2
Show file tree
Hide file tree
Showing 73 changed files with 1,427 additions and 770 deletions.
6 changes: 6 additions & 0 deletions code/CodeQL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ path_classifiers:
- "out-build"
- "out-vscode"
- "**/out/**"

# The default behavior is to tag library code as `library`. Results are hidden
# for library code. You can tag further files as being library code by adding them
# to the `library` section.
library:
- "**/node_modules/**"
1 change: 1 addition & 0 deletions code/build/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ module.exports.unicodeFilter = [
'**',

'!**/ThirdPartyNotices.txt',
'!**/ThirdPartyNotices.cli.txt',
'!**/LICENSE.{txt,rtf}',
'!LICENSES.chromium.html',
'!**/LICENSE',
Expand Down
4 changes: 2 additions & 2 deletions code/extensions/shellscript/cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"git": {
"name": "jeff-hykin/better-shell-syntax",
"repositoryUrl": "https://github.com/jeff-hykin/better-shell-syntax",
"commitHash": "1bad17d8badf6283125aaa7c31be06ba64146a0f"
"commitHash": "ce62ea59e8e522f8a07d8d8a2d1f992c6c600b91"
}
},
"license": "MIT",
"version": "1.5.4"
"version": "1.6.2"
}
],
"version": 1
Expand Down
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/jeff-hykin/better-shell-syntax/commit/1bad17d8badf6283125aaa7c31be06ba64146a0f",
"version": "https://github.com/jeff-hykin/better-shell-syntax/commit/ce62ea59e8e522f8a07d8d8a2d1f992c6c600b91",
"name": "Shell Script",
"scopeName": "source.shell",
"patterns": [
Expand All @@ -14,7 +14,7 @@
],
"repository": {
"alias_statement": {
"begin": "(alias)[ \\t]*+[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:export|declare|typeset|local|readonly)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
"begin": "(alias)[ \\t]*+[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
"end": "(?:(?= |\\t|$)|(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n))",
"beginCaptures": {
"1": {
Expand Down Expand Up @@ -119,7 +119,7 @@
"assignment": {
"patterns": [
{
"begin": "[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:export|declare|typeset|local|readonly)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))[ \\t]*+(\\()",
"begin": "[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))[ \\t]*+(\\()",
"end": "\\)",
"beginCaptures": {
"1": {
Expand Down Expand Up @@ -166,7 +166,7 @@
]
},
{
"begin": "[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:export|declare|typeset|local|readonly)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
"begin": "[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",
"end": "(?:(?= |\\t|$)|(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n))",
"beginCaptures": {
"1": {
Expand Down Expand Up @@ -221,7 +221,7 @@
]
},
"basic_command_name": {
"match": "(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?:((?<=^|;|&|[ \\t])(?:export|declare|typeset|local|readonly)(?=[ \\t]|;|&|$))|((?!\"|'|\\\\\\n?$)[^!'\" \\t\\n\\r]+?))(?:(?= |\\t)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))",
"match": "(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))|((?!\"|'|\\\\\\n?$)[^!'\" \\t\\n\\r]+?))(?:(?= |\\t)|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))",
"captures": {
"1": {
"name": "storage.modifier.$1.shell"
Expand All @@ -230,11 +230,11 @@
"name": "entity.name.function.call.shell entity.name.command.shell",
"patterns": [
{
"match": "(?<!\\w)(?:return|break)(?!\\w)",
"match": "(?<!\\w)(?:continue|return|break)(?!\\w)",
"name": "keyword.control.$0.shell"
},
{
"match": "(?<!\\w)(?:unfunction|unsetopt|autoload|suspend|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/)(?!\\w)",
"match": "(?<!\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/)(?!\\w)",
"name": "support.function.builtin.shell"
},
{
Expand Down Expand Up @@ -952,7 +952,7 @@
"keyword": {
"patterns": [
{
"match": "(?<=^|;|&| |\\t)(?:then|else|elif|fi|for|in|do|done|select|case|continue|esac|while|until|return)(?= |\\t|;|&|$)",
"match": "(?<=^|;|&| |\\t)(?:continue|foreach|return|select|repeat|break|until|while|case|done|elif|else|esac|then|for|end|do|if|fi|in)(?= |\\t|;|&|$)",
"name": "keyword.control.$0.shell"
}
]
Expand Down Expand Up @@ -1342,11 +1342,11 @@
]
},
"modifiers": {
"match": "(?<=^|;|&|[ \\t])(?:export|declare|typeset|local|readonly)(?=[ \\t]|;|&|$)",
"match": "(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)",
"name": "storage.modifier.$0.shell"
},
"normal_statement": {
"begin": "(?!^[ \\t]*+$)(?:(?<=^if | if |\\tif |^elif | elif |\\telif |^then | then |\\tthen |^else | else |\\telse |^while | while |\\twhile |^do | do |\\tdo )|(?<=(?:^|;|\\||&|!|\\(|\\{|\\`)))[ \\t]*+(?!nocorrect\\W|nocorrect\\$|function\\W|function\\$|foreach\\W|foreach\\$|repeat\\W|repeat\\$|logout\\W|logout\\$|coproc\\W|coproc\\$|select\\W|select\\$|while\\W|while\\$|pushd\\W|pushd\\$|until\\W|until\\$|case\\W|case\\$|done\\W|done\\$|elif\\W|elif\\$|else\\W|else\\$|esac\\W|esac\\$|popd\\W|popd\\$|then\\W|then\\$|time\\W|time\\$|for\\W|for\\$|end\\W|end\\$|fi\\W|fi\\$|do\\W|do\\$|in\\W|in\\$|if\\W|if\\$)",
"begin": "(?!^[ \\t]*+$)(?:(?<=^until | until |\\tuntil |^while | while |\\twhile |^elif | elif |\\telif |^else | else |\\telse |^then | then |\\tthen |^do | do |\\tdo |^if | if |\\tif )|(?<=(?:^|;|\\||&|!|\\(|\\{|\\`)))[ \\t]*+(?!nocorrect\\W|nocorrect\\$|function\\W|function\\$|foreach\\W|foreach\\$|repeat\\W|repeat\\$|logout\\W|logout\\$|coproc\\W|coproc\\$|select\\W|select\\$|while\\W|while\\$|pushd\\W|pushd\\$|until\\W|until\\$|case\\W|case\\$|done\\W|done\\$|elif\\W|elif\\$|else\\W|else\\$|esac\\W|esac\\$|popd\\W|popd\\$|then\\W|then\\$|time\\W|time\\$|for\\W|for\\$|end\\W|end\\$|fi\\W|fi\\$|do\\W|do\\$|in\\W|in\\$|if\\W|if\\$)",
"end": "(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",
"beginCaptures": {},
"endCaptures": {},
Expand Down Expand Up @@ -1376,11 +1376,11 @@
"include": "#modifiers"
},
{
"match": "(?<!\\w)(?:return|break)(?!\\w)",
"match": "(?<!\\w)(?:continue|return|break)(?!\\w)",
"name": "entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"
},
{
"match": "(?<!\\w)(?:unfunction|unsetopt|autoload|suspend|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/)(?!\\w)",
"match": "(?<!\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/)(?!\\w)",
"name": "entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"
},
{
Expand Down
11 changes: 10 additions & 1 deletion code/extensions/typescript-language-features/web/webServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ function toTsWatcherKind(event: 'create' | 'change' | 'delete') {
throw new Error(`Unknown event: ${event}`);
}

class AccessOutsideOfRootError extends Error {
constructor(
public readonly filepath: string,
public readonly projectRootPaths: readonly string[]
) {
super(`Could not read file outside of project root ${filepath}`);
}
}

type ServerHostWithImport = ts.server.ServerHost & { importPlugin(root: string, moduleName: string): Promise<ts.server.ModuleImportResult> };

function createServerHost(extensionUri: URI, logger: ts.server.Logger, apiClient: ApiClient | undefined, args: string[], fsWatcher: MessagePort): ServerHostWithImport {
Expand Down Expand Up @@ -455,7 +464,7 @@ function createServerHost(extensionUri: URI, logger: ts.server.Logger, apiClient
}

if (allowRead === 'block') {
throw new Error(`Could not read file outside of project root ${filepath}`);
throw new AccessOutsideOfRootError(filepath, Array.from(projectRootPaths.keys()));
}

return uri;
Expand Down
4 changes: 2 additions & 2 deletions code/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "che-code",
"version": "1.81.0",
"distro": "bed7b201bc6ebbfc63268cb4c390d788a86b0192",
"distro": "97db68abc58fce4ef0a70cdaa6255836e6a8d085",
"author": {
"name": "Microsoft Corporation"
},
Expand Down Expand Up @@ -212,7 +212,7 @@
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"tsec": "0.2.7",
"typescript": "^5.2.0-dev.20230710",
"typescript": "^5.2.0-dev.20230712",
"typescript-formatter": "7.1.0",
"underscore": "^1.12.1",
"util": "^0.12.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,16 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
this._register(autorunWithStore2('DiffEditorDecorations', (reader, store) => {
store.add(new (readHotReloadableExport(DiffEditorDecorations, reader))(this._editors, this._diffModel, this._options));
}));

this._register(this._instantiationService.createInstance(
ViewZoneManager,
this._editors,
this._diffModel,
this._options,
this,
() => this.unchangedRangesFeature.isUpdatingViewZones,
));
this._register(autorunWithStore2('ViewZoneManager', (reader, store) => {
store.add(this._instantiationService.createInstance(
readHotReloadableExport(ViewZoneManager, reader),
this._editors,
this._diffModel,
this._options,
this,
() => this.unchangedRangesFeature.isUpdatingViewZones,
));
}));

this._register(autorunWithStore2('OverviewRulerPart', (reader, store) => {
store.add(this._instantiationService.createInstance(readHotReloadableExport(OverviewRulerPart, reader), this._editors,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { $ } from 'vs/base/browser/dom';
import { ArrayQueue } from 'vs/base/common/arrays';
import { RunOnceScheduler } from 'vs/base/common/async';
import { Codicon } from 'vs/base/common/codicons';
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
import { Disposable, DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
import { IObservable, derived, observableFromEvent, observableValue } from 'vs/base/common/observable';
import { autorun, autorunWithStore2 } from 'vs/base/common/observableImpl/autorun';
import { ThemeIcon } from 'vs/base/common/themables';
Expand Down Expand Up @@ -340,6 +340,17 @@ export class ViewZoneManager extends Disposable {
scrollState.restore(this._editors.modified);
}));

this._register(toDisposable(() => {
this._editors.original.changeViewZones((a) => {
for (const id of alignmentViewZoneIdsOrig) { a.removeZone(id); }
alignmentViewZoneIdsOrig.clear();
});
this._editors.modified.changeViewZones((a) => {
for (const id of alignmentViewZoneIdsMod) { a.removeZone(id); }
alignmentViewZoneIdsMod.clear();
});
}));

let ignoreChange = false;
this._register(this._editors.original.onDidScrollChange(e => {
if (e.scrollLeftChanged && !ignoreChange) {
Expand Down Expand Up @@ -504,20 +515,52 @@ function computeRangeAlignment(
const c = m.lineRangeMapping;
handleAlignmentsOutsideOfDiffs(c.originalRange.startLineNumber, c.modifiedRange.startLineNumber);

const originalAdditionalHeight = originalLineHeightOverrides
.takeWhile(v => v.lineNumber < c.originalRange.endLineNumberExclusive)
?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;
const modifiedAdditionalHeight = modifiedLineHeightOverrides
.takeWhile(v => v.lineNumber < c.modifiedRange.endLineNumberExclusive)
?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;

result.push({
originalRange: c.originalRange,
modifiedRange: c.modifiedRange,
originalHeightInPx: c.originalRange.length * origLineHeight + originalAdditionalHeight,
modifiedHeightInPx: c.modifiedRange.length * modLineHeight + modifiedAdditionalHeight,
diff: m.lineRangeMapping,
});
let first = true;
let lastModLineNumber = c.modifiedRange.startLineNumber;
let lastOrigLineNumber = c.originalRange.startLineNumber;

function emitAlignment(origLineNumberExclusive: number, modLineNumberExclusive: number) {
if (origLineNumberExclusive < lastOrigLineNumber || modLineNumberExclusive < lastModLineNumber) {
return;
}
if (first) {
first = false;
} else if (origLineNumberExclusive === lastOrigLineNumber || modLineNumberExclusive === lastModLineNumber) {
return;
}
const originalRange = new LineRange(lastOrigLineNumber, origLineNumberExclusive);
const modifiedRange = new LineRange(lastModLineNumber, modLineNumberExclusive);
if (originalRange.isEmpty && modifiedRange.isEmpty) {
return;
}

const originalAdditionalHeight = originalLineHeightOverrides
.takeWhile(v => v.lineNumber < origLineNumberExclusive)
?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;
const modifiedAdditionalHeight = modifiedLineHeightOverrides
.takeWhile(v => v.lineNumber < modLineNumberExclusive)
?.reduce((p, c) => p + c.heightInPx, 0) ?? 0;

result.push({
originalRange,
modifiedRange,
originalHeightInPx: originalRange.length * origLineHeight + originalAdditionalHeight,
modifiedHeightInPx: modifiedRange.length * modLineHeight + modifiedAdditionalHeight,
});

lastOrigLineNumber = origLineNumberExclusive;
lastModLineNumber = modLineNumberExclusive;
}

for (const i of c.innerChanges || []) {
if (i.originalRange.startColumn > 1 && i.modifiedRange.startColumn > 1) {
// There is some unmodified text on this line
emitAlignment(i.originalRange.startLineNumber, i.modifiedRange.startLineNumber);
}
emitAlignment(i.originalRange.endLineNumber, i.modifiedRange.endLineNumber);
}

emitAlignment(c.originalRange.endLineNumberExclusive, c.modifiedRange.endLineNumberExclusive);

lastOriginalLineNumber = c.originalRange.endLineNumberExclusive;
lastModifiedLineNumber = c.modifiedRange.endLineNumberExclusive;
Expand Down
10 changes: 8 additions & 2 deletions code/src/vs/editor/contrib/colorPicker/browser/colorPicker.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,19 @@
cursor: pointer;
color: white;
flex: 1;
white-space: nowrap;
overflow: hidden;
}

.colorpicker-header .picked-color .picked-color-presentation {
white-space: nowrap;
margin-left: 5px;
margin-right: 5px;
}

.colorpicker-header .picked-color .codicon {
color: inherit;
font-size: 14px;
position: absolute;
left: 8px;
}

.colorpicker-header .picked-color.light {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class ColorPickerHeader extends Disposable {

private readonly _domNode: HTMLElement;
private readonly _pickedColorNode: HTMLElement;
private readonly _pickedColorPresentation: HTMLElement;
private readonly _originalColorNode: HTMLElement;
private readonly _closeButton: CloseButton | null = null;
private backgroundColor: Color;
Expand All @@ -37,6 +38,9 @@ export class ColorPickerHeader extends Disposable {
dom.append(container, this._domNode);

this._pickedColorNode = dom.append(this._domNode, $('.picked-color'));
dom.append(this._pickedColorNode, $('span.codicon.codicon-color-mode'));
this._pickedColorPresentation = dom.append(this._pickedColorNode, document.createElement('span'));
this._pickedColorPresentation.classList.add('picked-color-presentation');

const tooltip = localize('clickToToggleColorOptions', "Click to toggle color options (rgb/hsl/hex)");
this._pickedColorNode.setAttribute('title', tooltip);
Expand Down Expand Up @@ -91,8 +95,7 @@ export class ColorPickerHeader extends Disposable {
}

private onDidChangePresentation(): void {
this._pickedColorNode.textContent = this.model.presentation ? this.model.presentation.label : '';
this._pickedColorNode.prepend($('.codicon.codicon-color-mode'));
this._pickedColorPresentation.textContent = this.model.presentation ? this.model.presentation.label : '';
}
}

Expand Down
2 changes: 1 addition & 1 deletion code/src/vs/platform/actionWidget/browser/actionWidget.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
font-size: 13px;
border-radius: 0;
min-width: 160px;
max-width: 500px;
max-width: 80vw;
z-index: 40;
display: block;
width: 100%;
Expand Down
Loading

0 comments on commit c2004a2

Please sign in to comment.