Commit Graph

926 Commits

Author SHA1 Message Date
Strahinja Val Markovic
4af2ba0faa Option "shutdown_secs" is now "suicide_secs"
Calling the option server_idle_suicide_seconds should be easier to understand.
2013-10-23 12:33:27 -07:00
Strahinja Val Markovic
b2aa5e3d3f Moving client-only settings out of settings JSON
Since these options are only used on the client, they shouldn't be in
default_settings.json.
2013-10-23 12:30:13 -07:00
Strahinja Val Markovic
262d8aad03 New ycmd watchdog kills server when idle too long
Defaults are kill server after 12 hours of inactivity; the reason why it's 12
hours and not less is because we don't want to kill the server when the user
just left his machine (and Vim) on during the night.
2013-10-23 12:21:33 -07:00
Strahinja Val Markovic
78107361b3 Killing some dead code 2013-10-22 13:48:15 -07:00
Strahinja Val Markovic
5b76bcf8b7 GetDetailedDiagnostic actually takes 2 params
The Completer class version of the func only took 1 by mistake.
2013-10-22 13:46:24 -07:00
Strahinja Val Markovic
ce96a47098 Printing server PID in YcmDebugInfo 2013-10-22 10:53:31 -07:00
Strahinja Val Markovic
6d9969fa9c Surfacing ycmd server PID to user scripts
To get the PID, call function youcompleteme#ServerPid().
2013-10-22 10:51:37 -07:00
Strahinja Val Markovic
9d8fdac518 Minor cleanup of Completer comments 2013-10-18 12:35:40 -07:00
Strahinja Val Markovic
f6ca040cf7 Nth attempt at correct shutdown procedure.
If we install an explicit signal handler for SIGTERM and SIGINT and then call
sys.exit ourselves, atexit handlers are run. If we don't call sys.exit from the
handler, ycmd never shuts down. So fixed... I think. We'll see.

Fixes #577... again.
2013-10-17 22:15:17 -07:00
Strahinja Val Markovic
a5fb6b7509 Removing unsupported signal() calls on Windows
SIGQUIT and SIGHUP are not supported.

For details, see Python docs: http://docs.python.org/2/library/signal.html#signal.signal
2013-10-17 20:16:44 -07:00
Strahinja Val Markovic
6e9a16e90e Signal handler must take 2 params
Otherwise we get a TypeError
2013-10-17 20:14:56 -07:00
Strahinja Val Markovic
acae8e4e9d Tweaked the request retries logic.
We now send more retry requests that are less spaced apart.
2013-10-17 14:45:53 -07:00
Strahinja Val Markovic
40464f6e0d Resolving issues with event requests timing out
It appears that the issue comes from sending a None timeout to Requests. It
seems it's a bug in Requests/urllib3. So we just pick an arbitrary long timeout
of 30s as the default.
2013-10-17 14:21:37 -07:00
Strahinja Val Markovic
5070835d01 Ensuring server cleanup on OS signals
atexit won't run registered functions for SIGTERM which we send to the server.
This prevents clean shutdown.

Also making sure that the server logfiles are deleted as well.
2013-10-17 12:21:59 -07:00
Strahinja Val Markovic
b4d5b4ffbb More logging for extra conf store 2013-10-17 12:21:33 -07:00
Strahinja Val Markovic
5b37a2e36d Don't print traceback when no detailed diagnostic
We should only print the message.
2013-10-16 14:37:42 -07:00
Strahinja Val Markovic
18002e17df Better handling of crashed ycmd; restart command
Previously the YCM Vim client would go bonkers when ycmd crashed. Now the user
can continue using Vim just without YCM functionality.

Also added a :YcmRestartServer command to let the user restart ycmd if it
crashed. With a little luck, this will be rarely necessary.
2013-10-15 15:27:54 -07:00
Strahinja Val Markovic
436017bd4d Now using new ycm_client_support shared lib
This means we can now load just ycm_client_support (which is a much smaller
library) into Vim and ycm_core into ycmd. Since ycm_client_support never depends
on libclang.so, we never have to load that into Vim which makes things much,
much easier.
2013-10-15 14:15:04 -07:00
Strahinja Val Markovic
016434e846 Deleting some dead code 2013-10-14 20:46:42 -07:00
Strahinja Val Markovic
98f549aeae More robust way of picking an unused local port
Fixes #584.
2013-10-14 20:38:45 -07:00
Strahinja Val Markovic
b903867cdd ycm_core now imported after extra conf preload 2013-10-14 15:29:00 -07:00
Strahinja Val Markovic
bc607724f0 Ensuring ident completion works always
A bug turned it off when omni completion was available.

Fixes #583.
2013-10-14 13:29:28 -07:00
Strahinja Val Markovic
a534a58477 Checking if ultisnips data present before using it
Mentioned in issue #583, but it's not the root cause.
2013-10-14 12:32:18 -07:00
Strahinja Val Markovic
c3fcaf2b29 Strict 0.5s time budget for completion requests
Vim still loves to block the main GUI thread on occasion when asking for
completions... to counteract this stupidity, we enforce a hard budget of 0.5s
for all completion requests. If the server doesn't respond by then (it should,
unless something really bad happened), we give up.
2013-10-14 11:08:15 -07:00
Strahinja Val Markovic
a04ae37ead Client & server threads increased from 4 to 10 2013-10-11 20:12:04 -07:00
Strahinja Val Markovic
f6432e1498 Releasing Python's GIL in C++ code where possible
Without this, all requests to the server become effectively serialized.
2013-10-11 19:27:04 -07:00
Strahinja Val Markovic
3ae10395ea Preventing Vim thread block on file save
Syntastic would run SyntasticCheck on file save, which would unconditionally
call _latest_file_parse_request.Response() and thus block until the request
returned from the server. We don't want that, so we throw in an explicit check
for the request being ready.
2013-10-11 19:09:21 -07:00
Strahinja Val Markovic
db45e243dd Getting path to python exe on Windows correctly
Fixes #581.
2013-10-11 11:11:02 -07:00
Strahinja Val Markovic
78e3607b00 We now only run extra conf preload for global file
This changes functionality, but since this is an undocumented, non-public API,
it's fine. The reason this is required is because of issue #579; if we try to
run extra conf preload on non-global extra conf, we might not have the
permission to load it. The global extra conf is something the user explicitly
has to set so it's always fine to load that.
2013-10-10 12:55:49 -07:00
Strahinja Val Markovic
7a73eb14d8 Fix problems with unknown extra conf at ycmd start
Fixes #579.
2013-10-10 11:32:20 -07:00
Strahinja Val Markovic
8ce07f508c <c-space> again filters the semantic completions
Fixes #576.
2013-10-09 20:20:34 -07:00
Strahinja Val Markovic
98ef568359 Refactored the popen call for ycmd
Also removed shell = true in the other branch that calls popen
2013-10-09 19:28:27 -07:00
Strahinja Val Markovic
9482ad189e Using full path to Python in popen call
This is the root of the problem in issue #577.

Fixes #577.
2013-10-09 19:18:36 -07:00
Strahinja Val Markovic
a25ed01a7c Starting ycmd without shell = True
This should make it easier to shut down the server on some machines.

Fixes #577.
2013-10-09 17:00:28 -07:00
Strahinja Val Markovic
70a51be209 Making the cs_completer test less flaky 2013-10-09 13:17:53 -07:00
Strahinja Val Markovic
3b057cc667 Basic integration test for the cs_completer 2013-10-08 21:30:53 -07:00
Strahinja Val Markovic
d84f2b0e8e cs_completer works again 2013-10-08 20:52:04 -07:00
Strahinja Val Markovic
7afd76b4d4 Better url joining in base_request 2013-10-08 20:49:00 -07:00
Strahinja Val Markovic
daa0d50655 Removed the logging code from Clang completer
The exceptions are already logged by Bottle so what's the point.
Also removed an outdated TODO.
2013-10-08 20:20:15 -07:00
Strahinja Val Markovic
3dbd407f7a Adding forgotten test file 2013-10-08 19:02:20 -07:00
Strahinja Val Markovic
3d55748400 Correctly handling ycm_extra_conf files now
The user is asked about loading unknown extra conf files, as they were before.
2013-10-08 16:21:43 -07:00
Strahinja Val Markovic
f0650ddc7f Minor style fixes 2013-10-07 16:53:41 -07:00
Strahinja Val Markovic
ebb1627f2e Resolving a minor TODO
/filetype_completion_available handler renamed to /semantic_completion_available
2013-10-07 16:28:40 -07:00
Strahinja Val Markovic
5000d2e4ae NativeFiletypeCompletionAvailable now a local call
It used to block on the server to get the data. Now it doesn't anymore. This
speeds up Vim startup.
2013-10-07 16:10:48 -07:00
Strahinja Val Markovic
c7be1f1b47 Omni completion works again 2013-10-07 15:47:48 -07:00
Strahinja Val Markovic
4b73739b09 Removing some obsolete todos 2013-10-07 14:21:46 -07:00
Strahinja Val Markovic
1db0e720bc Refactored the server tests for simplicity 2013-10-07 13:59:01 -07:00
Strahinja Val Markovic
ff7fa74fc9 <c-space> works again (forces semantic completion) 2013-10-07 13:09:34 -07:00
Strahinja Val Markovic
99b0f018b3 Adding a minor TODO 2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
a836f68142 Fileype completer calls InCFamilyFile correctly 2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
a9d7105e1b YCM now working on new buffers with ft set
We used to demand a name be set for the buffer.

Fixes #568.
2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
915d092364 Prefixing clang version with "Clang version"
It's easier to know what that magic string is actually referring to.
2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
1bba4a38cc Ensuring the temp dir exists before returning it 2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
f0c9878f87 Ensuring we are serializing real Python objects
Trying to json.dump Vim dictionaries fails.
2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
cb98dc8537 Fixing python 2.6 compatibility
string.format() requires the number inside '{}' for Python 2.6.
2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
070d39b2a9 Adding a run_tests script
This is now also used by Travis CI.
2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
9747bbc26f Removing the sys.path changes from jedi_completer
This not needed anymore, the correct path to jedi is added to sys.path in
ycmd.py
2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
da723b1425 Moving Jedi under third_party 2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
5902a5e521 frozendict now as submodule in third_party 2013-10-07 11:03:30 -07:00
Strahinja Val Markovic
88a260d448 ycmd now uses Waitress instead of CherryPy 2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
8bc888d711 Vim now loads most defaults from the json file 2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
afa1afc49b Handling no diagnostic data from event response 2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
c43327d176 YcmShowDetailedDiagnostic works again 2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
159a8ecdfa YcmDiags and ForceCompilation work again 2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
62f813367d settings.json has integers for 1/0, not strings 2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
54255318f1 Changing line endings for settings.json to unix 2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
c274b7d4f8 Fixing the diagnostic-related race conditions
Now, every FileReadyToParse event returns diagnostics, if any. This is instead
of the previous system where the diagnostics were being fetched in a different
request (this caused race conditions).
2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
b9bb788a2a Diagnostics work again... somewhat.
There appear to be timing issues for the diag requests. Somehow, we're sending
out-of-date diagnostics and then not updating the UI when things change.

That needs to be fixed.
2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
e44fd87582 Added 'gitcommit' to filetype-completion blacklist 2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
5ef945fa0a Adding 'qf' (quickfix) filetype to ignore list 2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
7248979bb4 We now handle the starting FileReadyToParse event
The problem was that when you start vim like "vim foo.cc", the FileReadyToParse
event is sent to the server before it's actually started up. Basically, a race
condition.

We _really_ don't want to miss that event. For C++ files, it tells the server to
start compiling the file.

So now PostDataToHandlerAsync in BaseRequest will retry the request 3 times
(with exponential backoff) before failing, thus giving the server time to boot.
2013-10-07 11:03:29 -07:00
Strahinja Val Markovic
9742302cbd 'get_completions' handler is now 'completions' 2013-10-07 11:03:28 -07:00
Strahinja Val Markovic
9d0a6c96d7 Event and completion request are now async
This results in a much snappier Vim.
2013-10-07 11:03:28 -07:00
Strahinja Val Markovic
fe94ed6b1c Removing an outdate TODO 2013-10-07 11:03:28 -07:00
Strahinja Val Markovic
ec920b2758 Adding WebTest to pip test dependencies 2013-10-07 11:03:28 -07:00
Strahinja Val Markovic
6c53bad58f No more threading in completers!
The server is multi-threaded and will spawn a new thread for each new request.
Thus, the completers need not manage their own threads or even provide async
APIs; we _want_ them to block because now were implementing the request-response
networking API.

