Skip to content

Commit 0fb1f55

Browse files
authored
Merge branch 'master' into joh/e5host
2 parents 7085609 + 73a91c0 commit 0fb1f55

70 files changed

Lines changed: 947 additions & 603 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build/builtInExtensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
{
3333
"name": "ms-vscode.references-view",
34-
"version": "0.0.29",
34+
"version": "0.0.30",
3535
"repo": "https://github.com/Microsoft/vscode-reference-view",
3636
"metadata": {
3737
"id": "dc489f46-520d-4556-ae85-1f9eab3c412d",

build/lib/extensions.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,18 @@ const commit = util.getVersion(root);
2929
const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${commit}`;
3030
function fromLocal(extensionPath) {
3131
const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js');
32-
if (fs.existsSync(webpackFilename)) {
33-
return fromLocalWebpack(extensionPath);
34-
}
35-
else {
36-
return fromLocalNormal(extensionPath);
37-
}
32+
const input = fs.existsSync(webpackFilename)
33+
? fromLocalWebpack(extensionPath)
34+
: fromLocalNormal(extensionPath);
35+
const tmLanguageJsonFilter = filter('**/*.tmLanguage.json', { restore: true });
36+
return input
37+
.pipe(tmLanguageJsonFilter)
38+
.pipe(buffer())
39+
.pipe(es.mapSync((f) => {
40+
f.contents = Buffer.from(JSON.stringify(JSON.parse(f.contents.toString('utf8'))));
41+
return f;
42+
}))
43+
.pipe(tmLanguageJsonFilter.restore);
3844
}
3945
function fromLocalWebpack(extensionPath) {
4046
const result = es.through();

build/lib/extensions.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,20 @@ const sourceMappingURLBase = `https://ticino.blob.core.windows.net/sourcemaps/${
3030

3131
function fromLocal(extensionPath: string): Stream {
3232
const webpackFilename = path.join(extensionPath, 'extension.webpack.config.js');
33-
if (fs.existsSync(webpackFilename)) {
34-
return fromLocalWebpack(extensionPath);
35-
} else {
36-
return fromLocalNormal(extensionPath);
37-
}
33+
const input = fs.existsSync(webpackFilename)
34+
? fromLocalWebpack(extensionPath)
35+
: fromLocalNormal(extensionPath);
36+
37+
const tmLanguageJsonFilter = filter('**/*.tmLanguage.json', { restore: true });
38+
39+
return input
40+
.pipe(tmLanguageJsonFilter)
41+
.pipe(buffer())
42+
.pipe(es.mapSync((f: File) => {
43+
f.contents = Buffer.from(JSON.stringify(JSON.parse(f.contents.toString('utf8'))));
44+
return f;
45+
}))
46+
.pipe(tmLanguageJsonFilter.restore);
3847
}
3948

4049
function fromLocalWebpack(extensionPath: string): Stream {

build/npm/postinstall.js

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,42 @@ const processTreeDts = path.join('node_modules', 'windows-process-tree', 'typing
7878
if (fs.existsSync(processTreeDts)) {
7979
console.log('Removing windows-process-tree.d.ts');
8080
fs.unlinkSync(processTreeDts);
81-
}
81+
}
82+
83+
function getInstalledVersion(packageName, cwd) {
84+
const opts = {};
85+
if (cwd) {
86+
opts.cwd = cwd;
87+
}
88+
89+
const result = cp.spawnSync(yarn, ['list', '--pattern', packageName], opts);
90+
const stdout = result.stdout.toString();
91+
const match = stdout.match(new RegExp(packageName + '@(\\S+)'));
92+
if (!match || !match[1]) {
93+
throw new Error('Unexpected output from yarn list: ' + stdout);
94+
}
95+
96+
return match[1];
97+
}
98+
99+
function assertSameVersionsBetweenFolders(packageName, otherFolder) {
100+
const baseVersion = getInstalledVersion(packageName);
101+
const otherVersion = getInstalledVersion(packageName, otherFolder);
102+
103+
if (baseVersion !== otherVersion) {
104+
throw new Error(`Mismatched versions installed for ${packageName}: root has ${baseVersion}, ./${otherFolder} has ${otherVersion}. These should be the same!`);
105+
}
106+
}
107+
108+
// Check that modules in both the base package.json and remote/ have the same version installed
109+
const requireSameVersionsInRemote = [
110+
'xterm',
111+
'xterm-addon-search',
112+
'xterm-addon-web-links',
113+
'node-pty',
114+
'vscode-ripgrep'
115+
];
116+
117+
requireSameVersionsInRemote.forEach(packageName => {
118+
assertSameVersionsBetweenFolders(packageName, 'remote');
119+
});

build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"tslint": "^5.9.1",
4343
"typescript": "3.5.2",
4444
"vsce": "1.48.0",
45-
"vscode-telemetry-extractor": "1.5.3",
45+
"vscode-telemetry-extractor": "^1.5.4",
4646
"xml2js": "^0.4.17"
4747
},
4848
"scripts": {

build/yarn.lock

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,19 +2313,19 @@ vsce@1.48.0:
23132313
yauzl "^2.3.1"
23142314
yazl "^2.2.2"
23152315

2316-
vscode-ripgrep@^1.5.5:
2317-
version "1.5.5"
2318-
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.5.tgz#24c0e9cb356cf889c98e15ecb58f9cf654a1d961"
2319-
integrity sha512-OrPrAmcun4+uZAuNcQvE6CCPskh+5AsjANod/Q3zRcJcGNxgoOSGlQN9RPtatkUNmkN8Nn8mZBnS1jMylu/dKg==
2316+
vscode-ripgrep@^1.5.6:
2317+
version "1.5.6"
2318+
resolved "https://registry.yarnpkg.com/vscode-ripgrep/-/vscode-ripgrep-1.5.6.tgz#93bf5c99ca5f8248950a305e224f6ca153c30af4"
2319+
integrity sha512-WRIM9XpUj6dsfdAmuI3ANbmT1ysPUVsYy/2uCLDHJa9kbiB4T7uGvFnnc0Rgx2qQnyRAwL7PeWaFgUljPPxf2g==
23202320

2321-
vscode-telemetry-extractor@1.5.3:
2322-
version "1.5.3"
2323-
resolved "https://registry.yarnpkg.com/vscode-telemetry-extractor/-/vscode-telemetry-extractor-1.5.3.tgz#c17f9065a47425edafd23ea161e80c23274e009d"
2324-
integrity sha512-feioJ1e1KyMa9rzblnLbSOduo+Ny0l62H3/bSDgfgCSnU/km+tTSYxPBvZHVr7iQfQGC95J61yC/ObqS9EbaQg==
2321+
vscode-telemetry-extractor@^1.5.4:
2322+
version "1.5.4"
2323+
resolved "https://registry.yarnpkg.com/vscode-telemetry-extractor/-/vscode-telemetry-extractor-1.5.4.tgz#bcb0d17667fa1b77715e3a3bf372ade18f846782"
2324+
integrity sha512-MN9LNPo0Rc6cy3sIWTAG97PTWkEKdRnP0VeYoS8vjKSNtG9CAsrUxHgFfYoHm2vNK/ijd0a4NzETyVGO2kT6hw==
23252325
dependencies:
23262326
command-line-args "^5.1.1"
23272327
ts-morph "^3.1.3"
2328-
vscode-ripgrep "^1.5.5"
2328+
vscode-ripgrep "^1.5.6"
23292329

23302330
vso-node-api@6.1.2-preview:
23312331
version "6.1.2-preview"

extensions/git/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1354,6 +1354,15 @@
13541354
"scope": "resource",
13551355
"default": false,
13561356
"description": "%config.supportCancellation%"
1357+
},
1358+
"git.branchSortOrder": {
1359+
"type": "string",
1360+
"enum": [
1361+
"committerdate",
1362+
"alphabetically"
1363+
],
1364+
"default": "committerdate",
1365+
"description": "%config.branchSortOrder%"
13571366
}
13581367
}
13591368
},

