Commit Graph

2365 Commits

Author SHA1 Message Date
Greg Hurrell
1e3b7bae51 Don't use VimEnter initialization except when stating gui
This is another attempt at:

https://github.com/Valloric/YouCompleteMe/pull/2473

Which removed the apparently flawed attempt at "lazy" loading of YCM.
While it fails to get the load out of the critical startup path, it
*does* serve the useful purpose when starting up gvim of avoiding a
deadlock situation in gvim.

So, this time, we keep VimEnter, but only for the gui-starting case. We
update the comment to explain what is actually happening. And we can
keep the docs about how to defer loading.
2016-12-16 19:21:09 -08:00
Homu
86ccd88980 Auto merge of #2469 - micbou:remove-bufreadpre-autocommand, r=micbou
[READY] Do not use BufReadPre autocommand

This autocommand has a bug that makes the cursor goes to the first line of the current buffer when opening the preview window with `:pedit`. Since the `BufRead` autocommand is always called after, we can drop it by moving the `s:OnBufferReadPre` logic into the `s:OnBufferRead` function.

Fixes #2466.

<!-- 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/2469)
<!-- Reviewable:end -->
2016-12-16 22:54:19 +09:00
Val Markovic
caa4291a9a
Revert "Auto merge of #2473 - wincent:no-lazy, r=Valloric"
This reverts commit c182c0529b, reversing
changes made to 48b7ccef76.
2016-12-15 21:21:35 -08:00
Homu
c182c0529b Auto merge of #2473 - wincent:no-lazy, r=Valloric
No lazy

# PR Prelude

- [x] I have read and understood YCM's [CONTRIBUTING][cont] document.
- [x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
- [x] I have included tests for the changes in my PR. If not, I have included a
  rationale for why I haven't.
- [x] **I understand my PR may be closed if it becomes obvious I didn't
  actually perform all of these steps.**

# Why this change is necessary and useful

See prior version of this PR (https://github.com/Valloric/YouCompleteMe/pull/2454) for more discussion.

[cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md
[code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md

<!-- 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/2473)
<!-- Reviewable:end -->
2016-12-15 19:37:49 +09:00
Greg Hurrell
7f76b03e0e doc: Add FAQ entry explaining how to defer loading 2016-12-13 23:51:40 -08:00
Greg Hurrell
c22e425e25 Remove non-lazy lazy loading code
As discussed in https://github.com/Valloric/YouCompleteMe/pull/2454,
this code doesn't do what it claims to do on the surface, so we should
delete it.

I'll follow up with a commit to explain in the README how to actually
defer loading of the plug-in.
2016-12-13 23:43:39 -08:00
micbou
1511ee542f
Do not use BufReadPre autocommand
This autocommand has a bug that causes the cursor to move to the first
line of the current buffer when using the pedit command.
2016-12-12 21:16:06 +01:00
micbou
85d5844873
Add docstring to HandleServerException
Wrap request with HandleServerException in YcmdKeepalive class.
2016-12-12 02:53:57 +01:00
micbou
01aa54ee2d
Add tests 2016-12-12 02:36:15 +01: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
Homu
48b7ccef76 Auto merge of #2456 - micbou:remove-outdated-syntastic-option, r=Valloric
[READY] Remove outdated Syntastic option

The `ycm_register_as_syntastic_checker` option was introduced a long time ago in commit 16b6f877c6 and became obsolete when [Syntastic support was replaced](6c01881e1a). Since then, it doesn't serve any purpose except being an alias to the `ycm_show_diagnostics_ui` option which can be an issue (see #2455) so we remove it.

Fixes #2455.

<!-- 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/2456)
<!-- Reviewable:end -->
2016-12-02 08:56:36 +09:00
micbou
b26d395ed1
Remove outdated Syntastic option 2016-12-01 18:13:02 +01:00
Homu
39be8b1aad Auto merge of #2430 - micbou:client-logfile, r=Valloric
[READY] Add client logfile

We have a lot of issue reports with Python exceptions that interrupt user workflow or even worse make the editor unusable and force users to restart it (e.g. issue https://github.com/Valloric/YouCompleteMe/issues/2192). We really want to avoid that but at the same time we can't just silence these exceptions because they are useful to debug the issue. Logging them to Vim `:messages` is not practical because we can't write to it without displaying messages in the status line which, in addition to distract users, may lead to various issues like the infamous `Press ENTER or type command to continue` message. This is why a logfile is needed.

For now, only server crashes are logged but more logging will be added: connection issues with the server (`ConnectTimeout`, `ReadTimeout`, etc. exceptions), UltiSnips unavailability, requests sent to the server, etc.

The behavior of the `:YcmToggleLogs` command is changed to accept multiple arguments where each argument is a logfile name. Each of these files is opened in a separate window or closed if already open. When no argument is given, the list of available logfiles is displayed to the user. Example:
```
Available logfiles are:
ycm_pz83u7.log
ycmd_23830_stderr_gf6j3i.log
ycmd_23830_stdout_gmpa_k.log
```

With this change and PR #2342, we will add the completers logfiles to the list of files that can be opened with the `:YcmToggleLogs` command.

A bunch of tests are added that cover almost all changes introduced by this PR.

<!-- 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/2430)
<!-- Reviewable:end -->
2016-11-28 00:30:18 +09:00
Homu
8c39a0d5c5 Auto merge of #2445 - micbou:documentation-clang-3.9, r=puremourning
[READY] Bump Clang version in documentation

Since PR https://github.com/Valloric/ycmd/pull/590, Clang 3.9 is required because of the `KeepGoing` option. In fact, it is still possible to successfully compile against a 3.8 system libclang or with the `-DEXTERNAL_LIBCLANG_PATH` flag pointing to a 3.8 libclang since [the headers included in ycmd](https://github.com/Valloric/ycmd/tree/master/cpp/llvm/include/clang-c) are used in these two cases. However, the `KeepGoing` option will have no effect. So, we still recommend Clang 3.9 in all cases.

Closes https://github.com/Valloric/ycmd/issues/654.

<!-- 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/2445)
<!-- Reviewable:end -->
2016-11-22 18:19:09 +09:00
micbou
e179e860b4
Bump Clang version in documentation 2016-11-22 02:13:09 +01:00
micbou
b93c1fd47c
Add client logfile 2016-11-19 18:47:43 +01:00
Homu
fbe53de5a2 Auto merge of #2441 - micbou:flake8, r=Valloric
[READY] Fix flake8 error

This fixes a new error detected by the last version of `pycodestyle` (2.2.0), which is a dependency of `flake8`:
```
C:\projects\youcompleteme\python\ycm\youcompleteme.py:69:1: E305 expected 2 blank lines after class or function definition, found 1
```

<!-- 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/2441)
<!-- Reviewable:end -->
2016-11-16 04:10:30 +09:00
micbou
c33a844e5f
Fix flake8 error 2016-11-15 11:15:16 +01:00
Homu
195509285c Auto merge of #2436 - dojoteef:reuse_preview_buffer, r=micbou
Address #1366 by reusing a single preview buffer

