mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Various uses of `getPresumedLineAndColumnForLoc` were likely added when that function was the very misleading name `getLineAndColumn`. Change these to use `getLineAndColumnForBuffer` instead where appropriate, ie. we want the underlying file rather than the location to display to the user. There were also some cases where the buffer identifier had been swapped to use the display name instead, under the assumption that the presumed location was needed. Updated those as well. SingleRawComment: Lines are only used when merging comments, where the original location is fine to use. Index: Doesn't store the file set in #sourceLocation, so using the presumed line would end up pointing to a location that makes no sense. Editor functionality: Formatting and refactoring are on the current file. Using the presumed location would result in incorrect replacements.
7 lines
231 B
Swift
7 lines
231 B
Swift
#sourceLocation(file: "someFile.swift", line: 10)
|
|
func test() {}
|
|
#sourceLocation()
|
|
|
|
// RUN: %sourcekitd-test -req=find-local-rename-ranges -pos=2:6 %s -- %s | %FileCheck %s
|
|
// CHECK: 2:6-2:10 source.refactoring.range.kind.basename
|