Skip to content

Commit

Permalink
fix ghc90 test
Browse files Browse the repository at this point in the history
  • Loading branch information
coltenwebb committed Sep 25, 2022
1 parent 0bc2cfe commit 4231579
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions ghcide/src/Development/IDE/Plugin/Completions/Logic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import Data.List.Extra as List hiding
import qualified Data.Map as Map

import Data.Maybe (catMaybes, fromMaybe,
isJust, mapMaybe, listToMaybe)
isJust, listToMaybe,
mapMaybe)
import qualified Data.Text as T
import qualified Text.Fuzzy.Parallel as Fuzzy

Expand Down Expand Up @@ -637,7 +638,7 @@ getCompletions plugins ideOpts CC {allModNamesAsNS, anyQualCompls, unqualCompls,
-- Completions can return more information that just the completion itself, but it will
-- require more than what GHC currently gives us in the HieAST, since it only gives the Type
-- of the fields, not where they are defined, etc. So for now the extra fields remain empty.
-- Also: additionalTextEdits is a todo, since we may want to import the record. It requires a way
-- Also: additionalTextEdits is a todo, since we may want to import the record. It requires a way
-- to get the record's module, which isn't included in the type information used to get the fields.
dotFieldSelectorToCompl :: T.Text -> T.Text -> (Bool, CompItem)
dotFieldSelectorToCompl recname label = (True, CI
Expand Down Expand Up @@ -678,7 +679,7 @@ getCompletions plugins ideOpts CC {allModNamesAsNS, anyQualCompls, unqualCompls,
ty = showForSnippet <$> typ
thisModName = Local $ nameSrcSpan name

-- When record-dot-syntax completions are available, we return them exclusively.
-- When record-dot-syntax completions are available, we return them exclusively.
-- They are only available when we write i.e. `myrecord.` with OverloadedRecordDot enabled.
-- Anything that isn't a field is invalid, so those completion don't make sense.
compls
Expand Down Expand Up @@ -744,6 +745,7 @@ getCompletions plugins ideOpts CC {allModNamesAsNS, anyQualCompls, unqualCompls,




uniqueCompl :: CompItem -> CompItem -> Ordering
uniqueCompl candidate unique =
case compare (label candidate, compKind candidate)
Expand Down
2 changes: 1 addition & 1 deletion test/functional/Completion.hs
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,4 @@ compls `shouldNotContainCompl` lbl =
@? "Should not contain completion: " ++ show lbl

expectFailIfBeforeGhc92 :: String -> TestTree -> TestTree
expectFailIfBeforeGhc92 = knownBrokenForGhcVersions [GHC810, GHC88, GHC86]
expectFailIfBeforeGhc92 = knownBrokenForGhcVersions [GHC810, GHC88, GHC86, GHC90]

0 comments on commit 4231579

Please sign in to comment.