Exemplo n.º 1
0
/**
 * \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
}
Exemplo n.º 2
0
// Determine the number of source ranges associated with the given diagnostic.
func (d Diagnostic) NumRanges() uint32 {
	return uint32(C.clang_getDiagnosticNumRanges(d.c))
}