ANN: FancyDiagnostics package for better syntax errors

I tagged this a few days ago, but forgot to announce, so here goes:

The FancyDiagnostics package is now available on a julia 0.6 near you. It uses CSTParser to replace the built-in julia parser and provide nicer error messages:

30 PM

The new parser is activated as soon as the FancyDiagnostics package is loaded,
no further steps necessary. Coverage of syntax errors is not as comprehensive as the base julia parser right now, but should improve as CSTParser gets better. Let me know if you run into any trouble.

I’d also like to acknowledge the Sloan foundation for funding part of this work.

18 Likes

I’m using Windows, but get the following error:
(Sorry about the screen shot, error seems to break copy & paste of text)

Am I doing something wrong?

image

I’m seeing this:

julia> using FancyDiagnostics

julia> omitting /Users/malmaud/.julia/v0.6/AbstractTrees/src/AbstractTrees.jl due to parsing error near line 16omitting /Users/malmaud/.julia/v0.6/CSTParser/src/CSTParser.jl due to parsing error near line 6omitting /Users/malmaud/.julia/v0.6/FancyDiagnostics/src/display.jl due to parsing error near line 5


julia> REPL:15:20 REPL:4:14 REPL:5:27 ERRORERRORERROR: Unexpected )
include("traits.jl")
                   : ^Unexpected operator


global debug = true
             : ^Unexpected )


diag_code(D::Diagnostic{C}) where {C} = C

Revise + Fancydiagnostics apparently doesn’t work together.

I’ve found the Revise incompatibility.

https://github.com/Keno/FancyDiagnostics.jl/commit/67bc479e4a1c6c2d7121ac995a4018fffc844cae

Will release a new version with the fix.

3 Likes