mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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.
14 lines
589 B
Swift
14 lines
589 B
Swift
func foo() {
|
|
var aa = 3
|
|
aa = aa + 1
|
|
_ = "before \(aa) after"
|
|
return 1
|
|
}
|
|
|
|
// RUN: rm -rf %t.result && mkdir -p %t.result
|
|
// RUN: %sourcekitd-test -req=local-rename -pos=2:8 -name new_name %s -- %s > %t.result/local-rename.swift.expected
|
|
// RUN: diff -u %S/local-rename.swift.expected %t.result/local-rename.swift.expected
|
|
// RUN: %sourcekitd-test -req=find-local-rename-ranges -pos=2:8 %s -- %s > %t.result/local-rename-ranges.swift.expected
|
|
// RUN: diff -u %S/local-rename-ranges.swift.expected %t.result/local-rename-ranges.swift.expected
|
|
|
|
// REQUIRES-ANY: OS=macosx, OS=linux-gnu |