Commit Graph

24 Commits

Author SHA1 Message Date
micbou
43ebd5252d
Optimize request building
Reduce the time spent to build the request when there are a lot of buffers by:
 - using the options property on the buffer object to get the mod variable
instead of evaluating getbufvar;
 - not computing the buffer filepath if the buffer is not modified;
 - passing the number of the unloaded buffer instead of its filepath on the
   BufferUnload event. Getting the Python buffer object from its number is
   easier than from its filepath.
2018-01-09 01:40:07 +01:00
micbou
f3ccafe3ae
Do not install aliases from future
Installing aliases from python-future is unreliable and slow.
2017-03-18 18:24:48 +01:00
Homu
8161d35030 Auto merge of #2465 - micbou:response-future, r=Valloric
[READY] Fix exception when response future is not set

An `AttributeError` exception is raised when `Done` is called before `Start` in the `CompletionRequest` and `EventNotification` classes because the `_response_future` attribute is not yet defined.

Fixes #2461.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/valloric/youcompleteme/2465)
<!-- Reviewable:end -->
2016-12-23 09:41:21 +09:00
micbou
fd41d52dfe
Catch and log all server exceptions 2016-12-12 02:36:15 +01:00
micbou
bd890428a4
Fix exception when response future is not set 2016-12-11 20:51:45 +01:00
micbou
2fabac5a67
Fix BufferUnload event notification
Send the request as the unloaded buffer instead of the current buffer
for the BufferUnload event notification. This fixes the issue where
the filetype of the current buffer is not the same as the unloaded
buffer one, making the ycmd server uses the wrong completer when
handling the request.
2016-10-08 16:43:50 +02:00
micbou
f6d5f68d6b Catch ReadTimeout exception on requests 2016-03-05 22:34:45 +01:00
Val Markovic
ba6c6182ed Consistent handling of ServerError exceptions
Previously we used the super-evil 'except Exception' clauses that would
catch everything and turn debugging into a sanity-questioning exercise.
2016-02-28 19:23:40 -08:00
Val Markovic
4e82409cc1 Futurize pass + manual fixes 2016-02-27 16:12:44 -08:00
micbou
4835b49a89 Remove interpreter line from Python sources 2016-02-05 16:24:03 +01: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
a69bbb3009 Updating code to work with new ycmd location 2014-05-13 13:09:19 -07: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
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
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
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
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
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
1730660555 A (barely) working version of ycmd + client
Still a lot of work to do.
2013-10-07 11:03:26 -07:00