[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Re: Error Checking as you type

Alan Morgan wrote:
Hey,

Could someone tell me what is happening in the background to enable the JDT to generate errors and warnings while someone is typing ?
I have looked around for some documentation on this but have as yet been unable to find any.


I suspect that the file is being parsed for syntax and lexical problems as keystrokes are received but I need to confirm this.

Yes, it has it's own parser. It should not be that difficult to find any information on it. The Java syntax has been kept rather simple by Sun, both to keep the language easy to read, as well as to support tools like Eclipse. Now that old decission is paying off big time.

It keeps a parse tree next to the source files in memory, anything you type gets put in the parse tree, with a (rather) short delay. It's one thing that is missing in .NET (2003) - and it's not only usefull for syntax checking but also for GUI builders, refactoring, UML tool support - the list goes on.

The good thing is that you can still type the source files as if you were using a normal editor. One of the big tricks is to use the parser/generator without pissing off experienced programmers (like me).

Maarten