Skip to content

Commit a5812a5

Browse files
committed
Merge remote-tracking branch 'origin/master' into scm-api
2 parents 251b656 + a296926 commit a5812a5

140 files changed

Lines changed: 3823 additions & 1530 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/gulpfile.vscode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const nodeModules = ['electron', 'original-fs']
3939
// Build
4040

4141
const builtInExtensions = [
42-
{ name: 'ms-vscode.node-debug', version: '1.8.7' },
42+
{ name: 'ms-vscode.node-debug', version: '1.8.8' },
4343
{ name: 'ms-vscode.node-debug2', version: '1.8.2' }
4444
];
4545

build/lib/tslint/noUnexternalizedStringsRule.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,12 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) {
8989
if (functionName && this.ignores[functionName]) {
9090
return;
9191
}
92+
var x = "foo";
9293
if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) {
93-
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Unexternalized string found: " + node.getText()));
94+
var s = node.getText();
95+
var replacement = new Lint.Replacement(node.getStart(), node.getWidth(), "nls.localize('KEY-" + s.substring(1, s.length - 1) + "', " + s + ")");
96+
var fix = new Lint.Fix("Unexternalitzed string", [replacement]);
97+
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "Unexternalized string found: " + node.getText(), fix));
9498
return;
9599
}
96100
// We have a single quoted string outside a localize function name.
@@ -109,8 +113,8 @@ var NoUnexternalizedStringsRuleWalker = (function (_super) {
109113
for (var i = 0; i < keyArg.properties.length; i++) {
110114
var property = keyArg.properties[i];
111115
if (isPropertyAssignment(property)) {
112-
var name_1 = property.name.getText();
113-
if (name_1 === 'key') {
116+
var name = property.name.getText();
117+
if (name === 'key') {
114118
var initializer = property.initializer;
115119
if (isStringLiteral(initializer)) {
116120
this.recordKey(initializer, this.messageIndex ? callInfo.callExpression.arguments[this.messageIndex] : undefined);

build/lib/tslint/noUnexternalizedStringsRule.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@ class NoUnexternalizedStringsRuleWalker extends Lint.RuleWalker {
109109
if (functionName && this.ignores[functionName]) {
110110
return;
111111
}
112+
112113
if (doubleQuoted && (!callInfo || callInfo.argIndex === -1 || !this.signatures[functionName])) {
113-
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Unexternalized string found: ${node.getText()}`));
114+
const s = node.getText();
115+
const replacement = new Lint.Replacement(node.getStart(), node.getWidth(), `nls.localize('KEY-${s.substring(1, s.length - 1)}', ${s})`);
116+
const fix = new Lint.Fix("Unexternalitzed string", [replacement]);
117+
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), `Unexternalized string found: ${node.getText()}`, fix));
114118
return;
115119
}
116120
// We have a single quoted string outside a localize function name.

0 commit comments

Comments
 (0)