Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error UX Improvement Sync, 6/28/2018 #25306

Closed
DanielRosenwasser opened this issue Jun 28, 2018 · 2 comments
Closed

Error UX Improvement Sync, 6/28/2018 #25306

DanielRosenwasser opened this issue Jun 28, 2018 · 2 comments
Labels
Design Notes Notes from our design meetings

Comments

@DanielRosenwasser
Copy link
Member

DanielRosenwasser commented Jun 28, 2018

Stripping null and undefined from targets

#25287

  • We already avoid elaborating when relating primitives to unions.
  • Action item: don't work on primitives, just work on objects.

User Test Suite

#25294

  • Signed off
  • @andy-ms, can you take a look at that weird change?

Exposing diagnostic codes to related error spans

#25304

  • Should codes be Error? Suggestion? Info?
  • Discuss in issue.

Related Error Spans

#25257

  • Reprioritized
  • Duplicate declaration/redeclared block scoped variable errors
    • Having the link to the declarations is useful
    • But usually it's not that you have 100 of the same error, it's usually that you have 100 errors in two files respectively (because they're identical).
    • Maybe limit 5 duplicate declaration error within a file, taper off with "N other duplicates have been detected"
    • If all the top-level declarations are duplicate, potentially just consider the file a duplicate?
    • Maybe say "File A duplicates identifiers x, y, z, a, ..., q from file B".
      • This one seems good.
      • We'll figure out how to do it
    • Action item: file an issue for better consolidation.

Most searched errors (?)

  • We literally typed in error TS into Google and let it auto-complete.
    • Probably good enough.
  • TS2339, TS2307, TS2304, TS2322, TS2531, TS1005, TS2305, TS2345, TS2306
  • "error ts2304 cannot find name"
    • Google completes with require, map, buffer, describe, $, asyncIterator, process, symbol, module, promise
    • Should we provide a better error on these?
      • Yes!
    • You're using $ => Suggest jQuery
    • You're using describe => Did you mean to have types for mocha, jest, etc.?
    • process, require, module => Node types
    • Symbol, Promise, Map, Set, asyncIterator => Different lib or target.
    • Action item: Better elaborations
  • "error ts2531 object is possibly 'null/undefined'"
    • What can we do?
      • Possibly tell people to use the !?
      • Might be the wrong way to lead users down the right path.
  • "Typescript error TS1005: ';'"
    • Recurring issue with Visual Studio installations not overriding existing tsc.
  • "Argument of type X is not assignable to parameter of type Y"
  • "File is not a module"
    • How do we explain modules to people in the terminal?
    • Could provide an explanation in every error
      • Becomes noisy
        • Rust has a suggestion to run with --showElaborations.
    • Provide a link?
      • But you don't want to provide a link for every error.
    • "Consider searching Google for-"
      • lol
@DanielRosenwasser DanielRosenwasser added the Design Notes Notes from our design meetings label Jun 28, 2018
@DanielRosenwasser DanielRosenwasser changed the title Error Message Improvements Sync, 6/28/2018 Error UX Improvements Sync, 6/28/2018 Jun 28, 2018
@DanielRosenwasser DanielRosenwasser changed the title Error UX Improvements Sync, 6/28/2018 Error UX Improvement Sync, 6/28/2018 Jun 28, 2018
@RyanCavanaugh
Copy link
Member

We could run the numbers on @types packages by download count and make a reverse map from the globals they expose => suggestions for things to install. A quickfix would turn it into an amazing demo...

@mhegazy
Copy link
Contributor

mhegazy commented Jun 28, 2018

We can do that as part of #25308. we just need a json file of sorts that map global variable to a package file, and the compiler can use that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Design Notes Notes from our design meetings
Projects
None yet
Development

No branches or pull requests

3 participants