About Monkey 2 › Forums › General Programming Discussion › Atom Package for Monkey2
This topic contains 25 replies, has 6 voices, and was last updated by
arawkins 1 year, 2 months ago.
-
AuthorPosts
-
April 4, 2017 at 10:04 pm #7712
Thanks. That is using the symbols-tree-nav package (which is a fork of symbols-tree-view) with the following added to lib\.ctags:
Monkey123456--langdef=Monkey2--langmap=Monkey2:.monkey2--regex-Monkey2=/(^|=[ \t])*Class ([A-Za-z_][A-Za-z0-9_]+\.)*([A-Za-z_][A-Za-z0-9_]+)( Extends ([A-Za-z][A-Za-z0-9_.]*)+)?$/\3/c,class/--regex-Monkey2=/(^|=[ \t])*Method ([A-Za-z_][A-Za-z0-9_]+\.)*([A-Za-z_][A-Za-z0-9_]+).*$/- m: \3/o,other/--regex-Monkey2=/(^|=[ \t])*Function ([A-Za-z_][A-Za-z0-9_]+\.)*([A-Za-z_][A-Za-z0-9_]+).*$/\3/f,function/--regex-Monkey2=/(^|=[ \t])*'-(.*)$/'-\2/o,other/I’m sure the regex is terrible there (it was a hacky copy and paste job and probably doesn’t even cover all Monkey 2 syntax…)
I couldn’t get the collapsible classes to work that are shown on the package page screenshot, so the methods indented with a hyphen were a hacky way of getting them a little more readable.
I added ‘- as a way of adding custom comments to the outline, such as to do notes.
It’s all a bit messy but it is working ok here. If anyone has any improvements, please do share!
April 6, 2017 at 6:26 pm #7740@mat, cool, thanks for sharing, I will give that a try. It definitely looks useful.
I’ve just published v1.3 of the addon. Changes include:
* Added new target options to compiler toolbar (ios, android, etc)
* Added code folding for property/setter
* Fixed syntax highlighting for property/setter
* Added syntax highlighting for lambdasI am working on improving autocompletion for lambda functions, but it’s not quite ready yet.
April 12, 2017 at 4:15 am #7866v1.4 is up, added syntax highlighting and autocompletion for Enums.
April 12, 2017 at 5:14 pm #7872I think the highlighter gets confused when you use IF inside another IF.
April 12, 2017 at 5:35 pm #7873Thanks, just taking a look now. It seems related to the Then keyword. When removed, it seems to highlight properly, eg.
Monkey123456If TrueElseIf FalseEndIfEndIfI’ll see if I can get it working with Then as well.
April 12, 2017 at 8:37 pm #7876Ok, I’ve published v1.4.2, which has some fixes in for If statement highlighting. I’m still having trouble getting the more terse form of one line if statements working, eg.
Monkey1If True Print "Yes this is true"I can’t figure out a way to make it not pick up the next closing ‘End’, meaning it will usually take a closing End keyword from it’s containing method, function, class etc., which throws everything off. I need a regular expression that can exclusively match that form of if statement.
Everything else seems ok, including one line if statements with a Then in them (see attached screenshot). There’s still some inconsistency (some of the True keywords are colored differently in the screenshot, for example), but I think it’s mostly there. Let me know how it works for you.
Attachments:
April 21, 2017 at 4:07 pm #7985v1.4.3 is up with a bug fix for Atom 1.16. The addon would crash when ‘auto-save on build’ was enabled and new, unsaved files were open.
While fixing this I also noticed that Atom 1.17 is adding support for a new interface element called a Dock:
Docks are an extension of Atom’s pane system designed to hold interface elements that you want to quickly toggle into and out of view. This is a common pattern for tool panels such as the tree view, debugger controls, terminals, consoles, regex railroad diagrams, etc.
It looks like it might give a simpler, native way to do the output panel. Once 1.17 is out I will take a closer look at it.
February 11, 2018 at 6:16 am #13609I can’t get this to work. I don’t know where to begin to diagnose the problem.
February 11, 2018 at 3:34 pm #13612How far did you get with it?
Is the package installed?
Did you configure the path to Monkey 2 in the package settings?
Are you getting an error message?
February 11, 2018 at 9:51 pm #13614It’s working perfectly now.
It didn’t work at first because of the ‘Amon Effect’. The ‘Amon Effect’ is a highly stabilized, very powerful form, of absolute dumbass, that, once afflicted by it, renders everything you do as dumbass.
February 13, 2018 at 6:42 pm #13624Haha, no worries, glad you got it sorted out
-
AuthorPosts
You must be logged in to reply to this topic.
