Commit Graph

56 Commits

Author SHA1 Message Date
Strahinja Val Markovic
9b3e009ed1 Mappings can now be easily remapped 2013-01-26 18:45:27 -08:00
Strahinja Val Markovic
60860d82f3 Adding shift-tab for prev completion too 2013-01-26 17:58:34 -08:00
Strahinja Val Markovic
e8b60fd537 Adding the YcmDebugInfo command 2013-01-26 11:45:14 -08:00
Strahinja Val Markovic
d02ecc2b1c Making sure 'sys' is imported before being used 2013-01-21 17:20:54 -08:00
Strahinja Val Markovic
5ac3d40691 No error when no clang support and cpp file opened
Previously, when the user opened a cpp/c/objc/objcpp file and clang support was
not compiled in, there would be an error message printed in vim.
2013-01-13 20:56:10 -08:00
Strahinja Val Markovic
d0223a8f0b Easier to move in insert mode now
The completion menu would interfere with moving in insert mode with the arrow
keys. This is now solved.
2012-08-20 20:55:25 -07:00
Strahinja Val Markovic
0c17c49a66 Per-filetype turning off of filetype completion
So things like the ClangCompleter can be turned off fully and the user can rely
on identifier completion only.
2012-08-15 21:29:43 -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
4a4eea0d8a Final workaround for bug with vim-notes use
The vim-notes plugin adds 'longest' to completeopt in its filetype plugin. This
breaks ycm. The result is that the user can't type at all after a notes file has
been visited.

We work around this by setting our completeopt settings on every buffer visit
and CursorHold event.
2012-08-13 20:47:45 -07:00
Strahinja Val Markovic
bcf9ddff32 Now properly ignoring unwanted filetypes
The previous implementation of ignoring filetypes the user doesn't want
completions for was deeply flawed. This one actually works...
2012-08-13 19:01:55 -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
de8f45c202 Possible fix for rare completion-repeat bug
On rare occasions a bug can occur where the user is trying to type text but the
completion system is erasing it as he types. I believe this new approach should
fix that problem. It also replaces the old system for preventing an infinite
loop to occur when there are no completions to show to the user.
2012-08-11 21:20:17 -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
5a9d304c87 Option to auto-close preview window on select
The option defaults to off. Some people may find it useful.
2012-08-06 21:29:56 -07:00
Strahinja Val Markovic
15561b9f1e Adding 'preview' to completeopt if not forbidden
The user can opt-out of this, but we set it by default since most people don't
know that the option exists. Those that are annoyed by it can just toggle an
option in their vimrc.
2012-08-05 19:55:06 -07:00
Strahinja Val Markovic
ea30cb046e ShouldUseNow for IdentifierCompleter done and used 2012-08-05 13:12:10 -07:00
Strahinja Val Markovic
d0f62d1205 Initial, rough version of completer separation
We are trying to build a nice plugin-oriented architechure for loading varios
completer objects.
2012-08-04 17:46:54 -07:00
Strahinja Val Markovic
287d01c8b3 Setting updatetime to 2000 if user allows 2012-08-02 20:32:29 -07:00
Strahinja Val Markovic
06d653c60d Adding the cursor identifier on InsertLeave
This should help catch cases where the user jumps to an identifier and then
edits it in place; we want to add that new ident to the db ASAP because the user
may want to have it completed soon.

