@@ -47,8 +47,8 @@ identifierFromExternDecl (TypeSynonymDeclaration name _) = runProperNameT name
47identifierFromExternDecl (DataConstructor name _ _) = name
47identifierFromExternDecl (DataConstructor name _ _) = name
48identifierFromExternDecl (TypeClassDeclaration name) = runProperNameT name
48identifierFromExternDecl (TypeClassDeclaration name) = runProperNameT name
49identifierFromExternDecl (ModuleDecl name _) = name
49identifierFromExternDecl (ModuleDecl name _) = name
50−identifierFromExternDecl (FixityDeclaration (Left op)) = runOpNameT op
50+identifierFromExternDecl (ValueOperator op _ _ _) = runOpNameT op
51−identifierFromExternDecl (FixityDeclaration (Right op)) = runOpNameT op
51+identifierFromExternDecl (TypeOperator op _ _ _) = runOpNameT op
52identifierFromExternDecl Dependency{} = "~Dependency~"
52identifierFromExternDecl Dependency{} = "~Dependency~"
53identifierFromExternDecl Export{} = "~Export~"
53identifierFromExternDecl Export{} = "~Export~"
@@ -56,16 +56,25 @@ identifierFromMatch :: Match -> Text
56identifierFromMatch (Match _ ed) = identifierFromExternDecl ed
56identifierFromMatch (Match _ ed) = identifierFromExternDecl ed
58completionFromMatch :: Match -> Maybe Completion
58completionFromMatch :: Match -> Maybe Completion
59−completionFromMatch (Match _ Dependency{}) = Nothing
59+completionFromMatch (Match m d) = case d of
60−completionFromMatch (Match _ Export{}) = Nothing
61−completionFromMatch (Match m d) = Just $ case d of
62− ValueDeclaration name type' -> Completion (m, name, prettyTypeT type')
60+ ValueDeclaration name type' -> Just $ Completion (m, name, prettyTypeT type')
63− TypeDeclaration name kind -> Completion (m, runProperNameT name, T.pack $ P.prettyPrintKind kind)
61+ TypeDeclaration name kind -> Just $ Completion (m, runProperNameT name, T.pack $ P.prettyPrintKind kind)
64− TypeSynonymDeclaration name kind -> Completion (m, runProperNameT name, prettyTypeT kind)
62+ TypeSynonymDeclaration name kind -> Just $ Completion (m, runProperNameT name, prettyTypeT kind)
65− DataConstructor name _ type' -> Completion (m, name, prettyTypeT type')
63+ DataConstructor name _ type' -> Just $ Completion (m, name, prettyTypeT type')
66− TypeClassDeclaration name -> Completion (m, runProperNameT name, "class")
64+ TypeClassDeclaration name -> Just $ Completion (m, runProperNameT name, "class")
67− ModuleDecl name _ -> Completion ("module", name, "module")
65+ ModuleDecl name _ -> Just $ Completion ("module", name, "module")
68− _ -> error "the impossible happened in completionFromMatch"
66+ ValueOperator op ref precedence associativity -> Just $ Completion (m, runOpNameT op, showFixity precedence associativity ref op)
67+ TypeOperator op ref precedence associativity -> Just $ Completion (m, runOpNameT op, showFixity precedence associativity ref op)
68+ Dependency{} -> Nothing
76+ in T.unwords [asso, T.pack (show p), r, "as", runOpNameT o]
70encodeT :: (ToJSON a) => a -> Text
79encodeT :: (ToJSON a) => a -> Text
71encodeT = toStrict . decodeUtf8 . encode
80encodeT = toStrict . decodeUtf8 . encode