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 7 months ago.

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

    arawkins
    Participant

    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.

    #5001

    Hezkore
    Participant

    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!

    #5029

    arawkins
    Participant

    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.

    #5979

    arawkins
    Participant

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

    #7427

    Ethernaut
    Participant

    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?

    Cheers!

    #7441

    arawkins
    Participant

    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.

    #7553

    Ethernaut
    Participant

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

    Thanks!

    #7557

    arawkins
    Participant

    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?

    #7558

    Ethernaut
    Participant

    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!

    #7613

    mat
    Participant

    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!

    #7649

    arawkins
    Participant

    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
    #7653

    Xaron
    Participant

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

    #7702

    arawkins
    Participant

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

    #7705

    mat
    Participant

    Woah, that is awesome! Thank you very much 😀

    Attachments:
    #7711

    arawkins
    Participant

    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.