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

Related error span for "did you mean ...?" error messages #25031

Closed
DanielRosenwasser opened this issue Jun 18, 2018 · 0 comments
Closed

Related error span for "did you mean ...?" error messages #25031

DanielRosenwasser opened this issue Jun 18, 2018 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. Fixed A PR has been merged for this issue

Comments

@DanielRosenwasser
Copy link
Member

Now that we support multiple related spans for errors (#10489, #22789, #24548), we'd like to improve an existing error message.

Currently, we provide an error when accessing declarations that have been misspelled.

Property '{0}' does not exist on type '{1}'. Did you mean '{2}'?
Cannot find name '{0}'. Did you mean '{1}'?
Object literal may only specify known properties, but '{0}' does not exist in type '{1}'. Did you mean to write '{2}'?
Cannot find name '{0}'. Did you mean the static member '{1}.{0}'?
Cannot find name '{0}'. Did you mean the instance member 'this.{0}'?
Module '{0}' has no exported member '{1}'. Did you mean '{2}'?

We can add a related span on the declaration of the suggestion if one exists:

It's likely that you meant to reference '{0}'.

This can help users quickly glance at the original declaration.

@DanielRosenwasser DanielRosenwasser added the Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. label Jun 18, 2018
@mhegazy mhegazy added this to the TypeScript 3.0 milestone Jun 19, 2018
@mhegazy mhegazy added the Bug A bug in TypeScript label Jun 19, 2018
@mhegazy mhegazy modified the milestones: TypeScript 3.0, TypeScript 3.1 Jul 2, 2018
@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Jul 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Domain: Related Error Spans Specifying regions for error messages/diagnostics on multiple locations. Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants