|
22 | 22 |
|
23 | 23 | #include "DefinitionKind.h" |
24 | 24 | #include "EdgeKind.h" |
| 25 | +#include "ElementComponentKind.h" |
25 | 26 | #include "LocationKind.h" |
26 | 27 | #include "NameHierarchy.h" |
27 | 28 | #include "ReferenceKind.h" |
@@ -349,6 +350,42 @@ namespace sourcetrail |
349 | 350 | */ |
350 | 351 | bool recordReferenceLocation(int referenceId, const SourceRange& location); |
351 | 352 |
|
| 353 | + /** |
| 354 | + * Marks a reference that is stored in the database as "ambiguous" |
| 355 | + * |
| 356 | + * This method allows to additional information for a reference to the database. Sourcetrail will |
| 357 | + * display an "ambiguous" reference with a special style to emphasize that the existance of the |
| 358 | + * reference is questionable. This method is intended to be called in situations when an indexed |
| 359 | + * token may have meanings, all of which shall be recorded. |
| 360 | + * |
| 361 | + * param: referenceId - the id of the reference that shall be marked as ambiguous. |
| 362 | + * |
| 363 | + * return: true if successful. false on failure. getLastError() provides the error message. |
| 364 | + */ |
| 365 | + bool recordReferenceIsAmbiuous(int referenceId); |
| 366 | + |
| 367 | + /** |
| 368 | + * Stores a location between a specific context and an "unsolved" symbol to the database |
| 369 | + * |
| 370 | + * This method allows to store all available information to the database in the case that a symbol |
| 371 | + * is referenced in a certain context but the referenced symbol could not be resolved to a concrete |
| 372 | + * name. For each reference recorded by this method, Sourcetrail's graph view will display an edge |
| 373 | + * that originates at the recorded context symbol and points to a node called "unsolved symbol". |
| 374 | + * Furthermore Sourcetrail's code view will use a different highlight when the provided source range |
| 375 | + * gets hovered. |
| 376 | + * |
| 377 | + * param: contextSymbolId - the id of the source of the recorded reference edge |
| 378 | + * param: referenceKind - kind of the recorded reference edge |
| 379 | + * param: location - the SourceRange that shall be recorded as location for the respective |
| 380 | + * reference. |
| 381 | + * |
| 382 | + * return: referenceId - integer id of the stored reference. 0 on failure. getLastError() |
| 383 | + * provides the error message. |
| 384 | + * |
| 385 | + * see: SourceRange |
| 386 | + */ |
| 387 | + int recordReferenceToUnsolvedSymhol(int contextSymbolId, ReferenceKind referenceKind, const SourceRange& location); |
| 388 | + |
352 | 389 | /** |
353 | 390 | * Stores a location for the usage of a symbol's name as qualifier to the database |
354 | 391 | * |
@@ -475,6 +512,7 @@ namespace sourcetrail |
475 | 512 | int addFile(const std::string& filePath); |
476 | 513 | int addEdge(int sourceId, int targetId, EdgeKind edgeKind); |
477 | 514 | void addSourceLocation(int elementId, const SourceRange& location, LocationKind kind); |
| 515 | + void addElementComponent(int elementId, ElementComponentKind kind, const std::string& data); |
478 | 516 |
|
479 | 517 | std::string m_projectFilePath; |
480 | 518 | std::string m_databaseFilePath; |
|
0 commit comments