Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REPL doesn't load if JuliaSyntax is used #128

Closed
edmundmiller opened this issue Jul 28, 2023 · 5 comments
Closed

REPL doesn't load if JuliaSyntax is used #128

edmundmiller opened this issue Jul 28, 2023 · 5 comments

Comments

@edmundmiller
Copy link

edmundmiller commented Jul 28, 2023

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
Copy link
Owner

gcv commented Jul 28, 2023

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
Copy link
Author

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

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
Copy link
Owner

gcv commented Jul 30, 2023

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

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

@edmundmiller
Copy link
Author

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
Copy link
Owner

gcv commented Aug 4, 2023

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.

@gcv gcv closed this as completed Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants