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

Recompile .sma files when .inc they depend on is updated on watch #21

Open
rtxa opened this issue Sep 24, 2024 · 4 comments
Open

Recompile .sma files when .inc they depend on is updated on watch #21

rtxa opened this issue Sep 24, 2024 · 4 comments

Comments

@rtxa
Copy link

rtxa commented Sep 24, 2024

Sometimes, we just want to update an include file, let's say foo.inc, but this doesn't trigger recompilation of .sma files who depend on this include.

One strategy could be to check on watched .sma files if they have #include <foo> on it.

@Hedgefog
Copy link
Owner

Hedgefog commented Sep 24, 2024

amxxpack does not support this functionality. It only compiles .sma files when they are saved, but it clears the cache and recompiles when included files are modified, so recompilation occurs after a re-save. amxxpack don't have any static analysis, and adding this feature would significantly complicate the logic, requiring a custom solution built from scratch. Parsing #include directives and storing them in memory would also cause a major hit to performance.

I would prefer not to spend time on implementing such a complex functionality, as re-saving a file is not a significant issue.

@rtxa
Copy link
Author

rtxa commented Sep 24, 2024

I understand that it adds some complexity, but not as much as you make it seem; experimentation is required to prove this. Anyway, I just wanted to bring this issue to your attention. I know this is not a high priority thing, maybe this can be mentioned somewhere as a known limitation.

@Hedgefog
Copy link
Owner

I understand that it adds some complexity, but not as much as you make it seem; experimentation is required to prove this. Anyway, I just wanted to bring this issue to your attention. I know this is not a high priority thing, maybe this can be mentioned somewhere as a known limitation.

This implementation requires an extra step every time the file changes, also building a dependency tree in memory to handle nested includes and process the tree every save.

@rtxa
Copy link
Author

rtxa commented Sep 24, 2024

Big performance hit for sure!

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

2 participants