镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Related error spans for too few arguments #25255

Description

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

Metadata

Metadata

Labels

BugA bug in TypeScriptDomain: Related Error SpansSpecifying regions for error messages/diagnostics on multiple locations.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions