Re: [CEDET-devel] How to get cedet work with global?
Brought to you by:
zappo
From: Eric M. L. <er...@si...> - 2011-03-10 10:53:18
|
On 03/09/2011 02:41 AM, Darren Hoo wrote: > > The cause of the problem is with semanticdb-strip-find-results when > called with arg 'name passed. Tags returned by global's find-tag > already has property :filename set. But since semanticdb-table-global > does not overide semanticdb-full-filename, it returns nil to > semanticdb-strip-find-results. The result is that the final tags > returned with slot :property set to nil. > > Does the following patch look good? > > === modified file 'semantic/semanticdb-find.el' > --- semantic/semanticdb-find.el 2011-02-15 11:05:41 +0000 > +++ semantic/semanticdb-find.el 2011-03-09 07:13:19 +0000 > @@ -897,8 +899,9 @@ > ;; Find-file-match allows a tool to make sure the tag is > ;; 'live', somewhere in a buffer. > (cond ((eq find-file-match 'name) > - (let ((f (semanticdb-full-filename nametable))) > - (semantic--tag-put-property ntag :filename f))) > + (or (semantic--tag-get-property ntag :filename) > + (let ((f (semanticdb-full-filename nametable))) > + (semantic--tag-put-property ntag :filename f)))) > ((and find-file-match ntab) > (semanticdb-get-buffer ntab)) > ) This looks like a pretty good solution to me. It appears that in cedet/tests/cit-externaldb.el, the semanticdb lookup test is not validating that the found tags points at a specific file. It would be very useful if this change could be accompanied by an update to make sure the discovered test tags are accompanied by a file location so it does not regress. I also see the comments all say "gnu global" in the test procedure, when the test is testing many types of databases. That would be handy to fix also. Thanks! Eric |