diff options
author | Andrew Eidsness | 2013-01-31 16:41:44 +0000 |
---|---|---|
committer | Doug Schaefer | 2013-02-01 21:18:28 +0000 |
commit | 2bc9035f8c9f52455f923e0f7a16a6e41842b067 (patch) | |
tree | 077267a7fc7021f1c369561a7985d2b8cc22d6f1 /core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui | |
parent | d960fff7ddd0f1120d1ad733b04cc880461555fe (diff) | |
download | org.eclipse.cdt-2bc9035f8c9f52455f923e0f7a16a6e41842b067.tar.gz org.eclipse.cdt-2bc9035f8c9f52455f923e0f7a16a6e41842b067.tar.xz org.eclipse.cdt-2bc9035f8c9f52455f923e0f7a16a6e41842b067.zip |
Bug 363406: extensible semantic highlighting
- introduced extension point to allow plugins to add new semantic
highlighters
- see bug for more details
Change-Id: Ic019e8a3c483fcfc42344fe4ef2139cc933c0301
Reviewed-on: https://git.eclipse.org/r/10074
Reviewed-by: Doug Schaefer <dschaefer@qnx.com>
IP-Clean: Doug Schaefer <dschaefer@qnx.com>
Tested-by: Doug Schaefer <dschaefer@qnx.com>
Diffstat (limited to 'core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui')
-rw-r--r-- | core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ISemanticHighlighter.java | 31 | ||||
-rw-r--r-- | core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ISemanticToken.java | 27 |
2 files changed, 58 insertions, 0 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ISemanticHighlighter.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ISemanticHighlighter.java new file mode 100644 index 00000000000..65640501405 --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ISemanticHighlighter.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2013 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + */ + +package org.eclipse.cdt.ui.text; + + +/** + * Interface that must be implemented by contributors to the org.eclipse.cdt.ui.semanticHighlighting extension + * point. + * + * @since 5.5 + */ +public interface ISemanticHighlighter { + /** + * Returns <code>true</code> iff the semantic highlighting consumes the semantic token. + * <p> + * NOTE: Implementors are not allowed to keep a reference on the token or on any object retrieved from the + * token. + * </p> + * + * @param token + * the semantic token for a {@link org.eclipse.cdt.core.dom.ast.IASTName} + * @return <code>true</code> iff the semantic highlighting consumes the semantic token + */ + public boolean consumes(ISemanticToken token); +} diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ISemanticToken.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ISemanticToken.java new file mode 100644 index 00000000000..c9f3d65020c --- /dev/null +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/text/ISemanticToken.java @@ -0,0 +1,27 @@ +package org.eclipse.cdt.ui.text; + +import org.eclipse.cdt.core.dom.ast.IASTNode; +import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; +import org.eclipse.cdt.core.dom.ast.IBinding; + +/** + * An interface for accessing details of the token that is being highlighted. + * + * @since 5.5 + */ +public interface ISemanticToken { + /** + * @return Returns the binding, can be <code>null</code>. + */ + public IBinding getBinding(); + + /** + * @return the AST node + */ + public IASTNode getNode(); + + /** + * @return the AST root + */ + public IASTTranslationUnit getRoot(); +} |