aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorDuarte Meneses <duarte.meneses@sonarsource.com>2015-11-13 16:24:18 +0100
committerDuarte Meneses <duarte.meneses@sonarsource.com>2015-11-17 09:36:04 +0100
commitd986919813676f22b0d0f34f4e1cb8a65e7a0481 (patch)
treeab43781547ce73275a4516130d34ee96846050b5 /sonar-plugin-api
parentaef7ab9d126129f9e6382c1f06eb46cfb5565d8f (diff)
downloadsonarqube-d986919813676f22b0d0f34f4e1cb8a65e7a0481.tar.gz
sonarqube-d986919813676f22b0d0f34f4e1cb8a65e7a0481.zip
SONAR-5894 Support symbol references with different length
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/source/Symbolizable.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbolizable.java b/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbolizable.java
index f205ec41c17..a16025bed58 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbolizable.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/source/Symbolizable.java
@@ -33,11 +33,29 @@ public interface Symbolizable extends Perspective {
interface SymbolTableBuilder {
+ /**
+ * Creates a new Symbol.
+ * The offsets are global in the file.
+ */
Symbol newSymbol(int fromOffset, int toOffset);
+ /**
+ * Creates a new reference for a symbol.
+ * The length of the reference is assumed to be the same as the symbol's length.
+ */
void newReference(Symbol symbol, int fromOffset);
+
+ /**
+ * Creates a new reference for a symbol.
+ * The offsets are global in the file.
+ */
+ void newReference(Symbol symbol, int fromOffset, int toOffset);
+ /**
+ * Creates a {@link SymbolTable} containing all symbols and references previously created in this file.
+ */
SymbolTable build();
+
}
interface SymbolTable {