Skip to content

Add missing member codefix changes lib files #45225

@andrewbranch

Description

@andrewbranch
declare let p: Promise<string>;
async function f() {
  p.toLowerCase();
}

Available fixes are

  1. Add await
  2. Declare method 'toLowerCase'
  3. Declare property 'toLowerCase'
  4. Add index signature for property 'toLowerCase'

2–4 modify the Promise declaration in lib.es5.d.ts.

image

I recently suggested to @sandersn that a new codefix shouldn’t change any .d.ts files, since they’re likely to be downloaded or autogenerated. That may or may not be too aggressive a rule for all codefixes, but I think it may be worth asserting that no codefixes change lib files or node_modules.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Quick FixesEditor-provided fixes, often called code actions.Fix AvailableA PR has been opened for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions