If you previously installed as a NB plugin: There is only one all-in-one nbm now (net-colar-netbeans-fan.nbm), you should manually remove the old nbm's to avoid conflicts (net-jot.nbm, org-antlr.nbm, fan.nbm).
The main user feature of this release is code completion. This is quite a monster and contains many large changes to the code, and my unit-test are lacking at the moment, so it's considered beta for now, nevertheless it should be pretty useful.
The first time you run the new version it will index Fantom and Java which will hog your CPU for ~6mn, please let that complete.
Completion is requested using "CTRL-Space" (default), for example Str.<CTRL SPACE>
Please le me know of any issues/wishes so I can fix them.
What's new (user perspective):
Upgraded fro Netbeans 6.8
Upgraded for Fantom 1.0.48
Unknown/unresolved types reporting
Code completion, including the following:
Completion of Fantom/Java FFI using statements including FanDoc popup
Completion of any variables & slots with Fandoc popup, including it, this, loop variables and exception variables.
Resolving most inferrred types expressions properly (except ranges, let me know if you see some that don't work properly.)
What's new behind the scenes:
nbm plugin all in one isntead of separate nbm for sependant libraries
indexer using h2 database
scoping / type resolving
kaushikWed 13 Jan 2010
Thanks tcolar! I will try it today
tcolarWed 13 Jan 2010
It's not quite as polished as I would like, but I wanted to get out it since I'm gonna be on the road for the next 2 weeks.
If you guys see any show-stopper / annoyances let me know, I'll try to make quick release if there are any biggies.
andyWed 13 Jan 2010
Nice work tcolar!
kaushikWed 13 Jan 2010
IDK if you will consider this as a bug, but on my netbeans running on mac osx I get this error when trying to create a new fantom project
at net.colar.netbeans.fan.wizard.FanPodPanel1.initComponents(FanPodPanel1.java:152) at net.colar.netbeans.fan.wizard.FanPodPanel1.<init>(FanPodPanel1.java:30) at net.colar.netbeans.fan.wizard.FanPodWizardPanel1.getComponent(FanPodWizardPanel1.java:44)
Guess its because of unavailability of 1.6 on my 32 bit MAC, but while the rest of the netbeans 6.8 works only this fails, can you do something to fix this?
tcolarWed 13 Jan 2010
Damn, that one again ! What's happening with that, is that I used matisse(UI builder) for the few UI screens(options panels) - I son't really like UI builders, but making that kind of stuff by hand is even more painful.
Anyway there is some kind of a netbeans "bug" because even though I tell it that my projects target is Java 1.5, the UI builder is using that javax/swing/GroupLayout class that is avail only in 1.6+
I had fixed it in the past, but each time I make any kind of change to a UI panel it regenerates it and put that back - meh !
I'll try to add something to my build script to check for this so I don't forget to remove it.
I'll push a fix later today.
tcolarWed 13 Jan 2010
I've pushed an update version with that fix. You can re download/install.
But I only get the following error when making one in my own Main.fan. It conflicts with a main in src/docCompiler. "Not able to submit breakpoint LineBreakpoint Main.fan : 14, reason: Breakpoint does not belong into the preferred source root /home/jesse/programs/fantom/src/docCompiler/fan. See Window/Debugging/Sources."
I also noticed that your your parser gives a fault saying duplicate name "it" in scopes. Following piece of code is a case in which this happens.
someobj.addSomethhing(SomeClass(|elem,item| {
return elem.name == "hallo";
}));
tcolarWed 3 Feb 2010
What's the name of your pod ?
It's a little trickier with Fantom to get that source root business working right, since Fantom sources are not "aware" of what package they are in (no package statement like in java) so it might be an issue with that, though it seem to work for me.
Can you send me a screenshot of the "sources" window (Window/Debugging/Sources), so I can check if that looks right.
Or If you can send me your project that would be even better.
tcolar AT colar dot NET
I'm aware of the it issue, the whole scoping code is brand new (1.5.0) and there are a few wrinkles left, which is why I labeled it beta :)
Anyway I wrote some unit test code this week, which found the remaining issues like that one and will fix them soon.
You can "ignore" that warning in the meantime.
Please do keep sending whatever other issues you find so I can fix them up.
jessevdamThu 4 Mar 2010
I have been using your netbeans ide for a while, but I experience some problems. I hope you will continue to improve you fantom ide.
I installed new 1.0.51 fantom and reinstalled my computer now do get the error java.lang.NoClassDefFoundError: Could not initialize class fan.sys.Sys at net.colar.netbeans.fan.indexer.FanJarsIndexer.indexJars(FanJarsIndexer.java:71) catch at net.colar.netbeans.fan.indexer.FanIndexer$MainIndexer.run(FanIndexer.java:1145) which causes the type checking to fail since it can not build up its database of known types.
In the past I experienced the type completion to work sometimes and sometimes not
When creating a new file I get the error // Include failed for:../../LicensesFanDefaultLicense.txt->java.lang.NullPointerException
When creating a new file is not immediately added to the file listing
pod.fan has been removed from fantom
Definitely misses functionality to jump back to the previous view/edit place as you have in eclipse.
Giving parse errors as you type does work, but not as fluently as it does in eclipse with java. (I understand it is not an easy task). It would be great I can push compile and do not get any compile errors any more, because I have been notified while editing.
The debugger is a very nice tool to have, it can work fine with it. Except of the problem when I have to debug file which has an overlapping name in a system pod.
tcolarThu 4 Mar 2010
I'm aware of most of this, I've fell behind, but that's because I've been rewriting a good portion of the plugin (not standing still).
Long story short I was using ANTLR to parse Fantom files, but because Fantom's grammar is quite complex and ANTLR is quite cryptic to figure out, it got to the point where I felt it was just not maintainable and just to painful to work with, so I've been replacing ANTLR with a newer parser called parboiled. Parboiled is a PEG parser, and you write the grammar "as plain code" which means it's way easier to deal with(Writing code is what i'm use to do.)
So for example with ANTLR I had to figure out the write grammar (its own syntax) and it's just difficult to work with (even with the book) and that generates a very huge, messy Java parser that is nearly impossible to work with:
In comparison with parboiled you just code the Java parser directly. It's nice and easy to understand, and since it's plain code, you can use all the IDE tools easily(highlighting, refactoring, debugging etc...)
The good news is the new parser now parses ALL the fantom 1.0.51 files way faster and also will be easy to maintain in the future, on the other hand I'm still not fully done switching to using this parser everywhere in the plugin yet (completion etc...), that's quite a lot of work and could be a few more weeks.
Anyway, on to your specific questions:
I haven't updated my plugin for 1.0.51 yet, I would have to create a branch and all that and was trying to avoid spending the time ... in the meantime, if it's acceptable to you to stick with fantom 1.0.50 that would be the easiest.
Type completion is a work in progress, it works for most types I do resolve, but I'm not yet able to resolve all of them (especially inferred), that should get better soon, with the new parser.
Will check on the License issue.
pod.fan: It's just part of the changes for 1.0.51 I haven't done yet.
jump back to previous edit: I'm not aware if Netbeans even has that feature ... will look in the shortcut keys if there is anything like that.
parse errors warning: It's very limited right now, because util I have type resolution 100% working, I figure it's best not too show them (or you would see a lot of false errors) .. it's definitely in the next set of goals though.
debugger: I've noticed that one too, I'll have to see if I can do something about it or not (you would think so). It could be a NB issue, because I've had the same issues with Java files.
One "work-around" is to go to Windows/Debugging/Sources, it will show you list of debugging sources path, which you can reorder (right click) - Netbeans will open the first one.
jessevdamFri 5 Mar 2010
Nice work. Parboiled looks indeed very nice, never liked antlr. Thanks for the information :)
I did found a function which let you jump back to previous edit location.
What is the reason why you are developing for net beans instead of eclipse. Netbeans works, but I like eclipse more when using it. Do not know how net beans and eclipse compare when building plugins for them.
tcolarFri 5 Mar 2010
The main reason is that Netbeans is just my IDE of choice at the moment ... and also it seem to me their API's are a little easier () than eclipse.
I've use many IDE's over the years, and eclipse was my IDE of choice between 04-08, but in my opinion it got heavier and heavier (because "it's a platform") but at the same time not more integrated .. you still need to hunt plugins to get proper JSP support etc...
Back in the days I use to think Netbeans was the huge, slow monster, but since Version 6, it got leaner. Also I feel Netbeans now is better integrated, you go download whatever version is relevant to you (say Java), and you have all you need in one package. I've been using Netbeans since then and have been happy with it (although I still use the Eclipse key biddings)
Also I find Netbeans to possibly be the best IDE when it come to cross-platform support, I use several platforms and NB is good at that.
You really would think there would be a "standard" common API for writing language plugins for any IDE's, but apparently right now they all do their own things, so while you can reuse some stuff (parser etc..), a lot of the plugin code would still be IDE specific(lots of work).
The main thing that still is a problem with Netbeans is that sometimes it seem to be doing "scanning for projects" forever when not warranted(java), which can make it slow or unresponsive ... it's a problem in their indexer, i did my own indexer for Fantom support and that problem does not appear. I hope they fix that soon because it can be very annoying.
jessevdamSat 6 Mar 2010
Are you aware of the dltk plugin http://www.eclipse.org/dltk/ for eclipse which allow you to make much more easyly plugins for eclipse.
It is nice you make your own parser, but what is the reason why you do not use/upgrade the existing parser of Brian.
tcolarSat 6 Mar 2010
I strongly considered using Fantom's own parser, which is simple and clean, but didn't for the following reasons:
While calling Java from Fantom is simple, the opposite can't be said. The IDE is all Java, and calling a little Fantom from it, just isn't easy. I keep running into situtations where I wish there was much tighter integration between Java and Fantom, and even considered some solutions (generating Java stubs, bytecode instrumentation etc..) but just don't have the time to implement.
I could probably manage to make it work (call the fantom process from java) but because you get to use the AST all over the places(literally) in the IDE, it would require some decoupling and I'm also worried about the overhead - Keep in mind that the IDE parses the document every time you add/remove a character (plus all the indexing it does besides the scenes)
Error recovery: Fantom's parser is built for speed and efficiency at compiling a VALID file, if any error is found it bails out. Now in an IDE, you want the parser to take note of the error (so you can tell the user) but recover from it and continue parser so you still get a valid AST - otherwise every time there is any typo or incomplete statement you would just have to say "error" and all IDE features would turn off (completion, navigator etc...) Now error recovery is not a simple thing, and for example the author of ANTLR, who is a smart guy, has worked on it all his life ... so I'm not surer I want to go there and implement this myself.
On the other hand I do which I was actually writing some Fantom code !
As far as trying to reuse with eclipse ... it might be possible, but basically I need to research how eclipse does it and see if i can integrate ... and that tends to be a huge task in itself (IDE API's are complex) ... my guess would be it would be easier for me to integrate my stuff with flux (using FFI) simply because I won't have to spend weeks figuring out an IDE API's
tcolar Wed 13 Jan 2010
After much work:
FantomIDE 1.5.0 beta released (Completion!)
http://fantomide.colar.net/
If you previously installed as a NB plugin: There is only one all-in-one nbm now (net-colar-netbeans-fan.nbm), you should manually remove the old nbm's to avoid conflicts (net-jot.nbm, org-antlr.nbm, fan.nbm).
The main user feature of this release is code completion. This is quite a monster and contains many large changes to the code, and my unit-test are lacking at the moment, so it's considered beta for now, nevertheless it should be pretty useful.
The first time you run the new version it will index Fantom and Java which will hog your CPU for ~6mn, please let that complete.
Completion is requested using "CTRL-Space" (default), for example
Str.<CTRL SPACE>
Please le me know of any issues/wishes so I can fix them.
What's new (user perspective):
What's new behind the scenes:
kaushik Wed 13 Jan 2010
Thanks tcolar! I will try it today
tcolar Wed 13 Jan 2010
It's not quite as polished as I would like, but I wanted to get out it since I'm gonna be on the road for the next 2 weeks.
If you guys see any show-stopper / annoyances let me know, I'll try to make quick release if there are any biggies.
andy Wed 13 Jan 2010
Nice work tcolar!
kaushik Wed 13 Jan 2010
IDK if you will consider this as a bug, but on my netbeans running on mac osx I get this error when trying to create a new fantom project
java.lang.NoClassDefFoundError: javax/swing/GroupLayout
at net.colar.netbeans.fan.wizard.FanPodPanel1.initComponents(FanPodPanel1.java:152) at net.colar.netbeans.fan.wizard.FanPodPanel1.<init>(FanPodPanel1.java:30) at net.colar.netbeans.fan.wizard.FanPodWizardPanel1.getComponent(FanPodWizardPanel1.java:44)
Guess its because of unavailability of 1.6 on my 32 bit MAC, but while the rest of the netbeans 6.8 works only this fails, can you do something to fix this?
tcolar Wed 13 Jan 2010
Damn, that one again ! What's happening with that, is that I used matisse(UI builder) for the few UI screens(options panels) - I son't really like UI builders, but making that kind of stuff by hand is even more painful.
Anyway there is some kind of a netbeans "bug" because even though I tell it that my projects target is Java 1.5, the UI builder is using that javax/swing/GroupLayout class that is avail only in 1.6+
I had fixed it in the past, but each time I make any kind of change to a UI panel it regenerates it and put that back - meh !
I'll try to add something to my build script to check for this so I don't forget to remove it.
I'll push a fix later today.
tcolar Wed 13 Jan 2010
I've pushed an update version with that fix. You can re download/install.
kaushik Thu 14 Jan 2010
Thanks tcolar, Seems to work fine now!
tcolar Mon 1 Feb 2010
I just pushed version 1.5.1
Main changes:
http://fantomide.colar.net/
jessevdam Wed 3 Feb 2010
Thank you very much.
I now can do line breakpoints :).
But I only get the following error when making one in my own Main.fan. It conflicts with a main in src/docCompiler. "Not able to submit breakpoint LineBreakpoint Main.fan : 14, reason: Breakpoint does not belong into the preferred source root
/home/jesse/programs/fantom/src/docCompiler/fan
. See Window/Debugging/Sources."I also noticed that your your parser gives a fault saying duplicate name "it" in scopes. Following piece of code is a case in which this happens.
someobj.addSomethhing(SomeClass(|elem,item| {
}));
tcolar Wed 3 Feb 2010
What's the name of your pod ?
It's a little trickier with Fantom to get that source root business working right, since Fantom sources are not "aware" of what package they are in (no package statement like in java) so it might be an issue with that, though it seem to work for me.
Can you send me a screenshot of the "sources" window (Window/Debugging/Sources), so I can check if that looks right.
Or If you can send me your project that would be even better.
tcolar AT colar dot NET
I'm aware of the it issue, the whole scoping code is brand new (1.5.0) and there are a few wrinkles left, which is why I labeled it
beta
:)Anyway I wrote some unit test code this week, which found the remaining issues like that one and will fix them soon.
You can "ignore" that warning in the meantime.
Please do keep sending whatever other issues you find so I can fix them up.
jessevdam Thu 4 Mar 2010
I have been using your netbeans ide for a while, but I experience some problems. I hope you will continue to improve you fantom ide.
The debugger is a very nice tool to have, it can work fine with it. Except of the problem when I have to debug file which has an overlapping name in a system pod.
tcolar Thu 4 Mar 2010
I'm aware of most of this, I've fell behind, but that's because I've been rewriting a good portion of the plugin (not standing still).
Long story short I was using ANTLR to parse Fantom files, but because Fantom's grammar is quite complex and ANTLR is quite cryptic to figure out, it got to the point where I felt it was just not maintainable and just to painful to work with, so I've been replacing ANTLR with a newer parser called parboiled. Parboiled is a PEG parser, and you write the grammar "as plain code" which means it's way easier to deal with(Writing code is what i'm use to do.)
So for example with ANTLR I had to figure out the write grammar (its own syntax) and it's just difficult to work with (even with the book) and that generates a very huge, messy Java parser that is nearly impossible to work with:
Grammar: http://www.colar.net/websvn/filedetails.php?repname=src&path=/Fan/src/net/colar/netbeans/fan/antlr/Fan.g
Parser: http://www.colar.net/websvn/filedetails.php?repname=src&path=/Fan/src/net/colar/netbeans/fan/antlr/FanParser.java
In comparison with parboiled you just code the Java parser directly. It's nice and easy to understand, and since it's plain code, you can use all the IDE tools easily(highlighting, refactoring, debugging etc...)
New parser: http://www.colar.net/websvn/filedetails.php?repname=src&path=/Fan/src/net/colar/netbeans/fan/parboiled/FantomParser.java
The good news is the new parser now parses ALL the fantom 1.0.51 files way faster and also will be easy to maintain in the future, on the other hand I'm still not fully done switching to using this parser everywhere in the plugin yet (completion etc...), that's quite a lot of work and could be a few more weeks.
Anyway, on to your specific questions:
false
errors) .. it's definitely in the next set of goals though.One "work-around" is to go to Windows/Debugging/Sources, it will show you list of debugging sources path, which you can reorder (right click) - Netbeans will open the
first
one.jessevdam Fri 5 Mar 2010
Nice work. Parboiled looks indeed very nice, never liked antlr. Thanks for the information :)
I did found a function which let you jump back to previous edit location.
What is the reason why you are developing for net beans instead of eclipse. Netbeans works, but I like eclipse more when using it. Do not know how net beans and eclipse compare when building plugins for them.
tcolar Fri 5 Mar 2010
The main reason is that Netbeans is just my IDE of choice at the moment ... and also it seem to me their API's are a little easier () than eclipse.
I've use many IDE's over the years, and eclipse was my IDE of choice between 04-08, but in my opinion it got heavier and heavier (because "it's a platform") but at the same time not more integrated .. you still need to hunt plugins to get proper JSP support etc...
Back in the days I use to think Netbeans was the huge, slow monster, but since Version 6, it got leaner. Also I feel Netbeans now is better integrated, you go download whatever version is relevant to you (say Java), and you have all you need in one package. I've been using Netbeans since then and have been happy with it (although I still use the Eclipse key biddings)
Also I find Netbeans to possibly be the best IDE when it come to cross-platform support, I use several platforms and NB is good at that.
You really would think there would be a "standard" common API for writing language plugins for any IDE's, but apparently right now they all do their own things, so while you can reuse some stuff (parser etc..), a lot of the plugin code would still be IDE specific(lots of work).
The main thing that still is a problem with Netbeans is that sometimes it seem to be doing "scanning for projects" forever when not warranted(java), which can make it slow or unresponsive ... it's a problem in their indexer, i did my own indexer for Fantom support and that problem does not appear. I hope they fix that soon because it can be very annoying.
jessevdam Sat 6 Mar 2010
Are you aware of the dltk plugin http://www.eclipse.org/dltk/ for eclipse which allow you to make much more easyly plugins for eclipse.
It is nice you make your own parser, but what is the reason why you do not use/upgrade the existing parser of Brian.
tcolar Sat 6 Mar 2010
I strongly considered using Fantom's own parser, which is simple and clean, but didn't for the following reasons:
On the other hand I do which I was actually writing some Fantom code !
As far as trying to reuse with eclipse ... it might be possible, but basically I need to research how eclipse does it and see if i can integrate ... and that tends to be a huge task in itself (IDE API's are complex) ... my guess would be it would be easier for me to integrate my stuff with flux (using FFI) simply because I won't have to spend weeks figuring out an IDE API's