microsoft / microsoft/TypeScript

Document quick fix (or whatever it's officially called)

Open
#29,048 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

In Discussion Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

TypeScript Version: 3.3.0-dev.201xxxxx

Search Terms:
code fix
quick fix
suggestion

Code
not entirely applicable, but this is what I had which caused me to get confused

const fs = require("fs");

Expected behavior:
Commandline tsc should behave the same as editor integrations

Actual behavior:
The "quick fix" feature, which appears to be called "code fixes" in the codebase and googling the messages led me to the json file which refers to them as "suggestions", only appears to exist in the typescript server.

As a newcomer this had me extremely confused. I was running tsc on the commandline and getting no errors, but seeing squiggly lines and messages in my editor (atom, in this case).

I was unable to find any documentation about where the message 'require' call may be converted to an import was coming from, or that this was a hint that typescript was able to fix my code for me.

It would also be helpful if the tsc client was able to list the code fix suggestions, even if giving it a way to apply them would be too complex.

Playground Link:
n/a

Related Issues:
none that I could find

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 comparing the command-line tsc behavior with the TypeScript server and editor integrations described in the issue. Trace the code-fix terminology in the TypeScript codebase and its message JSON, then determine whether documentation alone covers the gap or whether listing suggestions in tsc is also required; done means the terminology and supported behavior are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.