The Indexer EP allows developers to override how current program elements are indexed. Developers can add new fields to indexed methods, such as adding a "surrounding text" field, or even replace all fields in a given program element.
- Extend either the SrcMLCSharpParser or SrcMLCppParser
- Extend just MethodElement or CppUnresolvedMethodElement and MethodElement
- Add new fields to be parsed to MethodElement or CppUnresolvedMethodElement and MethodElement
- Override ParseMethod or ParseCppFunction, populating only added fields and using base class to populate normal fields
- Add this new parser to Sando's configuration file (link to come)
MethodElement ParseMethod() - Parse and populate additional fields in CSharp
MethodElement ParseCppFunction() - Parse and populate additional fields in C++
See Sando.Parser.UnitTests.MyCSharpParserTest for an example of adding a field to a CSharp method element.
See Sando.Parser.UnitTests.MySrcMlCppParser for an example of adding a field to a C++ method element.
- Populates all fields in MethodDocument, ClassElement, CommentDocument, FieldDocument, EnumDocument, DocCommentDocument, MethodPrototypeDocument, and StructDocument
- Note that not all fields are searched by Sando
For details see:
An extension could use text summarization to create a summary of the documentation of each class that is used in a method, and add this new text to a field called "related text". This field would also be searched during the search process.