* Additionally set the preview buffer to be unlisted so it does not interfere with commands like :bnext
* See [my comment](https://github.com/Valloric/YouCompleteMe/issues/1366#issuecomment-259878581) for more details

<!-- 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/2436)
<!-- Reviewable:end -->
2016-11-15 02:48:31 +09:00
Nader Akoury
f4f12f3c9b Fix another test failure
* Because I cannot seem to run the tests locally I am relying on the CI
tests which kind of sucks...
2016-11-11 11:28:20 -08:00
Nader Akoury
659746eaaf Doh, forgot to revert my previous changes. Fixed! 2016-11-11 10:53:26 -08:00
Nader Akoury
9c93244d3b Addressed review comments and fixed tests 2016-11-11 10:15:22 -08:00
Nader Akoury
74951adcc7 Address #1366 by reusing a single preview buffer
* Additionally set the preview buffer to be unlisted so it does not
interfere with commands like :bnext
2016-11-11 07:53:01 -08:00
Homu
5875c86c41 Auto merge of #2434 - bstaletic:omnifunc, r=micbou
Don't set omnifunc when not allowed

# PR Prelude

Thank you for working on YCM! :)

**Please complete these steps and check these boxes (by putting an `x` inside
the brackets) _before_ filing your PR:**

- [x] I have read and understood YCM's [CONTRIBUTING][cont] document.
- [x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
- [x] I have included tests for the changes in my PR. If not, I have included a
  rationale for why I haven't.
- [x] **I understand my PR may be closed if it becomes obvious I didn't
  actually perform all of these steps.**

# Why this change is necessary and useful

[Please explain **in detail** why the changes in this PR are needed.]

See pull request: [#2072](https://github.com/Valloric/YouCompleteMe/pull/2072)
Unfortunately I was not able to reproduce the original author's results. I tried using a clean .vim and .vimrc. The only plugins I used were YCM and ctrlfs.vim, just as the original author mentioned. The .vimrc looks like this:
```VimL
syntax on
set history=500
set nocp
filetype plugin indent on
set encoding=GBK
```
Whatever I tried to do with configuration, I couldn't get a start without an error, but it is already known that YCM doesn't work properly with any file not using UTF encoding.
The error I was getting on vim start up:
```
Error detected while processing function youcompleteme#Enable[67]..<SNR>36_OnBufferRead[6]..<SNR>36_AllowedToCompleteInCurrentBuffer[1]..<SNR>36_AllowedToCompleteInBuffer:
line   15:
E715: Dictionary required
Press ENTER or type command to continue
Error detected while processing function <SNR>36_OnCursorMovedNormalMode[1]..<SNR>36_AllowedToCompleteInCurrentBuffer[1]..<SNR>36_AllowedToCompleteInBuffer:
line   15:
E715: Dictionary required
Press ENTER or type command to continue
```
Error I was having after almost every key press:
```
Error detected while processing function <SNR>36_OnCursorMovedNormalMode[1]..<SNR>36_AllowedToCompleteInCurrentBuffer[1]..<SNR>36_AllowedToCompleteInBuffer:
line   15:
E715: Dictionary required
Press ENTER or type command to continue
```

[cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md
[code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md

<!-- 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/2434)
<!-- Reviewable:end -->
2016-11-11 11:09:04 +09:00
Boris Staletic
57f64dca7b Fromating and function rename 2016-11-10 21:24:09 +01:00
Boris Staletic
30def5d246 Don't set omnifunc when not allowed 2016-11-09 16:20:23 +01:00
Homu
4f2494e87e Auto merge of #2425 - dhleong:dhleong/fix-namespace-insert, r=Valloric
Fix InsertNamespace

# PR Prelude

Thank you for working on YCM! :)

**Please complete these steps and check these boxes (by putting an `x` inside
the brackets) _before_ filing your PR:**

- [x] I have read and understood YCM's [CONTRIBUTING][cont] document.
- [x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
- [x] I have included tests for the changes in my PR. If not, I have included a
  rationale for why I haven't.
- [x] **I understand my PR may be closed if it becomes obvious I didn't
  actually perform all of these steps.**

# Why this change is necessary and useful

Auto-inserting namespace imports in C# is broken because the `ReplaceChunk()` call is missing an argument

[cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md
[code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md

ReplaceChunk must have changed to require the buffer at some point

No test is included because it's a one-line change; the method is theoretically covered, so I'm not sure why the missing argument error was not caught (not familiar with these tests). Happy to add one if needed (and I can get pointed in the right direction).

<!-- 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/2425)
<!-- Reviewable:end -->
2016-11-04 06:08:10 +09:00
dhleong
8eabf580ad Rename argument 2016-11-03 13:47:26 -04:00
dhleong
0babb4b102 Cleanup 2016-11-03 11:21:15 -04:00
dhleong
0523ad02c0 Fix InsertNamespace indent matching
Aso updates the appropriate tests and adds docs to some
relevant methods whose behavior might be confusing
2016-11-02 08:08:30 -04:00
Homu
fc4e326ab6 Auto merge of #2423 - micbou:gitter, r=micbou
[READY] Add Gitter badge and encourage users to ask questions on Gitter

This may help reduce the number of issues opened for questions or misconfigurations. This is also an alternative to the Google group for users that can't access it because of country regulations.

<!-- 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/2423)
<!-- Reviewable:end -->
2016-11-02 05:28:35 +09:00
dhleong
26141253a5 Add some tests for InsertNamespace 2016-11-01 08:28:28 -04:00
dhleong
62a815275f Fix InsertNamespace
ReplaceChunk must have changed to require the buffer at some point
2016-10-31 17:00:45 -04:00
micbou
9605c1d50a
Add Gitter badge 2016-10-31 18:13:36 +01:00
Homu
c895f09375 Auto merge of #2396 - dpzmick:patch-1, r=micbou
Update README.md

# PR Prelude

Thank you for working on YCM! :)

**Please complete these steps and check these boxes (by putting an `x` inside
the brackets) _before_ filing your PR:**

- [x] I have read and understood YCM's [CONTRIBUTING][cont] document.
- [x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
- [x] I have included tests for the changes in my PR. If not, I have included a
  rationale for why I haven't.
- [x] **I understand my PR may be closed if it becomes obvious I didn't
  actually perform all of these steps.**

[cont]: https://github.com/Valloric/YouCompleteMe/blob/master/CONTRIBUTING.md
[code]: https://github.com/Valloric/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md

# Why this change is necessary and useful
ycmd has this support: https://github.com/Valloric/ycmd/pull/628

no tests needed, only a change to docs

<!-- 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/2396)
<!-- Reviewable:end -->
2016-10-28 15:47:24 +09:00
Homu
bf67f78e2d Auto merge of #2412 - micbou:appveyor-coverage, r=Valloric
[READY] Enable coverage on AppVeyor

I forgot to do that when adding coverage.

Also, the `cover` folder is created at the project root, not in the `python` folder.

<!-- 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/2412)
<!-- Reviewable:end -->
2016-10-28 13:06:48 +09:00
David Zmick
0acafe7fc7 Update README.md
https://github.com/Valloric/ycmd/pull/628
2016-10-27 20:14:49 -05:00
micbou
bc8040f10c
Ignore cover folder 2016-10-27 23:05:58 +02:00
micbou
066657fca2
Enable coverage on AppVeyor 2016-10-27 23:05:50 +02:00
Homu
6e52536f70 Auto merge of #2407 - micbou:remove-unloaded-buffer-parameter, r=vheon
[READY] Remove unloaded_buffer parameter

See PR https://github.com/Valloric/ycmd/pull/542.

<!-- 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/2407)
<!-- Reviewable:end -->
2016-10-28 01:44:10 +09:00
micbou
f6ffe1f1a6
Remove unloaded_buffer parameter 2016-10-27 01:48:33 +02:00
Homu
d55b5c09d6 Auto merge of #2394 - micbou:move-client-tests, r=Valloric
[READY] Move client tests to the main tests folder

