Verified Commit 40f25eb7 authored by Camil Staps's avatar Camil Staps 🚀

Add name field to responses

parent 8f0d812e
......@@ -63,6 +63,7 @@ from Text.JSON import generic JSONEncode, generic JSONDecode, :: JSONNode
, modul :: String //* The full (hierarchical) module name
, dcl_line :: Maybe Int //* The line in the definition module of this entry
, icl_line :: Maybe Int //* The line in the implementation module of this entry
, name :: String //* The name of the entry
, distance :: Int //* A distancy measure, lower is more relevant
, builtin :: Maybe Bool //* Whether this is a builtin function
, documentation :: Maybe String //* The CleanDoc description for this result
......
......@@ -105,7 +105,7 @@ parseSingleLineRequest :: String -> MaybeErrorString Request
parseSingleLineRequest s = case split "::" s of
["",type] -> Ok {zero & unify=Just $ trim type}
[name,type] -> Ok {zero & name=Just $ trim name, unify=Just $ trim type}
[name] -> Ok {zero & name=Just $ trim name }
[name] -> Ok {Request | zero & name=Just $ trim name}
_ -> Error "Multiple ::s found"
toSingleLine :: Request -> Maybe String
......@@ -113,10 +113,10 @@ toSingleLine req
| isJust req.typeName && isJust req.className = Nothing
| isJust req.typeName = req.typeName
| isJust req.className = req.className
| isJust req.unify = case req.name of
| isJust req.unify = case req.Request.name of
Nothing -> Just $ ":: " + fromJust req.unify
Just n -> Just $ n + " :: " + fromJust req.unify
| otherwise = req.name
| otherwise = req.Request.name
toHTTPRequest :: Request -> HTTPRequest
toHTTPRequest req =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment