At 11:29 AM 1/10/01 -0500, [EMAIL PROTECTED] wrote:
>Can I control when JDE does its "Rescanning classes" function?
>

Yes. See the info files for the variables jde-auto-parse-buffer-interval
and jde-auto-parse-buffer-max-size.

Here is the rule that the JDE uses for parsing a buffer:

Reparse the buffer  jde-auto-parse-buffer-interval seconds after the user
has made a change to the buffer and only if the buffer is less that
jde-auto-parse-buffer-max-size characters long. Ignore any changes the user
makes while the parse delay timer is ticking. What this means is that if
you never change a buffer or the buffer is larger than a size that you can
specify, the JDE never automatically reparses the buffer. If the buffer is
below the max size and you do edit the buffer, the JDE does not immediately
reparse. Instead, it waits for an interval that you can specify. If you
make a series of changes, the JDE will still reparse only periodically at
the rate that you specify.


>The reason that I ask is twofold.
>
>1. There are times when this is a very expensive operation on my machine.
>2. I have two related projects (one is the primary code, the other is the
>test cases for the primary code) that share the same set of classes but
>differ only in compile options.  Switching between buffers can trigger this
>"Rescanning classes" function and it can take 5-10 seconds to make the
>buffer switch. Very distracting.
>

This has nothing to do with auto reparse. What you are actually seeing is
the JDE updating the list of classes required to do completion. This is a
new feature of the current release such that every time you switch
projects, the JDE  scans the classpath for that project to build a list of
classes to be used for completion and other purposes. This can take time if
the classpath for a project has a lot of classes on it. The rescan occurs
only if you have used a feature that requires the class list, such as
method completion, in the current session. I'll add a customization
variable in the next release that will allow you to disable automatic
rescanning of the class list. If you do disable the autoscanning of the
classpath, this means that you will have to execute the rescan command
yourself everytime you change projects. 

Meanwhile, if it gets annoying, you can kill the scanning by killing the
beanshell. Of course, the next time the JDE needs the classlist, it will
restart the beanshell and rescan the classpath. Alternatively, you can edit
or comment out out the form

(jde-wiz-update-class-list)

in the following code in jde.el

(defun jde-reload-project-file ()
  "If project context-switching is enabled (see
`jde-project-context-switching-enabled-p'), reloads the project file
for a newly activated Java buffer when the new buffer's project
differs from the old buffer's."
  (interactive)
  (if (and 
       jde-project-context-switching-enabled-p
       (not (jde-debugger-running-p))
       (not (string= jde-current-project jde-project-name)))
      (progn
        (setq jde-current-project jde-project-name)
        (jde-load-project-file)
        (jde-wiz-update-class-list))))

- Paul


- Paul


>I have done a scan of the JDE customization and see nothing. I have not
>looked at the code to see what could be done.
>
>Thanks in advance.
>Erik Husby
>Domain Pharma Corp
>Suite 110      Vox: 781-778-3834
>10 Maguire Rd       Fax: 781-778-3800
>Lexington, MA 02421 Email: [EMAIL PROTECTED]
>
>

Reply via email to