I have developed a new Nim package for Atom: https://atom.io/packages/nim
It supports autocomplete, error checking (both live and on save), jump-to-definition, and syntax highlighting. It uses both nim check and nimsuggest, and has a concept of nim projects. I started it as a fork of Zahary's nim-language package, but it's been mostly rewritten, so I've created a new package. See the readme for more info and instructions.
I've tested it on Windows 8.1 and Ubuntu 14.04, and it seems to be getting somewhat stable. I'm using nim and nimsuggest that are built from source.
Please give it a try and let me know what you think!
Oh man this works great. Best of all i have seen. Thanks a lot! But you know how it is.. Give something awesome to people and they want more. Like integrated debugger ;)
No seriously, its so great that plugin picks up entire project and nimsuggest works on all of that. Unlike sublime which gets easily confused by "missing" stuff which is present in other project files. Great work!
EDIT: I noticed that warnings do not underline entire symbol. Also results of autocomplete could be sorted alphabetically (or at least there could be an option for that).
@rku: Thanks! The way it deals with projects is still a bit hacky, but I think it should work for most situations. And you're absolutely right, an integrated debugger is on my todo list! :) It's possible, there is an Atom gdb debugger now (https://atom.io/packages/atom-debugger), and it sort of works for Nim, but it's really buggy and needs to be fixed. I'll take a look at it when I have a chance.
The symbol underline is only for the first character since nim check only provides a position and not a range. I wonder if there is some way to get nim check to give error ranges. Or, I guess it could just scan the file and look identifiers/symbols at the reported positions and extrapolate the ranges.
Autocomplete uses the default output by Nimsuggest, and I figured it shouldn't mess with the order in case it prioritizes certain symbols higher or lower based on context. I could be wrong about that.. It uses fuzzaldrin to do fuzzy matching after you start typing characters, which should be mostly alphabetical. Maybe I should add the option for sorting the initial list.
@yglukhov: Ok! I've added an entry to the wiki and to the FAQ.
THAT IS AWESOME!
Atom have very powerful Auto-Complete system now , only need to write nimprovider (Nim have auto-complete system ready right?) , did you developed a provider package for it?
I've updated autocomplete to work for all identifiers, not just after you press dot. It's configurable, though, and you can set it back to the old behavior if you want. I've also added some autocomplete for pragmas, since they don't seem to be handled by Nimsuggest.
@rku: I resolved the sorting issue you mentioned. Fuzzaldrin was actually sorting things (randomly?) even with an empty search string, so in that case, I now just pass the original set of results in order from Nimsuggest.
This is awesome! Made me try atom for the 1st time.
I have a project that uses threading, and the linter hated it. I modded linter.coffee to pass --threads:on, which worked perfectly. Perhaps this flag should be always passed, or there could be a config setting to enable it if it can cause problems with projects that don't use threading.
Edit: good job sir
@jsanc You can get the flag always on by adding a nim.cfg file to the root of your project that reads:
threads:on
you can also enable the flag per nim file by creating an example.nim.cfg file with the same threads:on content. The folder structure should look like this:
example.nim
example.nim.cfg
you can even set it on at system level (not recommended or portable) by changing your system level nim.cfg file.
@rpowers what if my project consists of several binaries (so several projects)? How would that be handled?
EDIT: can we get tab width detection? Its pretty easy.. Just set a tab width to number of spaces that precede the first line that isnt a comment and starts with spaces.
@OderWat Thanks, I'll check it out!
@rku Right now it just checks/builds/runs the first one in the nimble "bin" list. Eventually I could add something to switch between them, but I haven't had time yet. For tab width detection, there is https://atom.io/packages/auto-detect-indentation, but I haven't tried it yet.
Just wanted to throw my 2 cents in - I really like this package. I've been using the vim package, but Atom + vim keybindings + this package for Nim makes development really nice.
From playing around a few days ago:
https://files.slack.com/files-pri/T02K0UMVB-F0BJW1YNP/pasted_image_at_2015_09_30_12_39_pm.png
Thank you for making it!