1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
Find a file
Andrew Eidsness 2279927623 Bug 400020: Allow tagging of IBindings
This new extension point allows contributors to put their own
information into the PDOM and to later retrieve it for their own
purposes.

There are many details in the bug.  The idea is that contributors
provide an implementation of IBindingTagger, which is given a chance to
examine IBindings when they are created.  The ITagWriter interface
allows the contributor to create a new tag which can then have data
written to it.

The ITagService interface (accessible from CCorePlugin.getTagService()
provides a way for the contributor to later get an instance of
ITagReader to retrieve tags from bindings.

ITags are copied to the PDOM when the associated binding is persisteed.

Contributors use a unique id (based on their plugin id), so that
multiple contributors are able to independently tag a given binding.

In-memory tags are not cached.  I've done some timing tests using my
sample implementation and found no measurable difference.  The full log
lines look like:

	!MESSAGE Indexed 'simple-01' (2 sources, 184 headers) in <see below>
sec: 21,550 declarations; 35,394 references; 0 unresolved inclusions; 1
syntax errors; 0 unresolved names (0.00%)

I did 5 tests using the current master (no tagging-related code), the
times were:
	18.86 sec
	 9.17 sec
	 5.91 sec
	 4.79 sec
	 4.83 sec

And then I ran the same sequence of tests using the code in this
commit:
	18.73 sec
	 9.39 sec
	 6.50 sec
	 4.78 sec
	 5.27 sec

If performance does become a problem, then caching could be introduced
with a new implementation of ITaggableService.  The two problems are
finding a key other than the identity of the IBinding (since IBindings
are re-created often) and properly evicting stale entries when the
binding is no longer valid.

The process of copying tags from an in-memory IBinding to a PDOMBinding,
is a synchronization.  This means that tags that are no longer
applicable, will be removed from the persistent store.

While developing this I found that PDOMBindings are not deleted from the
Database (only the names that reference them are deleted), so there is
no provision for deleting all tags at once.

New database locks are not needed.  By the time the persistent tags are
accessed, higher levels of code have already taken a read or write lock
as appropriate.

There are new unit tests covering the changes to the PDOM.

Change-Id: I8da1bf5eeba7e1fc2ca7ec308ed8e212629986a4
Reviewed-on: https://git.eclipse.org/r/10407
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
2013-02-20 11:27:03 -05:00
build bug 401116: Built-in compiler settings cannot be scanner-discovered prior to a build by non-shared language settings providers 2013-02-18 14:20:30 -05:00
codan Enabled assertions during tests. 2013-02-05 10:07:41 -08:00
core Bug 400020: Allow tagging of IBindings 2013-02-20 11:27:03 -05:00
cross Bug 391390 : Updatesite url is indigo 2012-10-17 14:18:01 -04:00
debug Bug 396230 - [breakpoints] In Breakpoint Properties dialog sort and group pages. 2013-02-08 13:32:00 -08:00
doc Bug 400226: updated Toggle Function Definition docs 2013-02-16 14:21:33 -05:00
dsf Bug 400152 - Add org.eclipse.debug.core and org.eclipse.resources.core imports 2013-02-13 11:40:25 -08:00
dsf-gdb Bug 394183 - MIBreakpointChangedEvent causing NullPointerException in 2013-02-15 06:00:30 -05:00
jtag Bug 391390 : Updatesite url is indigo 2012-10-17 14:18:01 -04:00
launch/org.eclipse.cdt.launch Bug 384780 - No error is reported if a directory is specified as program 2012-07-10 16:20:56 -04:00
lrparser Bug 389009 - Enumerator with dependent value 2013-02-05 13:09:29 -05:00
memory Bug 398329 : MemoryBrowser - switching between debuggees does not update the provider for browser operations like Import and Export 2013-01-21 17:25:10 -05:00
p2 Bumped up feature versions for Kepler. 2012-06-28 11:08:11 -07:00
qt Fix overly strict dependency in qt.core. 2013-02-19 10:50:58 -05:00
releng Tycho: Use original (pre 0.15.0) packaging name for repository 2012-11-20 02:13:02 -05:00
testsrunner Bug 391390 : Updatesite url is indigo 2012-10-17 14:18:01 -04:00
upc Fixed compilation errors. 2012-12-28 14:08:36 -08:00
util Bug 391390 : Updatesite url is indigo 2012-10-17 14:18:01 -04:00
visualizer Bug 399281 - MulticoreVisualizer: disposeVisualizer() is not getting 2013-02-06 10:49:19 -05:00
windows Bug 397121 - Add support for Windows SDK 8.0 and Visual C++ 11.0 2013-01-03 00:49:38 -05:00
xlc bug 398681: CDT does not understand some of xlC diagnostic messages 2013-01-21 17:33:29 -05:00
.gitignore Ignore NFS-created files. 2012-11-08 13:34:54 -08:00
pom.xml Upgrade to Tycho 0.16.0 2012-11-20 00:39:42 -05:00