emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IDE


From: Filipp Gunbin
Subject: Re: IDE
Date: Wed, 28 Oct 2015 22:20:12 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (darwin)

On 28/10/2015 16:57 +0100, Steinar Bang wrote:

>>>>>> Filipp Gunbin <address@hidden>:
>> This is done only once given that pom.xml doesn't change (and if it
>> changes this is repeated).
>
> Have you given any thoughts to triggering this when the pom.xml is saved
> and/or changed on disk?

When a set of completions is prepared for an interactive command (like
`javaimp-add-import'), pom files' timestamps are checked and if they
changed then the information stored by the package is updated.  This
works only for current and one parent pom up the hierarchy for now, for
others it's better to do `javaimp-forget-all-visited-modules' manually.

The same is done for jar files: when a jar file classes are added to a
set of completion alternatives, its timestamp is checked - useful
because often we work with SNAPSHOT versions of the current module's
siblings and wish to read the latest information from them.

Current module's classes are added by scanning current source directory,
this is rather dumb scanning - no code parsing, just file names.

javaimp does not support importing of inner classes, but usually for me
it's not a problem because it's enough to import the top class in a
file.


>> This requires some time to wait for Maven to finish and output the
>> classpath.  But jar scanning is inevitable, I guess, and takes more time
>> (both are cached then).
>
> Do you cache this only in memory or on disk? (sounds like might be a
> good idea to cache this information in an S-expression file, eg. pom.el,
> toghether with each pom.xml and maintain the pom.el in a make-like
> fashion...?)

Currently only in memory, but I'm thinking of doing a "flush" to a
file.

My workflow is like that: when I "open" a project, I call
`javaimp-maven-visit-root' on a top-level project and it loads
information on it and its child projects (mvn help:effective-pom).  When
I call `javaimp-add-import' from one of the projects' files, it
recognizes which module needs to be scanned and invokes Maven on that
module (mvn dependency:build-classpath AFAIR), then scans jars which
require scanning and suggests completion alternatives.  So it's all on
demand (have to wait a bit during the first time, though).  This is to
eliminate constant indexing / scanning / updating which I hated in
Idea/Eclipse.

Filipp



reply via email to

[Prev in Thread] Current Thread [Next in Thread]