For @types installing quickfix, only activate for implicit-any module (#19394)
This commit is contained in:
parent
a9ffe0daeb
commit
f916e38015
|
@ -2,7 +2,6 @@
|
|||
namespace ts.codefix {
|
||||
registerCodeFix({
|
||||
errorCodes: [
|
||||
Diagnostics.Cannot_find_module_0.code,
|
||||
Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code,
|
||||
],
|
||||
getCodeActions: context => {
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////import * as abs from "abs";
|
||||
// @moduleResolution: node
|
||||
// @noImplicitAny: true
|
||||
|
||||
// @Filename: /node_modules/abs/index.js
|
||||
////not read
|
||||
|
||||
// @Filename: /a.ts
|
||||
/////**/import * as abs from "abs";
|
||||
|
||||
test.setTypesRegistry({
|
||||
"abs": undefined,
|
||||
});
|
||||
|
||||
goTo.marker();
|
||||
|
||||
verify.codeFixAvailable([{
|
||||
description: "Install '@types/abs'",
|
||||
commands: [{
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
/// <reference path='fourslash.ts' />
|
||||
|
||||
// @Filename: /a.ts
|
||||
////import * as abs from "abs";
|
||||
|
||||
test.setTypesRegistry({
|
||||
"abs": undefined,
|
||||
});
|
||||
|
||||
// We only give the fix for an implicit-any module, not for a missing module.
|
||||
verify.not.codeFixAvailable();
|
Loading…
Reference in a new issue