Skip to content

Commit dfee033

Browse files
authored
Merge branch 'master' into fix-executable-bits
2 parents 1cc0b59 + 6032e84 commit dfee033

103 files changed

Lines changed: 1016 additions & 544 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.

extensions/configuration-editing/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
"launch.json",
3838
"tasks.json",
3939
"keybindings.json",
40-
"extensions.json"
40+
"extensions.json",
41+
"argv.json"
4142
]
4243
}
4344
],

extensions/csharp/language-configuration.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
["[", "]"],
1414
["(", ")"],
1515
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
16-
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] },
17-
{ "open": "/*", "close": " */", "notIn": ["string"] }
16+
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] }
1817
],
1918
"surroundingPairs": [
2019
["{", "}"],
@@ -30,4 +29,4 @@
3029
"end": "^\\s*#endregion\\b"
3130
}
3231
}
33-
}
32+
}

extensions/git/package.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,11 @@
362362
"title": "%command.ignore%",
363363
"category": "Git"
364364
},
365+
{
366+
"command": "git.revealInExplorer",
367+
"title": "%command.revealInExplorer%",
368+
"category": "Git"
369+
},
365370
{
366371
"command": "git.stashIncludeUntracked",
367372
"title": "%command.stashIncludeUntracked%",
@@ -507,6 +512,10 @@
507512
"command": "git.restoreCommitTemplate",
508513
"when": "false"
509514
},
515+
{
516+
"command": "git.revealInExplorer",
517+
"when": "false"
518+
},
510519
{
511520
"command": "git.undoCommit",
512521
"when": "config.git.enabled && gitOpenRepositoryCount != 0"
@@ -913,6 +922,11 @@
913922
"when": "scmProvider == git && scmResourceGroup == merge",
914923
"group": "inline"
915924
},
925+
{
926+
"command": "git.revealInExplorer",
927+
"when": "scmProvider == git && scmResourceGroup == merge",
928+
"group": "2_view"
929+
},
916930
{
917931
"command": "git.openFile2",
918932
"when": "scmProvider == git && scmResourceGroup == merge && config.git.showInlineOpenFileAction && config.git.openDiffOnClick",
@@ -948,6 +962,11 @@
948962
"when": "scmProvider == git && scmResourceGroup == index",
949963
"group": "inline"
950964
},
965+
{
966+
"command": "git.revealInExplorer",
967+
"when": "scmProvider == git && scmResourceGroup == index",
968+
"group": "2_view"
969+
},
951970
{
952971
"command": "git.openFile2",
953972
"when": "scmProvider == git && scmResourceGroup == index && config.git.showInlineOpenFileAction && config.git.openDiffOnClick",
@@ -1007,6 +1026,11 @@
10071026
"command": "git.ignore",
10081027
"when": "scmProvider == git && scmResourceGroup == workingTree",
10091028
"group": "1_modification@3"
1029+
},
1030+
{
1031+
"command": "git.revealInExplorer",
1032+
"when": "scmProvider == git && scmResourceGroup == workingTree",
1033+
"group": "2_view"
10101034
}
10111035
],
10121036
"editor/title": [

extensions/git/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"command.publish": "Publish Branch",
5757
"command.showOutput": "Show Git Output",
5858
"command.ignore": "Add to .gitignore",
59+
"command.revealInExplorer": "Reveal in Explorer",
5960
"command.stashIncludeUntracked": "Stash (Include Untracked)",
6061
"command.stash": "Stash",
6162
"command.stashPop": "Pop Stash...",

extensions/git/src/commands.ts

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,11 +1249,13 @@ export class CommandCenter {
12491249
promptToSaveFilesBeforeCommit = 'never';
12501250
}
12511251

1252+
const enableSmartCommit = config.get<boolean>('enableSmartCommit') === true;
1253+
12521254
if (promptToSaveFilesBeforeCommit !== 'never') {
12531255
let documents = workspace.textDocuments
12541256
.filter(d => !d.isUntitled && d.isDirty && isDescendant(repository.root, d.uri.fsPath));
12551257

1256-
if (promptToSaveFilesBeforeCommit === 'staged') {
1258+
if (promptToSaveFilesBeforeCommit === 'staged' || repository.indexGroup.resourceStates.length > 0) {
12571259
documents = documents
12581260
.filter(d => repository.indexGroup.resourceStates.some(s => s.resourceUri.path === d.uri.fsPath));
12591261
}
@@ -1275,7 +1277,6 @@ export class CommandCenter {
12751277
}
12761278
}
12771279

1278-
const enableSmartCommit = config.get<boolean>('enableSmartCommit') === true;
12791280
const enableCommitSigning = config.get<boolean>('enableCommitSigning') === true;
12801281
const noStagedChanges = repository.indexGroup.resourceStates.length === 0;
12811282
const noUnstagedChanges = repository.workingTreeGroup.resourceStates.length === 0;
@@ -1370,9 +1371,18 @@ export class CommandCenter {
13701371
value = (await repository.getCommit(repository.HEAD.commit)).message;
13711372
}
13721373

1374+
const branchName = repository.headShortName;
1375+
let placeHolder: string;
1376+
1377+
if (branchName) {
1378+
placeHolder = localize('commitMessageWithHeadLabel2', "Message (commit on '{0}')", branchName);
1379+
} else {
1380+
placeHolder = localize('commit message', "Commit message");
1381+
}
1382+
13731383
return await window.showInputBox({
13741384
value,
1375-
placeHolder: localize('commit message', "Commit message"),
1385+
placeHolder,
13761386
prompt: localize('provide commit message', "Please provide a commit message"),
13771387
ignoreFocusOut: true
13781388
});
@@ -2069,6 +2079,19 @@ export class CommandCenter {
20692079
await this.runByRepository(resources, async (repository, resources) => repository.ignore(resources));
20702080
}
20712081

2082+
@command('git.revealInExplorer')
2083+
async revealInExplorer(resourceState: SourceControlResourceState): Promise<void> {
2084+
if (!resourceState) {
2085+
return;
2086+
}
2087+
2088+
if (!(resourceState.resourceUri instanceof Uri)) {
2089+
return;
2090+
}
2091+
2092+
await commands.executeCommand('revealInExplorer', resourceState.resourceUri);
2093+
}
2094+
20722095
private async _stash(repository: Repository, includeUntracked = false): Promise<void> {
20732096
const noUnstagedChanges = repository.workingTreeGroup.resourceStates.length === 0;
20742097
const noStagedChanges = repository.indexGroup.resourceStates.length === 0;

extensions/git/src/repository.ts

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,23 @@ export class Repository implements Disposable {
579579
return this._refs;
580580
}
581581

582+
get headShortName(): string | undefined {
583+
if (!this.HEAD) {
584+
return;
585+
}
586+
587+
const HEAD = this.HEAD;
588+
const tag = this.refs.filter(iref => iref.type === RefType.Tag && iref.commit === HEAD.commit)[0];
589+
const tagName = tag && tag.name;
590+
const branchName = HEAD.name || tagName || HEAD.commit;
591+
592+
if (branchName === undefined) {
593+
return;
594+
}
595+
596+
return branchName.substr(0, 8);
597+
}
598+
582599
private _remotes: Remote[] = [];
583600
get remotes(): Remote[] {
584601
return this._remotes;
@@ -1643,15 +1660,11 @@ export class Repository implements Disposable {
16431660
}
16441661

16451662
private updateInputBoxPlaceholder(): void {
1646-
const HEAD = this.HEAD;
1647-
1648-
if (HEAD) {
1649-
const tag = this.refs.filter(iref => iref.type === RefType.Tag && iref.commit === HEAD.commit)[0];
1650-
const tagName = tag && tag.name;
1651-
const head = HEAD.name || tagName || (HEAD.commit || '').substr(0, 8);
1663+
const branchName = this.headShortName;
16521664

1665+
if (branchName) {
16531666
// '{0}' will be replaced by the corresponding key-command later in the process, which is why it needs to stay.
1654-
this._sourceControl.inputBox.placeholder = localize('commitMessageWithHeadLabel', "Message ({0} to commit on '{1}')", "{0}", head);
1667+
this._sourceControl.inputBox.placeholder = localize('commitMessageWithHeadLabel', "Message ({0} to commit on '{1}')", "{0}", branchName);
16551668
} else {
16561669
this._sourceControl.inputBox.placeholder = localize('commitMessage', "Message ({0} to commit)");
16571670
}

extensions/html-language-features/server/src/modes/embeddedSupport.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function getDocumentRegions(languageService: LanguageService, document: T
5656
}
5757
importedScripts.push(value);
5858
} else if (lastAttributeName === 'type' && lastTagName.toLowerCase() === 'script') {
59-
if (/["'](module|(text|application)\/(java|ecma)script)["']/.test(scanner.getTokenText())) {
59+
if (/["'](module|(text|application)\/(java|ecma)script|text\/babel)["']/.test(scanner.getTokenText())) {
6060
languageIdFromType = 'javascript';
6161
} else {
6262
languageIdFromType = undefined;
@@ -228,4 +228,4 @@ function getAttributeLanguage(attributeName: string): string | null {
228228
return null;
229229
}
230230
return match[1] ? 'css' : 'javascript';
231-
}
231+
}

extensions/json/language-configuration.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
{ "open": "[", "close": "]", "notIn": ["string"] },
1313
{ "open": "(", "close": ")", "notIn": ["string"] },
1414
{ "open": "'", "close": "'", "notIn": ["string"] },
15-
{ "open": "/*", "close": "*/", "notIn": ["string"] },
1615
{ "open": "\"", "close": "\"", "notIn": ["string", "comment"] },
1716
{ "open": "`", "close": "`", "notIn": ["string", "comment"] }
1817
]
19-
}
18+
}

extensions/markdown-language-features/src/features/preview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ export class MarkdownPreview extends Disposable {
536536
}
537537

538538
private async onDidClickPreviewLink(href: string) {
539-
let [hrefPath, fragment] = href.split('#');
539+
let [hrefPath, fragment] = decodeURIComponent(href).split('#');
540540

541541
// We perviously already resolve absolute paths.
542542
// Now make sure we handle relative file paths

extensions/npm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ the hover shown on a script or using the command `Run Selected Npm Script`.
2424

2525
### Others
2626

27-
The extension fetches data from https://registry.npmjs/org and https://registry.bower.io to provide auto-completion and information on hover features on npm dependencies.
27+
The extension fetches data from https://registry.npmjs.org and https://registry.bower.io to provide auto-completion and information on hover features on npm dependencies.
2828

2929
## Settings
3030

0 commit comments

Comments
 (0)