oracle / opengrok

OpenGrok is a fast and usable source code search and cross reference engine, written in Java
http://oracle.github.io/opengrok/
Other
4.29k stars 739 forks source link

make the "is-annotatable" check more precise #4524

Closed vladak closed 4 months ago

vladak commented 5 months ago

When working on PR #4516, I noticed that the "is-annotatable" property is stronger than the "is-xrefable" property. xrefable does not imply annotatable. For example, the ELF analyzer allows for the ELF binaries to be xrefable (by extracting the symbols and other metadata), however annotating the binaries is currently not possible (although it would be certainly possible to come up with some ideas). The HistoryGuru#hasAnnotation() check can be adapted to make the check more precise/restrictive. The "xrefable" check currently uses the T field in the document, which stores the AbstractAnalyzer.Genre value. Also, this field is stored only for files that are "xrefable". For the more precise check, the TYPE document field can be used, probably as a secondary check after the "xrefable" check, to further narrow down whether the file can be annotated. The TYPE field is always present and stored for each document.