on master help sign in
Add primitive type names to name completion

This is necessary because these are treated specially by the parser and are thus not in the global definition context, from which name completion is drawn.

commit25ae311214f32cbd20edc5d8043e88abcbd4d3dd authorDavid Christiansen <david@davidchristiansen.dk> dateThu 23 May 2013, 14:12 (13 years ago) parent5b2f091
1 file changed+5−1
src/Idris/Completion.hs+5−1
src/Idris/Completion.hs+5−1
@@ -59,7 +59,11 @@ nameString _ = Nothing
5959names :: Idris [String]
6060names = do i <- get
6161 let ctxt = tt_ctxt i
62− return $ nub $ mapMaybe (nameString . fst) $ ctxtAlist ctxt
62+ return . nub $
63+ mapMaybe (nameString . fst) (ctxtAlist ctxt) ++
64+ -- Explicitly add primitive types, as these are special-cased in the parser
65+ ["Int", "Integer", "Float", "Char", "String", "Type",
66+ "Ptr", "Bits8", "Bits16", "Bits32", "Bits64"]
6367
6468metavars :: Idris [String]
6569metavars = do i <- get