The client gets the async API through the network (i.e., it can do something
else while the request is pending).
2013-10-07 11:03:28 -07:00
Strahinja Val Markovic
e38d145a47 Added debug info about the server
Location where running + logfiles location
2013-10-07 11:03:28 -07:00
Strahinja Val Markovic
3ca758a581 Getting debug info works again 2013-10-07 11:03:28 -07:00
Strahinja Val Markovic
c9b4e9ed3a Minor code style changes 2013-10-07 11:03:28 -07:00
Strahinja Val Markovic
1027de73fb Using a constant for server error instead of 500 2013-10-07 11:03:28 -07:00
Strahinja Val Markovic
446d02f66e Subcommand name completion works again 2013-10-07 11:03:28 -07:00
Strahinja Val Markovic
718e9974b7 Resolving symlinks in GoTo target filepath 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
a6a364de41 Fix bug in cache clear clang completer subcommand 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
4a95c2fc7c GoTo commands for clang completer work again 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
fe0c0a1607 GoTo commands work again 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
13b86563f0 Minor code formatting changes 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
5b4b3ed281 LOGGER now set to None by default
Init happens in test setup func or Main
2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
4c6a69b432 The UltiSnips completer works again 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
bf5708c422 NativeFiletypeCompletionAvailable works again 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
bdd769d043 default_settings.json now actually has defaults 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
4ac5466d80 Renaming server.py to ycmd.py 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
dd2445db06 Passing user options as file to server
This is a much better idea than starting the server in a default state, and then
resetting the state with a POST request.
2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
10469d318d Passing user options to server now 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
387621d957 Moving SendCommandRequest into appropriate module 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
c01bc0481a Refactoring the server tests to use a helper func
This makes the tests smaller, less repetitive and easier to maintain.
2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
3b9b9ed036 Ident completer loads syntax keywords again 2013-10-07 11:03:27 -07:00
Strahinja Val Markovic
c527cda436 Only calling Shutdown on valid Completers 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
c29dc44b38 Whitespace fix 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
9a4707f2c6 Ignoring failed event notifications
These happen rarely and are not a big deal when they do. We still log them to
the Vim message area, but we don't annoy the user with the default, in-your-face
Python traceback.
2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
17716ff51f Whitespace fix 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
088eb4d0d2 Cleaner server shutdown
Listening for VimLeave was sub-optimal. popen.terminate() is much cleaner.
2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
f51a687297 Server now shuts down cleanly on VimClose 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
1730660555 A (barely) working version of ycmd + client
Still a lot of work to do.
2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
02b88dccf1 extra conf store now vim-free 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
fba4477ca3 Deleting a stray 'print' statement
This was put in for debugging at some point.
2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
1d29a9a3bd Updating Jedi to v0.7.0 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
f5ad981f67 Converting Jedi unicode data to strings 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
9698bf8789 Bump ycm_core.so API version 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
08a9ff59b6 Using os.getcwd instead of getcwd from vimscript 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
b6c311c4dd Code typo fix 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
6acc381262 Identifier completer now fully decoupled from Vim 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
a7c609efd7 More python unicode object support in ycm_core 2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
3f0b719846 Encoding data to utf8 if 'unicode' object
ycm_core only deals with utf8 and the functions only accept python string
objects.
2013-10-07 11:03:26 -07:00
Strahinja Val Markovic
29bb90a6b4 Decoupling completers from Vim; still WIP & broken
Note to self: squash this commit before merging into master.
2013-10-07 11:03:25 -07:00
Strahinja Val Markovic
bd374a7096 Completer access now through CompletionRequest
This will make it easier to put Completers in the server.
2013-10-07 11:03:25 -07:00
Strahinja Val Markovic
28c3d9648c Deleting some dead code 2013-10-07 11:03:25 -07:00
Strahinja Val Markovic
6d29f429bb Adding the frozendict module
Upstream: https://github.com/slezica/python-frozendict
2013-10-07 11:03:25 -07:00
Strahinja Val Markovic
a26243092f Now more explicit about accessing user options
We don't inspect the Vim process anymore when we want an option; we parse the
options on startup and then use that data structure.
2013-10-07 11:03:25 -07:00
Strahinja Val Markovic
1d224eb8b4 Indentation fix 2013-10-07 11:03:25 -07:00
Strahinja Val Markovic
cb74119353 Minor code style fixes 2013-10-07 11:03:25 -07:00
Strahinja Val Markovic
22256f361d ShouldUseNow now takes a current_line param
This is now used instead of examining the vim.current.line property.
2013-10-07 11:03:25 -07:00
Strahinja Val Markovic
a077f85ecd extra conf path handling now OS-agnostic
It used to work incorrectly on Windows.

Fixes #490.
2013-08-25 10:44:45 -07:00
Strahinja Val Markovic
9d34fad24f Now parsing file on every normal mode cursor move
This is still fast & efficient because if we detect that the buffer hasn't been
changed (by examining b:changedtick), the parse doesn't proceed.

In effect, we now make sure we parse the file after every change to the buffer
as soon as that change happens. This means that compilation error feedback will
now be much, MUCH quicker.
2013-08-16 14:49:00 -07:00
Chiel92
44786c58ef Merge https://github.com/Valloric/YouCompleteMe 2013-08-16 21:03:39 +02:00
Chiel92
3c5a720835 Some minor fixes 2013-08-16 21:00:26 +02:00
Chiel92
cd6491290f flake fix and readme update 2013-08-16 11:11:32 +02:00
Chris
039ffa5a75 OmniSharp completer error message using incorrect naming format
The not found message used to instruct users on how to install the OmniSharp completer was using an underscore while the argument to the install script uses a hyphen. The message now uses the correct naming format.
2013-08-15 21:29:27 -07:00
Chiel92
6b73f3fde4 Goto definition implemented 2013-08-15 12:17:42 +02:00
Chiel92
bba97eb38b ServerIsRunning pitfall eliminated 2013-08-15 11:50:54 +02:00
Strahinja Val Markovic
0215a5b8c5 Show server location for C# completer debug output 2013-08-14 19:21:20 -07:00
Strahinja Val Markovic
40146b923d Minor code style changes 2013-08-14 18:57:41 -07:00
Chiel92
66f4136526 minor style fixes 2013-08-14 17:02:10 +02:00
Chiel92
8f63ec9e09 Merge https://github.com/Valloric/YouCompleteMe 2013-08-14 16:35:55 +02:00
Chiel92
b2c85d7060 simple debug info added 2013-08-14 16:34:44 +02:00
Chiel92
253c5b39ac default logfiles and some refactoring 2013-08-14 15:40:43 +02:00
svermeulen
65bca8b56a Added option to control whether YCM should auto-stop the omnisharp server upon leaving Vim or leave it running. 2013-08-12 16:11:19 -03:00
Strahinja Val Markovic
cb89c3f477 Minor code style fixes 2013-07-31 21:39:34 -07:00
Strahinja Val Markovic
4374da616e Fix crash: posting Vim message from thread
Vim is not thread-safe so posting a message to Vim from a non-GUI thread causes
a crash *sometimes*. I was aware of this problem before, but didn't catch this
instance of it in code review.

Fixes #479.
2013-07-30 11:20:52 -07:00
Chiel92
60e52f1a39 style fixes 2013-07-19 12:16:16 +02:00
Chiel92
a56041156e Merge branch 'C#MultipleOmniSharps' of https://github.com/mispencer/YouCompleteMe into multiple_sln
Conflicts:
	python/ycm/completers/cs/cs_completer.py
2013-07-19 11:55:25 +02:00
Chiel92
3f23893576 Merge branch 'master' of https://github.com/Chiel92/YouCompleteMe into multiple_sln
Conflicts:
	python/ycm/completers/cs/cs_completer.py
2013-07-19 11:31:52 +02:00
Chiel92
92032d7f54 Merge branch 'master' of https://github.com/Chiel92/YouCompleteMe into multiple_sln 2013-07-19 10:25:30 +02:00
Hinidu
e6183d6402 Fix code style 2013-07-18 18:18:17 +03:00
Hinidu
642572130c Add mono to command for non-windows systems 2013-07-18 13:35:46 +03:00
Strahinja Val Markovic
7aa01b9c09 More style fixes + more status reporting to :mes 2013-07-17 19:29:43 -07:00
Strahinja Val Markovic
33a05a4b42 Minor style fixes 2013-07-17 18:30:56 -07:00
Chiel92
44eaf5a0da Merge https://github.com/Valloric/YouCompleteMe
Conflicts:
	install.sh