Still, we're not perfect. If the user just deletes chars with 'x' or 'd' in Vim
and therefore never even enters insert mode we are obviously not going to pick
up that identifier until the next full file sweep.
2012-07-31 19:01:22 -07:00
Strahinja Val Markovic
b20a24cde9 Adding a TODO I don't want to forget about 2012-07-31 16:31:16 -07:00
Strahinja Val Markovic
11e42b49f0 Smarter updating of clang diagnostics display 2012-07-30 19:42:41 -07:00
Strahinja Val Markovic
15d82eac91 Making sure the syntastic variable exists 2012-07-30 14:19:42 -07:00
Strahinja Val Markovic
a6d5979b08 Don't run the plugin when in diff mode 2012-07-29 22:13:42 -07:00
Strahinja Val Markovic
333b71f8d5 Triggering syntastic error display more often 2012-07-29 22:13:42 -07:00
Strahinja Val Markovic
958a008462 Adding diagnostic extraction support
Next step is to add support to Syntastic so that it uses this new functionality
2012-07-28 15:27:30 -07:00
Strahinja Val Markovic
0ea218022a Leaving omnifunc mode on InsertLeave 2012-07-28 11:42:43 -07:00
Strahinja Val Markovic
019b84e18b Omnifunc for clang types + mapping to invoke it
This omnifunc basically calls our ClangComplete engine.
2012-07-28 11:19:26 -07:00
Strahinja Val Markovic
70900c5ac6 Simplified some vim logic 2012-07-28 11:19:25 -07:00
Strahinja Val Markovic
3cc4cf8e10 Async clang parsing of the current file 2012-07-26 21:44:17 -07:00
Strahinja Val Markovic
68156e8b47 Merge branch 'master' into dev
Conflicts:
	autoload/youcompleteme.vim
2012-07-26 12:59:06 -07:00
Strahinja Val Markovic
6d76563e86 C-TAB selects previous candidate 2012-07-24 18:45:28 -07:00
Strahinja Val Markovic
48d95bcd20 Doing buffervisit for clang only when clang on 2012-07-23 18:47:01 -07:00
Strahinja Val Markovic
ad32584a10 Now reparsing clang files on buffer enter
This creates an auto PCH that speeds up code completion.
2012-07-23 18:45:00 -07:00
Strahinja Val Markovic
cfede619f2 Added flag to turn off clang completion if desired 2012-07-23 11:15:25 -07:00
Strahinja Val Markovic
6f0dc0b21d Explicitly calling OnBufferVisit for first file 2012-07-21 15:33:59 -07:00
Strahinja Val Markovic
ad859ee002 Using the pyeval func introduced in vim 7.3.584
This makes the whole plugin much faster since we now don't need to serialize and
deserialize the return values from python funcs before we can use them in Vim.
Oh God I've been waiting for something like this for so long... using this also
forces us to demand vim 7.3.584 or higher.
2012-07-21 10:10:19 -07:00
Strahinja Val Markovic
44b671c2c0 ClangCompleter now returs extra data
This data is used to show more information about the completions in the
completion menu.
2012-07-19 21:17:39 -07:00
Strahinja Val Markovic
be41be5323 Can now ignore filetypes plugin-wide 2012-07-16 14:44:50 -07:00
Strahinja Val Markovic
ae474483e7 Whitespace fix 2012-07-16 14:35:24 -07:00
Strahinja Val Markovic
c9e1706fa1 ClangCompleter now async and caches Clang data
First off, we don't block the GUI thread anymore for ClangCompleter (that was
always temporary). Secondly, now ClangCompleter will cache the data coming from
clang so that query-based filtering of members is fast.
2012-07-15 20:49:56 -07:00
Strahinja Val Markovic
27e1400558 ClangComplete now sorts completions based on query 2012-07-11 22:41:32 -07:00
Strahinja Val Markovic
e78e0400d9 Renamed CompletionSystem to IdentifierCompleter 2012-07-10 23:30:44 -07:00
Strahinja Val Markovic
39ecf76798 Renamed ClangComplete to ClangCompleter 2012-07-10 23:28:58 -07:00
Strahinja Val Markovic
5de395d9bb Storing the completion start column in Vim script
This way we don't have to recalculate it every time we call CandidatesForQuery
2012-07-10 15:39:59 -07:00
Strahinja Val Markovic
94288108d8 Initial, rough kinda working version ClangComplete
Many things need to be ironed out still.
2012-07-10 15:26:07 -07:00
Strahinja Val Markovic
1df2a5d360 Using cmake_cxx_flags instead of add_definitions 2012-07-09 13:58:56 -07:00
Strahinja Val Markovic
a8f095ec0a Completion now off for comments and strings 2012-06-24 12:04:45 -07:00
Strahinja Val Markovic
02a1f8780c Small refactoring of the ShouldAddIdentifier func 2012-05-12 20:42:45 -07:00
Strahinja Val Markovic
6696d79518 CursorHold is now tied to OnCursorHold func 2012-05-12 15:26:04 -07:00