extensions/git/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@
127127
"config.confirmForcePush": "Controls whether to ask for confirmation before force-pushing.",
128128
"config.openDiffOnClick": "Controls whether the diff editor should be opened when clicking a change. Otherwise the regular editor will be opened.",
129129
"config.supportCancellation": "Controls whether a notification comes up when running the Sync action, which allows the user to cancel the operation.",
130+
"config.branchSortOrder": "Controls the sort order for branches.",
130131
"colors.added": "Color for added resources.",
131132
"colors.modified": "Color for modified resources.",
132133
"colors.deleted": "Color for deleted resources.",

extensions/git/src/git.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,8 +1624,14 @@ export class Repository {
16241624
.map(([ref]) => ({ name: ref, type: RefType.Head } as Branch));
16251625
}
16261626

1627-
async getRefs(): Promise<Ref[]> {
1628-
const result = await this.run(['for-each-ref', '--format', '%(refname) %(objectname)', '--sort', '-committerdate']);
1627+
async getRefs(opts?: { sort?: 'alphabetically' | 'committerdate' }): Promise<Ref[]> {
1628+
const args = ['for-each-ref', '--format', '%(refname) %(objectname)'];
1629+
1630+
if (opts && opts.sort && opts.sort !== 'alphabetically') {
1631+
args.push('--sort', opts.sort);
1632+
}
1633+
1634+
const result = await this.run(args);
16291635

16301636
const fn = (line: string): Ref | null => {
16311637
let match: RegExpExecArray | null;

extensions/git/src/repository.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,9 @@ export class Repository implements Disposable {
701701
onConfigListener(updateIndexGroupVisibility, this, this.disposables);
702702
updateIndexGroupVisibility();
703703

704+
const onConfigListenerForBranchSortOrder = filterEvent(workspace.onDidChangeConfiguration, e => e.affectsConfiguration('git.branchSortOrder', root));
705+
onConfigListenerForBranchSortOrder(this.updateModelState, this, this.disposables);
706+
704707
this.mergeGroup.hideWhenEmpty = true;
705708

706709
this.disposables.push(this.mergeGroup);
@@ -1405,7 +1408,6 @@ export class Repository implements Disposable {
14051408
const config = workspace.getConfiguration('git');
14061409
const shouldIgnore = config.get<boolean>('ignoreLimitWarning') === true;
14071410
const useIcons = !config.get<boolean>('decorations.enabled', true);
1408-
14091411
this.isRepositoryHuge = didHitLimit;
14101412

14111413
if (didHitLimit && !shouldIgnore && !this.didWarnAboutLimit) {
@@ -1455,7 +1457,8 @@ export class Repository implements Disposable {
14551457
// noop
14561458
}
14571459

1458-
const [refs, remotes, submodules, rebaseCommit] = await Promise.all([this.repository.getRefs(), this.repository.getRemotes(), this.repository.getSubmodules(), this.getRebaseCommit()]);
1460+
const sort = config.get<'alphabetically' | 'committerdate'>('branchSortOrder') || 'alphabetically';
1461+
const [refs, remotes, submodules, rebaseCommit] = await Promise.all([this.repository.getRefs({ sort }), this.repository.getRemotes(), this.repository.getSubmodules(), this.getRebaseCommit()]);
14591462

14601463
this._HEAD = HEAD;
14611464
this._refs = refs;

0 commit comments

Comments
 (0)