microsoft / microsoft/TypeScript

Differential `typeToString` / smarter error truncation

Ouverte
#42,597 0 commentaires 0 réactions 1 personne assignée Voir sur GitHub

@RyanCavanaugh y travaille déjà.

Depuis le 2/2/2021.

Domain: Error Messages Domain: LS: Type Display Experience Enhancement Experimentation Needed
Langage dominant
Go
Étoiles
111k
Forks
14.3k
Merge moyen
1 j 19 h
PR mergées (30 j)
117

Description

Lots of the time, error truncation will kick in at the most inopportune time, and lose relevant properties that will be subsequently elaborated on. @RyanCavanaugh has been thinking about a smarter version of this where we can inform our string writers to be a little smarter and not throw away the relevant members of a union, or properties of an object.

But there are some areas that we need to kind of think through and be wary of.

  1. don't repeat yourself: if you end up repeating a constituent of a union on the next line, then was it the best thing to focus on that part of the union on the prior line? You might avoid surprising a user ("where'd that type come from!?") but you're potentially not gaining anything. This leads us to
  2. don't lose the right information: error messages don't always go down the most-appropriate path. If we try to over-focus on the types that the error decided to elaborate on, we shouldn't lose relevant information from other possible types.

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.