/** * \brief Retrieve a source range associated with the diagnostic. * * A diagnostic's source ranges highlight important elements in the source * code. On the command line, Clang displays source ranges by * underlining them with '~' characters. * * \param Diagnostic the diagnostic whose range is being extracted. * * \param Range the zero-based index specifying which range to * * \returns the requested source range. */ func (d Diagnostic) Ranges() (ret []SourceRange) { ret = make([]SourceRange, C.clang_getDiagnosticNumRanges(d.c)) for i := range ret { ret[i].c = C.clang_getDiagnosticRange(d.c, C.uint(i)) } return }
// Determine the number of source ranges associated with the given diagnostic. func (d Diagnostic) NumRanges() uint32 { return uint32(C.clang_getDiagnosticNumRanges(d.c)) }