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.
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.
This reverts commit 182848050e.
The reason we are reverting this is because removing signs in a loop causes
flicker. The only non-flicker approach is to remove all signs in a buffer with
"sign unplace buffer=<buffer-num>".
So no compatibility with other plugins for us.
If the user had a hidden buffer and a recent version of Vim, the screen would
flicker every time the user typed. This was caused by a Vim bug.
On every key press, we end up calling GetUnsavedAndCurrentBufferData(), which
calls GetBufferOption( buffer_object, 'ft' ). If the buffer_object represents a
hidden buffer, Vim would flicker.
This would happen because we'd call "buffer_object.options[ 'ft' ]" in recent
versions of Vim, and that line of code causes Vim to flicker. I don't know why.
We're extracting the 'ft' value without going through buffer_object.options, and
that works just fine.
Fixes#669.
Now, "foobar.h" will be changed to insert "foo" if the text after the cursor is
"bar.h". This already worked for "foobar" and "bar", but the overlap search
would stop before a non-word character. This has now been resolved.
Previously we'd show a Python traceback if the user asked for a detailed
diagnostic in a file that wasn't supported by Clang (something written in Python
perhaps). Now we show an nice, far less scary message informing the user of
this.
Fixes#748.
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
We pass shell=True to Popen so that OmniSharp is not started inside a
new visible window under Windows. And since we use shell=True, we pass
the command to execute as a string, as recommended by Python's docs
(also, it won't work when passed as a sequence anyway :) ).
This can happen when the user inserts a candidate string like "operator[]" which
doesn't end with an identifier char. A very obscure bug, but a bug nonetheless.
When loading the Omnisharp server, YCM tries to find a suitable solution
file to feed it. Instead of giving up when finding multiple solution
files, it now tries to find one named like the edited files' folder at
the solution level, e.g. if we have bla/Project.sln and we are editing
bla/Project/Folder/Whatever/File.cs, we use bla/Project.sln.
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.
We don't want to send a unicode string to the user's ycm_extra_conf.py file.
This should fix problems with sending the filename to YCM's CompilationDatabase
API.
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.
[vimwiki][] has a markdown-like syntax, which doesn't bode well with YCM
(flickering "pattern not found" messages, performance hits with long prose).
[vimwiki]: https://github.com/vimwiki/vimwiki
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.
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.
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.
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.
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.
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.
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.
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.
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.