Re: [CEDET-devel] semanticdb-javap not working
Brought to you by:
zappo
From: Joel Borggren-F. <jb...@kt...> - 2012-01-23 18:52:37
|
On Mon, Jan 23, 2012 at 1:32 PM, Joel Borggren-Franck <jb...@kt...> wrote: > On Sat, Jan 21, 2012 at 5:09 AM, Eric Ludlam <eri...@gm...> wrote: >> On 01/19/2012 08:38 AM, Joel Borggren-Franck wrote: >>> >>> >>> But I'm back at square 1,5 :/ >>> > >> >> You could find out by looking in the javap output buffer, and using M-x >> bovinate there to see what it is doing. I'm not Java expert enough to >> recognize what might be wrong from the code snippets here. The 0 tags are >> definitely a clue though. >> > > So I found this. I'll post a patch later. Explanation is that javap > ouputs illegal Java source code, specifically class and interface > names are fully qualified IE "java.lang.String" but the language only > accepts simple names "String" with a package declaration at the top of > the compilation unit. > Here is the patch. After this I can complete on type members in the jars in semanticdb-javap-classpath (on Linux, still got other issues on Mac :) You can try it out by setting semanticdb-javap-classpath to /your/path/to/rt.jar And try completing in: " import java.lang.Runnable; public class Foo { public void foo () { Runnable r = null; r. ^^^ } } " === modified file 'semantic/semanticdb-javap.el' --- semantic/semanticdb-javap.el 2012-01-21 16:23:12 +0000 +++ semantic/semanticdb-javap.el 2012-01-23 18:25:23 +0000 @@ -891,6 +891,13 @@ (goto-char (point-min)) ;; The first line says "Compiled from ..." or some-such. (insert "// ") + + ;; strip out fully qualified part of class- and interface names + (while (re-search-forward "class \\([^\\. ]*\\.\\)+" nil t) + (replace-match "class ")) + (while (re-search-forward "interface \\([^\\. ]*\\.\\)+" nil t) + (replace-match "interface ")) + ;; Enable java mode and semantic parsing. (java-mode) (semantic-new-buffer-fcn) |