mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SourceKit: Introduce a new enum class to describe the kind of resolved sema token kind. NFC (#7657)
This commit is contained in:
@@ -91,6 +91,22 @@ bool SemaLocResolver::tryResolve(ModuleEntity Mod, SourceLoc Loc) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SemaLocResolver::tryResolve(Stmt *St) {
|
||||
if (auto *LST = dyn_cast<LabeledStmt>(St)) {
|
||||
if (LST->getStartLoc() == LocToResolve) {
|
||||
SemaTok = { St };
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (auto *CS = dyn_cast<CaseStmt>(St)) {
|
||||
if (CS->getStartLoc() == LocToResolve) {
|
||||
SemaTok = { St };
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool SemaLocResolver::visitSubscriptReference(ValueDecl *D, CharSourceRange Range,
|
||||
bool IsOpenBracket) {
|
||||
// We should treat both open and close brackets equally
|
||||
@@ -133,7 +149,7 @@ bool SemaLocResolver::walkToStmtPre(Stmt *S) {
|
||||
// non-implicit Stmts (fix Stmts created for lazy vars).
|
||||
if (!S->isImplicit() && !rangeContainsLoc(S->getSourceRange()))
|
||||
return false;
|
||||
return true;
|
||||
return !tryResolve(S);
|
||||
}
|
||||
|
||||
bool SemaLocResolver::walkToStmtPost(Stmt *S) {
|
||||
|
||||
Reference in New Issue
Block a user