-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Replace uses of presumed locations where they do not make sense #36807
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci please test |
40e88b5
to
df3b08f
Compare
@swift-ci please test |
Build failed |
Build failed |
Build failed |
df3b08f
to
4815034
Compare
@swift-ci please test |
f93f4cc
to
925bc33
Compare
@swift-ci please test |
Build failed |
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.
925bc33
to
20f45ec
Compare
@swift-ci please test |
Build failed |
@swift-ci please test Linux platform |
Various uses of
getPresumedLineAndColumnForLoc
were likely added whenthat function was the very misleading name
getLineAndColumn
. Changethese 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, refactoring, and live diagnostics are
all for the current file. Using the presumed location would either
result in incorrect refactorings or missing errors.