8000 Secondary spans on more diagnostics: the declaration a call resolved to, the declared return type · Issue #719 · kexhq/kex · GitHub
[go: up one dir, main page]

Skip to content

Secondary spans on more diagnostics: the declaration a call resolved to, the declared return type #719

Closed

Description

@akoskovacs

Follow-up to #657, whose snippets landed in #714 and whose highlighting is #717.

A diagnostic can carry secondary spans (Diagnostic::labels, underlined with - and labelled), but only one diagnostic uses them so far: the binding whose value disagrees with its annotation (KEXET-0001). #657 also asked for them where a message names another place in the source, for example:

  • an argument of the wrong type (KEXET-0491): the declaration of the function the call resolved to;
  • a body that answers the wrong type (KEXET-0127): the declared return type;
  • a non-exhaustive match (KEXET-0107): the type's declaration, listing the missing constructors.

Each needs the checker to keep that location where it reports the error, then a labelLast(...) call (src/semantic/typechecker.cxx). The LSP could pass the same spans on as relatedInformation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
45AA

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0