class NoTypoCorrectionCCC

Declaration

class NoTypoCorrectionCCC : public CorrectionCandidateCallback { /* full declaration omitted */ };

Description

Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo correction.

Declared at: clang/include/clang/Sema/TypoCorrection.h:398

Inherits from: CorrectionCandidateCallback

Member Variables

Inherited from CorrectionCandidateCallback:

public WantTypeSpecifiers = true
public WantExpressionKeywords = true
public WantCXXNamedCasts = true
public WantFunctionLikeCasts = true
public WantRemainingKeywords = true
public WantObjCSuper = false
public IsObjCIvarLookup = false
public IsAddressOfOperand = false
protected Typo
protected TypoNNS
public static InvalidDistance = TypoCorrection::InvalidDistance

Method Overview

Inherited from CorrectionCandidateCallback:

Methods

NoTypoCorrectionCCC()

Declared at: clang/include/clang/Sema/TypoCorrection.h:400

bool ValidateCandidate(
    const clang::TypoCorrection& candidate)

Description

Simple predicate used by the default RankCandidate to determine whether to return an edit distance of 0 or InvalidDistance. This can be overridden by validators that only need to determine if a candidate is viable, without ranking potentially viable candidates. Only ValidateCandidate or RankCandidate need to be overridden by a callback wishing to check the viability of correction candidates. The default predicate always returns true if the candidate is not a type name or keyword, true for types if WantTypeSpecifiers is true, and true for keywords if WantTypeSpecifiers, WantExpressionKeywords, WantCXXNamedCasts, WantRemainingKeywords, or WantObjCSuper is true.

Declared at: clang/include/clang/Sema/TypoCorrection.h:408

Parameters

const clang::TypoCorrection& candidate

std::unique_ptr<CorrectionCandidateCallback>
clone()

Description

Clone this CorrectionCandidateCallback. CorrectionCandidateCallbacks are initially stack-allocated. However in case where delayed typo-correction is done we need to move the callback to storage with a longer lifetime. Every class deriving from CorrectionCandidateCallback must implement this method.

Declared at: clang/include/clang/Sema/TypoCorrection.h:411