-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Conversation
RedrawErrors. The new function takes the buffer number as an argument, and several other functions called by RedrawErrors() are made to operate on the specific buffer instead of the current buffer.
background. There is a new option added called "g:syntastic_async" which turn this functionality on, but only when the syntax checker indicates it's written to take advantage of this new functionality. This feature depends on the AsyncCommand plugin which can be obtained, https://github.com/pydave/AsyncCommand or http://www.vim.org/scripts/script.php?script_id=3431 This code also incorporates code from Yurin Slava (aka nevar), from https://github.com/nevar/syntastic/
task. All that needed to be done was add the "checker" dictionary value, and add the "async_css_syntax_checker" variable.
This required the checking function to be split into two functions. One calls SyntasticMake() and the other one does all the secondary processing on all the error lines. Also the bufnr() had to be made into 'defaults' in SyntasticMake instead of getting set while processing after it.
Hey, just so you know: I am interested in this. I need to set aside a night to investigate it though - async stuff is scary :) The ideal solution would be to have async totally optional (as you have here) and to have the core of the async code small and decoupled from the rest of the code. That way we can try it out for a few months and know that its easy to remove if it doesnt work out. |
Yes, I would agree with that. |
I'd say this set of patches isn't totally decoupled .. I'm not sure that all of it could be separated out, but there's for sure some parts that could be. Something to note is that it's kind of hard to use this code .. You have to do the following,
If anything above isn't done, then it's not used. So it's not exactly trivial to use it. |
The really nitty gritty of the Async stuff is inside a whole other plugin called AsyncCommand. In addition to what I mentioned above, if you don't have that additional plugging async won't enable. |
Note that vim --servername needs a working X server; not always the case. I am working on an async solution but it needs perfection -- VIm has zero support for async commands in general. My idea is to start a shell command in the background with output redirected to a temporary file, then watch the file periodically (periodically means CursorMove or CursorHold autocmd events). When the process completed, parse the resulting errors in the file. Why it's ugly: 1) needs bash for background process start; 2) continuous monitoring of a temp output file to detect completion. |
I did all my testing with console vim .. So I'm not sure about the whole X server thing .. It worked find in console vim. |
This would be a killer feature, I would love to see this async stuff in syntastic! |
I'm also interested in this feature. It takes my perl syntax checker ~8 seconds to check. |
Async is a very nice feature to have, so we will not be in a "waiting state", at least something like "we can still/continue editing while its running the checker in background", but needed to wait that finishes for other less-prior tasks (save the file, exit vim, etc...) Note: i dont know much about viml, so maybe what im saying sounds OT of viml :) |
+1 |
This would make the syntastic user experience a lot better IMO. I hope this does not get left behind. |
+1 |
1 similar comment
+1 |
+1 |
1 similar comment
+1 |
+1 |
2 similar comments
👍 |
+1 |
+1 The syntax checking feature of the python-mode plugin has this feature already for some time (it was introduced in commit 59d7fd7 with some fixes in the following commits). From my experience it works quite well. Maybe that code helps to implement the same feature in syntastic? |
+1, it would be awesome to have this option in syntastic! |
+1 |
1 similar comment
+1 |
Guys, please continue at #699. Do read the entire thread there before adding more +1. :) |
No, but it would make sense for you to read the thread I mentioned above. |
Makes it possible for the user to run the checkers in the background. It will only be used if the user enabled it, and the syntax checker makes use of it.