mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-27 10:17:13 +03:00
Updated editor binding to openEdit node function
This commit is contained in:
parent
752b01e24a
commit
55a6650aeb
@ -110,6 +110,27 @@ metadatas host params =
|
||||
let req host params = jsonGet (Encoder.list H.encode) host "metadata" params
|
||||
in decodeResponse (Decoder.object MD.decodeMetadata) <~ Http.send (Signal.map2 req host params)
|
||||
|
||||
type alias OpenEdit =
|
||||
{ current : Type
|
||||
, admissible : Type
|
||||
, locals : List Term
|
||||
, focalApplications : List Int
|
||||
, wellTypedLocals : List Term }
|
||||
|
||||
openEdit : Signal Host
|
||||
-> Signal (Term, Path)
|
||||
-> Signal (Response OpenEdit)
|
||||
openEdit host params =
|
||||
let body = Encoder.tuple2 E.encodeTerm Path.encodePath
|
||||
req host params = jsonPost body host "open-edit" params
|
||||
decode = Decoder.product5 OpenEdit
|
||||
T.decodeType
|
||||
T.decodeType
|
||||
(Decoder.list E.decodeTerm)
|
||||
(Decoder.list Decoder.int)
|
||||
(Decoder.list E.decodeTerm)
|
||||
in decodeResponse decode <~ Http.send (Signal.map2 req host params)
|
||||
|
||||
search : Signal Host
|
||||
-> Signal (Maybe Type, Query)
|
||||
-> Signal (Response (List Term))
|
||||
@ -120,15 +141,6 @@ search host params =
|
||||
decode = decodeResponse (Decoder.list E.decodeTerm)
|
||||
in decode <~ Http.send (Signal.map2 req host params)
|
||||
|
||||
searchLocal : Signal Host
|
||||
-> Signal (Hash, Path, Maybe Type)
|
||||
-> Signal (Response (List Term))
|
||||
searchLocal host params =
|
||||
let body = Encoder.tuple3 H.encode Path.encodePath (Encoder.optional T.encodeType)
|
||||
req host params = jsonGet body host "search-local" params
|
||||
decode = Decoder.list E.decodeTerm
|
||||
in decodeResponse decode <~ Http.send (Signal.map2 req host params)
|
||||
|
||||
terms : Signal Host -> Signal (List Hash) -> Signal (Response (M.Dict Hash Term))
|
||||
terms host params =
|
||||
let req host params = jsonGet (Encoder.list H.encode) host "terms" params
|
||||
|
@ -29,8 +29,8 @@ data Node m k t e = Node {
|
||||
-- returns ( current type
|
||||
-- , admissible type
|
||||
-- , local vars
|
||||
-- , matching local applications
|
||||
-- , matching local expressions )
|
||||
-- , well-typed applications of focus
|
||||
-- , well-typed expressions involving local vars )
|
||||
openEdit :: e -> P.Path -> Noted m (t, t, [e], [Int], [e]),
|
||||
-- | Search for a term, optionally constrained to be of the given type
|
||||
search :: Maybe t -> Query -> Noted m [e],
|
||||
|
Loading…
Reference in New Issue
Block a user