@@ -226,7 +226,6 @@ data Success =
226226 | TextResult Text
227227 | UsagesResult [P. SourceSpan ]
228228 | MultilineTextResult [Text ]
229- | PursuitResult [PursuitResponse ]
230229 | ImportList (P. ModuleName , [(P. ModuleName , P. ImportDeclarationType , Maybe P. ModuleName )])
231230 | ModuleList [ModuleIdent ]
232231 | RebuildSuccess P. MultipleErrors
@@ -241,7 +240,6 @@ instance ToJSON Success where
241240 toJSON (TextResult t) = encodeSuccess t
242241 toJSON (UsagesResult ssp) = encodeSuccess ssp
243242 toJSON (MultilineTextResult ts) = encodeSuccess ts
244- toJSON (PursuitResult resp) = encodeSuccess resp
245243 toJSON (ImportList (moduleName, imports)) = object [ " resultType" .= (" success" :: Text )
246244 , " result" .= object [ " imports" .= map encodeImport imports
247245 , " moduleName" .= P. runModuleName moduleName]]
@@ -265,61 +263,6 @@ encodeImport (P.runModuleName -> mn, importType, map P.runModuleName -> qualifie
265263 , " identifiers" .= (identifierFromDeclarationRef <$> refs)
266264 ] ++ map (\ x -> " qualifier" .= x) (maybeToList qualifier)
267265
268- newtype PursuitQuery = PursuitQuery Text
269- deriving (Show , Eq )
270-
271- data PursuitSearchType = Package | Identifier
272- deriving (Show , Eq )
273-
274- instance FromJSON PursuitSearchType where
275- parseJSON (String t) = case t of
276- " package" -> pure Package
277- " completion" -> pure Identifier
278- _ -> mzero
279- parseJSON _ = mzero
280-
281- instance FromJSON PursuitQuery where
282- parseJSON o = PursuitQuery <$> parseJSON o
283-
284- data PursuitResponse =
285- -- | A Pursuit Response for a module. Consists of the modules name and the
286- -- package it belongs to
287- ModuleResponse ModuleIdent Text
288- -- | A Pursuit Response for a declaration. Consist of the declaration's
289- -- module, name, package, type summary text
290- | DeclarationResponse Text ModuleIdent Text (Maybe Text ) Text
291- deriving (Show ,Eq )
292-
293- instance FromJSON PursuitResponse where
294- parseJSON (Object o) = do
295- package <- o .: " package"
296- info <- o .: " info"
297- (type' :: Text ) <- info .: " type"
298- case type' of
299- " module" -> do
300- name <- info .: " module"
301- pure (ModuleResponse name package)
302- " declaration" -> do
303- moduleName <- info .: " module"
304- ident <- info .: " title"
305- (text :: Text ) <- o .: " text"
306- typ <- info .:? " typeText"
307- pure (DeclarationResponse moduleName ident package typ text)
308- _ -> mzero
309- parseJSON _ = mzero
310-
311- instance ToJSON PursuitResponse where
312- toJSON (ModuleResponse name package) =
313- object [" module" .= name, " package" .= package]
314- toJSON (DeclarationResponse module' ident package type' text) =
315- object
316- [ " module" .= module'
317- , " ident" .= ident
318- , " type" .= type'
319- , " package" .= package
320- , " text" .= text
321- ]
322-
323266-- | Denotes the different namespaces a name in PureScript can reside in.
324267data IdeNamespace = IdeNSValue | IdeNSType | IdeNSKind
325268 deriving (Show , Eq , Ord , Generic , NFData )
0 commit comments