2013-07-16 20:59:26 +02:00
Chiel92
485457af5d Apparently tested an unsaved file -_- 2013-07-16 16:12:40 +02:00
Chiel92
3617ce69db style fixes 2013-07-16 12:33:07 +02:00
Spencer G. Jones
1a7da1650c Find a free port for OmniSharp if another OmniSharp is using the default port 2013-07-15 09:12:32 -06:00
Chiel92
e15ec6ee93 minor refactoring PR #2 2013-07-13 20:11:59 +02:00
Spencer G. Jones
3737ca2ef4 Optionally write OmniSharp stdout and stderr to log files 2013-07-12 14:46:33 -06:00
Chiel92
a6a9fa10c3 pointed submodule to newest commit 2013-07-10 11:27:55 +02:00
Strahinja Val Markovic
ddd0287436 Code style fixes 2013-07-08 16:00:06 -07:00
Strahinja Val Markovic
a011eb6aa0 Fix duplicate entries in filename completion
We could just remove the "dup: 1" part in the completion dict, but that would
leave the duplicate removal up to Vim which would be slow. Also, we might not
end up returning the correct number of results then.
2013-07-08 15:56:54 -07:00
Chiel92
3227e6dc73 checkalivestatus rename 2013-07-08 14:39:43 +02:00
Chiel92
9250f55952 minor fix 2013-07-08 11:44:06 +02:00
Chiel92
bdd95ff43f variable for csharp server port added 2013-07-08 11:39:17 +02:00
Chiel92
6ec038870b ServerIsRunning fixed and variable defaults set 2013-07-08 11:22:17 +02:00
Chiel92
34c24129d2 Merge https://github.com/Valloric/YouCompleteMe 2013-07-07 22:37:10 +02:00
Chiel92
2f207cb4c6 autostart/stop server 2013-07-07 22:36:05 +02:00
Val Markovic
f7ef1aa041 Merge pull request #424 from beards/master
fix jedi DeprecationWarning
2013-07-07 11:13:22 -07:00
Strahinja Val Markovic
451acc0073 Adding OnVimLeave support to Completer class 2013-07-07 11:00:45 -07:00
Chiel92
d2a7fe9c0e choice for multiple solutionfiles implemented 2013-07-07 13:28:28 +02:00
Chiel92
2743f96529 Starting subprocess is working now 2013-07-07 13:06:07 +02:00
simon_hsiung
a95195c8e8 fix jedi DeprecationWarning 2013-07-05 08:52:53 +00:00
Strahinja Val Markovic
cbc6c07a1a Encouraging the user to read the docs even more
Apparently we weren't encouraging enough before. Related to issue #415.
2013-07-01 11:34:25 -07:00
Strahinja Val Markovic
5496984931 Option to set min length for suggestions
Only works with the identifier completer. Fixes #387.
2013-06-29 15:43:10 -07:00
Strahinja Val Markovic
04ca6ec4de g:ycm_semantic_triggers now only adds new triggers
Fixes #164.
2013-06-29 11:53:16 -07:00
Chiel92
e453c2b772 bugfix in solutionfile detector 2013-06-29 10:41:45 +02:00
Chiel92
faa6cf3f36 several fixes 2013-06-28 21:15:05 +02:00
Chiel92
37eb1b7521 added omnisharp server as submodule 2013-06-26 11:51:52 +02:00
Chiel92
a69d827934 solution file detection ported 2013-06-21 22:26:11 +02:00
Strahinja Val Markovic
280c704814 Using the new clang 3.3 headers 2013-06-19 21:58:53 -07:00
Chiel92
6dc4b38625 first throw 2013-06-13 23:34:34 +02:00
Strahinja Val Markovic
18ef728742 Updating the error message for ycm_core loading 2013-06-12 10:38:49 -07:00
Strahinja Val Markovic
e740bac1f6 Better completion in the middle of a word
For instance (`|` represents the cursor):
  1. Buffer state: `foo.|bar`
  2. A completion candidate of `zoobar` is shown and the user selects it.
  3. Buffer state: `foo.zoobar|bar` instead of `foo.zoo|bar` which is what the
  user wanted.

This commit resolves that issue.

It could be argued that the user actually wants the final buffer state to be
`foo.zoobar|` (the cursor at the end), but that would be much more difficult
to implement and is probably not worth doing.

Fixes #374.
2013-06-09 19:00:49 -07:00
Strahinja Val Markovic
8fe41c7c73 Clarifying a comment. 2013-06-09 17:31:17 -07:00
Chiel92
48a4b324f4 moved vim.eval to init 2013-06-09 11:22:11 +02:00
Chiel92
1f91c59938 echoerr replaced by postvim message 2013-06-08 10:16:22 +02:00
Chiel92
a6424c22d8 displaytext and description swapped 2013-06-07 11:45:36 +02:00
Chiel92
7d7349142c completer rewritten to fit in the changed api 2013-06-04 12:14:12 +02:00
Strahinja Val Markovic
3948b6efe2 Check for empty flags list
IndexErrors are not fun.
2013-05-28 09:43:13 -07:00
Strahinja Val Markovic
973064d0bd Can now seed identifier database with keywords
By toggling the g:ycm_seed_identifiers_with_syntax option, the user can now tell
YCM to seed the identifier database with the language's keywords.

This is off by default because it can be noisy. Since the identifier completer
collects identifiers from buffers as the user visits them, the keywords that the
user cares about will already be in the database, regardless of the state of the
new option. So the only keywords added will be the ones the user is not using.

Meh. But people want it so there.

Fixes #142.
2013-05-27 00:08:21 -07:00
Strahinja Val Markovic
454a961318 The identifier completer now reads tags files
See the docs for details. Fixes #135.
2013-05-26 13:33:40 -07:00
Strahinja Val Markovic
38faa0e94e Adding the ClearCompilationFlagCache subcommand
With this command the user can clean the in-memory cache of the compilation
flags that the clang completer uses.
2013-05-24 14:48:46 -07:00
Strahinja Val Markovic
d9f45d576f Fix breakage of some compile_commands.json users
Depending on the user, the PrepareClangFlags rewrite of a few commits ago could
break users with an extra "clang: 'linker' input not used" (or similar) error
message because the compiler executable string was not removed from flags
upstream if the user prepended some flags to the output of PrepareClangFlags
before returning it to the caller of FlagsForFile.

Since the rewrite was supposed to be backwards compatible, this needs
to be handled.
2013-05-24 14:29:33 -07:00
Strahinja Val Markovic
11a7746753 Preventing possible TypeError with StringVec
It was possible to get a traceback if results[ 'flags' ] was a StringVec; the
code would try to perform results[ 'flags' ] += self.special_clang_flags and
this would then fail because the clang flags would be a Python list.
2013-05-22 15:47:30 -07:00
Strahinja Val Markovic
4389b1f1d8 API docs for ThreadedCompleter 2013-05-20 09:40:04 -07:00
Strahinja Val Markovic
381b86d595 Fixing python tests broken in rename 2013-05-19 20:06:14 -07:00
Strahinja Val Markovic
087cadcfaf Adding back the Jedi submodule 2013-05-19 19:47:34 -07:00
Strahinja Val Markovic
faa225fdc4 Moving everything under pytho/ycm 2013-05-19 19:44:42 -07:00
Strahinja Val Markovic
acb9099bb9 Removing jedi submodule 2013-05-19 19:37:43 -07:00
Strahinja Val Markovic
357fd98747 Tests for helper functions in flags.py 2013-05-19 14:20:13 -07:00
Strahinja Val Markovic
45cbc7da7f Calling PrepareClangFlags is not needed anymore
ycm_extra_conf.py files used to import clang_helpers and then use the
PrepareClangFlags function; this is now unnecessary since the logic from that
function has been moved to flags.py. The old PrepareClangFlags function is still
there (it just returns the flags it gets) for the sake of backwards
compatibility with old ycm_extra_conf.py files.
2013-05-19 10:48:23 -07:00
Strahinja Val Markovic
4978546e62 Refactoring out some pointless sys.path changes 2013-05-19 10:35:42 -07:00
Stanislav Golovanov
df7d51aeda Use new Jedi API for keyword checking in goto funcs
Fixes #320
2013-05-18 23:47:49 +04:00
Stanislav Golovanov
9f1f329823 switch to upstream Jedi API
This replaces deprecated API calls to the new ones. Also this
partially fixes #320.
2013-05-18 09:40:08 +04:00
Strahinja Val Markovic
4b039e2102 Using BufUnload instead of BufDelete
Seems to be more robust. This should help with memory consumption when using the
clang_completer. See issue #184.
2013-05-11 13:49:48 -07:00
Strahinja Val Markovic
7bb7e20f8d Revert "[filename_completer] Append '/' to [DIR] automatically"
This reverts commit 48d6a5378c.
2013-05-11 12:24:35 -07:00
Zhao Cai
48d6a5378c [filename_completer] Append '/' to [DIR] automatically 2013-05-11 02:21:19 -04:00
Strahinja Val Markovic
2b23245422 Minor refactoring & style cleanup 2013-05-09 20:28:04 -07:00
Val Markovic
48281d1379 Merge pull request #304 from JazzCore/subcommand_complete
Add subcommand completion for :YcmCompleter command
2013-05-09 20:21:26 -07:00
Val Markovic
3a984f938e Merge pull request #308 from JazzCore/fix_307
fix IndexError when min_num_of_chars is set to 0
2013-05-09 20:15:40 -07:00
Strahinja Val Markovic
0c19ee4fa7 Updating to latest Jedi 2013-05-09 11:08:11 -07:00
Stanislav Golovanov
e5c99428f3 fix IndexError when min_num_of_chars is set to 0
Fixes #307. Error is thrown when g:ycm_min_num_of_chars_for_completion
option is set to 0 user tries to delete an identifier which starts at
the beginning of the line.
2013-05-09 22:02:47 +04:00
Stanislav Golovanov
0edec9c95a Add subcommand completion for YcmCompleter command 2013-05-09 21:55:55 +04:00
Stanislav Golovanov
54fabc1816 style fixes 2013-05-05 13:27:23 +04:00
Stanislav Golovanov
54e6a9f594 Add GoToDefinitionElseDeclaration for python 2013-05-04 22:48:27 +04:00
Stanislav Golovanov
f246f5b8c6 remove not needed type casting 2013-05-04 22:47:37 +04:00
Stanislav Golovanov
c2024edbaa Add GoTo features for python
This adds a Go To Definition and Go To Declaration features for
python.
2013-05-04 03:11:10 +04:00
Strahinja Val Markovic
df7026e9b6 Fix error on YcmDebugInfo in quickfix window
Fixes #283
2013-04-28 15:52:22 -07:00
Strahinja Val Markovic
209f2fd777 Minor refactoring for simplicity 2013-04-26 22:32:22 -07:00
Strahinja Val Markovic
5207918432 Fix bug with [File] being shown instead of [Dir]
This is for filename completion in the case of C-family include completion. The
path was being assembled incorrectly so os.isdir() was getting the wrong path
and then could not see was it a directory.
2013-04-26 14:10:48 -07:00
Strahinja Val Markovic
840930ce09 Fixing minor regressions from general store commit
A few Completer methods that should have been forwarded to general completers
were not. This broke the identifier completer picking up the current identifier
right after it's typed in.
2013-04-25 15:36:56 -07:00
Stanislav Golovanov
4d138b2b7f fix UnicodeEncodeError in ultisnips_completer
Fix a rare exception when a description of UltiSnips snippet contains
unicode symbols.

Fixes #274
2013-04-26 00:42:02 +04:00
Strahinja Val Markovic
a9215f10fe Including current file dir for #include "" form
Relevant to issue #273
2013-04-25 12:56:32 -07:00
Strahinja Val Markovic
663873255f Filename completer now uses include paths
It's also smart enough to trigger filename completion right after '#include "'.

Fixes #261
2013-04-24 22:51:53 -07:00
Strahinja Val Markovic
3ae9764451 Force filename completer on #include 2013-04-24 19:59:14 -07:00
Strahinja Val Markovic
7500a94cda Use OnBufferVisit in ultisnips completer
This is instead of OnFileReadyToParse which is called every time the users stops
typing.
2013-04-24 13:31:28 -07:00
Strahinja Val Markovic
8c0a9bc90e Fixing rare hang issue with ultisnips completer
The issue was that AsyncCandidateRequestReady in the ultisnips completer would
always return false if there were no snippets for the current filetype, leading
to an infinite loop in CompletionsForQuery.

Fixes #270.
2013-04-24 13:07:56 -07:00
Strahinja Val Markovic
3258f324dd Merge branch 'JazzCore-general_completers'
Conflicts:
	python/ycm.py
2013-04-22 22:37:32 -07:00
Strahinja Val Markovic
196228217f Filename completer now uses threads
This was done by introducing a new ThreadedCompleter class that descends from
Completer. Both JediCompleter and FilenameCompleter descend from
ThreadedCompleter.
2013-04-22 22:30:10 -07:00
Strahinja Val Markovic
8d20637295 User can now pick the root for relative paths 2013-04-22 22:30:10 -07:00
Strahinja Val Markovic
aa9127e3dc Rewriting the code from the pull request
This implements the filename completer and introduces integration with
UltiSnips. The user will now see snippets in the completion menu. After
selecting a snippet, the user should invoke the UltiSnips trigger key
(which should be changed from the default of TAB) to trigger the snippet
expansion.

Fixes #77, Fixes #36
2013-04-22 22:26:35 -07:00
Stanislav Golovanov
bb5839dd74 Add general filename completer & other stuff 2013-04-22 22:24:38 -07:00
Strahinja Val Markovic
14b2220f01 Supporting YcmCorePreload logic
Now the user has the option of writing custom logic before ycm_core.so is
loaded. This can be used to dynamically change the location of where ycm_core.so
is loaded by prepending paths to sys.path.

