You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to somehow use this to asynchronously get information about errors in a file before saving it? Maybe running the check when leaving insert mode or some smarter autocmd event?
The text was updated successfully, but these errors were encountered:
I don't think this could be done easily. You would either need a compiler/linter that supports piping output directly into it (as opposed to passing a file) or would need to save the file to a temp file.
But saving to a temp file could make it difficult for the compiler/linter to properly resolve dependencies if it looks for dependencies in the same project directory as the file being checked. Since a temp file would be stored in some random location the dependencies would have to be explicitly specified.
Assuming that dependencies are not a problem, or a mechanism is already in place to handle them (like setting the Java classpath) it could probably be most easily done via a compiler plugin
The drawbacks of doing it from a compiler plugin being
The tempfile isn't automatically deleted after each run. Although you can get around this by setting a variable to hold the tempfile name so that you can reuse the tempfile every time :compiler is called (which happens everytime Accio is run).
Similar to how the javac example in the readme stores the classpath.
Accio's current design would cause it to assume that this compiler is run on a group of files instead of a single file (kind of like a project-wide build script). Which means that Accio could only store the results from one run of this compiler at a time, as opposed to storing the results from one run for each buffer. The main consequence being that if you ran this compiler on two separate buffers, the signs from the first run (and the first buffer) would disappear when the second run is started.
I could try and modify the API to allow some way of forcing an Accio command to be local to a buffer, instead of Accio trying to figure it out on its own.
Would it be possible to somehow use this to asynchronously get information about errors in a file before saving it? Maybe running the check when leaving insert mode or some smarter autocmd event?
The text was updated successfully, but these errors were encountered: