Hey Eric and all Java Programmers using TextMate,
/me and Brian Lalor are currently working on the Java Syntax a bit.
The big evil Java might be the last to succumb, though. Are there others on this list who would like to jettison Eclipse, too? What can we do to improve Java editing in TM? What would be your minimum list of features?
Eclipse is very deticated to Java. it even comes with its own incremental compiler so that it can highlight errors before you manually compiled the file and can do much more than a regexp language grammar that way, like it know about types and variables all the time and so on. If one knows how to work with it and needs all those nice features like a builtin debugger, great autocompletion and documentation lookup (I love that and certainly depend on a lot of features of eclipse) there is no way around it.
If one is new to a language on the other hand, a nice little editor and writing all the code from hand is a good way to learn the language, so one learns what he is doing instead of eclipse doing it for him.
If I find the time, I will put some effort into it (Juggling with jobs at the moment). It would be great, if some more people would communicate here on the list or in the irc channel on how to improve the current situation. I know you are out there, Java guys! ;)
Soryu
On Nov 8, 2005, at 5:03 PM, Soryu wrote:
/me and Brian Lalor are currently working on the Java Syntax a bit.
As the original author of the Java syntax, I'm actually pretty happy with it. :-) I think the *syntax* is pretty solid, but a lot more work could be done with commands, macros and snippets. I added quite a bit more syntactical sugar to the syntax yesterday (and I'm hoping it doesn't make things too slow, but so far so good). From my perspective (and I haven't talked to Soryu about his goals yet), the only thing missing is the listing of methods in the symbol pop-up. I'm looking at a BNF description of the Java language right now and I understand what needs to be done, but it makes for a fairly hairy regexp.
Aside: can regexps be commented, like in PHP code?
If one is new to a language on the other hand, a nice little editor and writing all the code from hand is a good way to learn the language, so one learns what he is doing instead of eclipse doing it for him.
I abhor IDEs in general. They take too much focus away from the act of writing code, in my opinion. I've lost too much productivity by having to resuscitate my development environment when something goes screwy. Incremental compilation and method lookup is grand; some kind of method lookup would be fantastic in TM, but I fear it would be a huge amount of work. Javadoc in Safari does the trick nicely for me. :-)
I'm with Soryu: talk it up, folks!
I just checked in another smallish batch of changes to the Java syntax. It now captures methods for use in the symbol pop-up, and uses some patterns from the repository to ensure that parameters and exceptions declared with "throws" have the same scope as elsewhere.
Yesterday I committed some additional changes that scope built-in types from the JDK (1.5, in this case) differently than normal storage types. Constants were also properly scoped with that revision.
Hey,
I worked a bit on my syntax. I even got around the problem with the opening bracket on the next line (thanks to Infininight, may the light shine on him).
I've attached my current syntax (It is based on my own version, not the 'official' one). You might not like that I colour every method call.
Brian, I think we should argue (and maybe agree ;-) about out different approaches of several scopes. I tried to stick to the official Java Language Specification for the scopes, hence my colouring of keywords (plus, I did not want to exaggarate it). Then we might be able to work out the One and Only™ Java Syntax.
I also am not a fan of all those predefined types with scope 'support.type.built-ins.java'. Types should not really be styled differently, whether they are defined with the Java Class Library or by the user. And if someone has an own type that happens to have the same name (but different package) as one of those built-ins it is styled like one.
I guess codesense is the more common term. I think this would probably require some kind of plugin.
Probably. I haven't played with any of the existing tools for code browsing or completion or anything. I think the code browser with ctags support might be a good start... I wouldn't even know where to start with this kind of thing, really...
Codesense seems a little more difficult to me. For completion of Class/Interface types there should be something like a static list of tha Java Class Library. Though different versions of Java will differ slighly. Next, a plugin would have to scan all imported types recursively. It would need the source directory for that at least, plus it would have to scan all jar files, that the project includes (ok, this could be done once and cached maybe, if we have the info about those libs). All this goes for organizing imports, too. I plugin with such capability would definitely have to be written in Java, which brings up other issues. Code sensing for variable names would have to honor Java scopes (think of bracket levels and variable scopes, not TM scopes).
I have done a recursive includes scanning for php using a php and ctags that provides completion for user defined functions But Java with the jar libs and huge class library is a different beast.
smart rename/delete etc.
eclipse has the power of the included compiler that scopes the syntax 100% right, so it always knows, whether something is a variable, type or whatever. Smart rename like refactoring? If you meant that, consider this example when trying to refactor the variable 'foo':
public class Test { // foo stores the answer to Life, the Universe and everything <--- foo String foo = "bar"; <--- class variable public static void main(String[] args) { String foo = "42"; <--- new variable, shadows the class variable System.out.println(foo); new Test(); } public Test() { String foo = "nothing"; <--- another shadow System.out.println(foo); System.out.println(this.foo); <--- instance of original class variable } }
------- end of code
and the whole thing would be pointless if it was not across the whole project (like eclipse does), think of access from a different class to foo, or better to a public getter method
OK, don't want to discourage anyone, just my thoughts.
Keep it rolling, Soryu.
PS: Maybe I'm too much of a perfectionist here (or a pessimist). I'd be happy to be surprised that I am wrong on the Codesense/organizing imports and refactoring.
On 09.11.2005, at 13:39, Brian Lalor wrote:
I'm with Soryu: talk it up, folks!
I built an import sorter a while ago, and I'd include it in the SVN, if someone's interested. It's a small Ruby program (not perfect yet), but doing the job it's supposed to.
I'd definitely be interested in an improved Java support for TextMate, and in helping to get one. As much as I like Eclipse, sometimes it's just to memory consuming. Throw in your Ant build with some XDoclet tasks, and away goes the memory.
Cheers, Mathias
I know you are out there, Java guys! ;)
I just wanted to mention that I'm also a Java Web Developer (Struts/Tomcat/etc.) who's picked TextMate over Eclipse/IntelliJ. My boss was willing to get me the pretty and feature-rich IntelliJ, but I:
(1) Wanted to save our company nearly $500 because I'm a good employee. (2) Couldn't bear what IntelliJ was doing to my PowerBook's RAM.
(Apparently IntelliJ runs faster on Windows but - gah!)
-d
Dev
> My boss I hope he is not reading this forum.
> .. was willing to get me the pretty and feature-rich IntelliJ, but I: > (1) Wanted to save our company nearly $500 because I'm a good employee.
I'm afraid your "smart" saving is costing him much much much more than $500 in lost productivity and lower code quality. Even if you worked for free or peanuts, you would miss the many features that helps you write clean and solid code (the inspections), the integrated JUnit integration, the code formatter, the code pointer sharing (ideTalk plugin), etc, etc...
If you disagree then, obviously, you don't know IDEA's power. If you really want to be a good employee, give it a try and evaluate it for a month.
> (2) Couldn't bear what IntelliJ was doing to my PowerBook's RAM. I guess it depends on your project's size, but it works fine on mine, with 1GB and java 5.
Alain