JuliaEditorSupport / julia-vim

Vim support for Julia.
http://julialang.org/
Other
753 stars 94 forks source link

Highlight function calls, type expressions #231

Closed carlobaldassi closed 3 years ago

carlobaldassi commented 3 years ago

This is adding more syntax highlighting elements. It closes #216 and addresses #24, #226. In order to actually see the highlighting of function calls, one must do something like this (in the command line or in vimrc/init.vim):

hi link juliaFunctionCall Identifier

My concern is that this might have too much of a performance impact. In my setup, everything actually works smoothly enough in the cases that I have tested. But the plugin is already demanding as-is, and I'd need some feedback on this (also about whether everything works as expected, of course). Pinging a few people that have participated in the above-mentioned issues: @fredrikekre @tomchor @del2z @jessebett @briochemc @bstellato @KadeG @paniash

tomchor commented 3 years ago

I'd like to test this out, but frankly I don't know how to. The installation instructions say almost nothing about the manual installation (which I'm assuming is necessary to test this branch).

I tried just manually copying your branch into ~/.vim/bundle, which is where my other plugins are, but apparently Vundle does something else to install the plugins.

carlobaldassi commented 3 years ago

@tomchor this should work: install the plugin with Vundle normally, using this repo name. Then go to ~/.vim/bundle/julia-vim and run these commands

git remote add cb https://github.com/carlobaldassi/julia-vim/
git fetch cb
git checkout -b cb/morecolors

Once you are done, just go back with git checkout master.

tomchor commented 3 years ago

@carlobaldassi thanks for the feedback. I did exactly what you said (I included the extra line in .vimrc and can confirm that ~/.vim/vundle/julia-vim/ is up to date with cb/morecolors) but everything looks exactly the same. Do you have any screenshot of what's supposed to change?

carlobaldassi commented 3 years ago

First of all, if you write

a::Thing
Thing <: AbstractThing

you should see the types highlighted. Then, if you give the command :hi link juliaFunctionCall Identifier you should see the names in function calls highlighted too.

tomchor commented 3 years ago

Sorry, but it looks exactly the same before and after your command. Also looks the same as regular julia-vim for me:

Screenshot from 2021-02-27 12-14-22

~I appreciate the help though. If you have any material that I can read so that I can dig into what's happening and test your modifications I'd be happy to do so.~

I actually just found that I'm not actually in your branch. When I issue git checkout cb/morecolors I get a warning saying warning: refname 'cb/morecolors' is ambiguous. So I'll do some digging as to why.

tomchor commented 3 years ago

Alright, I was able to test it. I don't love the default color for function calls but other than that it looks pretty good to me. Didn't notice any slowdown whatsoever!

My vote definitely goes to merging! And thanks for the contribution.

tomchor commented 3 years ago

I found what appears to be a small bug though: Screenshot from 2021-02-27 16-54-54

This doesn't happen with the master branch:

Screenshot from 2021-02-27 16-54-33

carlobaldassi commented 3 years ago

@tomchor thanks, I think the bug should be fixed now

tomchor commented 3 years ago

Thanks! Indeed it appears the the issue is resolved