-
-
Notifications
You must be signed in to change notification settings - Fork 397
Fix extend imports regression #769
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
d6ce4a9
db6e175
bba7488
26d7c44
69f75b3
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 |
---|---|---|
|
@@ -628,7 +628,14 @@ suggestExtendImport exportsMap contents Diagnostic{_range=_range,..} | |
| Just match <- Map.lookup binding (getExportsMap exportsMap) | ||
, [(ident, _)] <- filter (\(_,m) -> mod == m) (Set.toList match) | ||
= Just ident | ||
| otherwise = Nothing | ||
|
||
-- fallback to using GHC suggestion even though it is not always correct | ||
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 see a test for this branch added - would be good to see it reflected there. 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. Well, I duplicated the test suite to run without |
||
| otherwise | ||
= Just IdentInfo | ||
{ name = binding | ||
, rendered = binding | ||
, parent = Nothing | ||
, isDatacon = False} | ||
|
||
suggestFixConstructorImport :: Maybe T.Text -> Diagnostic -> [(T.Text, [TextEdit])] | ||
suggestFixConstructorImport _ Diagnostic{_range=_range,..} | ||
|
@@ -968,8 +975,8 @@ extractQualifiedModuleName :: T.Text -> Maybe T.Text | |
extractQualifiedModuleName x | ||
| Just [m] <- matchRegexUnifySpaces x "module named [^‘]*‘([^’]*)’" | ||
= Just m | ||
| otherwise | ||
= Nothing | ||
| otherwise | ||
= Nothing | ||
|
||
------------------------------------------------------------------------------------------------- | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.