Very, very few people will need this feature, but I'm one of them so there.
2013-04-22 10:31:16 -07:00
Strahinja Val Markovic
aea154e829 Refactoring ycm_extra_conf handling into module 2013-04-22 10:31:16 -07:00
Stanislav Golovanov
5d37c40fea Add general UltiSnips snippet completer 2013-04-21 01:28:37 +04:00
Stanislav Golovanov
48cda3bb8f Add general completers support 2013-04-21 01:28:37 +04:00
Strahinja Val Markovic
93ed6f7db7 Fix bug with removing flag after "-c"
-c does not take an argument. Why did I think it did?
2013-04-19 10:31:55 -07:00
Thomas Refis
dad08df71b checking if a key is in a dict is done with 'key in dict' not 'hasattr(dict, key)' 2013-04-13 14:29:57 +02:00
Jacek Lach
1b4eb6122c Make caching optional in the omnicompleter 2013-04-11 10:22:16 +01:00
Strahinja Val Markovic
77fbd80c89 Refactoring out some vim.eval calls
s:completion_start_column should not be evaled in Python code. That was a
stopgap measure that ended up lasting far longer than intended.
2013-04-09 19:32:48 -07:00
Strahinja Val Markovic
27d73e0d51 Removing some dead code 2013-04-09 18:43:29 -07:00
Strahinja Val Markovic
085df7e8af Fix traceback print on None for |location|
This happens when the user invokes a GoTo* command on a file with no compilation
flags.
2013-04-08 11:15:27 -07:00
Strahinja Val Markovic
a75c92bb6a Using event.is_set to be compatible with Python2.6
Fixes #227
2013-04-03 19:14:46 -07:00
Strahinja Val Markovic
8e4a2e24f8 Ignoring mappings in our vim 'normal' invocation 2013-03-31 21:01:38 -07:00
Strahinja Val Markovic
1f094e50d0 GoToDefinition/Declaration commands for C-family
These are accessible through the :YcmCompleter command. The docs have more
information.
2013-03-31 20:38:29 -07:00
Strahinja Val Markovic
b4837c81fe Handling exceptions in jedi_completer thread 2013-03-24 18:52:50 -07:00
Strahinja Val Markovic
edbcb3abfe More cleanup for correctness and simplicity
The jedi completer now won't hang on <C-Space>
2013-03-24 18:42:31 -07:00
Strahinja Val Markovic
9845d81fb0 More style fixes 2013-03-24 15:22:31 -07:00
Strahinja Val Markovic
6fb784e61b Making the python thread not hang Vim on exit
As the Pytho docs say, "The entire Python program exits when no alive non-daemon
threads are left." Basically, the daemon threads are safely killed.
2013-03-24 15:04:00 -07:00
Strahinja Val Markovic
1c78971acd More style fixes 2013-03-24 14:57:25 -07:00
Strahinja Val Markovic
8f2715c1a4 Posting an error message when jedi import fails 2013-03-24 14:52:11 -07:00
Strahinja Val Markovic
4d95e32a1e Python code style fixes 2013-03-24 14:41:22 -07:00
Strahinja Val Markovic
0954ff31d9 Bug fixes for the new python semantic completer 2013-03-24 14:38:55 -07:00
Stephen Sugden
eed0434e39 Refactor jedi-completer to use a worker thread 2013-03-23 19:24:26 -07:00
Stephen Sugden
da46be7044 Add jedi-based completion.
This first version only uses the Jedi completion engine after a ".", similar to
how the ClangCompleter works. It is also entirely synchronous and blocks for
quite a while the first time it is called.
2013-03-23 16:21:49 -07:00
Strahinja Val Markovic
74021144c0 Making the omni completer more robust
- There was a bug in not calling int() on the result of the first call to the
omnifunc.
- We need to be more resilient to badly written omnifuncs and check that the
result of the second call is a list or a dict with a list, as the vim docs say
the omnifunc should return on the second call.

One of the two fixes probably fixes #198 but since I can't repro the error, I
can't be sure.
2013-03-22 10:26:18 -07:00
Strahinja Val Markovic
d0a51fbf2c More info for conf file load dialog message
The user is now informed of options that can turn off this dialog.
2013-03-19 12:59:17 -07:00
Strahinja Val Markovic
4cb9f17c5f Cache deletion is now async 2013-03-16 12:10:24 -07:00
Strahinja Val Markovic
c391bdcc62 Reducing RAM consumption by deleting unused caches
When the user deletes a buffer, we can delete the clang caches for that file.
Fixes #184.
2013-03-16 10:41:47 -07:00
Strahinja Val Markovic
ba6b40e485 Refactoring the ClangAvailableForBuffer method 2013-03-03 10:48:34 -08:00
Zeh Rizzatti
c6aefaef86 Select correct triggers for multiple filetypes
The base class completer Inner chose the first filetype available and
would use the triggers for it.

The triggers are now chosen considering the first for the current buffer
that is supported by the current completer. If there is no intersection,
it fallsback to considering the first filetype for the buffer.
2013-03-03 01:52:56 -04:00
Zeh Rizzatti
ac1e04fc14 Check for a native completer with multiple filetypes
GetFiletypeCompleter would always return a omnicompleter for the first
filetype in case there was no native completer, and the lookup would
stop.

This changes that behaviour to get all possible completers and tries to
find a native one among them. If no native completer is found, it
returns the omnicompleter for the first filetypes, as it used to.
2013-03-02 22:14:22 -04:00
Zeh Rizzatti
1acd3e84c7 Support for multile filetypes in clang_completer
clang_completer would check if the raw value of '&ft' was one of
supported filetypes for the completer.

Vim allows for multiple filetypes with a '.' separator. A file with
ft=qt.cpp, for example, would not be supported by clang_completer even
though it was a cpp file.

This patch changes that behaviour.
2013-03-02 22:02:29 -04:00
Strahinja Val Markovic
980a1c2ffc Minor post-PR changes 2013-02-28 09:54:22 -08:00
Strahinja Val Markovic
aafcd4264d Merge branch 'globlist' of github.com:kljohann/YouCompleteMe into kljohann-globlist
Conflicts:
	python/completers/cpp/flags.py
2013-02-28 09:51:38 -08:00
Val Markovic
c24d272df6 Merge pull request #155 from kljohann/reload
Implement completer-specific commands
2013-02-28 09:49:11 -08:00
Johann Klähn
1d566bad80 Implement white-/blacklisting 2013-02-28 18:15:09 +01:00
Johann Klähn
3d305f9c74 Implement completer-specific commands
This provides a framework for completer-writers to create
completer-specific commands. I have in mind to use this for the clang
completer to force reloading of a flags module via `:YcmCompleter reload`.
2013-02-28 11:32:07 +01:00
Strahinja Val Markovic
263b405ab4 Very minor post-pull style-related changes. 2013-02-26 18:28:58 -08:00
Strahinja Val Markovic
95b9eeee18 Merge branch 'master' of github.com:kljohann/YouCompleteMe into kljohann-master 2013-02-26 18:21:46 -08:00
Johann Klähn
e9cce29761 Ask before loading .ycm_extra_conf.py files
To prevent the execution of malicious code the new default is
to ask the user before a `.ycm_extra_conf.py` file is loaded.
This can be disabled using the option `g:ycm_confirm_extra_conf`.

