예제 #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
}
예제 #2
0
/*
	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.

	Parameter Diagnostic the diagnostic whose range is being extracted.

	Parameter Range the zero-based index specifying which range to

	Returns the requested source range.
*/
func (d Diagnostic) Range(r uint32) SourceRange {
	return SourceRange{C.clang_getDiagnosticRange(d.c, C.uint(r))}
}