Commit Graph

2494 Commits

Author SHA1 Message Date
micbou
cacc8e0d92
Remove unnecessary lists and fix options link in docs 2018-04-07 06:01:54 +02:00
micbou
05f7f1c6f0
Remove Java from the GoToImplementation command in docs 2018-04-07 03:56:24 +02:00
micbou
3b115831a0
Fix applying fixit twice after completion 2018-04-06 17:56:25 +02:00
zzbot
e8477c16b6
Auto merge of #2972 - micbou:universal-ctags, r=puremourning
[READY] Mention Universal Ctags in docs

Closes https://github.com/Valloric/YouCompleteMe/issues/2971.

<!-- 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/2972)
<!-- Reviewable:end -->
2018-04-03 21:29:48 -07:00
micbou
1bda165728
Mention Universal Ctags in docs 2018-04-03 22:20:01 +02:00
micbou
6f9366d150
Check if completion is allowed on character events 2018-04-02 22:16:47 +02:00
zzbot
c1815a9b2d
Auto merge of #2963 - micbou:refactor-completedone-logic, r=puremourning
[READY] Refactor CompleteDone logic

Since the `CompleteDone` code only depends on the completion request, it makes sense to move its logic to the `CompletionRequest` class. This is also going to help fixing the issue where a FixIt is applied twice when selecting a completion:

![completedone-bug](https://user-images.githubusercontent.com/10026824/38029281-bc09d224-3295-11e8-9976-d4dd031f2cca.gif)

Finally, this reduces the time it takes to run the tests because the ycmd server is not started anymore in the `postcomplete` tests.

<!-- 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/2963)
<!-- Reviewable:end -->
2018-04-02 11:13:23 -07:00
micbou
866693ef80
Refactor CompleteDone logic
Move CompleteDone logic to the CompletionRequest class.
2018-03-28 22:00:43 +02:00
zzbot
dc341aab58
Auto merge of #2957 - micbou:refactoring-commands-readme, r=puremourning
[READY] Fix Refactoring Commands link in table of contents

I broke it in PR https://github.com/Valloric/YouCompleteMe/pull/2900.

<!-- 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/2957)
<!-- Reviewable:end -->
2018-03-27 14:55:27 -07:00
micbou
9408ccec5d
Fix Refactoring Commands link in table of contents 2018-03-26 03:08:19 +02:00
zzbot
37965fe311
Auto merge of #2956 - micbou:fix-column-clamping-python3, r=puremourning
[READY] Fix column clamping when highlighting diagnostics on Python 3

We need to convert the Vim buffer to bytes in the `LineAndColumnNumbersClamped` function to correctly compute the length of the line as a byte offset (and not a Unicode offset) on Python 3.

Before:

![column-clamping-before](https://user-images.githubusercontent.com/10026824/37876087-01f38dde-3048-11e8-93aa-0ce284b09b55.png)
After:

![column-clamping-after](https://user-images.githubusercontent.com/10026824/37876089-056db49e-3048-11e8-9d84-540fe67e6689.png)

<!-- 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/2956)
<!-- Reviewable:end -->
2018-03-25 13:32:37 -07:00
micbou
ca8211a64b
Fix column clamping when highlighting diagnostics on Python 3 2018-03-25 16:02:48 +02:00
zzbot
788c293aee
Auto merge of #2951 - micbou:replace-chunk-out-of-range, r=puremourning
[READY] Fix index error when applying a chunk at the end of file

When sending a request to the server, [we add a newline to the buffer contents to match what gets saved to disk](d3381411a0/python/ycm/vimsupport.py (L117)). If the server generates a chunk containing that newline, this chunk goes past the Vim buffer contents since there is actually no new line, which raises an `IndexError` exception when applying the chunk. We fix the issue by recomputing the end position of where the chunk is applied and by removing all trailing characters in the chunk.

Steps to reproduce the issue:
 - create a `Test.java` file with the following contents:
```java
package Test;$
$
```
where `$` represents an end of line;
 - issue the `:YcmCompleter Format` command.

<!-- 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/2951)
<!-- Reviewable:end -->
2018-03-19 06:40:11 -07:00
micbou
3086626448
Fix index error when applying a chunk at the end of file
When sending a request to the server, we add a newline to the buffer contents
to match what gets saved to disk. If the server generates a chunk containing
that newline, this chunk goes past the Vim buffer contents since there is
actually no new line, which raises an IndexError exception when applying the
chunk. We fix the issue by recomputing the end position of where the chunk is
applied and by removing all trailing characters in the chunk.
2018-03-19 14:28:28 +01:00
zzbot
d3381411a0
Auto merge of #2946 - micbou:docs-ctrl-r-remap, r=puremourning
[READY] Add an entry in the docs about remapping CTRL-R in completion mode

The `<C-R>` key cannot be remapped in YCM's completion mode (`<C-X><C-U>`) due to a Vim limitation. Add an entry in the FAQ about this.

Closes https://github.com/Valloric/YouCompleteMe/issues/2943.

<!-- 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/2946)
<!-- Reviewable:end -->
2018-03-12 03:28:09 -07:00
micbou
0c22c000ef
Add an entry in the docs about remapping CTRL-R in completion mode 2018-03-11 20:09:46 +01:00
zzbot
3a760212cb
Auto merge of #2942 - micbou:remove-7zip-dependency, r=puremourning
[READY] Remove 7-Zip dependency from Windows instructions

7-Zip is not required anymore on Windows since we now extract libclang from our  `.tar.bz` packages.

<!-- 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/2942)
<!-- Reviewable:end -->
2018-03-09 15:11:50 -08:00
micbou
a80da86542
Remove 7-Zip dependency from Windows instructions 2018-03-09 19:46:25 +01:00
zzbot
b4714c711c
Auto merge of #2939 - bstaletic:ycmd_update, r=micbou
[READY] ycmd update

# 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

- Valloric/ycmd#949 - update-clang
- Valloric/ycmd#948 - sitecustomize-import-failure
- Valloric/ycmd#922 - alt-translation-unit
- Valloric/ycmd#946 - java-upgrade
- Valloric/ycmd#945 - skip-build
- Valloric/ycmd#939 - drop-vagrant-setup
- Valloric/ycmd#941 - update-clang-script
- Valloric/ycmd#940 - lower-minimum-python-version-requirements
- Valloric/ycmd#938 - stray-windows-paths
- Valloric/ycmd#936 - clang-cl_support
- Valloric/ycmd#934 - run-tests-fix-removing-cfamily
- Valloric/ycmd#933 - java-completer-server-is-running
- Valloric/ycmd#932 - java-completer-stderr
- Valloric/ycmd#931 - server-file-state
- Valloric/ycmd#929 - fix-cs-instructions
- Valloric/ycmd#926 - code-actions-offset
- Valloric/ycmd#924 - quiet-build

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

[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/2939)
<!-- Reviewable:end -->
2018-03-09 01:18:41 -08:00
Boris Staletic
137f1382b1 ycmd update 2018-03-09 07:54:24 +01:00
zzbot
4b3075bf54
Auto merge of #2930 - micbou:lower-minimum-python-version-requirements, r=bstaletic
[READY] Lower minimum Python version requirements on Travis and CircleCI

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

<!-- 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/2930)
<!-- Reviewable:end -->
2018-02-26 16:50:14 -08:00
zzbot
9d9c12a192
Auto merge of #2926 - puremourning:fixit-no-quickfix, r=micbou
[READY] Don't open the quickfix window after FixIt/Refactor

# 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

When FixIt was originally implemented, I decided to present the quick fix list containing the set of changes made to the buffers as it was thought this would be helpful and would reassure the user that the changes we made to their code made sense and were safe. Some large part of this decision was paranoia.

Since then we're using fixit code in a lot more places and the feature is pretty mature. I personally find the opening of the quick fix window to be a bit of a pain, and I quickly end up closing it manually to reclaim the space. I have literally never used it to jump to a location that was changed.

I have received recent feedback from users that "Why is it when I do a FixIt, this annoying window appears at the bottom of the screen that I can't get rid of?". Most users who are unhappy with the result of a FixIt can, and do, use the undo command as a matter of habit.

So I propose to just not auto-display the quick fix window anymore for FixIts, Renames, etc. We continue to populate the quick fix list, however, so `:copen` can be used to inspect the results, for those power users that know about quick fix lists.

[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/2926)
<!-- Reviewable:end -->
2018-02-26 15:12:39 -08:00
zzbot
66b6fad000
Auto merge of #2931 - micbou:windows-prefix-command-with-python, r=puremourning
[READY] Prefix commands with python in Windows instructions

Arguments may be ignored when running the `install.py` script in a `cmd.exe` prompt if the command associated to Python files is incorrect. Update the Windows instructions by prefixing the commands with `python`.

Fixes #2929.

<!-- 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/2931)
<!-- Reviewable:end -->
2018-02-26 12:42:14 -08:00
micbou
6602b45efe
Prefix commands with python in Windows instructions 2018-02-26 16:45:48 +01:00
micbou
ddd5045b18
Lower minimum Python version requirements on Travis and CircleCI 2018-02-26 16:25:26 +01:00
Ben Jackson
dc52b73048 Don't open the quickfix window after fixit 2018-02-22 23:02:10 +00:00
zzbot
d27563d2f1
Auto merge of #2924 - micbou:capture-vim-command-unicode, r=puremourning
[READY] Convert Vim command output to Unicode

Forgot to do that in PR https://github.com/Valloric/YouCompleteMe/pull/2921.

<!-- 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/2924)
<!-- Reviewable:end -->
2018-02-20 02:26:04 -08:00
micbou
5d2258bdd4
Convert Vim command output to Unicode 2018-02-20 10:43:29 +01:00
zzbot
54a4ecf2d9
Auto merge of #2922 - micbou:improve-diagnostic-match, r=bstaletic
[READY] Improve diagnostic matches display

There are two issues with how we display diagnostic matches. The first issue is that if the current buffer contains diagnostic matches and is split in a new window, all the matches are cleared and only matches in the new window are shown. The second issue is that if a new buffer with no diagnostic support is open in the current window and that window already contained matches then the matches are still displayed. Here's an illustration of both issues (signs are disabled):

![diagnostic-matches-issue](https://user-images.githubusercontent.com/10026824/36352338-bfeb2092-14b7-11e8-88f4-ae8cf6903304.gif)

The solution is to add an autocommand that updates matches on the `BufEnter` and `WinEnter` events. Here's the result:

![diagnostic-matches-fix](https://user-images.githubusercontent.com/10026824/36352340-c2a64a8c-14b7-11e8-8db2-4f1f54448c65.gif)

Note that it's not perfect as multiple windows of the same buffer won't be updated simultaneously. Supporting that scenario is rather tricky because we would need to go through all the windows to update the matches and switching windows can lead to a lot of issues (like interrupting visual mode) so we don't.

This PR also improves how we update matches by only displaying matches that are not already present and then clearing the remaining ones (similarly to what we do with signs; see PR https://github.com/Valloric/YouCompleteMe/pull/2915) instead of always clearing all the matches then displaying the new ones.

<!-- 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/2922)
<!-- Reviewable:end -->
2018-02-18 17:15:46 -08:00
micbou
c84e70737c
Improve diagnostic matches display 2018-02-18 21:32:00 +01:00
zzbot
92405cb011
Auto merge of #2921 - micbou:capture-command-output, r=bstaletic
[READY] Add function to capture Vim command output

Since there are now two places where we need to capture the output of a Vim command (for diagnostic signs and for syntax keywords), we should add a function for that.

<!-- 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/2921)
<!-- Reviewable:end -->
2018-02-18 06:46:52 -08:00
micbou
b182556804
Add function to capture Vim command output 2018-02-18 14:06:09 +01:00
zzbot
3f287967f3
Auto merge of #2915 - micbou:improve-diagnostic-sign-placement, r=bstaletic
[READY] Improve diagnostic sign placement

Currently, we store internally the signs that we place in the buffer so that when we receive a new batch of diagnostics, we can efficiently add and remove signs by looking at the line positions of the stored signs. However, there is a flaw in that approach. When lines are added or removed to the buffer, Vim update the lines of the signs accordingly and thus our stored signs may not correspond anymore to the actual signs. Here's an example of the issue:

![sign-diagnostic-issue](https://user-images.githubusercontent.com/10026824/36215183-af078aea-11ab-11e8-9827-0e7ab6e4b7b5.gif)
*Where did my signs go? I want a refund!*

The solution is to not store the signs but instead get them directly from Vim each time we need to update them. This is done by parsing the output of the `:sign place` command (Vim doesn't provide an API to properly do that). The same example as above with the proposed changes:

![sign-diagnostic-fix](https://user-images.githubusercontent.com/10026824/36215595-ce3916ee-11ac-11e8-8625-d44dc6c8bd1c.gif)
*Oh, they were there.*

<!-- 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/2915)
<!-- Reviewable:end -->
2018-02-18 04:04:17 -08:00
micbou
5e98da5b09
Improve diagnostic sign placement 2018-02-18 10:46:19 +01:00
zzbot
6a0f016955
Auto merge of #2914 - micbou:replace-range-with-count, r=puremourning
[READY] Replace <range> with <count> in YcmCompleter command

[`<range>` was introduced in Vim 8.0.1089](c168bd4bd3). Use `<count>` instead.  It returns `-1` when no range is given.

Fixes #2913.

<!-- 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/2914)
<!-- Reviewable:end -->
2018-02-14 10:18:56 -08:00
micbou
0f1d7706fe
Replace <range> with <count> in YcmCompleter command
<range> was introduced in Vim 8.0.1089. Use <count> instead.  It returns -1
when no range is given.
2018-02-13 12:06:14 +01:00
zzbot
02f117035e
Auto merge of #2910 - micbou:fix-typo-tests, r=puremourning
[READY] Fix typo in tests name

`:%s/YouCompelteMe/YouCompleteMe`.

<!-- 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/2910)
<!-- Reviewable:end -->
2018-02-12 13:06:31 -08:00
micbou
8ab3f73b4d
Fix typo in tests name 2018-02-12 02:03:05 +01:00
zzbot
5108e3fa68
Auto merge of #2900 - micbou:completer-command-range, r=puremourning
[READY] Add range support to completer command

Implement the API introduced by PR https://github.com/Valloric/ycmd/pull/920.

PR https://github.com/Valloric/YouCompleteMe/pull/2898 is required for a bug-free formatting experience.

<!-- 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/2900)
<!-- Reviewable:end -->
2018-02-11 16:51:49 -08:00
micbou
a13329fe94
Add range support to completer command 2018-02-12 01:50:08 +01:00
micbou
74ee5d4011
Update ycmd
Include the following changes:
 - add formatting support to language server completer;
 - do not grow the notification queue forever.
