Re: Bugs introduced that affected jde-import-all (patch for last import has comment bug)
"Eric M. Ludlam" <[email protected]>
| Newsgroups | gmane.emacs.jdee.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Jeff Peck wrote: > But! If I try to run (semantic-parse-changes) using advice around/after > jde-import-all, > (or even directly putting it into the end > of jde-import-insert-imports-into-buffer) > it has no beneficial effect; it apparently sees no changes and makes no > updates. > > Maybe someone who understands how semantic reparse really works can > explain...? Semantic tracks changes as a buffer is edited. If you enable semantic-highlight-edits-mode, and then edit code, you can watch how it tracks what you edit, and how it periodically will re-parse everything highlighted. This is the incremental parser in action. It works by coalescing edits into groups defined by tag boundaries. Those tags are then reparsed. If you ever looked inside tags, you would see a 'reparse-symbol' attribute. It uses this to jump back into the grammar at the right place for that tag. Based on your loose description, I would guess that the edits are not being tracked, or the edits are not coalescing to the right tags because the tag boundaries are incorrect. Either of those might be due to a non-local exit which was hidden by a condition-case or some-such. Since semantic uses after-change-functions, and that is documented as getting cleared if an error is thrown, this is another possibility. Lastly, the change hooks can be inhibited by inhibit-modification-hooks, which is something that SRecode uses when making big changes, and which also provides a big speed improvement, since there are a lot of minor modes that use change hooks. See srecode-insert-fcn for an example on how to use it safely with Semantic. If there is a test case I can examine that doesn't include a successful JDEE install I can probably help, though I have never delved into that specific code before. Since the JDEE has a lot of code generators, it would be good for a JDEE developer to be familiar with some of the tricks too, similar to what SRecode uses. If the JDEE ever implements some unit tests, I'd like to know, as I would set it up to run when I test CEDET releases. Thanks Eric ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev