Re: [CEDET-devel] Why 'semantic-symref' logically identical to 'semantic-symref-symbol'
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2011-03-30 23:27:43
|
On 03/30/2011 12:45 PM, York Zhao wrote: > >The implementation, of analyzing every hit, would also be very slow. > Another > >option is to modify semantic-symref-list mode to add a "smart filter" > option to > >post process the list. That way you can filter only if it matters. > > This could become a temporary workaround, could you be more specific? semantic-symref-list.el is a mode used when you call semantic-symref to find all calls to some symbol. In the major mode, you can see that the buffer-local variable semantic-symref-current-results has the full output results from symref in it, and semantic-symref-results-dump will draw that output. You can add a new command (like semantic-symref-list-expand-all is defined) whose contents gets the results and, just like semantic-symref-results-dump, loop over each entry, identify the tag, visit the tags location (see semantic-symref-rb-goto-match for how it does it) and then run semantic-analyze-current-context, look into the :prefix on the returned context, and see if it matches your target symbol. The target symbol is in the results 'created-by' slot which is an object with a searchfor slot. It may be that there isn't enough info gathered when the search is started to do this properly, so some sort of query will be needed. Alternately, you could flip the whole thing around, and then sort the results buffer into all the different kinds of parents owning a similarly named tag. I'm sure a whole range of 'sort' options would be cool in this buffer. Anyway, after you filter or resort the results, store the data back onto the originating object, and dump it back into the buffer with semantic-symref-results-dump. Enjoy Eric |