2018-02-12 01:21:08 +01:00
zzbot
ce1764cf40
Auto merge of #2907 - puremourning:java-additional-fixits, r=micbou
[READY] Support for additional FixIts on java completions, e.g. for automatic imports

Java completer can include FixIts which are applied when a completion
entry is selected. We use the existing mechanism implemented for c-sharp
to perform these edits using the CompleteDone autocommand.

However, the existing mechanism relies on pattern matching the source to
work out which item was completed. Vim patch 8.0.1493 introduces support
for user_data on completion items, so when available we populate it with
the completion array index of the item and use that to get the exact
element that was selected. This is both a lot faster and a lot more
accirate.

Of course when applying these 'FixIts' we don't interrupt the user with
confirmation or the quickfix list as this would just be annoying. If the
server reports that an edit must be made, we just make the edit.

## Use SplitLines in ReplaceChunk to allow newlines to be inserted.

The Java completer frequently inserts newlines as part of its FixIts. We
previously used the base python splitlines implementation which consumed
terminating newlines and also consumed empty strings.

We can therefore now remove the duplicate newline in InsertNamespace, as
this was only to work around the splitlines behaviour.

In the tests, be clear that replacement_text in ReplaceChunks is Unicode

# 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

Automatic addition of import statements is a highly desirable feature when working with languages like java where it is idiomatic to literally import everything by name. Users expect this function: it was the first question I got when i put java live at work.

I was at first reticent to include it due to the irksome complete_done interface, but since Bram merged my PR: 9b56a57cda we can now identify the exact completion selected which makes this a _lot_ more robust.

We can't just remove the old code as nobody will actually have that version yet, but I have tested before and after and it is fully backwardly compatible.

# Test case

A simple way to verify this is with the ycmd tests:

* open `third_party/ycmd/ycmd/tests/java/testdata/simple_eclipse_project/src/com/test/TestFactory.java`
* Invoke completion for `CUTHBERT` on line 19 (replace to end of line)
* select one of the enum values

You should get the enum value automatically imported at the top of the file.

[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/2907)
<!-- Reviewable:end -->
2018-02-11 12:09:42 -08:00
Ben Jackson
7989b7b0fd Support for additional FixIts on java completions
Java completer can include FixIts which are applied when a completion
entry is selected. We use the existing mechanism implemented for c-sharp
to perform these edits using the CompleteDone autocommand.

However, the existing mechanism relies on pattern matching the source to
work out which item was completed. Vim patch 8.0.1493 introduces support
for user_data on completion items, so when available we populate it with
the completion array index of the item and use that to get the exact
element that was selected. This is both a lot faster and a lot more
accirate.

Of course when applying these 'FixIts' we don't interrupt the user with
confirmation or the quickfix list as this would just be annoying. If the
server reports that an edit must be made, we just make the edit. This is
achieved by adding a silent flag to ReplaceChunks.
2018-02-11 18:11:34 +00:00
zzbot
c2a7b3cffc
Auto merge of #2908 - micbou:appveyor-python-36, r=puremourning
[READY] Test for Python 3.6 on AppVeyor

We should always test for the latest version of Python on AppVeyor.

<!-- 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/2908)
<!-- Reviewable:end -->
2018-02-10 22:48:43 -08:00
micbou
fa6af51630
Test for Python 3.6 on AppVeyor 2018-02-11 00:27:15 +01:00
zzbot
39fe6d1f86
Auto merge of #2898 - micbou:line-overlapping-chunks, r=micbou
[READY] Apply chunks from bottom to top

Without the proposed fix, the test included in that PR fails as follows
```
FAIL: ycm.tests.vimsupport_test.ReplaceChunksInBuffer_LineOverlappingChunks_test
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python36\lib\site-packages\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "C:\Users\micbou\projects\YouCompleteMe\python\ycm\tests\vimsupport_test.py", line 768, in ReplaceChunksInBuffer_LineOverlappingChunks_test
    AssertBuffersAreEqualAsBytes( expected_buffer, result_buffer )
  File "C:\Users\micbou\projects\YouCompleteMe\python\ycm\tests\vimsupport_test.py", line 86, in AssertBuffersAreEqualAsBytes
    eq_( ToBytes( result_line ), ToBytes( expected_line ) )
AssertionError: b'    third line' != b'    third '
```
Found the issue while trying to add code formatting support to the language server completer. The test is based on a real-world scenario when formatting with jdt.ls (for some reason, jdt.ls is including the newline of the previous line when fixing indentation).

<!-- 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/2898)
<!-- Reviewable:end -->
2018-02-10 15:20:24 -08:00
micbou
4c6290ccb7
Merge pull request #2906 from puremourning/update-docs
Update help doc
2018-02-11 00:00:31 +01:00
Ben Jackson
aacff42403 Update help doc 2018-02-10 21:47:34 +00:00
micbou
c692b48bc6
Apply chunks from bottom to top 2018-02-10 21:42:41 +01:00
zzbot
0d495578b5
Auto merge of #2863 - puremourning:java-async-diagnostics, r=micbou
[READY] Java support with asynchronous diagnostics and messages

# 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

This change is required for a better user experience when using native
java support

This implements an asynchronous message system using a long-poll request
to the server.

The server provides an endpoint /receive_messages which blocks until
either a timeout occurs or we receive a batch of asynchronous messages.
We send this request asynchronously and poll it 4 times a second to see
if we have received any messages.

The messages may either be simply for display (such as startup progress)
or diagnostics, which override the diagnostics returned by
OnFileReqdyToParse.

In the former case, we simply display the message, accepting that this
might be overwritten by any other message (indeed, requiring this), and
for the latter we fan out diagnostics to any open buffer for the file in
question.

Unfortunately, Vim has bugs related to timers when there is something
displayed (such as a "confirm" prompt or other), so we suspend
background timers when doing subcommands to avoid vim bugs. NOTE: This
requires a new version of Vim (detected by the presence of the
particular functions used).

NOT_READY because:

- the submodule commit points at my repo and requires https://github.com/Valloric/ycmd/pull/857 to be merged
- my spider sense suggest i have more testing to do...

Notes:

- Part 3 (I think) of the Java support PRs. This one actually adds the minimal changes for working java support
- There are about 2 or 3 other PRs to come to add things like automatic module imports, etc.

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

[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/2863)
<!-- Reviewable:end -->
2018-02-10 12:37:57 -08:00