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 spans for too few arguments #25255

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

Related error spans for too few arguments #25255

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

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.

When calling a function with too few arguments, we should see if we can provide a related span on the first missing parameter in the resolved call.

For example

   foo(0, 0)
// ~~~~~~~~~
// Expected 3 arguments, but got 2.

   function foo(a, b, c) {}
//                    ~
// An argument for 'c' was not provided.

///////////////////////////////

   bar(0, 0)
// ~~~~~~~~~
// Expected 3 arguments, but got 2.

   function bar(a, b, { hello }) {}
//                    ~~~~~~~~~
// The respective argument was not provided.
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.
Projects
None yet
Development

No branches or pull requests

3 participants