Commit Graph

59 Commits

Author SHA1 Message Date
Ben Jackson
258951ece4 If errors are returned in addition to completion suggestions, print them 2015-08-17 01:13:20 +01:00
Ben Jackson
98c4d712b4 YouCompleteMe client support for FixIt subcommands 2015-08-05 22:09:07 +01:00
Strahinja Val Markovic
9de61988ac Fix bad formatting for YcmCompleter message
Fixes #1522
2015-06-30 14:24:05 -07:00
Strahinja Val Markovic
ecb4252322 Minor formatting fixes 2015-06-30 13:52:47 -07:00
Andrea Cedraro
3dd24201f3 Revert "Revert "Check the server end point for available completer""
This reverts commit f5e2fc6958.
2015-06-15 16:08:56 +02:00
Strahinja Val Markovic
f5e2fc6958 Revert "Check the server end point for available completer"
This reverts commit d7684470a2.

Fixes #1529
2015-06-11 12:37:40 -07:00
Andrea Cedraro
d7684470a2 Check the server end point for available completer
Previously we were checking if the `hook.py` file existed for the given
filetype. ycmd has an endpoint for checking if given a filetype a
semantic completer is available. To avoid redundant requests we cache
those requests for every filetype. A semantic engine cannot be added
*after* the ycmd server is started so to avoid redundant requests we
cache those requests for every filetype and we clear the cache at server
setup, in this way if we issue a `YcmRestartServer` command the server
will be setup again and if a semantic completer is available we can use
it. Should fix #1284.
2015-06-09 13:09:25 +02:00
Strahinja Val Markovic
a70bf21d29 Updating to latest ycmd
This required changing the HMAC calculation logic.
2015-04-17 15:01:29 -07:00
Ben Jackon
2215bcdeb5 Support completer commands that return text …
This is required to allow the ycmd GetType and GetParent subcommands to echo
their reults in vim. The apporach is to display any text returned from a
subcommand in the 'message' property assuming that the command is not a known
'GoTo' command.
2015-03-19 13:31:24 +00:00
Strahinja Val Markovic
2fafab88c4 Ignoring the new "already being parsed" message
This exception comes from ycmd and is not something the user can do
anything about, so let's rather not show it.
2014-12-10 13:46:10 -08:00
Strahinja Val Markovic
c032cf30c0 Removing default server_location. 2014-08-22 11:25:58 -07:00
Strahinja Val Markovic
0cdb588207 Updating to latest ycmd
Diagnostic & completion 'kind' changed in the REST API.
2014-06-03 14:49:53 -07:00
Strahinja Val Markovic
e9a318fc7c Update to latest ycmd
Upstream completions API changed.
2014-06-02 15:15:45 -07:00
Strahinja Val Markovic
09d4723fcc Updating to latest ycmd
Top-level 'filetypes' property not needed in request data anymore.
2014-05-29 10:42:46 -07:00
Strahinja Val Markovic
5d647fec99 Removing erroneous whitespace 2014-05-28 10:20:54 -07:00
Strahinja Val Markovic
6fa49582ed Fix missing param in OmniCompletionRequest 2014-05-28 00:05:50 -07:00
Strahinja Val Markovic
9100044afc Refactored completion request creation
- OmniCompleter is now more similar to other Completers.
- CompletionRequest doesn't store start_column anymore.
- Calling BuildRequestData only once per request.
2014-05-27 17:38:34 -07:00
Strahinja Val Markovic
4cf9cfcdff Updating to latest ycmd
Since ycmd doesn't need 'query', 'start_column' and 'line_value' params, we
don't send them anymore.
2014-05-27 14:30:22 -07:00
Strahinja Val Markovic
a69bbb3009 Updating code to work with new ycmd location 2014-05-13 13:09:19 -07:00
Strahinja Val Markovic
d56ec1ea7a ycmd's JSON interface now uses 1-based indices
This makes far more sense because editors manipulate user-level errors/warnings
on a 1-based system, not a 0-based one.
2014-05-09 15:57:04 -07:00
Strahinja Val Markovic
9691bd9236 Encoding the x-ycm-hmac header value as base64.
We need to respect RFC 5987.
2014-05-09 10:37:20 -07:00
Strahinja Val Markovic
e965e02847 Client/server communication now uses HMAC for auth
This is to prevent a convoluted exploit that can trigger remote code execution.
2014-04-25 11:07:08 -07:00
Strahinja Val Markovic
9cf566bd8f Renamed GoToDefinitionElseDeclaration to GoTo
The old name still works for the sake of backwards compatibility.
2014-03-21 11:34:00 -07:00
Strahinja Val Markovic
2f051ee9f1 YCM client now sends utf-8 encoded JSON.
Previously, we'd just use json.dumps() to dump out JSON. By default,
ensure_ascii is set to true and non-ASCII chars are encoded as \uXXXX.

Problems seem to happen with other text in the data then not being utf8. I'm not
sure why, still can't repro. This should go away now that we explicitly build a
unicode string which we then encode as utf8.

Hopefully fixes #821.
2014-03-19 13:16:49 -07:00
Strahinja Val Markovic
7a4f5a4a53 Minor var naming changes 2014-03-19 10:27:34 -07:00
Strahinja Val Markovic
18be5c254a Increasing worker thread count to 30
If it takes a while to compile the user's C++ file, the YCM client/server may
run out of threads. Vim gets laggy then.

This is a stopgap measure until I think of something better.
2014-02-07 12:46:45 -08:00
Strahinja Val Markovic
433b3b64f0 Decoding completion strings to utf8 for Vim
Fixes #761
Fixes #775
2014-01-15 11:25:57 -08:00
Strahinja Val Markovic
b1bba2e201 Changing copyright headers from me to Google
When I initially released this project, I released it under my own copyright. I
have since then worked on it in my 20% time at Google (and want to continue
doing this) and my life becomes much simpler if the copyright is Google's.

From the perspective of how this project is run and managed, **NOTHING**
changes. YCM is not a Google product, merely a project run by someone who just
happens to work for Google.

Please note that the license of the project is **NOT** changing.

People sending in future pull requests will have to sign the Google
[CLA](https://developers.google.com/open-source/cla/individual) (you can sign
online at the bottom of that page) before those pull requests could be merged
in. People who sent in pull requests that were merged in the past will get an
email from me asking them to sign the CLA as well.
2014-01-13 11:08:43 -08:00
Strahinja Val Markovic
209d22cfdb DiagnosticInterface now uses server diag objects 2014-01-06 15:24:06 -08:00
Strahinja Val Markovic
3ed8d9883c Diagnostic ranges now exposed to server clients
Still haven't used them in the Vim client though, but will soon.
2014-01-06 15:24:06 -08:00
Strahinja Val Markovic
6c01881e1a Replaced Syntastic support with YCM-native code
Currently, the only supported Syntastic features are the error signs in the
gutter. Other features will be added in the future.
2014-01-06 15:24:05 -08:00
Strahinja Val Markovic
b1d71bbb91 Better handling of unknown extra conf files
Previously, we'd implicitly turn off future notices about unknown extra conf
files if we already raised one exception about it. This breaks when the user
ends up not receiving the "unknown extra conf, load?" message.

Now we only turn off the notice as a result of the user saying "don't load this"
so that if the first request fails to reach them, they'll get a second (and
third etc) request about it.

Fixes #615
2013-12-21 11:19:39 -08:00
Strahinja Val Markovic
cf6211055e Removing the server_idle_suicide_seconds option
This option existed so that the user can tweak it if they found the default idle
timeout too short, for instance if they leave their machine on over the weekend.

This use case is now covered by the new YcmdKeepalive system that pings ycmd
every 10 minutes as long as Vim is running. This prevents ycmd shutting down if
one leaves their Vim instance alone for a long time.

Thus the old option is useless now; ycmd now shuts down after 3 hours of
inactivity, which should only ever happen when its corresponding Vim instance
has shut down abnormally.
2013-11-20 12:33:57 -08:00
Strahinja Val Markovic
7bfb4c3402 Use a thread pool that doesn't join workers
By default, a ThreadPoolExecutor will wait at Python interpreter shutdown for
all the threads to stop by themselves before letting the interpreter shut down.

We don't want that for the network requests thread pool, it causes a shutdown
latency if there are outstanding requests. Killing the threads in our pool is
perfectly safe so we can avoid the latency by introducing an
UnsafeThreadPoolExecutor.
2013-10-30 18:08:35 -07:00
Strahinja Val Markovic
6e782508b3 Now possible to sent Vim data to FlagsForFile func
Fixes #612.
2013-10-26 16:22:43 -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
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
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
7afd76b4d4 Better url joining in base_request 2013-10-08 20:49:00 -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
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
ff7fa74fc9 <c-space> works again (forces semantic completion) 2013-10-07 13:09:34 -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
afa1afc49b Handling no diagnostic data from event response 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
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