This commit introduces a helper class `FlagsModules` that keeps track of
and caches the currently loaded modules. To introduce further criteria
for a module look at `FlagsModules.ShouldLoad`.

Also `:YcmDebugInfo` now lists the file that was used to determine
the current set of flags.

`Flags.ModuleForFile` could be used in a user-facing command that
opens the `.ycm_extra_conf.py` corresponding to the current file.
A second command could then force a reloding of this module via
`Flags.ReloadModule`.
2013-02-26 11:16:26 +01:00
Johann Klähn
4b3e0a1895 Add code to ask user for confirmation in vimsupport 2013-02-25 10:50:44 +01:00
Johann Klähn
70a2a722fe Add GetBoolValue helper in vimsupport 2013-02-25 10:50:39 +01:00
Strahinja Val Markovic
c819c9f31e Typo fix 2013-02-23 13:08:56 -08:00
Strahinja Val Markovic
98ff82ece5 Removing falsy items from omnifunc returned items
Depending on the omnifunc the user has set, it could return empty strings etc in
the list of items.

Fixes #146, fixes #147
2013-02-23 09:55:13 -08:00
Strahinja Val Markovic
c1700c7d19 Handle omnifunc returning dict with 'words' 2013-02-23 09:35:07 -08:00
Strahinja Val Markovic
101d949a88 Splitting echo text on \n and echoing lines 2013-02-21 10:50:38 -08:00
Strahinja Val Markovic
e60928d721 Updating error message on missing ycm_extra_conf 2013-02-20 13:16:18 -08:00
bear
66289d7522 let g:ycm_global_ycm_extra_conf can use "~" 2013-02-18 15:10:13 +08:00
Val Markovic
9e3aa21a77 Merge pull request #119 from olajep/let-local-conf-override-global
Let local YCM config file override global config file
2013-02-17 13:07:38 -08:00
Ola Jeppsson
3d1a86c382 Let local YCM config file override global config file
Currently, when VIM opens a source file, YCM always defaults to
'g:global_ycm_extra_conf_file' if it exists.

This commit changes YCM's behaviour so that it first tries to find the config
file in the source file's folder (or any of its parents folder), before
falling back to 'g:global_ycm_extra_conf_file'.
2013-02-17 19:06:48 +01:00
Strahinja Val Markovic
e743076e14 Option to collect identifiers n comments/strings
Fixes #98.
2013-02-16 14:00:46 -08:00
Strahinja Val Markovic
7833cc1cf1 More doc updates for Completer API 2013-02-16 13:33:19 -08:00
Strahinja Val Markovic
1cd6f4d05e Some extra docs for the Completer API 2013-02-16 13:26:56 -08:00
Stephen Sugden
7006033d3e typo fix 2013-02-13 21:18:51 -08:00
Strahinja Val Markovic
4000da089d Only triggering omni_completer when omnifunc set 2013-02-13 10:27:40 -08:00
Strahinja Val Markovic
ad8345aa35 Now checking ycm_core version for compatibility 2013-02-12 20:54:27 -08:00
Strahinja Val Markovic
21dac46ecc Docs for the Completer API 2013-02-12 20:01:22 -08:00
Strahinja Val Markovic
452f7d1fec Better triggering of semantic completion
Now there's a nice user-configurable setting for when YCM should trigger
semantic completion. This is very useful for the new omni_completer that uses
data coming from Vim's omnicomplete system.
2013-02-11 21:46:06 -08:00
Strahinja Val Markovic
786e6182ff Initial version of omnifunc-based omni_completer
Still a work in progress (needs better triggering and bug fixes)
2013-02-10 20:03:56 -08:00
Strahinja Val Markovic
6e27176ebd Shortening some function names
They could be shorter and still readable
2013-02-10 20:03:56 -08:00
Strahinja Val Markovic
b0c0a12df8 Removing unused file 2013-02-10 20:03:56 -08:00
Strahinja Val Markovic
6be3cd37ed Making sure filename exists before using it 2013-02-06 18:46:57 -08:00
Strahinja Val Markovic
6f10d7aad7 YcmDiags now doesn't hang when no flags available
Fixes #46
2013-02-05 21:22:50 -08:00
Strahinja Val Markovic
a1c89f5108 Fix rare traceback on <leader>d. Fixes #43 2013-02-05 20:12:43 -08:00
Strahinja Val Markovic
ace95db4f0 Emit warning about missing extra_conf file once
Otherwise we spam the user, which is annoying. Fixes #41.
2013-02-05 19:03:38 -08:00
Strahinja Val Markovic
f0e98fa21f Reordering some imports 2013-02-04 23:12:22 -08:00
Strahinja Val Markovic
cc14981774 Renaming utils.py to ycm_utils.py 2013-02-04 15:33:18 -08:00
Strahinja Val Markovic
f671fe72b2 Adding our paths to sys.path start, not end
Otherwise things can conflict and we could end up loading the wrong module.
2013-01-31 17:32:39 -08:00
Strahinja Val Markovic
c67658bbce Supporting multiple filetypes set for current file
Vim allows setting the filetype string to something like "cpp.c", which means
that the file is both cpp and c (nonsense, but allowed). We need to support such
filetype strings.
2013-01-31 16:19:56 -08:00
Strahinja Val Markovic
8452914046 Adding a command to force recompilation and diags 2013-01-30 14:46:58 -08:00
Strahinja Val Markovic
79f834f97e Now possible to specify a global ycm_extra_conf 2013-01-30 13:23:57 -08:00
Strahinja Val Markovic
424736e395 Making sure that 'flags' is a list 2013-01-28 12:56:45 -08:00
Strahinja Val Markovic
d3874ebb65 Code style fix 2013-01-28 10:05:13 -08:00
Strahinja Val Markovic
7e929b7831 clang_completer debug info now shows file flags 2013-01-28 10:00:15 -08:00
Strahinja Val Markovic
a6a1e7c949 Clear error message on ycm_core ImportError 2013-01-26 17:29:18 -08:00
Strahinja Val Markovic
e8b60fd537 Adding the YcmDebugInfo command 2013-01-26 11:45:14 -08:00
Strahinja Val Markovic
6579a1d05d Trivial refactoring 2013-01-24 17:14:10 -08:00
Strahinja Val Markovic
19637cadda Renaming ycm_clang_options to ycm_extra_conf 2013-01-24 09:59:21 -08:00
Strahinja Val Markovic
90fe31f98e Async querying of CompilationDatabase supported 2013-01-23 17:23:51 -08:00
Strahinja Val Markovic
970b2fb56c Kiling a memory leak... I hate C interfaces 2013-01-22 17:29:05 -08:00
Strahinja Val Markovic
6ba2dd8caa Printing an error when no ycm_clang_options.py file 2013-01-22 17:13:14 -08:00
Strahinja Val Markovic
482de517ba Better support for CompilationDatabase
We now use the compilation working directory for a file that is specified in the
CompilationDatabase. We don't actually change the working directory of the
process, even temporarily (that would be annoying to users); we munge the flags
coming from the database so that all the relative paths in them are resolved to
absolute ones.
2013-01-22 16:30:49 -08:00
Strahinja Val Markovic
00db8fd8b1 compilation_database.json now fully supported 2013-01-19 18:53:30 -08:00
Strahinja Val Markovic
f9a516704b Now explicitly adding the clang includes to flags 2013-01-17 17:08:28 -08:00
Strahinja Val Markovic
0922864eda Moving clang includes to clang_includes folder 2013-01-17 17:08:11 -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
fa21622655 Updating local clang includes to 3.2
We have to have these beneath the folder where ycm_core.so is placed so that we
get fast completions. If these files are not here, then clang fails to
precompile a file preamble and completions are slow.
2013-01-13 12:49:49 -08:00
Strahinja Val Markovic
c9adb9e86e Comment update in vimsupport.py 2012-09-24 19:20:33 -07:00
Strahinja Val Markovic
04991d874d Moving a comment closer to the related code 2012-09-05 21:49:51 -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
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
d793919969 Removing old debugging statement 2012-08-11 21:19:06 -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
b2b6b12195 Created c, objc & objcpp hooks that use cpp clang
These hooks just create a ClangCompleter which is universal for these four
languages. It can complete all of them.
2012-08-05 14:24:15 -07:00
Strahinja Val Markovic
b62ec81d68 Completer plugins now have their own folder 2012-08-05 14:14:31 -07:00
Strahinja Val Markovic
ea30cb046e ShouldUseNow for IdentifierCompleter done and used 2012-08-05 13:12:10 -07:00
Strahinja Val Markovic
3c65c84c7b Renaming 'indexer' to the more accurate 'ycm_core' 2012-08-04 18:59:22 -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
f120c0ce1c Showing function args right next to name now
The completion text in the menu is different. We used to just show the func name
in the "main" part of the completion menu, now we show the full signature
without the return type (which is shown on the right)
2012-08-02 21:37:21 -07:00
Strahinja Val Markovic
3a820f1fb4 The clang options file now ends in .py 2012-08-01 20:22:03 -07:00
Strahinja Val Markovic
eab70838f0 New system for specifying clang flags
Now the .ycm_clang_options file is a python script that needs to implement our
API. This enables the user to do arbitrary things when computing flags.
2012-08-01 19:34:20 -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
2726349975 Not parsing empty files anymore
Also, not sending non-clang supported files as unsaved buffers when a completion
is requested.
2012-07-31 15:30:50 -07:00
Strahinja Val Markovic
11e42b49f0 Smarter updating of clang diagnostics display 2012-07-30 19:42:41 -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
bfafad4f50 Using python's abc module for the Completer class 2012-07-28 12:24:25 -07:00
Strahinja Val Markovic
76715bd94c Posting vim message when no clang candidates 2012-07-28 12:06:59 -07:00
Strahinja Val Markovic
ae618c5566 Clang parse now again called on cursor hold 2012-07-28 12:06:38 -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
3cc4cf8e10 Async clang parsing of the current file 2012-07-26 21:44:17 -07:00
Strahinja Val Markovic
13f87c5a62 Buffer identifiers are now extracted async 2012-07-24 20:09:09 -07:00
Strahinja Val Markovic
b120d6a5ba Now extracting identifiers in C++ code 2012-07-23 20:17:59 -07:00
Strahinja Val Markovic
74c363ef60 These headers magically speed up completions.
Clang searches for these files and if it doesn't find them, completion is twice
as slow (or slower) than otherwise.

See this issue report for more details:
https://github.com/Rip-Rip/clang_complete/issues/17
2012-07-23 18:45:00 -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
cdb8dfc86b Loading .ycm_clang_options files now
These files can contain flags that are passed to clang.
2012-07-22 15:19:28 -07:00
Strahinja Val Markovic
6f0dc0b21d Explicitly calling OnBufferVisit for first file 2012-07-21 15:33:59 -07:00
Strahinja Val Markovic
b53ea06d5f Using 'dup':1 to save expensive dup eliminition
Since we are never going to return duplicate candidates to Vim we might as well
save some performance by forcing Vim to not search for duplicates
2012-07-21 12:17:29 -07:00
Strahinja Val Markovic
7bf18c7c5c Improving IdentifierCompleter performance
We limit the number of candidates returned to Vim to 20 and also make sure that
we are not returning any duplicate candidates. This provides a noticeable
improvement in latency.
2012-07-21 12:06:18 -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
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
52d8a1236b If query empty, Results sorted lexicographically
This change was also the root cause of the crash bug I spent two days tracking
down. The problem was that the new bool member was not added to the custom copy
ctor... since we don't really need a custom copy ctor for Result, we're going
with the compiler-provided one.
2012-07-15 19:40:24 -07:00
Strahinja Val Markovic
ca861d9f0c Creating a new Completer Python base class
Common logic for the IdentifierCompleter and ClangCompleter (from the python
plugin) is now in the base class.
2012-07-15 18:11:26 -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
545792c055 Renaming Completer to IdentifierCompleter 2012-07-10 23:13:12 -07:00
Strahinja Val Markovic
39ceebbb1e Where possible, using native objects, not vim.eval 2012-07-10 20:50:03 -07:00
Strahinja Val Markovic
ab0b349207 Sending the contents of all the modified buffers
Initially, we were sending only the contents of the current buffer.
2012-07-10 20:27:46 -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
30c9637992 Using the vector indexing suite from Boost.Python
This removes the need for a special overload for AddCandidatesToDatabase. Also,
the GetFuture function now provides a more sensible API with the list being
returned instead of accepted as an out parameter.
2012-07-08 15:34:44 -07:00
Strahinja Val Markovic
174687c4bc Renaming ConcurrentStack to ConcurrentLatestValue 2012-07-06 12:14:25 -07:00
Strahinja Val Markovic
02a1f8780c Small refactoring of the ShouldAddIdentifier func 2012-05-12 20:42:45 -07:00
Strahinja Val Markovic
5d6e839118 Newly inserted identifiers are added immediately 2012-05-12 15:20:03 -07:00
Strahinja Val Markovic
6430677f4f Whitespace changes 2012-05-07 21:23:38 -07:00
Strahinja Val Markovic
7cf580a447 Completion suggestions are now fetched async 2012-05-05 23:48:22 -07:00
Strahinja Val Markovic
7468a5a21c Don't add candidates for "weird" buffers 2012-05-05 18:12:15 -07:00
Strahinja Val Markovic
903452e855 Candidates are now stored per type and filepath 2012-04-29 19:51:20 -07:00
Strahinja Val Markovic
ced1d0ad5a Adding new candidates is now faster; + more
Also fixed a memory leak and started work on adding filepath-aware candidate
repos.
2012-04-29 16:36:31 -07:00
Strahinja Markovic
1a08eb9ce0 Updating copyright line 2012-04-15 20:28:46 -07:00
Strahinja Markovic
156a1882e1 Initial import 2012-04-15 16:57:10 -07:00