Commit Graph

189 Commits

Author SHA1 Message Date
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