Skip to content

Declare method quickfix/codeaction should create method after current quick fix location #22674

Closed
@mattbierner

Description

@mattbierner

TypeScript Version: 2.8.0-rc

Search Terms:

  • declare method
  • quick fix
  • code action

Code

class Foo {
    a() {
        this.b()
    }
}

Trigger the declare method 'b' quickfix on this.b()

Expected behavior:
Method inserted after current location (or possible at end of class)

class Foo {
    a() {
        this.b()
    }
    b(): any {
        throw new Error("Method not implemented.");
    }
}

Actual behavior:
Method inserted at top of class:

class Foo {
    b(): any {
        throw new Error("Method not implemented.");
    }
    a() {
        this.b()
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Quick FixesEditor-provided fixes, often called code actions.FixedA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions