|
|
|
06-05-2014, 01:47 PM
|
#1
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
ReaSyntax: Sublime Text Syntax for JS/EEL/LUA/WALTER
I'm sure some of you here are using the fabulous Sublime Text and are disappointed by the fact that you can't code your favorite JS/EEL scripts and WALTER themes in it!
Well, no more! Proceed here to find out more about ReaSyntax installation and features.
Additionally, you can also get a separate JS Editor theme for Lua scripts here. Big thanks to the user earhax for providing it!
A lot of effort has been invested in this. If you seriously use it, please consider supporting the developer. Thanks!
Some screens:
__________________
REAPER ReWorked: An elegant and self-sufficient all-around REAPER configuration
Other stuff
Last edited by Breeder; 03-06-2021 at 10:43 PM.
|
|
|
06-05-2014, 01:49 PM
|
#2
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Btw, don't hesitate to report any bugs!
Also, if somebody wants to create additional color schemes let me know and I can add you to the project (if you're not comfortable with git just PM your contribution and I will add it together with the copyright notice )
If mods could sticky this, it would be appreciated, thanks!
|
|
|
06-05-2014, 02:02 PM
|
#3
|
Human being with feelings
Join Date: Mar 2010
Posts: 4,713
|
Nice one Breeder, looks good
|
|
|
06-06-2014, 09:58 PM
|
#4
|
Human being with feelings
Join Date: Apr 2012
Location: Cincinnati area...
Posts: 642
|
So far it's proving very useful for theming...makes the WALTER process more tolerable, lol.
Thank you Breeder...
|
|
|
06-08-2014, 01:41 AM
|
#5
|
Human being with feelings
Join Date: May 2014
Location: Germany
Posts: 643
|
Hey,
this is really great. If you work with big JS files this is a great time saver:-)
But there seems to be a small issue with the syntax detection feature:
opening files inside sublime works, also drag&drop.
But js autodection does not work using command line (windows 7):
typing "sublime_text testjsfx" on command line gives plain text syntax
Any idea? Thanks a lot.
regards
Thomas
|
|
|
06-08-2014, 07:50 AM
|
#6
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by TBProAudio
But js autodection does not work using command line (windows 7):
typing "sublime_text testjsfx" on command line gives plain text syntax
Any idea? Thanks a lot.
regards
Thomas
|
Well, that appears to be a bug in Sublime Text...I guess we should report it on their forums or wherever they report bugs
|
|
|
06-28-2014, 10:58 AM
|
#7
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
Well done !
I had myself done the Syntax Highlighting for Notepad ++ : Walter & ReaperLangPack
Can you make a ReaperLangPack synthax highlight ? It would be awesome !
|
|
|
06-28-2014, 12:26 PM
|
#8
|
Human being with feelings
Join Date: Sep 2012
Location: Indonesia
Posts: 91
|
sooo great!
IMHO this is much more convenient than using notepad++
i'm quite sure this will also catalyze JS coding addictiveness
thank you Breeder
|
|
|
06-28-2014, 12:35 PM
|
#9
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
@pakkuncung : LOL what's SO wrong with using Notepad++ ? I can concieve than you prefer Sublime Text but Notepad++ has a LOTS of good things :P hasn't it ? If no, there is hundreds of plugins than can improve it's functionnalities :P
|
|
|
06-28-2014, 01:09 PM
|
#10
|
Human being with feelings
Join Date: Sep 2012
Location: Indonesia
Posts: 91
|
Quote:
Originally Posted by X-Raym
@pakkuncung : LOL what's SO wrong with using Notepad++ ? I can concieve than you prefer Sublime Text but Notepad++ has a LOTS of good things :P hasn't it ? If no, there is hundreds of plugins than can improve it's functionnalities :P
|
nothing's wrong with notepad++, it's great
i've tried customizing and creating JS syntax as user defined language on notepad++, but it was never felt like home (as in JS editor).
in the other hand, my impression using sublime text (with Breeder's Reasyntax) feels much better.
perhaps i care about my feeling too much, yet coding needs more logic hahaha
i'm not a coder nor programmer anyway, i just love to create my own tools for crafting music.
|
|
|
06-29-2014, 05:44 AM
|
#11
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
@pakkuncung :
Ok
What I like about sublime text is something a bit special : it's integration with the real-time online collaborative text editor Floobits.
That's said, if I remember well, I think that's the synthax highlight colors for the online version of Floobits uses the Sublime Text system.
Greg from the Floobits told me that he was ok to implement no new languages, but my Notepad ++ UDL files was not supported.
If we can provide him a ReaperLang Sublime Text color file, teams of Reaper translators could work online in a very efficient way
|
|
|
06-29-2014, 06:21 AM
|
#12
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by X-Raym
Can you make a ReaperLangPack synthax highlight
|
I can stuff it in when I'll be fixing some ReaSyntax bugs - but don't count on it too soon, there are other things requiring my attention
|
|
|
06-29-2014, 10:51 AM
|
#13
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
That is a marvellous news
|
|
|
07-04-2014, 10:19 PM
|
#14
|
Human being with feelings
Join Date: Apr 2012
Location: Christchurch, New Zealand
Posts: 482
|
This is outstanding! Because of ReaSyntax it's now a joy to work on my JSFX projects. Thank you Breeder!
|
|
|
09-20-2014, 10:34 AM
|
#15
|
Human being with feelings
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
|
ReaSyntax does not have autocomplete, so I started creating my own. But Does Sublimetext NOT have the ability to give you a list of possible inputs for function parameters? Here's my file so far,
PHP Code:
{ "scope": "source.EEL", "completions": [ {"trigger": "ApplyNudge", "contents": "ApplyNudge(${0:ReaProject* project}, ${1:int nudgeflag}, ${2:int nudgewhat}, ${3:int nudgeunits}, ${4:double value}, ${5:bool reverse}, ${6:int copies})"}, {"trigger": "CountSelectedMediaItems", "contents": "CountSelectedMediaItems(${1:ReaProject* proj})"}, {"trigger": "GetMediaItem", "contents": "GetMediaItem(${1:ReaProject* proj}, ${2:int itemidx})"}, {"trigger": "GetSelectedMediaItem", "contents": "GetSelectedMediaItem(${1:ReaProject* proj}, ${2:int selitem})"}, {"trigger": "GetMediaItemInfo_Value", "contents": "GetMediaItemInfo_Value(${1:MediaItem* item}, \"${2:parname}\")"}, "I_GROUPID", "B_MUTE", "B_LOOPSRC", "B_ALLTAKESPLAY", "B_UISEL", "C_BEATATTACHMODE", "C_LOCK", "D_VOL", "D_POSITION", "D_LENGTH", "D_SNAPOFFSET", "D_FADEINLEN", "D_FADEOUTLEN", "D_FADEINLEN_AUTO", "D_FADEOUTLEN_AUTO", "C_FADEINSHAPE", "C_FADEOUTSHAPE", "I_GROUPID", "I_LASTY", "I_LASTH", "I_CUSTOMCOLOR", "I_CURTAKE", "IP_ITEMNUMBER", "F_FREEMODE_Y", "F_FREEMODE_H",
{"trigger": "Main_OnCommand", "contents": "Main_OnCommand(${1:int command}, ${2:int flag})"}, {"trigger": "Main_OnCommandEx", "contents": "Main_OnCommandEx(${1:int command}, ${2:int flag}, ${3:ReaProject* proj})"},
{"trigger": "Undo_BeginBlock", "contents": "Undo_BeginBlock()"}, {"trigger": "Undo_EndBlock", "contents": "Undo_EndBlock(\"${1:descchange}\", ${2:int extraflags})"}, ] }
extract to: Sublime Text\Data\Packages\User
save as: ANYTHING.sublime-completions
The goal of Sublime Text, I think, is to not have to look at the html API guide every time you want to write a line of code. This gets me a lot closer to that goal, but definitely not all the way, possibly due to Sublime Text lacking in "code helper" features. For example, the "Nudge" function is still difficult to use because you have to look up what numbers do what. Also, for stuff like "I_GROUPID", "B_MUTE", "B_LOOPSRC", they only belong in the "parname" of GetMediaItemInfo_Value, but I don't think there's a way to tell Sublime Text.
I am very new to this and there may be Sublime Text features that I'm not making use of.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
Last edited by Argitoth; 09-20-2014 at 10:47 AM.
|
|
|
09-20-2014, 11:02 AM
|
#16
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by Argitoth
But Does Sublimetext NOT have the ability to give you a list of possible inputs for function parameters?
|
It does and I'm finishing it up - will push it soon (maybe today, probably tomorrow)
|
|
|
09-20-2014, 11:30 AM
|
#17
|
Human being with feelings
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
|
I want it NOWWWWW :'(
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
|
|
|
09-20-2014, 12:02 PM
|
#18
|
Human being with feelings
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
|
Question: I put sublime text as the external editor for eel files in REAPER preferences. It opened sublimetext where each word of the file was a new tab in Sublime Text, and of course, did not open the intended file. How do I get it to work?
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
|
|
|
09-21-2014, 12:14 PM
|
#19
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by Argitoth
Question: I put sublime text as the external editor for eel files in REAPER preferences. It opened sublimetext where each word of the file was a new tab in Sublime Text, and of course, did not open the intended file. How do I get it to work?
|
Yes, that's some kind of bug - hard to tell where the bug is actually - maybe REAPER's passing wrong parameters to sublime_text.exe or Sublime Text's not smart enough to work with parameters passed by REAPER.
In any case, I'm using this to overcome it:
https://github.com/grumpydev/Sublime...ad-Replacement
This way Sublime Text will be launched instead of notepad in all scenarios. So you don't even need to set external editors. Both .EEL and jesusonic files will get opened in Sublime Text by default.
|
|
|
09-21-2014, 02:58 PM
|
#20
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Bump for v0.1.0
changelog:
Code:
[JS, EEL, WALTER] added auto completion for built-in functions (EEL, JS) and keywords (WALTER)
[JS, EEL] fixed local/global/instance parameters
[JS, EEL] added support for namespace function parameters (a*)
[JS] fixed slider description when using various characters that were not letters
[JS] added support for gfx_ext_retina, import and options:gmem
If you installed the package using Package Manager it should update itself automatically
|
|
|
09-21-2014, 04:55 PM
|
#21
|
Human being with feelings
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
|
Breeder, you removed indication of what the parameter type is. Is this just your preference or was this done for a specific reason? For example, parmname of GetMediaItemInfo_Value is not surrounded by quotes when it is autocompleted.
Also, you didn't include parameter hints. How do you implement this? I wouldn't mind implementing it myself, if only I knew how.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
|
|
|
09-22-2014, 04:23 AM
|
#22
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by Argitoth
Is this just your preference or was this done for a specific reason?
|
I really don't see much need for types since parameter name usually tells you enough and auto completed function with all the types would just end up too long.
Surronding things with quotes also feels kinda wrong. All parameters are just variables and they don't have to be literals. That would IMHO be better handled in a following way:
Quote:
Originally Posted by Argitoth
Also, you didn't include parameter hints. How do you implement this? I wouldn't mind implementing it myself, if only I knew how.
|
Sublime text doesn't understand concept of hints, it only has completions and snippets.
I guess you could use it's API (or maybe snippets) to detect if current selection is within the function. If it is, check name of the function ad current parameter - if it matches with something that needs hint you throw it in auto completion (in case of an undo you would name the completion UNDO_STATE_ALL, but insert -1)
I might tackle with it someday, but feel free to experiment - if you come up with something useful I recommend you do a pull request and if it's good enough I'll merge it
Last edited by Breeder; 09-22-2014 at 04:38 AM.
|
|
|
10-05-2014, 11:17 AM
|
#23
|
Human being with feelings
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
|
Hey Breeder, I can't comment code in EEL. Are you having problems with this or is it just me?
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
|
|
|
10-05-2014, 11:46 AM
|
#24
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Quote:
Originally Posted by Argitoth
Hey Breeder, I can't comment code in EEL.
|
Huh? Any example?
|
|
|
10-05-2014, 12:09 PM
|
#25
|
Human being with feelings
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
|
lol oops, maybe I should have explained.
I can't use the hotkey "comment code" because when I do that (or even when I go to menu --> comment code) nothing happens. I think this is because the "comment" syntax is messed up in the definition files of EEL syntax. I was wondering if you couldn't auto-comment code as well.
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
|
|
|
10-05-2014, 01:50 PM
|
#26
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Confirmed, I think I know what's going on. Thanks for the report!
|
|
|
10-06-2014, 01:06 AM
|
#27
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
Fixed!
v0.1.1 changelog:
Code:
[JS, EEL, WALTER] fixed toggling comments
[EEL] added SetCursorContext() to completion list
|
|
|
10-06-2014, 10:05 AM
|
#28
|
Human being with feelings
Join Date: Feb 2008
Location: Mesa, AZ
Posts: 2,057
|
Thank you breeder for the great work on this! Coding is fun with REAPER!
__________________
Soundemote - Home of the chaosfly and pretty oscilloscope.
MyReaperPlugin - Easy-to-use cross-platform C++ REAPER extension template
|
|
|
10-26-2014, 06:41 AM
|
#29
|
Human being with feelings
Join Date: Feb 2012
Posts: 1,972
|
Wow, just found it! Thank you!
|
|
|
11-16-2014, 05:42 PM
|
#30
|
Human being with feelings
Join Date: Aug 2014
Location: New York
Posts: 135
|
This is amazing! Thanks for the hard work
|
|
|
11-23-2014, 04:17 PM
|
#31
|
Human being with feelings
Join Date: Apr 2013
Location: France
Posts: 9,875
|
OMG. I totally missed that auto-completion stuff.
It is truly amazing. Congratulations !
I installed Sublime Text just for this (I was a lot into Brackets this times :P)
|
|
|
01-20-2015, 11:36 AM
|
#32
|
Human being with feelings
Join Date: Mar 2013
Posts: 463
|
thanks so much! this is fantastic! so glad to be able to stick with sublime to edit ReaScript, JS etc, thank you
|
|
|
03-20-2015, 08:35 AM
|
#33
|
Human being with feelings
Join Date: Feb 2012
Posts: 1,972
|
Should be sticky, no?
|
|
|
03-20-2015, 01:49 PM
|
#34
|
Human being with feelings
Join Date: Apr 2012
Location: Christchurch, New Zealand
Posts: 482
|
Quote:
Originally Posted by Viente
Should be sticky, no?
|
Would not disagree, my friend.
|
|
|
08-09-2015, 12:46 PM
|
#35
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
I'm slowly preparing next update which should have auto completion for all ReaScript languages (Lua, Python, EEL). I want to try and do it before v5 goes official. Stay tuned
|
|
|
08-09-2015, 01:43 PM
|
#36
|
Human being with feelings
Join Date: Feb 2009
Location: Dunedin, New Zealand
Posts: 205
|
Quote:
Originally Posted by Breeder
I want to try and do it before v5 goes official.
|
Awesome!
|
|
|
09-28-2018, 05:18 PM
|
#37
|
Human being with feelings
Join Date: Nov 2010
Posts: 2,436
|
ReaScript updated for anyone who uses it:
Code:
##### v0.2.0 (September 29 2018)
* [Lua] Added Lua completion list. All scripts load it - REAPER or not. This can be limited to specific folders through settings
* [JS, EEL, WALTER] Updated syntax and completion lists to match REAPER 5.96pre12, SWS 2.9.8 and ReaPack 1.2.1
* [JS, EEL] Fixed indentation
edit:
Had to update to 0.2.1 immediately after this...
It seems the feature to have auto-complete only in REAPER folder is broken due to Sublime Text API bug. So the feature was removed for now and autocomplete will work on all Lua files.
Last edited by Breeder; 09-28-2018 at 09:37 PM.
|
|
|
09-28-2018, 11:09 PM
|
#38
|
Human being with feelings
Join Date: May 2012
Location: Italy - Austria
Posts: 55
|
Oh, what a surprise!
Open Sublime Text and ReaSyntax has updated right now!
Thank you.
__________________
Thanks.
|
|
|
10-02-2018, 11:22 AM
|
#39
|
Human being with feelings
Join Date: May 2012
Location: Berlin, Germany
Posts: 171
|
This looks very promising, autocomplete for the REAPER/LUA API works like a charm. One suggestion, though: in LUA, there is no different color for the API calls, it's all white. For instance reaper.get_action_context() etc.
It would be very clever to have them colored, too?
|
|
|
10-02-2018, 12:00 PM
|
#40
|
Human being with feelings
Join Date: May 2017
Location: Leipzig
Posts: 6,621
|
Is there a way to expand it with syntax-highlighting for my own functions? Or for Lokasenna's Gui-Lib?
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 10:08 AM.
|