Description
Initial checklist
- I read the support docs
- I read the contributing guide
- I agree to follow the code of conduct
- I searched issues and couldn’t find anything (or linked relevant results below)
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
showAncestors
was chosen arbritrarily. The name could be different.- Use
DiagnosticRelatedInformation
instead of appending to the message. This makes the trace clickable, but it renders differently.