1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00
cdt/core/org.eclipse.cdt.core/schema
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
..
BinaryParser.exsd bug 293572: No schema found for org.eclipse.cdt.core.ScannerInfoProvider/BinaryParser extension points 2009-10-29 16:44:43 +00:00
CBuildConsole.exsd small schema update 2004-06-22 14:51:52 +00:00
CConfigurationDataProvider.exsd schema fixes 2007-04-17 11:19:22 +00:00
CExtensionGeneric.exsd bug 293572: No schema found for org.eclipse.cdt.core.ScannerInfoProvider/BinaryParser extension points 2009-10-29 16:44:43 +00:00
CIndex.exsd Bug 387935 - Codan does not see symbols from pre-built indexes 2012-08-24 14:57:15 -04:00
CIndexer.exsd Fix for 108173, basically removes warnings in plugin.xml 2007-02-13 09:39:20 +00:00
CodeFormatter.exsd [Bug 105915] Fix for Code Formatter schema to show real name. 2005-08-08 18:08:35 +00:00
CProject.exsd small schema update 2004-06-22 14:51:52 +00:00
CProjectDescriptionStorage.exsd RESOLVED - bug 252966: ProjectDescription Storage: It should be possible to extend / override persistence mechanism 2009-02-03 19:17:38 +00:00
EFSExtensionProvider.exsd further changes for Bug 291815 - Add an extension point to allow utilities for virtual EFS filesystems 2010-05-25 17:58:41 +00:00
ErrorParser.exsd Bug 372551. Fixed semantics of ErrorParserManager (e.g. 2012-04-25 16:44:50 -04:00
externalSettingsProvider.exsd schema fixes 2007-04-17 11:19:22 +00:00
language.exsd bring list of extension points up to date, change externalized string to string literal for language.exsd as externalized strings don't seem to be supported here 2007-06-21 09:54:00 +00:00
LanguageSettingsProvider.exsd bug 328007: [sd90] Design user interface for new scanner discovery 2012-05-01 23:05:37 -04:00
PathEntryContainerInitializer.exsd small schema update 2004-06-22 14:51:52 +00:00
ProcessList.exsd small schema update 2004-06-22 14:51:52 +00:00
projectConverter.exsd 1. Schema fixes 2007-06-08 10:42:23 +00:00
RefreshExclusionFactory.exsd Bug 133881 - Make refreshing after building optional 2011-04-21 19:15:20 +00:00
ScannerInfoProvider2.exsd New ScannerInfoProvider extension point allowing providers to be associated with build commands in the project description. 2009-12-08 18:51:56 +00:00
tagger.exsd Bug 400020: Allow tagging of IBindings 2013-02-20 11:27:03 -05:00
templateAssociations.exsd 201087: add additional description for the templateAssociations extension point 2007-09-17 16:02:16 +00:00
TemplateDescriptorSchema.xsd Template Engine submission from Bala Torati (Symbian) with some modifications and bug-fixes (see Bug 160012) 2007-04-26 17:07:39 +00:00
templateProcessTypes.exsd 201087: apply contributions from James Blackburn 2008-02-22 17:34:43 +00:00
templates.exsd Add real categories for templates. Organize selection in tree. 2012-01-27 13:41:24 -05:00
UNCPathConverter.exsd Bug 343437: Support for UNC include directories, by Greg Watson. 2011-04-28 14:10:29 +00:00