* Fix #19959 and #19958: Remove un-localizable messages * Update message * Update diagnostic messages
This commit is contained in:
parent
568e52d550
commit
6b3cfc7008
11 changed files with 12 additions and 26 deletions
|
@ -3766,7 +3766,7 @@
|
||||||
"category": "Error",
|
"category": "Error",
|
||||||
"code": 90010
|
"code": 90010
|
||||||
},
|
},
|
||||||
"Import '{0}' from \"{1}\".": {
|
"Import '{0}' from module \"{1}\".": {
|
||||||
"category": "Message",
|
"category": "Message",
|
||||||
"code": 90013
|
"code": 90013
|
||||||
},
|
},
|
||||||
|
@ -3886,13 +3886,5 @@
|
||||||
"Install '{0}'": {
|
"Install '{0}'": {
|
||||||
"category": "Message",
|
"category": "Message",
|
||||||
"code": 95014
|
"code": 95014
|
||||||
},
|
|
||||||
"Import '{0}' = require(\"{1}\").": {
|
|
||||||
"category": "Message",
|
|
||||||
"code": 95015
|
|
||||||
},
|
|
||||||
"Import * as '{0}' from \"{1}\".": {
|
|
||||||
"category": "Message",
|
|
||||||
"code": 95016
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
// 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
|
// 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.
|
// are there are already a new line seperating code and import statements.
|
||||||
return createCodeAction(
|
return createCodeAction(
|
||||||
actionFormat,
|
Diagnostics.Import_0_from_module_1,
|
||||||
[symbolName, moduleSpecifierWithoutQuotes],
|
[symbolName, moduleSpecifierWithoutQuotes],
|
||||||
changes,
|
changes,
|
||||||
"NewImport",
|
"NewImport",
|
||||||
|
|
|
@ -16,7 +16,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
|
||||||
verify.applyCodeActionFromCompletion("", {
|
verify.applyCodeActionFromCompletion("", {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
source: "/a",
|
source: "/a",
|
||||||
description: `Import 'foo' from "./a".`,
|
description: `Import 'foo' from module "./a".`,
|
||||||
// TODO: GH#18445
|
// TODO: GH#18445
|
||||||
newFileContent: `import f_o_o from "./a";
|
newFileContent: `import f_o_o from "./a";
|
||||||
import foo from "./a";\r
|
import foo from "./a";\r
|
||||||
|
|
|
@ -21,7 +21,7 @@ verify.completionListContains({ name: "fooBar", source: "/src/foo-bar" }, "(prop
|
||||||
verify.applyCodeActionFromCompletion("1", {
|
verify.applyCodeActionFromCompletion("1", {
|
||||||
name: "fooBar",
|
name: "fooBar",
|
||||||
source: "/src/foo-bar",
|
source: "/src/foo-bar",
|
||||||
description: `Import 'fooBar' from "./foo-bar".`,
|
description: `Import 'fooBar' from module "./foo-bar".`,
|
||||||
// TODO: GH#18445
|
// TODO: GH#18445
|
||||||
newFileContent: `import fooBar from "./foo-bar";\r
|
newFileContent: `import fooBar from "./foo-bar";\r
|
||||||
\r
|
\r
|
||||||
|
|
|
@ -17,7 +17,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
|
||||||
verify.applyCodeActionFromCompletion("", {
|
verify.applyCodeActionFromCompletion("", {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
source: "/a",
|
source: "/a",
|
||||||
description: `Import 'foo' from "./a".`,
|
description: `Import 'foo' from module "./a".`,
|
||||||
// TODO: GH#18445
|
// TODO: GH#18445
|
||||||
newFileContent: `import foo from "./a";\r
|
newFileContent: `import foo from "./a";\r
|
||||||
\r
|
\r
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
verify.applyCodeActionFromCompletion("", {
|
verify.applyCodeActionFromCompletion("", {
|
||||||
name: "x",
|
name: "x",
|
||||||
source: "m",
|
source: "m",
|
||||||
description: `Import 'x' from "m".`,
|
description: `Import 'x' from module "m".`,
|
||||||
// TODO: GH#18445
|
// TODO: GH#18445
|
||||||
newFileContent: `import { x } from "m";\r
|
newFileContent: `import { x } from "m";\r
|
||||||
\r
|
\r
|
||||||
|
|
|
@ -22,7 +22,7 @@ verify.completionListContains({ name: "foo", source: "/b" }, "const foo: 1", "",
|
||||||
verify.applyCodeActionFromCompletion("", {
|
verify.applyCodeActionFromCompletion("", {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
source: "/b",
|
source: "/b",
|
||||||
description: `Import 'foo' from "./b".`,
|
description: `Import 'foo' from module "./b".`,
|
||||||
// TODO: GH#18445
|
// TODO: GH#18445
|
||||||
newFileContent: `import { foo } from "./b";\r
|
newFileContent: `import { foo } from "./b";\r
|
||||||
\r
|
\r
|
||||||
|
|
|
@ -16,7 +16,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
|
||||||
verify.applyCodeActionFromCompletion("", {
|
verify.applyCodeActionFromCompletion("", {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
source: "/a",
|
source: "/a",
|
||||||
description: `Import 'foo' from "./a".`,
|
description: `Import 'foo' from module "./a".`,
|
||||||
// TODO: GH#18445
|
// TODO: GH#18445
|
||||||
newFileContent: `import * as a from "./a";
|
newFileContent: `import * as a from "./a";
|
||||||
import { foo } from "./a";\r
|
import { foo } from "./a";\r
|
||||||
|
|
|
@ -28,7 +28,7 @@ verify.not.completionListContains({ name: "foo", source: "/a_reexport_2" }, unde
|
||||||
verify.applyCodeActionFromCompletion("", {
|
verify.applyCodeActionFromCompletion("", {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
source: "/a",
|
source: "/a",
|
||||||
description: `Import 'foo' from "./a".`,
|
description: `Import 'foo' from module "./a".`,
|
||||||
// TODO: GH#18445
|
// TODO: GH#18445
|
||||||
newFileContent: `import { foo } from "./a";\r
|
newFileContent: `import { foo } from "./a";\r
|
||||||
\r
|
\r
|
||||||
|
|
|
@ -23,7 +23,7 @@ verify.not.completionListContains({ name: "foo", source: "/foo/index" }, undefin
|
||||||
verify.applyCodeActionFromCompletion("", {
|
verify.applyCodeActionFromCompletion("", {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
source: "/foo/lib/foo",
|
source: "/foo/lib/foo",
|
||||||
description: `Import 'foo' from "./foo".`,
|
description: `Import 'foo' from module "./foo".`,
|
||||||
// TODO: GH#18445
|
// TODO: GH#18445
|
||||||
newFileContent: `import { foo } from "./foo";\r
|
newFileContent: `import { foo } from "./foo";\r
|
||||||
\r
|
\r
|
||||||
|
|
|
@ -22,7 +22,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "",
|
||||||
verify.applyCodeActionFromCompletion("b", {
|
verify.applyCodeActionFromCompletion("b", {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
source: "/a",
|
source: "/a",
|
||||||
description: `Import 'foo' from "./a".`,
|
description: `Import 'foo' from module "./a".`,
|
||||||
// TODO: GH#18445
|
// TODO: GH#18445
|
||||||
newFileContent: `import { foo } from "./a";\r
|
newFileContent: `import { foo } from "./a";\r
|
||||||
\r
|
\r
|
||||||
|
@ -39,7 +39,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "",
|
||||||
verify.applyCodeActionFromCompletion("c", {
|
verify.applyCodeActionFromCompletion("c", {
|
||||||
name: "foo",
|
name: "foo",
|
||||||
source: "/a",
|
source: "/a",
|
||||||
description: `Import 'foo' from "./a".`,
|
description: `Import 'foo' from module "./a".`,
|
||||||
// TODO: GH#18445
|
// TODO: GH#18445
|
||||||
newFileContent: `import { foo } from "./a";\r
|
newFileContent: `import { foo } from "./a";\r
|
||||||
\r
|
\r
|
||||||
|
|
Loading…
Reference in a new issue