Anyone working on adding Julia support to combobulate?
This screenshot looks amazing. Is the completion from LSP or from this tree-sitter package?
The completion candidates are likely being powered by eglot, which is the LSP client that is now built into the 29 release of emacs. The pop up ui itself will be either company or corfu.
Got you. Thanks.
Hi @linwaytin !
The popup is company, which receives information from the LSP as @jcmkk3 said. However, I am using lsp-mode instead of eglot. I have never been able to make eglot works with Julia for some strange reason.
Thank you!
I asked because I remember the LSP server for julia is very slow. I tried it some years ago and the experience is not good. Do you think itâs usable now?
I use eglot + corfu, and find the experience good.
Yes, the experience was very slow but it got much better now. It is not perfect yet, but I use it daily without problems.
Awesome! Itâs the time to try it again.
Hi, I am trying/enjoying the Julia tree-sitter on Emacs. Nice work. However, is there a specific config to get the indentation works properly? Right now, auto-indent works only if I write the begin and end of a block and then go and press enter at the end of the lines inside the block.
Hi!
I am not sure if this can be âfixedâ. The tree sitter grammar does not identify the blocks until you add âbeginâ (or if, else, while, etc) and end. Hence, emacs does not know that it must apply an indentation to that code. I have no ideia how can we workaround.
I see. Maybe one can use snippets to add the âendâ keyword automatically. Then tree-sitter should be able to take care of the indentation inside the block.
Could someone post a workable .emacs? I cannot get going⌠Thanks!
Recently, I built Emacs on a new system, and since then, julia-ts-mode
does not show different colors for the source code. Upon checking the messages, I see the following errors. Does anyone have an idea what is missing?
Treesitter context fold mode cannot be enabled.
[eglot] Waiting in the background for serverEGLOT (esi/(julia-mode ess-julia-mode julia-ts-mode))' Error during redisplay: (jit-lock-function 1) signaled (treesit-query-error "Node type error at" 177 "(assignment (identifier) @font-lock-variable-name-face (_)) (assignment (field_expression (identifier) \".\" (identifier) @font-lock-variable-name-face) (operator)) (assignment (bare_tuple (identifier) @font-lock-variable-name-face)) (assignment (bare_tuple (field_expression (identifier) \".\" (identifier) @font-lock-variable-name-face)) (operator)) (local_statement (identifier) @font-lock-variable-name-face) (let_binding (identifier) @font-lock-variable-name-face) (global_statement (identifier) @font-lock-variable-name-face)" "Debug the query with
treesit-query-validateâ")
Sounds like youâre running into Displaying Julia files using julia-ts-mode fails on Emacs 30.0.5 ¡ Issue #21 ¡ JuliaEditorSupport/julia-ts-mode ¡ GitHub. Help fixing it would of course be appreciated.
Hi @ehsani63 !
Are you using Emacs 29 or 30?
It seems that the grammar has changed, leading to some errors (this kind of problem is particularly difficult to debug in Emacs only by those debugging messagesâŚ). Unfortunately, I do not use Emacs anymore and it will take sometime until I can setup the environment to debug it myself.
I have already transferred the julia-ts-mode
repository to the org JuliaEditorSupport and hopefully someone will be able to help us here
In Neovim, the tree-sitter plugin decides what version of the grammar to use. Does it work the same way in Emacs?
EDIT: I see that GitHub - renzmann/treesit-auto: Automatic installation, usage, and fallback for tree-sitter major modes in Emacs 29 is used to install the grammar. This isnât ideal because itâs very easy to have version mismatches. Ideally the mode should list the last tag that works correctly, so the installer knows the correct version to install (nvim-treesitter tracks the latest commit).
Do not know if it would help at all, but see Helixâs (www.helix-editor.com) implementation of tree-sitter.
To be clear, julia-ts-mode
merely assumes that a compatible grammar is installed but doesnât itself install any grammar. Installing the grammar is the userâs responsibility, but treesit-auto
is suggested as an option.
Obviously something needs to change if the recommended way of installing the grammar installs an incompatible version, but itâs not julia-ts-mode
itself misbehaving. Maybe the correct change is to have julia-ts-mode
manage the grammar installation itself, but that sounds like a massive pain to do correctly in a cross-platform way.
TLDR: .dll hell
Yeah, I didnât mean to imply julia-ts-mode
should install the grammar, but rather that it should store metadata so the installer knows the version it needs to install. Itâs a very bad idea to install HEAD
unconditionally.
In nvim-treesitter, thereâs a json file with the latest commit of each parser that is known to work with the queries in the repo. Since thereâs no emacs tree-sitter mono-repo, youâd need a different approach. But the principle is the same.