Closed prikhi closed 4 years ago
Hey sorry for getting back to you this late. I have some thoughts on this, but the TLDR is: I think you're better off scripting something yourself, as the responses we get from the ide server are essentially in the json format you'd care about.
In more details here are the things pscid does:
If you've already got watchers and build things set up and don't care about the formatting aspect, pscid
only does 2-3 for you. If your editor already starts an IDE server you don't need to worry about that either, so we're down to just composing a bit of json and sending it over a socket.
Hey sorry for getting back to you this late.
All good, in no hurry over here. The current setup is working relatively fine.
I think you're better off scripting something yourself, as the responses we get from the ide server are essentially in the json format you'd care about.
Ah, I'm pretty new to the purescript world & didn't realize the ide server was doing the majority of the work. I saw the "starting ide server..." message but assumed that was for editor integration.
If you've already got watchers and build things set up and don't care about the formatting aspect, pscid only does 2-3 for you. If your editor already starts an IDE server you don't need to worry about that either.
I'm using spago build
& stack build
for production builds, but the "watcher" bit of the script just forks ghcid
& pscid
- I'm not actually doing any file watching or ide-server starting myself(or via my editor).
Once I have more time to work on the build script, I might just go that route though(with a simple haskell client that sends the load/rebuild commands & parses the responses?). But it feels like I'd be re-implementing what pscid
does, so it seemed sensible to see if there was interest in making pscid more flexible instead.
What editor are you using? If you're using any of the autocompletion/auto-import features you've already started an IDE server. (If you're not using those I'd strongly recommend them)
Either way, I'll see if I can extract a small PureScript program that would do what you need.
I'm doing a bit of spring cleaning, and there's not been activity here for a long time, and I don't intend on making pscid
a scriptable tool, so I'll close this. If you want to be able to script the functionality pscid is giving you, you're probably better off using the ide server directly.
Hey, been using pscid & I think it's great. I've got a build script that calls
pscid
in a separate thread, along with some other "watchers".It would be awesome to have a flag like
--output=json
that printed a line of JSON that describes the status change(success, errors, etc.), instead of clearing the screen & printing the pretty version for users. That way I could parse each line & output them however I like.Also, it would be great if this mode was able to operate with an empty
stdin
. E.g., these causepscid
to throw an exception:echo "" | npx pscid
,npx pscid < /dev/null
. Which means I have to pass in the stdin of my build script topscid
.