Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support running multiple processes #25

Open
mgsloan opened this issue Jul 18, 2015 · 2 comments
Open

Support running multiple processes #25

mgsloan opened this issue Jul 18, 2015 · 2 comments
Assignees

Comments

@mgsloan
Copy link
Contributor

mgsloan commented Jul 18, 2015

ide-backend supports running multiple processes at once, based on the same interpreter session. Currently, stack-ide only allows one process, an unnecessary restriction.

@mgsloan
Copy link
Contributor Author

mgsloan commented Jul 18, 2015

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)
`

@mgsloan mgsloan self-assigned this Jul 18, 2015
@mgsloan
Copy link
Contributor Author

mgsloan commented Jul 18, 2015

Assigning this to myself for now, but not sure when I'll get around to it. Feel free to jump in and do this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants