-
-
Notifications
You must be signed in to change notification settings - Fork 390
Solve crash with module name plugin under certain circumstances #2518
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
Changes from all commits
ee7845a
42bef3d
123d00a
5128e19
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -48,7 +48,7 @@ renameProvider state pluginId (RenameParams (TextDocumentIdentifier uri) pos _pr | |
getFileEdits = ap (getSrcEdits state . renameModRefs newNameText) (locToUri . head) | ||
|
||
fileEdits <- mapM getFileEdits filesRefs | ||
pure $ foldl1 (<>) fileEdits | ||
pure $ foldl' (<>) mempty fileEdits | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If strictness is useful here - afaik This note may be skipped. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH, I don't know what level of strictness is needed here. I guess "the more the better" since it is left fold and non-strict left fold does not have much application. The goal here was to get rid of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, I think there's a small policy question here: do we want to return a response with an empty edit here, or fail the response? I think either is arguable, but perhaps worth a note that we might send back an empty edit here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a matter of policy, we don't want any unhandled exceptions to leak out. So we want There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't mean to leak an exception, the request itself can fail in the protocol. Probably that's not appropriate since nothing went wrong per se, though. |
||
|
||
------------------------------------------------------------------------------- | ||
-- Source renaming | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're feeling brave, there's a
head
here you could murder too.