Re: flymake integration for the eclipse java compiler
"Jason Coffin" <[email protected]> Wed, 25 Apr 2007 21:44:56 -0400
| Newsgroups | gmane.emacs.jdee |
|---|---|
| Message-ID | <[email protected]> |
On 4/25/07, Suraj Acharya <[email protected]> wrote: > > > > I also noticed that using Windows Emacs 22.0.95.1 I can get flymake > > > > to work but only when using jde-ecj-flymake-init not when using > > > > jde-ecj-server-flymake-init I'm not sure what is wrong, my beanshell > > > > environment seems to work fine. There are no error messages, flymake > > > > just won't highlight my syntax errors. > > > > > > Try setting flymake-log-level to 3, the output of the compile process > > > and other stuff should be logged to the *Messages* buffer. That should > > > give you some indication of what is going wrong. > > > > I did that and the eclipse compiler reports the error but it isn't > > being highlighted in my buffer this is the relevant output: > > > > file e:/work/LTY-P000039/backoffice/process/src/main/java/com/**myCompanyName**/backoffice/daemons/ISPSpamComplaintHandler.java, > > init=jde-ecj-server-flymake-init > > server process 1772 "exited" with output c:\Documents and > > Settings\jcoffin\Local > > Settings\Temp\-18539309\ISPSpamComplaintHandler.java:1: error: Syntax > > error on token "dpackage", package expected > > dpackage com.upromise.backoffice.daemons; > > ^^^^^^^^ > > 1 problem (1 error) > > bsh % > > cleaning up using jde-ecj-flymake-cleanup > > deleted file c:/DOCUME~1/jcoffin/LOCALS~1/Temp/-18539309/ISPSpamComplaintHandler.java > > ISPSpamComplaintHandler.java: 0 error(s), 0 warning(s) in 0.72 > > second(s) [2 times] > > > > Ah, this looks like a familiar problem. Process output buffering > behaves slightly differently on windows machines. Does this help? > > (defun jde-ecj-flymake-process-filter (process output) > "Parse OUTPUT and highlight error lines. > It is the flymake process filter. It is also responsible for > calling `jde-ecj-flymake-server-process-end' if the process is a server > process and the output contains the end of output marker > `flymake-process-server-end-marker'." > (let ((source-buffer (process-buffer process))) > (flymake-log 3 "received %d byte(s) of output from process %d" > (length output) (process-id process)) > (flymake-log 3 "output : %s" output) > (when source-buffer > (with-current-buffer source-buffer > (flymake-parse-output-and-residual output)))) > (if (and flymake-process-server-end-marker (string-match > flymake-process-server-end-marker output)) > (jde-ecj-flymake-server-process-end process output))) > Almost have it. Now the first line of my source file will highlight as an error when there are errors in the file but none of the other errors will be highlighted, only the first line (even if that line has no error). If there are no errors in the file then there will be no highlights as expected.