Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Remove JSON instances for unused completion code #305

Merged
merged 2 commits into from
Jan 6, 2020
Merged
Changes from 1 commit
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
Prev Previous commit
Remove completion resolve data from tests
  • Loading branch information
serras committed Jan 4, 2020
commit daf3ba02a9dc126a430d4282f5df6c7a729d9787
11 changes: 5 additions & 6 deletions test/exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module Main (main) where
import Control.Applicative.Combinators
import Control.Monad
import Control.Monad.IO.Class (liftIO)
import qualified Data.Aeson as Aeson
import Data.Char (toLower)
import Data.Foldable
import Development.IDE.GHC.Util
Expand Down Expand Up @@ -1061,27 +1060,27 @@ completionTests
let source = T.unlines ["module A where", "f = hea"]
docId <- openDoc' "A.hs" "haskell" source
compls <- getCompletions docId (Position 1 7)
liftIO $ compls @?= [complItem "head" ["GHC.List", "base", "v", "head"] (Just CiFunction)]
liftIO $ compls @?= [complItem "head" (Just CiFunction)]
, testSessionWait "type" $ do
let source = T.unlines ["{-# OPTIONS_GHC -Wall #-}", "module A () where", "f :: ()", "f = ()"]
docId <- openDoc' "A.hs" "haskell" source
expectDiagnostics [ ("A.hs", [(DsWarning, (3,0), "not used")]) ]
changeDoc docId [TextDocumentContentChangeEvent Nothing Nothing $ T.unlines ["{-# OPTIONS_GHC -Wall #-}", "module A () where", "f :: Bo", "f = True"]]
compls <- getCompletions docId (Position 2 7)
liftIO $ compls @?=
[ complItem "Bounded" ["GHC.Enum", "base", "t", "Bounded"] (Just CiClass)
, complItem "Bool" ["GHC.Types", "ghc-prim", "t", "Bool"] (Just CiClass)
[ complItem "Bounded" (Just CiClass)
, complItem "Bool" (Just CiClass)
]
, testSessionWait "qualified" $ do
let source = T.unlines ["{-# OPTIONS_GHC -Wunused-binds #-}", "module A () where", "f = ()"]
docId <- openDoc' "A.hs" "haskell" source
expectDiagnostics [ ("A.hs", [(DsWarning, (2, 0), "not used")]) ]
changeDoc docId [TextDocumentContentChangeEvent Nothing Nothing $ T.unlines ["{-# OPTIONS_GHC -Wunused-binds #-}", "module A () where", "f = Prelude.hea"]]
compls <- getCompletions docId (Position 2 15)
liftIO $ compls @?= [complItem "head" ["GHC.List", "base", "v", "head"] (Just CiFunction)]
liftIO $ compls @?= [complItem "head" (Just CiFunction)]
]
where
complItem label xdata kind = CompletionItem
complItem label kind = CompletionItem
{ _label = label
, _kind = kind
, _detail = Just "Prelude"
Expand Down