Ah ha:
This is only a problem in the case where orginally, the file is loaded/parsed
and has no import statements.
and jde-import inserts text between the "package" and the first "class"
statement,
so grammattically speaking, it is inserting into semantic "whitespace", between
the existing tags!
So technically, it may be correct that no tag-regions have been
edited/changed...
Perhaps the older grammar has something to find/mark that region between
package and class?
[i ask in an separate thread what code/grammar is running for java if
wisent-java has not been enabled/autoloaded]
The wisent-java.wy grammar says:
;; The default goal.
%start goal
;; Alternate goals needed for re-parse.
%start package_declaration
%start import_declaration
%start class_declaration
package foo;
<--- when inserting [an import statement]
here, semantic does not notice!
class Foo {
}
----- Original Message -----
From: "Jeff Peck" <jpjnk4-j...@yahoo.com>
To: "Eric M. Ludlam" <e...@siege-engine.com>
Cc: "JDEE Development" <jdee-devel@lists.sourceforge.net>
Sent: Friday, January 08, 2010 4:35 PM
Subject: Re: [jdee-devel] Bugs introduced that affected jde-import-all (patch
for last import has comment bug)
> Eric, thanks for the info.
>
> Given that it fails in/after the jde-import-all; which is basically: (insert
> (concat "import " new-import ";\n"))
> And that it seems to work on the old grammar and fails with the new grammar
> (but works invoked in a separate command)
>
> I'm guessing that the condition-case has disabled the after-hooks... ?
> Or it is simply that the tags are not being marked?
>
> semantic-highlight-edits-mode does *not* indicate any changes when
> jde-import-all does the insert.
> [but again: semantic does not appear to have any tag/region/overlays in that
> area...
> can the apparent loss of the import-tag be a result of some after-hook not
> running?]
>
> And that is the question:
> Why does it not see the tag/region when jde-import does its thing,
> But it apparently *does* see a region and reparse when invoked as a
> separate command.
>
>
> ----- Original Message -----
> From: "Eric M. Ludlam" <e...@siege-engine.com>
> To: "Jeff Peck" <jpjnk4-j...@yahoo.com>
> Cc: "JDEE Development" <jdee-devel@lists.sourceforge.net>
> Sent: Friday, January 08, 2010 3:06 PM
> Subject: Re: [jdee-devel] Bugs introduced that affected jde-import-all
> (patch for last import has comment bug)
>
>
>> 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
_______________________________________________
jdee-devel mailing list
jdee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jdee-devel