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

updating included files even in case of compilation error #638

Closed
akiran opened this issue Nov 11, 2014 · 5 comments
Closed

updating included files even in case of compilation error #638

akiran opened this issue Nov 11, 2014 · 5 comments
Assignees

Comments

@akiran
Copy link

akiran commented Nov 11, 2014

As of now, included files are updated only if compilation is successful and it is empty if compilation fails.

Is is possible to update included files even in case of compilation error.
This feature is required in watcher tools, where compilation temporarily enters error state while typing code.

@mgreter
Copy link
Contributor

mgreter commented Nov 11, 2014

I guess what you actually want is to query that list before the compile step is taking place. This way you could retrieve that information without triggering any compiling issues. Am I right? Be aware that this could still fail, but only if there are problems resolving the imports etc. and not with compilation issues.

@akhleung Can you confirm that imports are fully resolved before compilation? Or is there some way to add more includes during the compilation phase? If not I would propose the fallowing:

  • Split compile_file/string (in context.cpp) into parse and compile steps. Add some API functions to just call the parse step to query the included files afterwards.
  • Set the included files array on the result before the compilation step, so it contains something even in case of compilation errors.

@mgreter
Copy link
Contributor

mgreter commented Nov 12, 2014

Added a commit to the C API refactoring PR!
This should enable implementors to do what @akiran was asking for!

@akiran
Copy link
Author

akiran commented Nov 12, 2014

yes, ability to query the list before compile step will solve our problem at webpack-contrib/sass-loader#29

@mgreter +1 for your two step proposal.
Having api functions to parse dependencies and also updating included files in case of errors is very useful.

@mgreter
Copy link
Contributor

mgreter commented Nov 17, 2014

This should be fixed by 2a57715
Added example to the API Documentation

@mgreter mgreter closed this as completed Nov 17, 2014
@jhnns
Copy link

jhnns commented Nov 18, 2014

👍

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

No branches or pull requests

3 participants