This makes it possible to configure all tests at a package level by implementing the `setUpPackage` and `tearDownPackage` functions in `python/ycm/tests/__init__.py` file.

<!-- 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/2394)
<!-- Reviewable:end -->
2016-10-26 07:46:33 +09:00
Homu
03835a9afc Auto merge of #2405 - micbou:called-process-error, r=Valloric
[READY] Catch CalledProcessError exception in install script

See PR https://github.com/Valloric/ycmd/pull/630.

Closes https://github.com/Valloric/YouCompleteMe/pull/2351.

<!-- 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/2405)
<!-- Reviewable:end -->
2016-10-26 06:16:44 +09:00
Homu
79ddf746b4 Auto merge of #2406 - micbou:shutdown-request, r=Valloric
[READY] Remove unused code in shutdown request

This is what happens when you copy paste code.

<!-- 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/2406)
<!-- Reviewable:end -->
2016-10-26 06:15:34 +09:00
micbou
62ff65006f
Remove unused code in shutdown request 2016-10-25 17:59:17 +02:00
micbou
7b251dbd58
Catch CalledProcessError exception in install script
This exception is not relevant to the install failure. Catch it and exit
with the status code returned by the build script.
2016-10-25 16:44:41 +02:00
Homu
ffbe7b032f Auto merge of #2398 - micbou:secure-temp, r=Valloric
[READY] Create temporary files in a secure manner

