Open mgsloan opened 9 years ago
The API changes would look something like this:
diff --git a/stack-ide-api/src/Stack/Ide/JsonAPI.hs b/stack-ide-api/src/Stack/Ide/JsonAPI.hs
index 982fd8a..8fd8d39 100644
--- a/stack-ide-api/src/Stack/Ide/JsonAPI.hs
+++ b/stack-ide-api/src/Stack/Ide/JsonAPI.hs
@@ -76,12 +76,11 @@ data Request =
| RequestGetAutocompletion AutocompletionSpan
-- Run
| RequestRun Bool ModuleName Identifier
- | RequestProcessInput String
- | RequestProcessKill
+ | RequestProcessInput ProcessId String
+ | RequestProcessKill ProcessId
-- Misc
| RequestShutdownSession
-
-- | Session updates
data RequestSessionUpdate
= RequestUpdateTargets Targets
@@ -108,9 +107,10 @@ data Response =
| ResponseGetAnnExpTypes [ResponseAnnExpType]
| ResponseGetAutocompletion [AutocompletionInfo]
-- Run
- | ResponseProcessOutput String
- | ResponseProcessDone RunResult
- | ResponseNoProcessError
+ | ResponseRun ProcessId
+ | ResponseProcessOutput ProcessId String
+ | ResponseProcessDone ProcessId RunResult
+ | ResponseNoSuchProcessError ProcessId
-- Misc
| ResponseInvalidRequest String
| ResponseShutdownSession
@@ -169,6 +169,8 @@ data CodeVariety =
-- default to yielding type id info. The expression annotated code
-- is yielded in this annotation.
+newtype ProcessId = ProcessId Int
+
-- | Client version
--
-- Standard versioning applies (major, minor, patch)
`
Assigning this to myself for now, but not sure when I'll get around to it. Feel free to jump in and do this!
ide-backend
supports running multiple processes at once, based on the same interpreter session. Currently,stack-ide
only allows one process, an unnecessary restriction.