Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Send the module graph after loading a session.

  • Loading branch information...
commit 605e5ea591be5895847895d0710b1f025f727804 1 parent 3b1d2be
@nominolo authored
View
2  emacs/scion.el
@@ -2335,7 +2335,7 @@ loaded."
)))
(defun scion-complete-load-component (result)
- (destructuring-bind (session-id success notes) result
+ (destructuring-bind (session-id success notes graph) result
(setq scion-current-thread session-id)
(scion-report-compilation-result
(list :succeeded success :notes notes :duration 0.42))))
View
17 src-execs/Server.hs
@@ -177,7 +177,7 @@ data ServerResponse
| RSupportedLanguages [Extension]
| RQuitting
| RFileConfigs [SessionConfig]
- | RSessionCreated SessionId Bool Notes
+ | RSessionCreated SessionId Bool Notes [ModuleSummary]
| RFileModifiedResult Bool Notes
data Response
@@ -221,8 +221,8 @@ instance ToLisp ServerResponse where
toLisp RQuitting = L.nil
toLisp (RFileConfigs confs) =
toLisp confs
- toLisp (RSessionCreated sid success notes) =
- L.List [toLisp sid, toLisp success, toLisp notes]
+ toLisp (RSessionCreated sid success notes graph) =
+ L.List [toLisp sid, toLisp success, toLisp notes, toLisp graph]
toLisp (RFileModifiedResult inGraph notes) =
L.List [toLisp inGraph, toLisp notes]
@@ -287,6 +287,14 @@ instance ToLisp LocSource where
toLisp (OtherSrc txt) =
L.mkStruct ":other" [toLisp (T.pack txt)]
+instance ToLisp ModuleSummary where
+ toLisp modsum =
+ L.mkStruct "modsum" [toLisp (ms_module modsum),
+ toLisp (T.pack $ ms_location modsum)]
+
+instance ToLisp ModuleName where
+ toLisp modname = toLisp (moduleNametoText modname)
+
--instance From
parseRequest :: B.ByteString -> Either String Request
@@ -327,7 +335,8 @@ handleRequest (ListAvailConfigs file) _ =
handleRequest (CreateSession conf) _ = do
sid <- createSession conf
notes <- sessionNotes sid
- return (RSessionCreated sid (not (hasErrors notes)) notes)
+ mods <- sessionModules sid
+ return (RSessionCreated sid (not (hasErrors notes)) notes mods)
handleRequest (FileModified file) (Just sid) = do
fileModified sid (T.unpack file)
let fileInModuleGraph = True -- FIXME: find out
View
3  src/Scion/Types/Session.hs
@@ -193,6 +193,9 @@ instance Exception CannotStartWorker
newtype ModuleName = ModuleName T.Text
deriving (Eq, Ord)
+moduleNametoText :: ModuleName -> T.Text
+moduleNametoText (ModuleName t) = t
+
instance IsString ModuleName where
fromString = ModuleName . fromString
Please sign in to comment.
Something went wrong with that request. Please try again.