Atom Package for Monkey2

Home Forums General Programming Discussion Atom Package for Monkey2

Tagged: , ,

This topic contains 21 replies, has 5 voices, and was last updated by  arawkins 5 months ago.

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
  • #4318



    If anyone is interested, I’ve just put up a Monkey2 language module for Atom:

    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.



    I’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!



    Hey, 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.



    Ok, 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(…



    This 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?




    Thanks 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.



    Strangely, 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).




    Ok, 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?



    Awesome, 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!



    Thanks 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!



    Thanks 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


    That’s a fantastic package, I use it as well, just to let you know. πŸ™‚ Will give more feedback!



    @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.



    Woah, that is awesome! Thank you very much πŸ˜€



    You’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?

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic.