Re: Trouble with Java completion

Edward John Steere <[email protected]> Mon, 29 Aug 2016 22:26:11 +0200
Newsgroups gmane.emacs.semantic
Message-ID <[email protected]>
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

------------------------------------------------------------------------------