2018-04-05 21:33:00 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
////function f([|p|]) {
|
|
|
|
//// const [|x|] = 0;
|
|
|
|
////}
|
|
|
|
|
|
|
|
const [r0, r1] = test.ranges();
|
|
|
|
verify.getSuggestionDiagnostics([
|
2018-10-12 01:15:38 +02:00
|
|
|
{
|
2018-10-29 21:23:33 +01:00
|
|
|
message: "Parameter 'p' implicitly has an 'any' type, but a better type may be inferred from usage.",
|
2018-10-12 01:15:38 +02:00
|
|
|
range: r0,
|
2018-10-29 21:23:33 +01:00
|
|
|
code: 7044,
|
2018-10-12 01:15:38 +02:00
|
|
|
},
|
2018-04-05 21:33:00 +02:00
|
|
|
{
|
|
|
|
message: "'p' is declared but its value is never read.",
|
|
|
|
range: r0,
|
|
|
|
code: 6133,
|
2018-05-22 16:56:29 +02:00
|
|
|
reportsUnnecessary: true,
|
2018-04-05 21:33:00 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
message: "'x' is declared but its value is never read.",
|
|
|
|
range: r1,
|
|
|
|
code: 6133,
|
2018-05-22 16:56:29 +02:00
|
|
|
reportsUnnecessary: true,
|
2018-04-05 21:33:00 +02:00
|
|
|
}
|
|
|
|
]);
|
|
|
|
|
|
|
|
verify.codeFixAvailable(
|
2018-10-29 21:23:33 +01:00
|
|
|
[
|
|
|
|
"Infer parameter types from usage",
|
2020-01-18 22:28:19 +01:00
|
|
|
"Remove unused declaration for: 'p'",
|
2018-10-29 21:23:33 +01:00
|
|
|
"Prefix 'p' with an underscore",
|
2020-01-18 22:28:19 +01:00
|
|
|
"Remove unused declaration for: 'x'"
|
2018-10-29 21:23:33 +01:00
|
|
|
].map(description => ({ description })));
|