|
From: Nik Trevallyn-J. <ni...@us...> - 2010-08-03 08:52:42
|
@Shlomy> So, if I understand correctly, all Nik has to do to see the errors is > configure SideKick to parse on keystrokes? > (Plugins -> Plugin options -> SideKick -> General -> Parse on > keystroke). 1. Thanks for the tip. I had been looking in the JavaSidekick settings - not the Sidekick settings.\ 2. Even with "parse on keystroke) enabled, I don't get any display of errors. I types the following into my current buffer: ArrayList(String> fred; (This is basically the typo that got me thinking on this topic in the first place) There are no error or warning icons in the gutter, and there are no errors enumerated in the status line. When I save the buffer, PMD does display its verbose error in a separate window, but that is the same behaviour as before I changed the setting. @Shlomy> Nik, in any case, if you find ANTLR useful for > incremental parsing, I'd be very interested in that also. Well, I have found a couple of bits of code that show how that can be done: 1. http://www.antlr.org/wiki/pages/viewpage.action?pageId=789 Shows the following code snippet: String input = "public static void main(String[] args) { }"; CharStream cs = new ANTLRStringStream(input); 2. gUnit generates code that parses lines and sub-lines: http://www.antlr.org/wiki/display/ANTLR3/gUnit+-+Grammar+Unit+Testing gUnit is all about presenting small snippets of valid or invalid input to an Antlr parser and verifying the result. I will look at both, but from what I've read already, I believe I can probably build a generic Antlr-grammar driven validator for any input consisting of a line or more. It will probably take a bit more to include the context in there (validate variables in the symbol table), but overall I believe it's doable without huge amounts of code. @Dale> The DefaultBeautifier class uses the jEdit syntax tokenizer and some regular expressions Excellent - I'll take a look! @Dale> Definitely the ErrorList plugin will need to be involved. Ok, I'll have a look at that shortly - thanks :o) Thank you both for your very helpful input. I'll keep the list posted on progress :o) Cheers! Nik |