-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
<localleader>ee, <localleader>E evaluate the whole file #547
Comments
Not something I'm seeing and definitely not expected. Could you try running |
That's assuming you're using TreeSitter which I highly recommend. If not, what does your syntax highlighting situation look like? Do you have any? |
Below is the ouput of running :TSUpdate .
I do have syntax highlight for clojure file but I am not sure what information But it reminds me one recent change I made in ~/.config/nvim/init.vim is using
With such change there is no such "<localleader>ee, <localleader>E evaluate the I have no idea why such simple change can fix the issue and after that I cannot |
Cool so we've confirmed you're not using TreeSitter, might be worth setting it up, I think it's vastly superior to the default system in Neovim and it allows Conjure to do some more tricks for you. My hunch is that this new Neovim scheme is tagging the words with different highlight groups that Conjure doesn't expect for some reason. In the default mode, it's looking for certain highlight groups to work out if you're inside a string or not (for example), with tree sitter we can query the tree to see what kind of nodes your cursor is in. I'll have to reproduce this myself with this new theme and see what the issue is, will get back to you when I've got some evidence. |
Ah Neovim 0.10 isn't out yet! I see, will get a copy of it somehow and reproduce the issue hopefully. |
Hm, I'm using 0.10 with the new default colorscheme and tree sitter disabled but it all works fine for me 🤔 I can't reproduce the issue, maybe it's because I loaded the buffer with another scheme / tree sitter which polluted some shared mutable state. I'll try to open Neovim fresh with these settings and this version. |
Still can't reproduce the issue on What is the issue you're actually seeing? Because after re-reading your initial comment I don't see any problems there in your example. You're evaluating the And if the entire file is evaluated then you should be seeing the result of I think I'm misunderstanding something here, I'd like to help, I just need a little more of a "what you're seeing" and "what you expect to see" I think? Thanks! |
I have a side question. Would you elaborate a bit what's additional benefit if I Note: (1) IIRC last time I check out this plugin there is no tree sitter support
Yes, the entire file is being evaluated as well. If there is anything not clear |
This is a good summary of the benefits of tree sitter https://thevaluable.dev/tree-sitter-neovim-overview/ For Conjure specifically you get accuracy in some cases (allowing you to evaluate things like Clojure deref, set and short function syntax correctly) AND performance on slower machines because Conjure doesn't have to hunt character to character looking for matching parenthesis. You also get features such as the comment block eval which treats And then there's the more obvious one of being able to evaluate Python / Lua etc as if it was a lisp. I've found my syntax highlighting is far deeper and more meaningful with TS and I don't run into issues where something is highlighted incorrectly because my regex line limit is set too low. I wouldn't be surprised if it one day completely replaced the regex engine as the default system in Neovim, only using regex as a fallback for some languages. I'd consider it the first class highlighting / parsing system for Conjure, it's fantastic as a plugin author to have access to an AST instead of a string of characters with an archaic regex based tagging system as my only source of semantic information. I treat the regex support as a fallback these days, so still supported, but just the essentials. I haven't attempted to reproduce your actual issue just yet, I've been staying with my family for a week or so and haven't found the time. I'll try to do it soon though! Would be great to know if anyone else has this issue too. And do you see the issue with ANY other theme, or just the new Neovim one? |
(1) <localleader>ee is used to evaluate the current form
(2) <localleader>E is used to evaluate the current selection
But they seems to evaluate the whole file as well. Is this an expected behavior?
Take following file for example, we can print the vaule of a and b after using
<localleader>ee or <localleader>E to evaluate example_input.
Here is the full setup of the small example.
To reproduce the issue, you can create deps.edn and src/hello.clj and then on a
terminal run:
On a second terminal, start nvim as below:
We'll see messages like:
Use <localleader>ee to evaluate example_input, we'll see
Or use <localleader>E to evalute example_input, we'll see
Then we can print out the value of a and b.
The text was updated successfully, but these errors were encountered: