Skip to content

Support node ancestors via a configuration option #60

Open
@remcohaszing

Description

Initial checklist

Problem

You might also support ancestors: https://github.com/vfile/vfile-message#fields

Originally posted by @wooorm in #57 (review)

I looked into ancestors, but I think the information is not relevant here. It makes the messages very verbose. As an end user of the language server, the fact that everything is based on ASTs, is an implementation detail.

Originally posted by @remcohaszing in #57 (comment)

I’m not saying it should be a default. It isn’t in vfile-reporter either.

But I see if quite different. There are many reasons for errors to be thrown. I think users and the code that emits errors should decide whether the positional info and other info in the AST is an “implementation detail” or not.

Originally posted by @wooorm in #57 (comment)

Solution

Add option showAncestors. If this is true, the ancestry will be added to the LSP diagnostic message.

Alternatives

  1. showAncestors was chosen arbritrarily. The name could be different.
  2. Use DiagnosticRelatedInformation instead of appending to the message. This makes the trace clickable, but it renders differently.

Metadata

Assignees

No one assigned

    Labels

    🤞 phase/openPost is being triaged manually

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions