Next: Updating for ind. buffers, Previous: Customizing the display, Up: The Methods window [Contents][Index]
First a preliminary remark: Do not confuse this chapter with that synchronizing described in ECB-window synchronizing. The latter one describes the mechanism for synchronizing the ECB-windows when the current-buffer in the edit-area has been changed. This chapter describes how to update the ECB-methods-window with the contents of the current-buffer if the buffer has been modified!
In almost all cases there is NO need to manually rebuild the method-buffer, because it is always done automatically if necessary; the mechanism depends on the sources:
global-semantic-idle-scheduler-mode
switches on autom.
reparsing of semantic-sources. All the rest will be done by semantic and ECB
automatically. ECB and semantic always try to reparse and update as less as
possible of the sourcecode-buffer.
imenu-auto-rescan
. But nevertheless you have to manually
rebuild the Method-buffer (with the autom. updated imenu-tags) via the
command ecb-rebuild-methods-buffer
(bound to C-c . r).
Generally ECB calls semantic to get the list of tags for current source-file
of current edit-window. Per default ECB does never automatically force a
reparse of the source-file after this has been changed - this is only done on
demand by calling the command ecb-rebuild-methods-buffer
. So per
default the idle-scheduler of semantic is responsible for reparsing the
source-file when this is necessary (see ‘semantic-idle-scheduler-mode’ for
further details). So this scheduler is also responsible when
updating/sychronizing the methods-window with current buffer-contents. This is
the most user-resonsible and therefore the recommended approach.
ECB is responsible to update the methods-window after the idle scheduler of semantic has triggered either a full or partial reparse of the source-buffer. Semantic always tries to reparse as less tags of the buffer as possible, often just the edited section (if it has no sideeffect to tags outside the edited parts). ECB handles this partial reparse output smoothly and updates only these nodes which are releated to the reparsed tags.
The main effect a user will notice is that edit actions which trigger just a partial reparse will just update the related node in the methods-window and not the whole methods-window. One of the main advantages is that this preserves the expand/collapse state of the methods-window.
Editing examples which trigger only a partial reparse:
In these cases only the related node in the methods-window will change nothing else, ie. the expand/collapse-states of all other nodes in the methods-window will not be changed.
Summary: It’s strongly recommended to enable
semantic-idle-scheduler-mode
or
global-semantic-idle-scheduler-mode
(see Setting up CEDET/semantic)
because then reparsing is always done during idle-time of Emacs and - maybe
even more important - it is also interruptable.
But if this idle-scheduler is switched off then ECB offers now two
possibilities (via ecb-force-reparse-when-semantic-idle-scheduler-off
):
ecb-rebuild-methods-buffer
(bound to C-c . r)!
This means also in consequence that the methods-buffer is not
automatically filled when a source-file is opened but first on demand
after calling the command ecb-rebuild-methods-buffer
!
The term “forcing a reparse by semantic” is a simplification: ECB uses then
the function semantic-fetch-tags
which can decide that the cached tags
are up-to-date so no real reparsing is necessary - but it can also run a full
reparse and this reparse is not being done when Emacs is idle but immediatelly
and not interruptable (as with the idle-scheduler of semantic), which can be
quite annoying with big source-files.
To make a long story short: It is strongly recommended to enable the
semantic-idle-scheduler-mode
or
global-semantic-idle-scheduler-mode
! See Setting up CEDET/semantic. This will give you in all cases the behavior you would expect
of an IDE like ECB/semantic.
Next: Updating for ind. buffers, Previous: Customizing the display, Up: The Methods window [Contents][Index]