Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into alex/main-process-ext…
Browse files Browse the repository at this point in the history
…ension-host
  • Loading branch information
alexdima committed Oct 25, 2021
2 parents 41d6fc7 + c208d9b commit 81471f8
Show file tree
Hide file tree
Showing 41 changed files with 449 additions and 287 deletions.
2 changes: 1 addition & 1 deletion .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-references-view repo:microsoft/vscode-anycode repo:microsoft/vscode-hexeditor repo:microsoft/vscode-extension-telemetry\n\n// current milestone name\n$milestone=milestone:\"October 2021\""
"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-references-view repo:microsoft/vscode-anycode repo:microsoft/vscode-hexeditor repo:microsoft/vscode-extension-telemetry repo:microsoft/vscode-livepreview repo:microsoft/vscode-remotehub\n\n// current milestone name\n$milestone=milestone:\"October 2021\""
},
{
"kind": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class SettingsDocument {
completions.push(this.newSimpleCompletionItem('${folderPath}', range, localize('folderPath', "file path of the workspace folder the file is contained in (e.g. /Users/Development/myFolder)")));
completions.push(this.newSimpleCompletionItem('${appName}', range, localize('appName', "e.g. VS Code")));
completions.push(this.newSimpleCompletionItem('${remoteName}', range, localize('remoteName', "e.g. SSH")));
completions.push(this.newSimpleCompletionItem('${dirty}', range, localize('dirty', "a dirty indicator if the active editor is dirty")));
completions.push(this.newSimpleCompletionItem('${dirty}', range, localize('dirty', "an indicator for when the active editor has unsaved changes")));
completions.push(this.newSimpleCompletionItem('${separator}', range, localize('separator', "a conditional separator (' - ') that only shows when surrounded by variables with values")));

return Promise.resolve(completions);
Expand Down
2 changes: 2 additions & 0 deletions extensions/xml/xml.language-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
{ "open": "(", "close": ")" },
{ "open": "<", "close": ">" }
],
"colorizedBracketPairs": [
],
"folding": {
"markers": {
"start": "^\\s*<!--\\s*#region\\b.*-->",
Expand Down
2 changes: 1 addition & 1 deletion resources/linux/snap/electron-launch
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ if [ -f "$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" ]; then
fi

# Create $XDG_RUNTIME_DIR if not exists (to be removed when https://pad.lv/1656340 is fixed)
[ -n "$XDG_RUNTIME_DIR" ] && mkdir -p "$XDG_RUNTIME_DIR" -m 700
[ -n "$XDG_RUNTIME_DIR" ] && mkdir -p -m 700 "$XDG_RUNTIME_DIR"

exec "$@"
32 changes: 19 additions & 13 deletions src/vs/base/common/map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -741,13 +741,17 @@ interface ResourceMapKeyFn {
(resource: URI): string;
}

class ResourceMapEntry<T> {
constructor(readonly uri: URI, readonly value: T) { }
}

export class ResourceMap<T> implements Map<URI, T> {

private static readonly defaultToKey = (resource: URI) => resource.toString();

readonly [Symbol.toStringTag] = 'ResourceMap';

private readonly map: Map<string, T>;
private readonly map: Map<string, ResourceMapEntry<T>>;
private readonly toKey: ResourceMapKeyFn;

/**
Expand All @@ -774,12 +778,12 @@ export class ResourceMap<T> implements Map<URI, T> {
}

set(resource: URI, value: T): this {
this.map.set(this.toKey(resource), value);
this.map.set(this.toKey(resource), new ResourceMapEntry(resource, value));
return this;
}

get(resource: URI): T | undefined {
return this.map.get(this.toKey(resource));
return this.map.get(this.toKey(resource))?.value;
}

has(resource: URI): boolean {
Expand All @@ -802,30 +806,32 @@ export class ResourceMap<T> implements Map<URI, T> {
if (typeof thisArg !== 'undefined') {
clb = clb.bind(thisArg);
}
for (let [index, value] of this.map) {
clb(value, URI.parse(index), <any>this);
for (let [_, entry] of this.map) {
clb(entry.value, entry.uri, <any>this);
}
}

values(): IterableIterator<T> {
return this.map.values();
*values(): IterableIterator<T> {
for (let entry of this.map.values()) {
yield entry.value;
}
}

*keys(): IterableIterator<URI> {
for (let key of this.map.keys()) {
yield URI.parse(key);
for (let entry of this.map.values()) {
yield entry.uri;
}
}

*entries(): IterableIterator<[URI, T]> {
for (let tuple of this.map.entries()) {
yield [URI.parse(tuple[0]), tuple[1]];
for (let entry of this.map.values()) {
yield [entry.uri, entry.value];
}
}

*[Symbol.iterator](): IterableIterator<[URI, T]> {
for (let item of this.map) {
yield [URI.parse(item[0]), item[1]];
for (let [, entry] of this.map) {
yield [entry.uri, entry.value];
}
}
}
Expand Down

0 comments on commit 81471f8

Please sign in to comment.