microsoft / microsoft/TypeScript

'declare method' quick fix for adding a private method

Open
#37,782 20 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Good First Issue Help Wanted Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

From https://github.com/microsoft/vscode/issues/94118

TypeScript Version: 3.9.0-dev.20200330

Search terms

  • quick fix
  • declare method
  • private

Repro
For ts file:

index.ts

class Bar {
    bar() {
         this._baz(123)
    }
}
  1. Trigger quick fixes on _baz

Feature request:
https://github.com/microsoft/TypeScript/issues/36249 added a quick fix for adding private properties. However there is no quick fix for adding a private method

Playground Link:

Related Issues:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the missing quick fix in index.ts with the TypeScript version described, then inspect the existing private-property quick fix from issue 36249 as the closest entry point. Done means triggering a quick fix on the missing _baz call offers a way to declare a private method and the relevant checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.