-
Notifications
You must be signed in to change notification settings - Fork 17
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
Detect when a build is required #128
Comments
You have to run a Edit: Once your dependencies are built, atom will keep them up to date and reflect changes right away, but the initial build needs to be triggered manually. |
What @kritzcreek says is correct. Open to suggestions for better UX for this case - my concern is I don't want to automatically run a full build on save in certain cases that may not trigger correctly, and may not be obvious that/why it's happening. |
A full build fixes the problem, thanks. |
If you have "Use fast rebuild" configured then a single-file rebuild will be done via psc-ide-server, which for larger projects is much faster than a full build. The unknown module error is from the compiler itself, so this will not change, but what would be more realistic is detecting when there are no externs present (ie no/empty output dir) when doing a rebuild, and throw up some info somehow in this case. I'm not sure we can detect anything more subtle than this all/nothing though (other occasions you may need to do a full build due to making interdependent changes, installing further dependencies, etc). I guess we could augment unknown module with a "full build" text or quick-fix action, but I'm not sure what the hit rate is for that - probably is a good chance that a rebuild might fix it? Or at least you would know whether it should. |
From discussion there's a possibility this is something psc-ide might do in the future |
On Windows, if I do the following steps:
psc-ide-server
processespulp init
in the new folderThen Atom reports as an error that Control.Monad.Eff is an unknown module. The error disappears after a short time.
If I then add
import Math (sqrt)
to the end of the imports, I again get the errorUnknown module Math
, as expected.If I now do
bower install purescript-math --save-dev
, and save src/Main.purs again, the error should stop and compilation should be successful, but there's no change.For comparison, if I do
pulp -w build --to bundle.js
in the same folder it builds successfully with no errors (just warnings about unused imports). I can add an index.html file, run lserver, and successfully run a bundle.js compiled with the Math module.The Atom package's build command is the default:
pulp.cmd build --no-psa --json-errors
If I exit Atom and open it again, when I save Main.purs it builds successfully, with only warnings about redundant imports. It's good that I can work around the problem, but I shouldn't have to restart Atom to import a new module.
The text was updated successfully, but these errors were encountered: