There was a recent change to error early if the stdlib couldn't be
loaded when semantic functionality is required. Since
`ide::initCompilerInvocation` was ignoring the given `Action` and just
setting to `Typecheck` instead, this would cause an error even if
semantic functionality *wasn't* required.
Resolves rdar://88968608.
`SemaAnnotator` walks the tree in source order with respect to the source ranges *excluding* attributes, but `RangeResolver` considers attributes part of their declaration. Thus they disagree on what “walking in source order means”. `SemaAnnotator` will visit the attributes *before* the decl they are on, while `RangeResolver` as currently implemented expects them *as part of* the decl they are on.
Thus, for the purpose of `RangeResolver`, we need to assume that nodes are visited in arbitrary order and we might encounter enclosing nodes after their children.
Thus, when we find a new node, remove all nodes that it encloses from `ContainedASTNodes`.
Fixes rdar://64140713 [SR-12958]
This converts the instances of the pattern for which we have a proper
substitution in lit. This will make it easier to replace it
appropriately with Windows equivalents.
NameMatcher checked if a StringLiteralExpr was a string segment in an
interpolated string by checking if the parent expression was an
InterpolatedStringLiteralExpr. That's only true pre-type-checking, and unlike
global rename, local rename uses the type-checked AST.