gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
231 stars 21 forks source link

REPL doesn't load if JuliaSyntax is used #128

Closed edmundmiller closed 11 months ago

edmundmiller commented 11 months ago

I'm guessing it has something to do with the use of CSTParser.jl.

I'm wondering if this will break in 1.10 then...

gcv commented 11 months ago

Can you give me some more information? A sample Project.toml file, some sample code?

Also, is CSTParser deprecated? I don't follow it closely; is the VSCode Julia plugin switching to the new Julia parser?

It's well within the realm of possibility that I update Snail to use this other parser for Julia >1.9.

edmundmiller commented 11 months ago

Sure thing! Sorry about that, it was a running around at JuliaCon issue :laughing:

Using Julia 1.9.1, add JuliaSyntax to the root/default environment.

Then in ~/.julia/config/startup.jl add:

using JuliaSyntax
JuliaSyntax.enable_in_core!()

Fire up a snail REPL, and it'll start and then disappear with no error message, and opening another starts a fresh instance with the same behavior.

gcv commented 11 months ago

I haven't yet had time to investigate too closely, especially the matter of 1.10 compatibility, but I did find this ticket: https://github.com/JuliaLang/JuliaSyntax.jl/issues/128

Could you please try the atreplinit workaround described there and let me know if it helps?

edmundmiller commented 11 months ago

Awesome, it worked!

atreplinit() do repl
    @eval begin
        import JuliaSyntax
        JuliaSyntax.enable_in_core!(true)
    end
end

If you want to close it, go ahead, or we can add it to the docs in this repo as well, or maybe just in the wiki

gcv commented 11 months ago

Added to wiki (https://github.com/gcv/julia-snail/wiki/Tips-and-Tricks#enabling-juliasyntax-in-julia-110). I tried 1.10beta1 with Snail, and everything seems to work. Maybe the problem is the enable_in_core!, which probably isn't used in 1.10?

In any case, this raises questions about the future of CSTParser in Snail. Maybe when the next Julia LTS release comes out, I should replace CSTParser with JuliaSyntax and make the LTS version the minimum required for the latest versions of Snail. Or get rid of Julia-based parsing altogether in favor of the new tree-sitter parser included in Emacs 29. Though making 29 the minimum required Emacs version for Snail bother me. We'll see.