JuliaLang / JuliaLang/JuliaSyntax.jl

Diagnostics are too chatty

Open
#442 8 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
293
Forks
50
PR merge metrics
No merged PRs in 30d

Description

I've started implementing a linter that will eventually power the LS. For now all it does is use the diagnostic messages from JuliaSyntax. https://github.com/davidanthoff/StringBuilders.jl/pull/96/files is an example. There is one syntax error, a missing `)` on line 14 and the error message for that is nice.

But then _all_ the other error messages after it I feel ideally would _not_ appear at all. In my mind once the parser recognizes that the error on line 14, it should continue parsing pretending that the error was fixed and then not report all these knock-off errors further down in the file.

This is actually probably a reason to not surface the diagnostics in the VS Code extension yet. CSTParser doesn't have a nice error message, but it just stops processing the file after this first error, which at the end of the day is probably a better user experience because the error list is not populated by lots of false-positive like things.

FYI @pfitzseb

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing how JuliaSyntax currently produces diagnostic messages and compare the behavior described in the StringBuilders.jl pull request. Consider the parser recovery behavior after the first syntax error and how diagnostics are surfaced to the VS Code extension. Done should mean that follow-on errors caused by the initial missing token are not reported as separate false positives.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.