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
-
October 8, 2016 at 4:04 am #4318
Hello,
If anyone is interested, I’ve just put up a Monkey2 language module for Atom:
https://atom.io/packages/language-monkey2
This started as a fork of the Monkey-X Atom package by Shinkiro1, but is now focused just on Monkey2. I was trying to support both languages at once and things were getting messy so I just decided to pare it down. So far I’ve tested on Windows 7, OS X El Capitan, and Ubuntu 16.04 and it works ok with all three.
It is still pretty basic (just syntax highlighting and compiler integration), but I hope to add to it over time. So far my monkey2 experience has just been playing around with bananas, so I haven’t had a chance to really code with it yet.
Anyways if you give it a shot and find any bugs or have any feedback let me know. I’ll try to keep it fixed and up to date.
November 14, 2016 at 6:05 am #5001I’ve recently started using Atom and Monkey 2, so this is perfect.
Sadly I’m not familiar enough with Monkey 2 to code without the auto-complete stuff.
If you could somehow get it to scan through modules and other imports I would definitely use this!November 14, 2016 at 6:36 pm #5029Hey, that’s good to hear. Regarding autocomplete, yes it would be great to have. I am still working on it. I’ve managed to get a boilerplate Atom autocomplete-plus provider working, but I haven’t populated it yet with proper suggestions. I hit a bit of a wall with that and some of the highlighting and indentation bugs, as my regex skills were not up to the task. I decided to step back a bit and brush up on that and then jump back in. I will post back here again when I make some proper progress.
December 21, 2016 at 10:17 pm #5979Ok, v1.1.1 is now up with basic autocompletion. Here are the notes from the README:
Autocompletion depends the autocomplete-plus package, which should be installed by default in Atom. If not, you can install it via the package manager.
Once you have entered a path to your monkey installation (see Installation above), the package will automatically parse your modules folder, as well as your local project tree for monkey2 files. It will then try to provide autocompletion suggestions based on what it finds.
Currently it will ignore anything within a Private or Extern block. It also cannot parse the type variables assigned in the shorthand format Local var:= Image.Load(…, so to get autocompletion on your variables, define their type explicitly, eg. Local var:Image = Image.Load(…
March 9, 2017 at 6:54 am #7427This is working great. Thanks!!!
My only two cents are:
– Hitting the shortcut for “build” doesn’t save the file automatically (or save all files, which would be ideal)
– Printing anything seems to ignore end of line characters in the output panel (everything is printed at the same line)
– Can’t change size of output panel?Cheers!
March 9, 2017 at 9:06 pm #7441Thanks for the feedback, glad you are finding it useful
All of those things should be doable. I will take a look at them for the next update.
March 20, 2017 at 5:09 am #7553Strangely, in some of my tests the end of line is ignored in the output panel (multiple prints end up in the same line), but in some it isn’t. Importing Mojo and printing from within the Window class seems to be what makes a difference?
On that same note, the little toolbar at the bottom is overlapping the bottom of the output panel, like in this screenshot (I can’t scroll past that point to see the last printed line).
Thanks!
Attachments:
March 20, 2017 at 7:43 pm #7557Ok, I’ve published v1.1.2 which should hopefully resolve some of these issues.
- The package now has a “Save on Build” setting (on by default) which should save all open editors before building
- Print statements should now be broken up line by line
- I’ve tried adjusting the padding / margin on the output panel to help with the unreadable text at the bottom of the window. I wasn’t able to replicate the problem unfortunately though so I’m kind of groping in the dark here. Can you let me know what font & font size are you using, and what OS?
I wasn’t able to make the panel resizable; I had assumed that would be straightforward, but unfortunately atom panels don’t have that functionality by default, and I don’t have the time right now to code it in from scratch. I could put in another package setting so that you could specify the height in pixels of the output window or something though, and/or possibly adjust the docking position (top, right, left, etc.)…would that suffice for you?
March 20, 2017 at 8:00 pm #7558Awesome, that is more than sufficient!
I’m on MacOS, but I’m away from home right now and can’t tell you which font it is yet. Regardless, I really appreciate your effort. Thanks!
<edit>Works brilliantly. Thanks again!
March 25, 2017 at 3:30 pm #7613Thanks for this package. I’ve been giving Atom a go and it is awesome with this package installed
If I can slip in a feature request… It would be very helpful if double-clicking on error lines in the output log would jump to the file/line number.
Great work. Thanks again!
March 28, 2017 at 11:39 pm #7649Thanks for the feedback mat, glad you are finding it useful. I definitely want to do more with the output and debugging and will look at that in a future update. Integration with the Atom Linter package is still on my radar as well
I’ve just pushed up v1.1.3 which has some bugfixes and small improvements to the autocompletion:
- Bug fix: improved parsing of one line if statements
- Bug fix: improved private block parsing
- Improved global and constant variable lookup in autocomplete
March 29, 2017 at 8:04 am #7653That’s a fantastic package, I use it as well, just to let you know.
Will give more feedback!
April 4, 2017 at 6:59 pm #7702@xaron, thanks, I appreciate that. It is good to know it is getting used and that gives me motivation to improve it. Looking forward to any feedback you might have.
I’ve published v1.2 which adds some coloring and error linking to the output panel, so you can jump to directly to errors as suggested above by mat.
Attachments:
April 4, 2017 at 7:31 pm #7705April 4, 2017 at 9:49 pm #7711You’re welcome
Nice screenshot. How are you getting that code outline of your class/methods on the right hand side? Is that a separate addon?
-
AuthorPosts
You must be logged in to reply to this topic.


