Re: Trouble with Java completion
David Ventimiglia <[email protected]> Sat, 3 Sep 2016 13:45:36 -0700
| Newsgroups | gmane.emacs.semantic |
|---|---|
| Message-ID | <CALaE=t8OOZjNj0GAy0oJJimDb2w6Og_zLXC=dRvYYE_c89VtYA@mail.gmail.com> |
--===============5351063043392128024== Content-Type: multipart/alternative; boundary=94eb2c18cbd0a0329c053ba08831 --94eb2c18cbd0a0329c053ba08831 Content-Type: text/plain; charset=UTF-8 Hi Edward, That worked! Thanks, so much. Seems I need to do some reading about this Wisent parser. :) Warm regards, David On Sat, Sep 3, 2016 at 9:13 AM, Edward John Steere <[email protected]> wrote: > Hi David, > > Brilliant idea! I use docker at work, but I've never thought of using > it as a mechanism for submitting reproducible bugs! :-) > > I fired it up and added all of my semantic configuration to the .emacs > in the container until it worked. It's actually a simple problem which > I really should have thought of sooner -- given that it was only failing > to parse tags from the library (!) > > You need to use the Java v1.5 parser for generic types (of which Map is > one.) > > Here's a working .emacs file: > > (load-file "/root/cedet/cedet-devel-load.el") > (require 'semantic/db-javap) > (autoload 'wisent-java-default-setup "semantic/wisent/java" > "Hook run to setup Semantic in `java-mode'." nil nil) > (semantic-mode 1) > > Note the use of the semantic/wisent/java default setup for the java > parser. > > The grammar for this parser isn't without it's problems :-( At the > moment it doesn't seem to handle annotations or foreach loops despite > there being some mention of it. For most of Java it'll work just fine > though. Here's the path to the grammar file if you're interested: > cedet/lisp/cedet/semantic/wisent/java.wy > > Kind regards, > > Edward Steere > > > Hi Edward, > > > > Thanks for getting back to me. Yes, it certainly seems like EDE picked > > up my project; at least, ede-project-customize seems to think that it > > has. Also, cedet-java-describe (thanks for that tip) seems to have a > > sensible opinion on the subject (output pasted in below). I'll dig > > into the function call with the debugger, beginning with the > > back-trace you sent, so thanks for that as well. > > > > In the meantime ("no good deed goes unpunished"), if you're up for it > > you might for fun (for some definition of "fun") try a Docker image > > that I threw together with the intent of having a reproducible > > environment for demonstrating the problem I'm experiencing. If so, and > > if you have Docker installed (not necessarily an easy task), I think > > you can issue the following commands to get the image and run it in a > > terminal: > > > > docker pull dventimi/docker-emacs > > docker run -t -i dventimi/docker-emacs emacs > > > > That should put you into an Emacs instance running in console mode in > > a Docker container. You're "root" and the CWD is "/", but there's an > > Emacs bookmark set to the same HelloWorld.java file in > > "/root/Scratch", an up-to-date version of CEDET is in "/root/cedet" > > and is compiled, Emacs is initialized with a bare-bones .emacs file in > > "/root", and within that initialization file an EDE Java project is > > configured for "/root/Scratch". If that all works, you should be able > > to visit the "HelloWorld.java" file and with point at "m." and try > > semantic-ia-complete-symbol or semantic-analyze-debug-assist. With > > point in either of the includes (e.g., "import java.util.Map"), if you > > try M-x semantic-decoration-fileless-include-describe, you should > > again get the output indicating it has a tag table handled by a JAR > > file, but there are 0 tags. > > > > Of course, if you've no appetite for all this, I completely > > understand. :) > > > > Best wishes, > > David > > > > ========================== > > cedet-java-describe output: > > > > CEDET Java Operational Environment: > > > > Current Java Version: 1.7.0_111 > > > > Minimum Desired version: 1.4 > > Java Command: java > > Jar Command: jar > > Javap Command: javap > > > > User Specified Global Classpath Extension: > > > > Project Specified Classpath Extension (EDE): > > > > Java JDK Core Jar File: > > /usr/lib/jvm/java-1.7.0-openjdk-amd64/jre/lib/rt.jar > > > > On Tue, Aug 30, 2016 at 12:01 PM, Edward John Steere > > <[email protected]> wrote: > > > > Hi David, > > > > 1-4, all roughly the same as me. > > 5. I don't know whether it's necessary, but it doesn't seem to > > work on > > my machine w/o a project. > > 7. Did ede pick up the project after you defined it? You can run > > `ede-customize-project' to verify. > > > > I think that there might be a bug in the db because it isn't > > finding any > > tags for the include. I get the following output for that import: > > > > Include Tag: java.util.Map > > > > This header tag has been marked "Fileless". > > This means that Semantic cannot find a file associated with this > > tag > > on disk, but a database table of tags has been associated with it. > > > > This means that the include will still be used to find tags for > > searches, but you cannot visit this include. > > > > This Header is now represented by the following database table: > > > > #<semanticdb-table-jar-file java/util/Map.class (1 tags)> > > > > I found a function to detect your java environment: > > `cedet-java-describe'. You could use that to determine whether > > your > > java is being picked up correctly. I get the following (on a Mac): > > > > CEDET Java Operational Environment: > > > > Current Java Version: 1.8.0_11 > > > > Minimum Desired version: 1.4 > > Java Command: java > > Jar Command: jar > > Javap Command: javap > > > > User Specified Global Classpath Extension: > > > > Project Specified Classpath Extension (EDE): > > > > Java JDK Core Jar File: > > /Library/Java/JavaVirtualMachines/jdk1.8.0_ > 11.jdk/Contents/Home/jre/lib/ > > rt.jar > > > > > > I used the profiler to find the most likely functions involved in > > finding tags. This *might* not be a real call stack, but I find > > that it > > sometimes helps me to orient myself in a project. If you're going > > to > > debug the issue then I'd say that theses functions are probably a > > good > > place to start: > > > > - semanticdb-javap-classpath-objects > > - semanticdb-find-table-for-include-java-mode > > - semanticdb-find-table-for-include > > - semanticdb-find-translate-path-includes--internal > > - semanticdb-find-translate-path-includes-default > > - semanticdb-find-translate-path-java-mode > > - semanticdb-find-translate-path > > - semanticdb-table > > - apply > > - eieio-generic-call-primary-only > > - semanticdb-typecache-include-tags > > - #<compiled 0x411b26ed> > > - apply > > - semanticdb-typecache-find-method > > - semanticdb-typecache-find-default > > - semanticdb-typecache-find-java-mode > > > > If I could replicate your problem then I would be much better > > equipped > > to help. As it stands this is the best I can do to point you in a > > direction (I'm sure I'll be corrected if anything I've said is off > > point > > :-) ). > > > > Kind regards, > > > > Edward Steere > > > > > Hi Edward, > > > > > > Thanks so much for replying. Here's what I can tell you. > > > > > > 1 I'm using CEDET from the Git repository > > > http://git.code.sf.net/p/cedet/git and it's up-to-date. > > > 2 It's the very first thing I load in my init file, so as to > > avoid > > > using the built-in CEDET. > > > 3 CEDET version is 2.0. Full (cedet-version) output is below. > > > 4 I've always had global-semantic-decoration-mode enabled and > > all my > > > imports have always been green "Fileless." Full output is below. > > > 5 I didn't originally have an EDE project-root (is that > > necessary). I > > > only had the HelloWorld.java file in /home/dventimi/Scratch > > > 6 I have however always had (require 'semantic/db-javap) at the > > top of > > > my init file. > > > 7 I added a project-root with this line in my init file: > > > (ede-java-root-project "Scratch" :file > > > "/home/dventimi/Scratch/HelloWorld.java"). I know the project > > root > > > doesn't typically "hang off" the file I'm trying to compile, but > > > there's no choice since I have no other files in the Scratch > > > directory. > > > 8 Even with this addition, I get precisely the same behavior. > > The key > > > > > > > is that it seems to identify the import statements as > > "Fileless." In > > > my experience (I've had completion working in the past, though > > long > > > ago under different circumstances on a different computer) > > "green is > > > good" and that's the ideal state for importing tags from JAR > > files > > > via javap. And yet, the tags table it builds this time has 0 > > tags. > > > > > > I'm happy to start drilling in with the debugger, but at present > > I > > > don't even know where to begin. Anyway, thanks! > > > > > > Best, > > > David > > > > > > (cedet-version) > > > -> > > > CEDET Version: 2.0 > > > Requested File Loaded > > > Package Version Version Version > > > ---------------------------------------------------------- > > > cedet: 2.0 ok ok > > > eieio: 1.4 nil ok > > > semantic: 2.2 ok ok > > > srecode: 1.2 ok ok > > > ede: 1.2 2.0 2.0 > > > cogre: 1.2 ok ok > > > cedet-contrib: 1.2 nil Not Loaded > > > > > > "What's this?" > > > -> > > > Include Tag: java.util.Map > > > > > > This header tag has been marked "Fileless". > > > This means that Semantic cannot find a file associated with this > > tag > > > on disk, but a database table of tags has been associated with > > it. > > > > > > This means that the include will still be used to find tags for > > > searches, but you cannot visit this include. > > > > > > This Header is now represented by the following database table: > > > > > > #<semanticdb-table-jar-file java/util/Map.class (0 tags)> > > > > > > On Mon, Aug 29, 2016 at 1:26 PM, Edward John Steere > > > <[email protected]> wrote: > > > > > > Hi David, > > > > > > You're right, db-javap does deal with this :) I could only > > > replicate > > > your problem with db-javap turned off (i.e. not `require'd). > > Once > > > I > > > `require'd it it complained that generic projects don't have a > > > :classpath slot (which is of course true.) Once I created a > > > `java-root' > > > project, and dumped your code in it, it worked fine and gave me > > > the > > > following options: > > > > > > clear compute > > > computeIfAbsent computeIfPresent > > > containsKey containsValue entrySet > > > equals forEach get > > > getOrDefault hashCode isEmpty > > > keySet merge put > > > putAll putIfAbsent remove > > > replace replaceAll size > > > values > > > > > > Are you using upstream or built in CEDET? > > > > > > You can also turn on `global-semantic-decoration-mode' and your > > > imports > > > will be decorated to indicate whether they have been: > > > > > > - Parsed (no highlighting) > > > - Still need to be parsed (highlighted yellow on my machine) > > > - None-file imports -- such as an import from a jar file > > > (highlighted > > > green on my machine) > > > - Unrecognised imports (highlighted red on my machine) > > > - (Your function tags will also be decorated in the buffer) > > > > > > This ought to give you a good idea of whether cedet has figured > > > out your > > > project setup. > > > > > > To answer 1. and 2. I'm not familiar with the global versus > > local > > > type > > > cache, but with any luck you wont have to be either :) > > > > > > Kind regards, > > > > > > Edward Steere > > > > > > > Hi! > > > > > > > > I'm having trouble with the Semantic Analyzer and Analyzer > > > Debugging > > > > for Java programs. I've a simple "Hello, World!" Java file > > that > > > looks > > > > like this: > > > > > > > > import java.util.Map; > > > > > > > > import java.util.HashMap; > > > > > > > > > > > > > > > > > > > > public class HelloWorld { > > > > > > > > public static void main (String[] args) { > > > > > > > > Map m = new HashMap(); > > > > > > > > m. > > > > > > > > } > > > > > > > > } > > > > > > > > When I try M-x semantic-ia-complete-symbol after the "m.", I > > get > > > the > > > > message "Cannot find types for `Map m'," I get the output in > > the > > > > attached debug.txt file. I'm trying to interpret this output, > > > and a > > > > couple questions come to mind. > > > > > > > > 1 Should I expect the type to be a local type or a global > > type? > > > > 2 What's the difference between a local type and a global > > type? > > > > 3 Shouldn't semantic/db-javap just handle this? > > > > > > > > The typecache (also attached) seems to have all the java.lang > > > types, > > > > which semantic/db-javap presumably fished out of my Java > > > > installation's rt.jar file. If that's the case, shouldn't it > > > also have > > > > fished out java.util.Map? > > > > > > > > Thanks! > > > > Best, > > > > David > > > > > > > > > > > > > > > > > > > > - > > > - > > ------------------------------------------------------------ > ---------------- > > > > > > > > > _______________________________________________ > > > > cedet-semantic mailing list > > > > [email protected] > > > > https://lists.sourceforge.net/lists/listinfo/cedet-semantic > > > > > > --94eb2c18cbd0a0329c053ba08831 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi Edward,<div><br></div><div>That worked!=C2=A0 Thanks, s= o much.=C2=A0 Seems I need to do some reading about this Wisent parser. =C2= =A0:)</div><div><br></div><div>Warm regards,</div><div>David</div></div><di= v class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Sat, Sep 3, 2016 = at 9:13 AM, Edward John Steere <span dir=3D"ltr"><<a href=3D"mailto:edwa= [email protected]" target=3D"_blank">[email protected]</a>></spa= n> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b= order-left:1px #ccc solid;padding-left:1ex">Hi David,<br> <br> Brilliant idea!=C2=A0 I use docker at work, but I've never thought of u= sing<br> it as a mechanism for submitting reproducible bugs! :-)<br> <br> I fired it up and added all of my semantic configuration to the .emacs<br> in the container until it worked.=C2=A0 It's actually a simple problem = which<br> I really should have thought of sooner -- given that it was only failing<br= > to parse tags from the library (!)<br> <br> You need to use the Java v1.5 parser for generic types (of which Map is<br> one.)<br> <br> Here's a working .emacs file:<br> <br> =C2=A0 =C2=A0 (load-file "/root/cedet/cedet-devel-load.<wbr>el")<= br> =C2=A0 =C2=A0 (require 'semantic/db-javap)<br> =C2=A0 =C2=A0 (autoload 'wisent-java-default-setup "semantic/wisen= t/java"<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 "Hook run to setup Semantic in `java-mode&= #39;." nil nil)<br> =C2=A0 =C2=A0 (semantic-mode 1)<br> <br> Note the use of the semantic/wisent/java default setup for the java<br> parser.<br> <br> The grammar for this parser isn't without it's problems :-( At the<= br> moment it doesn't seem to handle annotations or foreach loops despite<b= r> there being some mention of it.=C2=A0 For most of Java it'll work just = fine<br> though.=C2=A0 Here's the path to the grammar file if you're interes= ted:<br> cedet/lisp/cedet/semantic/<wbr>wisent/java.wy<br> <span class=3D"im HOEnZb"><br> Kind regards,<br> <br> Edward Steere<br> <br> > Hi Edward,<br> ><br> </span><div class=3D"HOEnZb"><div class=3D"h5">> Thanks for getting back= to me. Yes, it certainly seems like EDE picked<br> > up my project; at least, ede-project-customize seems to think that it<= br> > has. Also, cedet-java-describe (thanks for that tip) seems to have a<b= r> > sensible opinion on the subject (output pasted in below). I'll dig= <br> > into the function call with the debugger, beginning with the<br> > back-trace you sent, so thanks for that as well.<br> ><br> > In the meantime ("no good deed goes unpunished"), if you'= ;re up for it<br> > you might for fun (for some definition of "fun") try a Docke= r image<br> > that I threw together with the intent of having a reproducible<br> > environment for demonstrating the problem I'm experiencing. If so,= and<br> > if you have Docker installed (not necessarily an easy task), I think<b= r> > you can issue the following commands to get the image and run it in a<= br> > terminal:<br> ><br> > docker pull dventimi/docker-emacs<br> > docker run -t -i dventimi/docker-emacs emacs<br> ><br> > That should put you into an Emacs instance running in console mode in<= br> > a Docker container. You're "root" and the CWD is "/= ", but there's an<br> > Emacs bookmark set to the same HelloWorld.java file in<br> > "/root/Scratch", an up-to-date version of CEDET is in "= /root/cedet"<br> > and is compiled, Emacs is initialized with a bare-bones .emacs file in= <br> > "/root", and within that initialization file an EDE Java pro= ject is<br> > configured for "/root/Scratch". If that all works, you shoul= d be able<br> > to visit the "HelloWorld.java" file and with point at "= m." and try<br> > semantic-ia-complete-symbol or semantic-analyze-debug-assist. With<br> > point in either of the includes (e.g., "import java.util.Map"= ;), if you<br> > try M-x semantic-decoration-fileless-<wbr>include-describe, you should= <br> > again get the output indicating it has a tag table handled by a JAR<br= > > file, but there are 0 tags.<br> ><br> > Of course, if you've no appetite for all this, I completely<br> > understand. :)<br> ><br> > Best wishes,<br> > David<br> ><br> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D<br> > cedet-java-describe output:<br> ><br> > CEDET Java Operational Environment:<br> ><br> > Current Java Version: 1.7.0_111<br> ><br> > Minimum Desired version: 1.4<br> > Java Command: java<br> > Jar Command: jar<br> > Javap Command: javap<br> ><br> > User Specified Global Classpath Extension:<br> ><br> > Project Specified Classpath Extension (EDE):<br> ><br> > Java JDK Core Jar File:<br> > /usr/lib/jvm/java-1.7.0-<wbr>openjdk-amd64/jre/lib/rt.jar<br> ><br> > On Tue, Aug 30, 2016 at 12:01 PM, Edward John Steere<br> > <<a href=3D"mailto:[email protected]">[email protected]= </a>> wrote:<br> ><br> >=C2=A0 =C2=A0 =C2=A0Hi David,<br> ><br> >=C2=A0 =C2=A0 =C2=A01-4, all roughly the same as me.<br> >=C2=A0 =C2=A0 =C2=A05. I don't know whether it's necessary, but= it doesn't seem to<br> >=C2=A0 =C2=A0 =C2=A0work on<br> >=C2=A0 =C2=A0 =C2=A0my machine w/o a project.<br> >=C2=A0 =C2=A0 =C2=A07. Did ede pick up the project after you defined it= ? You can run<br> >=C2=A0 =C2=A0 =C2=A0`ede-customize-project' to verify.<br> ><br> >=C2=A0 =C2=A0 =C2=A0I think that there might be a bug in the db because= it isn't<br> >=C2=A0 =C2=A0 =C2=A0finding any<br> >=C2=A0 =C2=A0 =C2=A0tags for the include. I get the following output fo= r that import:<br> ><br> >=C2=A0 =C2=A0 =C2=A0Include Tag: java.util.Map<br> ><br> >=C2=A0 =C2=A0 =C2=A0This header tag has been marked "Fileless"= ;.<br> >=C2=A0 =C2=A0 =C2=A0This means that Semantic cannot find a file associa= ted with this<br> >=C2=A0 =C2=A0 =C2=A0tag<br> >=C2=A0 =C2=A0 =C2=A0on disk, but a database table of tags has been asso= ciated with it.<br> ><br> >=C2=A0 =C2=A0 =C2=A0This means that the include will still be used to f= ind tags for<br> >=C2=A0 =C2=A0 =C2=A0searches, but you cannot visit this include.<br> ><br> >=C2=A0 =C2=A0 =C2=A0This Header is now represented by the following dat= abase table:<br> ><br> >=C2=A0 =C2=A0 =C2=A0#<semanticdb-table-jar-file java/util/Map.class = (1 tags)><br> ><br> >=C2=A0 =C2=A0 =C2=A0I found a function to detect your java environment:= <br> >=C2=A0 =C2=A0 =C2=A0`cedet-java-describe'. You could use that to de= termine whether<br> >=C2=A0 =C2=A0 =C2=A0your<br> >=C2=A0 =C2=A0 =C2=A0java is being picked up correctly. I get the follow= ing (on a Mac):<br> ><br> >=C2=A0 =C2=A0 =C2=A0CEDET Java Operational Environment:<br> ><br> >=C2=A0 =C2=A0 =C2=A0Current Java Version: 1.8.0_11<br> ><br> >=C2=A0 =C2=A0 =C2=A0Minimum Desired version: 1.4<br> >=C2=A0 =C2=A0 =C2=A0Java Command: java<br> >=C2=A0 =C2=A0 =C2=A0Jar Command: jar<br> >=C2=A0 =C2=A0 =C2=A0Javap Command: javap<br> ><br> >=C2=A0 =C2=A0 =C2=A0User Specified Global Classpath Extension:<br> ><br> >=C2=A0 =C2=A0 =C2=A0Project Specified Classpath Extension (EDE):<br> ><br> >=C2=A0 =C2=A0 =C2=A0Java JDK Core Jar File:<br> >=C2=A0 =C2=A0 =C2=A0/Library/Java/<wbr>JavaVirtualMachines/jdk1.8.0_<wb= r>11.jdk/Contents/Home/jre/lib/<br> >=C2=A0 =C2=A0 rt.jar<br> ><br> ><br> >=C2=A0 =C2=A0 =C2=A0I used the profiler to find the most likely functio= ns involved in<br> >=C2=A0 =C2=A0 =C2=A0finding tags. This *might* not be a real call stack= , but I find<br> >=C2=A0 =C2=A0 =C2=A0that it<br> >=C2=A0 =C2=A0 =C2=A0sometimes helps me to orient myself in a project. I= f you're going<br> >=C2=A0 =C2=A0 =C2=A0to<br> >=C2=A0 =C2=A0 =C2=A0debug the issue then I'd say that theses functi= ons are probably a<br> >=C2=A0 =C2=A0 =C2=A0good<br> >=C2=A0 =C2=A0 =C2=A0place to start:<br> ><br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-javap-classpath-<wbr>objects<br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-find-table-for-<wbr>include-java-mode<= br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-find-table-for-<wbr>include<br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-find-translate-<wbr>path-includes--int= ernal<br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-find-translate-<wbr>path-includes-defa= ult<br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-find-translate-<wbr>path-java-mode<br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-find-translate-path<br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-table<br> >=C2=A0 =C2=A0 =C2=A0- apply<br> >=C2=A0 =C2=A0 =C2=A0- eieio-generic-call-primary-<wbr>only<br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-typecache-include-<wbr>tags<br> >=C2=A0 =C2=A0 =C2=A0- #<compiled 0x411b26ed><br> >=C2=A0 =C2=A0 =C2=A0- apply<br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-typecache-find-<wbr>method<br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-typecache-find-<wbr>default<br> >=C2=A0 =C2=A0 =C2=A0- semanticdb-typecache-find-<wbr>java-mode<br> ><br> >=C2=A0 =C2=A0 =C2=A0If I could replicate your problem then I would be m= uch better<br> >=C2=A0 =C2=A0 =C2=A0equipped<br> >=C2=A0 =C2=A0 =C2=A0to help. As it stands this is the best I can do to = point you in a<br> >=C2=A0 =C2=A0 =C2=A0direction (I'm sure I'll be corrected if an= ything I've said is off<br> >=C2=A0 =C2=A0 =C2=A0point<br> >=C2=A0 =C2=A0 =C2=A0:-) ).<br> ><br> >=C2=A0 =C2=A0 =C2=A0Kind regards,<br> ><br> >=C2=A0 =C2=A0 =C2=A0Edward Steere<br> ><br> >=C2=A0 =C2=A0 =C2=A0> Hi Edward,<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> Thanks so much for replying. Here's what I= can tell you.<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> 1 I'm using CEDET from the Git repository<= br> >=C2=A0 =C2=A0 =C2=A0> <a href=3D"http://git.code.sf.net/p/cedet/git"= rel=3D"noreferrer" target=3D"_blank">http://git.code.sf.net/p/<wbr>cedet/g= it</a> and it's up-to-date.<br> >=C2=A0 =C2=A0 =C2=A0> 2 It's the very first thing I load in my i= nit file, so as to<br> >=C2=A0 =C2=A0 =C2=A0avoid<br> >=C2=A0 =C2=A0 =C2=A0> using the built-in CEDET.<br> >=C2=A0 =C2=A0 =C2=A0> 3 CEDET version is 2.0. Full (cedet-version) o= utput is below.<br> >=C2=A0 =C2=A0 =C2=A0> 4 I've always had global-semantic-decorati= on-<wbr>mode enabled and<br> >=C2=A0 =C2=A0 =C2=A0all my<br> >=C2=A0 =C2=A0 =C2=A0> imports have always been green "Fileless.= " Full output is below.<br> >=C2=A0 =C2=A0 =C2=A0> 5 I didn't originally have an EDE project-= root (is that<br> >=C2=A0 =C2=A0 =C2=A0necessary). I<br> >=C2=A0 =C2=A0 =C2=A0> only had the HelloWorld.java file in /home/dve= ntimi/Scratch<br> >=C2=A0 =C2=A0 =C2=A0> 6 I have however always had (require 'sema= ntic/db-javap) at the<br> >=C2=A0 =C2=A0 =C2=A0top of<br> >=C2=A0 =C2=A0 =C2=A0> my init file.<br> >=C2=A0 =C2=A0 =C2=A0> 7 I added a project-root with this line in my = init file:<br> >=C2=A0 =C2=A0 =C2=A0> (ede-java-root-project "Scratch" :fi= le<br> >=C2=A0 =C2=A0 =C2=A0> "/home/dventimi/Scratch/<wbr>HelloWorld.j= ava"). I know the project<br> >=C2=A0 =C2=A0 =C2=A0root<br> >=C2=A0 =C2=A0 =C2=A0> doesn't typically "hang off" the= file I'm trying to compile, but<br> >=C2=A0 =C2=A0 =C2=A0> there's no choice since I have no other fi= les in the Scratch<br> >=C2=A0 =C2=A0 =C2=A0> directory.<br> >=C2=A0 =C2=A0 =C2=A0> 8 Even with this addition, I get precisely the= same behavior.<br> >=C2=A0 =C2=A0 =C2=A0The key<br> ><br> ><br> >=C2=A0 =C2=A0 =C2=A0> is that it seems to identify the import statem= ents as<br> >=C2=A0 =C2=A0 =C2=A0"Fileless." In<br> >=C2=A0 =C2=A0 =C2=A0> my experience (I've had completion working= in the past, though<br> >=C2=A0 =C2=A0 =C2=A0long<br> >=C2=A0 =C2=A0 =C2=A0> ago under different circumstances on a differe= nt computer)<br> >=C2=A0 =C2=A0 =C2=A0"green is<br> >=C2=A0 =C2=A0 =C2=A0> good" and that's the ideal state for = importing tags from JAR<br> >=C2=A0 =C2=A0 =C2=A0files<br> >=C2=A0 =C2=A0 =C2=A0> via javap. And yet, the tags table it builds t= his time has 0<br> >=C2=A0 =C2=A0 =C2=A0tags.<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> I'm happy to start drilling in with the de= bugger, but at present<br> >=C2=A0 =C2=A0 =C2=A0I<br> >=C2=A0 =C2=A0 =C2=A0> don't even know where to begin. Anyway, th= anks!<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> Best,<br> >=C2=A0 =C2=A0 =C2=A0> David<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> (cedet-version)<br> >=C2=A0 =C2=A0 =C2=A0> -><br> >=C2=A0 =C2=A0 =C2=A0> CEDET Version: 2.0<br> >=C2=A0 =C2=A0 =C2=A0> Requested File Loaded<br> >=C2=A0 =C2=A0 =C2=A0> Package Version Version Version<br> >=C2=A0 =C2=A0 =C2=A0> ------------------------------<wbr>-----------= -----------------<br> >=C2=A0 =C2=A0 =C2=A0> cedet: 2.0 ok ok<br> >=C2=A0 =C2=A0 =C2=A0> eieio: 1.4 nil ok<br> >=C2=A0 =C2=A0 =C2=A0> semantic: 2.2 ok ok<br> >=C2=A0 =C2=A0 =C2=A0> srecode: 1.2 ok ok<br> >=C2=A0 =C2=A0 =C2=A0> ede: 1.2 2.0 2.0<br> >=C2=A0 =C2=A0 =C2=A0> cogre: 1.2 ok ok<br> >=C2=A0 =C2=A0 =C2=A0> cedet-contrib: 1.2 nil Not Loaded<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> "What's this?"<br> >=C2=A0 =C2=A0 =C2=A0> -><br> >=C2=A0 =C2=A0 =C2=A0> Include Tag: java.util.Map<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> This header tag has been marked "Fileless= ".<br> >=C2=A0 =C2=A0 =C2=A0> This means that Semantic cannot find a file as= sociated with this<br> >=C2=A0 =C2=A0 =C2=A0tag<br> >=C2=A0 =C2=A0 =C2=A0> on disk, but a database table of tags has been= associated with<br> >=C2=A0 =C2=A0 =C2=A0it.<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> This means that the include will still be used= to find tags for<br> >=C2=A0 =C2=A0 =C2=A0> searches, but you cannot visit this include.<b= r> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> This Header is now represented by the followin= g database table:<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> #<semanticdb-table-jar-file java/util/Map.c= lass (0 tags)><br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> On Mon, Aug 29, 2016 at 1:26 PM, Edward John S= teere<br> >=C2=A0 =C2=A0 =C2=A0> <<a href=3D"mailto:[email protected]"= >[email protected]</a>> wrote:<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> Hi David,<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> You're right, db-javap does deal with this= :) I could only<br> >=C2=A0 =C2=A0 =C2=A0> replicate<br> >=C2=A0 =C2=A0 =C2=A0> your problem with db-javap turned off (i.e. no= t `require'd).<br> >=C2=A0 =C2=A0 =C2=A0Once<br> >=C2=A0 =C2=A0 =C2=A0> I<br> >=C2=A0 =C2=A0 =C2=A0> `require'd it it complained that generic p= rojects don't have a<br> >=C2=A0 =C2=A0 =C2=A0> :classpath slot (which is of course true.) Onc= e I created a<br> >=C2=A0 =C2=A0 =C2=A0> `java-root'<br> >=C2=A0 =C2=A0 =C2=A0> project, and dumped your code in it, it worked= fine and gave me<br> >=C2=A0 =C2=A0 =C2=A0> the<br> >=C2=A0 =C2=A0 =C2=A0> following options:<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> clear compute<br> >=C2=A0 =C2=A0 =C2=A0> computeIfAbsent computeIfPresent<br> >=C2=A0 =C2=A0 =C2=A0> containsKey containsValue entrySet<br> >=C2=A0 =C2=A0 =C2=A0> equals forEach get<br> >=C2=A0 =C2=A0 =C2=A0> getOrDefault hashCode isEmpty<br> >=C2=A0 =C2=A0 =C2=A0> keySet merge put<br> >=C2=A0 =C2=A0 =C2=A0> putAll putIfAbsent remove<br> >=C2=A0 =C2=A0 =C2=A0> replace replaceAll size<br> >=C2=A0 =C2=A0 =C2=A0> values<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> Are you using upstream or built in CEDET?<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> You can also turn on `global-semantic-decorati= on-<wbr>mode' and your<br> >=C2=A0 =C2=A0 =C2=A0> imports<br> >=C2=A0 =C2=A0 =C2=A0> will be decorated to indicate whether they hav= e been:<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> - Parsed (no highlighting)<br> >=C2=A0 =C2=A0 =C2=A0> - Still need to be parsed (highlighted yellow = on my machine)<br> >=C2=A0 =C2=A0 =C2=A0> - None-file imports -- such as an import from = a jar file<br> >=C2=A0 =C2=A0 =C2=A0> (highlighted<br> >=C2=A0 =C2=A0 =C2=A0> green on my machine)<br> >=C2=A0 =C2=A0 =C2=A0> - Unrecognised imports (highlighted red on my = machine)<br> >=C2=A0 =C2=A0 =C2=A0> - (Your function tags will also be decorated i= n the buffer)<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> This ought to give you a good idea of whether = cedet has figured<br> >=C2=A0 =C2=A0 =C2=A0> out your<br> >=C2=A0 =C2=A0 =C2=A0> project setup.<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> To answer 1. and 2. I'm not familiar with = the global versus<br> >=C2=A0 =C2=A0 =C2=A0local<br> >=C2=A0 =C2=A0 =C2=A0> type<br> >=C2=A0 =C2=A0 =C2=A0> cache, but with any luck you wont have to be e= ither :)<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> Kind regards,<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> Edward Steere<br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> > Hi!<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > I'm having trouble with the Semantic = Analyzer and Analyzer<br> >=C2=A0 =C2=A0 =C2=A0> Debugging<br> >=C2=A0 =C2=A0 =C2=A0> > for Java programs. I've a simple &quo= t;Hello, World!" Java file<br> >=C2=A0 =C2=A0 =C2=A0that<br> >=C2=A0 =C2=A0 =C2=A0> looks<br> >=C2=A0 =C2=A0 =C2=A0> > like this:<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > import java.util.Map;<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > import java.util.HashMap;<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > public class HelloWorld {<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > public static void main (String[] args) {= <br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > Map m =3D new HashMap();<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > m.<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > }<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > }<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > When I try M-x semantic-ia-complete-symbo= l after the "m.", I<br> >=C2=A0 =C2=A0 =C2=A0get<br> >=C2=A0 =C2=A0 =C2=A0> the<br> >=C2=A0 =C2=A0 =C2=A0> > message "Cannot find types for `Map = m'," I get the output in<br> >=C2=A0 =C2=A0 =C2=A0the<br> >=C2=A0 =C2=A0 =C2=A0> > attached debug.txt file. I'm trying t= o interpret this output,<br> >=C2=A0 =C2=A0 =C2=A0> and a<br> >=C2=A0 =C2=A0 =C2=A0> > couple questions come to mind.<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > 1 Should I expect the type to be a local = type or a global<br> >=C2=A0 =C2=A0 =C2=A0type?<br> >=C2=A0 =C2=A0 =C2=A0> > 2 What's the difference between a loc= al type and a global<br> >=C2=A0 =C2=A0 =C2=A0type?<br> >=C2=A0 =C2=A0 =C2=A0> > 3 Shouldn't semantic/db-javap just ha= ndle this?<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > The typecache (also attached) seems to ha= ve all the java.lang<br> >=C2=A0 =C2=A0 =C2=A0> types,<br> >=C2=A0 =C2=A0 =C2=A0> > which semantic/db-javap presumably fished= out of my Java<br> >=C2=A0 =C2=A0 =C2=A0> > installation's rt.jar file. If that&#= 39;s the case, shouldn't it<br> >=C2=A0 =C2=A0 =C2=A0> also have<br> >=C2=A0 =C2=A0 =C2=A0> > fished out java.util.Map?<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > Thanks!<br> >=C2=A0 =C2=A0 =C2=A0> > Best,<br> >=C2=A0 =C2=A0 =C2=A0> > David<br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> ><br> >=C2=A0 =C2=A0 =C2=A0> > -<br> >=C2=A0 =C2=A0 =C2=A0> -<br> >=C2=A0 =C2=A0 =C2=A0------------------------------<wbr>----------------= --------------<wbr>----------------<br> ><br> >=C2=A0 =C2=A0 =C2=A0><br> >=C2=A0 =C2=A0 =C2=A0> > ______________________________<wbr>______= ___________<br> >=C2=A0 =C2=A0 =C2=A0> > cedet-semantic mailing list<br> >=C2=A0 =C2=A0 =C2=A0> > <a href=3D"mailto:[email protected]= urceforge.net">cedet-semantic@lists.<wbr>sourceforge.net</a><br> >=C2=A0 =C2=A0 =C2=A0> > <a href=3D"https://lists.sourceforge.net/= lists/listinfo/cedet-semantic" rel=3D"noreferrer" target=3D"_blank">https:/= /lists.sourceforge.net/<wbr>lists/listinfo/cedet-semantic</a><br> >=C2=A0 =C2=A0 =C2=A0><br> ><br> </div></div></blockquote></div><br></div> --94eb2c18cbd0a0329c053ba08831-- --===============5351063043392128024== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ --===============5351063043392128024== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ cedet-semantic mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/cedet-semantic --===============5351063043392128024==--