Skip to content
This repository has been archived by the owner on Oct 7, 2020. It is now read-only.

Fix code renaming in windows #1392

Merged
merged 2 commits into from
Sep 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/Haskell/Ide/Engine/Plugin/GhcMod.hs
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,12 @@ extractRenamableTerms msg
. T.lines
singleSuggestions = T.splitOn "), " -- Each suggestion is comma delimited
isKnownSymbol t = " (imported from" `T.isInfixOf` t || " (line " `T.isInfixOf` t
getEnclosed = T.dropWhile (== '‘')
. T.dropWhileEnd (== '’')
. T.dropAround (\c -> c /= '‘' && c /= '’')
getEnclosed' b e = T.dropWhile (== b)
. T.dropWhileEnd (== e)
. T.dropAround (\c -> c /= b && c /= e)
getEnclosed txt = case getEnclosed' '‘' '’' txt of
jneira marked this conversation as resolved.
Show resolved Hide resolved
"" -> getEnclosed' '`' '\'' txt -- Needed for windows
enc -> enc

extractRedundantImport :: T.Text -> Maybe T.Text
extractRedundantImport msg =
Expand Down