logic: show real code of signatures in tooltips

* added new location type
* refactored old recording code
* record signature locations for cxx functions and java methods
* added signature locations to sample project indexer tests
* ignore signature locations in ui
* signatures in tooltip with qualified name of the function/method
* added test for finding signature location of constructor with initializer list
This commit is contained in:
mlangkabel
2018-07-20 14:00:08 +02:00
parent 605d07688b
commit c6f9d8f92c
211 changed files with 19809 additions and 19293 deletions
@@ -234,11 +234,39 @@ public abstract class AstVisitor extends ASTVisitor
DeclName symbolName = DeclNameResolver.getQualifiedDeclName(node, m_filePath, m_compilationUnit);
m_client.recordSymbolWithLocationAndScope(
Range signatureRange = getRange(node);
if (!node.thrownExceptionTypes().isEmpty())
{
Object lastExceptionType = node.thrownExceptionTypes().get(node.thrownExceptionTypes().size() - 1);
if (lastExceptionType instanceof ASTNode)
{
signatureRange.end = getRange((ASTNode) lastExceptionType).end;
}
}
else
{
signatureRange.end = getRange(node.getName()).end;
if (!node.parameters().isEmpty())
{
Object lastParametersType = node.parameters().get(node.parameters().size() - 1);
if (lastParametersType instanceof ASTNode)
{
signatureRange.end = getRange((ASTNode) lastParametersType).end;
}
}
signatureRange.end = m_fileContent.findStartPosition(")", signatureRange.end);
}
m_client.recordSymbolWithLocationAndScopeAndSignature(
symbolName.toNameHierarchy(),
SymbolKind.METHOD,
getRange(node.getName()),
getRange(node),
signatureRange,
AccessKind.fromModifiers(node.getModifiers()),
DefinitionKind.EXPLICIT);