*/
Symbol newSymbol(int fromOffset, int toOffset);
+ /**
+ * @since 5.6
+ */
+ Symbol newSymbol(int startLine, int startLineOffset, int endLine, int endLineOffset);
+
/**
* 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, int toOffset);
+ /**
+ * @since 5.6
+ */
+ void newReference(Symbol symbol, int startLine, int startLineOffset, int endLine, int endLineOffset);
+
/**
* Creates a {@link SymbolTable} containing all symbols and references previously created in this file.
*/
return NO_OP_SYMBOL;
}
+ @Override
+ public Symbol newSymbol(int startLine, int startLineOffset, int endLine, int endLineOffset) {
+ return NO_OP_SYMBOL;
+ }
+
@Override
public void newReference(Symbol symbol, int fromOffset) {
// Do nothing
// Do nothing
}
+ @Override
+ public void newReference(Symbol symbol, int startLine, int startLineOffset, int endLine, int endLineOffset) {
+ // Do nothing
+ }
+
@Override
public SymbolTable build() {
return NO_OP_SYMBOL_TABLE;
return new DeprecatedDefaultSymbol(symbolTable.newSymbol(fromOffset, toOffset), toOffset - fromOffset);
}
+ @Override
+ public Symbol newSymbol(int startLine, int startLineOffset, int endLine, int endLineOffset) {
+ // This is wrong in case of multiline symbol bu I assume references will be added using start and end offsets so length is useless.
+ int length = endLineOffset - startLineOffset;
+ return new DeprecatedDefaultSymbol(symbolTable.newSymbol(startLine, startLineOffset, endLine, endLineOffset), length);
+ }
+
@Override
public void newReference(Symbol symbol, int fromOffset) {
((DeprecatedDefaultSymbol) symbol).getWrapped().newReference(fromOffset, fromOffset + ((DeprecatedDefaultSymbol) symbol).getLength());
((DeprecatedDefaultSymbol) symbol).getWrapped().newReference(fromOffset, toOffset);
}
+ @Override
+ public void newReference(Symbol symbol, int startLine, int startLineOffset, int endLine, int endLineOffset) {
+ ((DeprecatedDefaultSymbol) symbol).getWrapped().newReference(startLine, startLineOffset, endLine, endLineOffset);
+ }
+
@Override
public Symbolizable.SymbolTable build() {
return new DeprecatedDefaultSymbolTable(symbolTable);