Fix #19959 and #19958: Remove un-localizable messages (#20019)

* Fix #19959 and #19958: Remove un-localizable messages

* Update message

* Update diagnostic messages
This commit is contained in:
Mohamed Hegazy
2017-11-24 22:02:48 -08:00
committed by GitHub
parent 568e52d550
commit 6b3cfc7008
11 changed files with 12 additions and 26 deletions

View File

@@ -3766,7 +3766,7 @@
"category": "Error",
"code": 90010
},
"Import '{0}' from \"{1}\".": {
"Import '{0}' from module \"{1}\".": {
"category": "Message",
"code": 90013
},
@@ -3886,13 +3886,5 @@
"Install '{0}'": {
"category": "Message",
"code": 95014
},
"Import '{0}' = require(\"{1}\").": {
"category": "Message",
"code": 95015
},
"Import * as '{0}' from \"{1}\".": {
"category": "Message",
"code": 95016
}
}

View File

@@ -276,17 +276,11 @@ namespace ts.codefix {
}
});
const actionFormat = kind === ImportKind.Equals
? Diagnostics.Import_0_require_1
: kind === ImportKind.Namespace
? Diagnostics.Import_Asterisk_as_0_from_1
: Diagnostics.Import_0_from_1;
// if this file doesn't have any import statements, insert an import statement and then insert a new line
// between the only import statement and user code. Otherwise just insert the statement because chances
// are there are already a new line seperating code and import statements.
return createCodeAction(
actionFormat,
Diagnostics.Import_0_from_module_1,
[symbolName, moduleSpecifierWithoutQuotes],
changes,
"NewImport",