Files
swift-mirror/test/SourceKit/Refactoring/semantic-refactoring/local-rename.swift
Nathan Hawes c4e87f0861 [Refactoring] Fix local rename missing occurrences in string interpolations
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.
2017-11-17 20:16:59 -08:00

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