Commit Graph

11 Commits

Author SHA1 Message Date
Strahinja Val Markovic
04991d874d Moving a comment closer to the related code 2012-09-05 21:49:51 -07:00
Strahinja Val Markovic
dc2f52edbf Adding a max_diagnostics_to_display user option 2012-08-15 20:58:21 -07:00
Strahinja Val Markovic
daef17feb4 Support for showing extra info for diagstics
This was intended to show the full clang output for a given diagnostic,
including notes. But it appears that libclang does not provide this
functionality...
2012-08-15 19:39:03 -07:00
Strahinja Val Markovic
f500ecaffb Fix for hang on insert enter after "foo.bar"
If the user had code like "foo.bar" and then entered insert mode after the 'r'
in "bar", YCM would cause vim to hang.

The problem happened because a sorting task was created that would try to sort
on the latest clang result but none would be created because a clang task was
not created in this occasion. clang_data_ready_ would remain false and would
never be set to true, thus causing an infinite loop in SortingThreadMain since
the thread would forever wait on the mutex.

This was rectified with better handling of the clang results cache. Now the
cache is a full class and it also stores the line & column number of the
location for which the results were computed. Better logic is in place for the
cache invalidation.
2012-08-12 19:01:39 -07:00
Strahinja Val Markovic
f99e89f812 Fix for "lclose not allowed here" error on open
The problem was caused by a race condition of all things. ClangCompleter would
set possibly_completions_ready when starting the first parse pass for the file
and then would try to extract diagnostics for the file before the diagnostics
were done. Technically this was not a problem because only an empty diagnostics
vector would be returned, but this triggered Syntastic because hey, we have some
diagnostics to show (even though we don't).

And then Syntastic would try to close the location list window during startup
when this operation is not available. Technically it's Syntastic's fault, but a
more principled way to check for done diagnostics is to return and use a future
for file parsing operations and this solution also works around the Syntastic
issue.
2012-08-12 14:36:36 -07:00
Strahinja Val Markovic
fef702eef0 Reversed the logic for the no-results-found var 2012-08-12 14:07:38 -07:00
Strahinja Val Markovic
f88c9feb4f Refactored the clang completer; many bugs fixed
This change should fix the random hangs and segfaults when using the clang
completer. Also, assertion errors printed to the console on vim exit should go
away too, same thing with segfaults on vim exit. These "on exit" errors were
caused by not cleanly shutting down the background threads; both the identifier
completer and the clang one now join the threads on destruction. This results in
a clean shutdown.

The new clang completer architecture now uses only one clang thread (again)
instead of a completion and parsing thread. Since the parsing task needs to wait
on the completion task if it was started first (and vice-versa) there's no point
to using two threads. The desired "simplicity" of using two threads for these
two tasks actually created needless complexity (and bugs). Sigh. Such is life.

A TranslationUnit abstraction was also created and this in turn also reduces the
complexity of the clang completer.

The clang completer now also has some (very) basic tests.
2012-08-11 19:37:08 -07:00
Strahinja Val Markovic
658e1393b4 Moved completer.py under completers 2012-08-06 20:14:21 -07:00
Strahinja Val Markovic
5f95a2bfde Showing preview window data for completions
Also, const functions have " const" correctly appended in the completion window.
2012-08-05 19:49:54 -07:00
Strahinja Val Markovic
bf9eba70ac Adding some python docstrings 2012-08-05 14:32:11 -07:00
Strahinja Val Markovic
b62ec81d68 Completer plugins now have their own folder 2012-08-05 14:14:31 -07:00