minism / SublimeLove

LÖVE support for SublimeText2
http://love2d.org
41 stars 16 forks source link

Add Love GLSL syntax highlighting #10

Open DanielOaks opened 9 years ago

DanielOaks commented 9 years ago

This adds support for Love fragment shaders (GLSL). Basically, it's the highlighting from the awesome sublime-glsl repo, with the Love-specific changes and variables and types and such added in. Works well and fixes #8

This also lets shaders inside newShader and newPixelEffect get highlighted with proper Love GLSL rules!

minism commented 9 years ago

Hi Daniel,

Sorry it's taken me so long to get to this. Thanks for your patch, I have a couple of questions about it:

  1. Are you re-adding the Love.sublime-completions file, or do you need to rebase against the latest master?
  2. It looks like you took the upstream GLSL syntax file and modified it to fit the love syntax, is that right? Did you do that programmatically or by hand? I'm wondering if we should be concerned about checking in a script which programmatically modifies it, so we can easily re-sync with upstream.
DanielOaks commented 9 years ago

Hi, no problem.

  1. I believe that file was automatically rebuilt when I ran the src/build.py script, but I'll need to double-check that since it's been a little while.
  2. That was done by hand, but I should be able to knock up a script to build that file automatically (hopefully). I'll take a look and see the best way we'd go about that.

I'll rebase my specific changes onto master, to clean the commits up and to see why/how the Love.sublime-completions file got added.

edit: Right, I rolled the update to Love 0.9.1 into this PR because I got carried away and needed to re-generate the language file anyway (for the newShader highlighting), the build.py script recreated the sublime-completions file if I remember correctly. I'll have another look at it.

DanielOaks commented 9 years ago

@minism Alright, I'm gonna make a PR to upgrade SublimeLove to Love 0.9.1, or if you'd like to do it yourself just let me know.

I did the scrape_api.py and that worked fine, but the build.py script created that Love.sublime-completions file.

Should I manually delete that, then modify the build script and comment out the code that creates the completions file before I commit and send the PR to update to 0.9.1?

minism commented 9 years ago

Okay, so there were multiple issues here which is why I was confused:

Can you rebase one last time and remove Love.sublime-completions from your Pull Request? Then I will merge it. I have also filed #12 for generating the GLSL syntax programmatically in the future.

Thanks Daniel, sorry for all the complexity :)

DanielOaks commented 9 years ago

Hmm, I'll look into #11 in that case, see if I can fix it on my system.

Thanks for updating, I'll rebase it in the next few days.

I'll also take on #12, shouldn't be too difficult and I've dealt with this sorta work before. Will commit the current file now, and then work on the autogenerating, and file another PR once that work's done.

No problem, glad to help :)

On 18 February 2015 at 11:00, Josh Bothun notifications@github.com wrote:

Okay, so there were multiple issues here which is why I was confused:

  • The Love.sublime-completions file is now obsolete since pull request

    5 https://github.com/minism/SublimeLove/pull/5, but I forgot to

    remove it from the build script. Thats done and pushed to master.

  • Autocompletions don't seem to work on ST3 when installed from package control, filed #11 https://github.com/minism/SublimeLove/issues/11 for that.
  • API was out of date as you said -- I've updated everything to love 0.9.2 and pushed that to master as well.

Can you rebase one last time and remove Love.sublime-completions from your Pull Request? Then I will merge it. I have also filed #12 https://github.com/minism/SublimeLove/issues/12 for generating the GLSL syntax programmatically in the future.

Thanks Daniel, sorry for all the complexity :)

— Reply to this email directly or view it on GitHub https://github.com/minism/SublimeLove/pull/10#issuecomment-74790261.

DanielOaks commented 9 years ago

Update: I actually am just doing the programmatic creation right now, easier to just do it and get it over with now.

Right now I'm trying to work out some minor issues with highlighting and scoping, not related to the auto-generation but just a general fault. I'll keep you posted, and update when it's all working proper.