# ANN: FancyDiagnostics package for better syntax errors

**URL:** <https://discourse.julialang.org/t/ann-fancydiagnostics-package-for-better-syntax-errors/6850>\
**Category:** Community\
**Created:** [November 2, 2017, 9:28pm UTC](https://discourse.julialang.org/t/ann-fancydiagnostics-package-for-better-syntax-errors/6850 "2017-11-02T21:28:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [November 2, 2017, 9:28pm UTC](https://discourse.julialang.org/t/ann-fancydiagnostics-package-for-better-syntax-errors/6850/1 "2017-11-02T21:28:34Z")

</div>

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

The [FancyDiagnostics](https://github.com/Keno/FancyDiagnostics.jl) package is now available on a julia 0.6 near you. It uses [CSTParser](https://github.com/ZacLN/CSTParser.jl) to replace the built-in julia parser and provide nicer error messages:

![30 PM](https://global.discourse-cdn.com/julialang/original/3X/a/2/a27e69e9d21e3a220b9a70f368abbabb05c45436.png)

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.

---

<div class="post-metadata">

**Author:** ![greg\_plowman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/greg_plowman/32/8100_2.png) [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Post date:** [November 2, 2017, 10:37pm UTC](https://discourse.julialang.org/t/ann-fancydiagnostics-package-for-better-syntax-errors/6850/2 "2017-11-02T22:37:13Z")

</div>

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](https://global.discourse-cdn.com/julialang/original/3X/b/b/bb68693338f7570475e7ebe6d2492d1e52aad337.png)

---

<div class="post-metadata">

**Author:** ![malmaud](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/malmaud/32/29_2.png) [@malmaud](https://discourse.julialang.org/u/malmaud)\
**Post date:** [November 3, 2017, 4:21pm UTC](https://discourse.julialang.org/t/ann-fancydiagnostics-package-for-better-syntax-errors/6850/3 "2017-11-03T16:21:28Z")

</div>

I’m seeing this:

```julia
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

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [November 3, 2017, 4:36pm UTC](https://discourse.julialang.org/t/ann-fancydiagnostics-package-for-better-syntax-errors/6850/4 "2017-11-03T16:36:55Z")

</div>

Revise + Fancydiagnostics apparently doesn’t work together.

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [November 3, 2017, 6:57pm UTC](https://discourse.julialang.org/t/ann-fancydiagnostics-package-for-better-syntax-errors/6850/5 "2017-11-03T18:57:49Z")

</div>

I’ve found the Revise incompatibility.

[https://github.com/Keno/FancyDiagnostics.jl/commit/67bc479e4a1c6c2d7121ac995a4018fffc844cae](https://github.com/Keno/FancyDiagnostics.jl/commit/67bc479e4a1c6c2d7121ac995a4018fffc844cae)

Will release a new version with the fix.