Fixes #2395.

Depends on PR https://github.com/Valloric/ycmd/pull/629.

<!-- 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/2398)
<!-- Reviewable:end -->
2016-10-25 17:45:03 +09:00
micbou
c991f04905
Create temporary files in a secure manner
Fixes #2395.
2016-10-24 22:45:15 +02:00
Homu
f27787f263 Auto merge of #2377 - dhleong:dhleong/#2021-quiet_messages, r=micbou
Implement ycm_quiet_messages options (See #2021)

# PR Prelude

- [x] I have read and understood YCM's [CONTRIBUTING][cont] document.
- [x] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.
- [x] I have included tests for the changes in my PR. If not, I have included a
  rationale for why I haven't.
- [x] **I understand my PR may be closed if it becomes obvious I didn't
  actually perform all of these steps.**

# Why this change is necessary and useful

See issue #2021. This is a partial implementation based on the syntastic option referenced, supporting the `!` flag and filters of type `regex` and `level`. Also supports filetype specific filters using `ycm_<ft>_quiet_messages`, but I couldn't think of a great way to fall back to syntastic configs for this one.

In terms of usefulness: I've been playing with C# recently, which has a bunch of style warnings that I don't want to follow, and prefer to only have the gutter showing if there are actually errors, or warnings that I *do* want to follow.

<!-- 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/2377)
<!-- Reviewable:end -->
2016-10-24 10:46:06 +09:00