YouCompleteMe/python/ycm/tests
zzbot 95efbc8766
Auto merge of #3208 - micbou:null-character-completion, r=micbou
[READY] Handle null characters in completion response

The `detailed_info` field may contain null characters e.g. `\x00` in Python docstrings (though it doesn't make sense to use such characters in a docstring). Since these characters cannot be evaluated through `pyeval` (and `py3eval`), we replace them with the symbol used by Vim to display them (`^@`).

This PR also rewrites the `_ConvertCompletionDataToVimData` function by relying on two things:
 - [the `insertion_text` field is always defined](600f54de20/ycmd/responses.py (L109));
 - [Vim ignores fields with an empty string](833e5dab14/src/edit.c (L2748-L2755)).

I did some measurements and the performance hit is negligible.

Fixes #3207.

<!-- 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/3208)
<!-- Reviewable:end -->
2018-11-17 05:23:42 -08:00
..
client Auto merge of #3208 - micbou:null-character-completion, r=micbou 2018-11-17 05:23:42 -08:00
testdata Tests for checking that extra_conf_data sended to server from :DebugInfo and :YcmCompleter commands. 2017-03-12 19:03:07 +03:00
__init__.py Allow users to change the options by restarting the server 2018-05-15 23:45:54 +02:00
base_test.py Simplify AdjustCandidateInsertionText function 2018-10-14 18:07:55 +02:00
command_test.py Ignore ft= argument from YcmCompleter command 2018-09-28 01:12:23 +02:00
completion_test.py Update matches for all windows 2018-06-03 18:58:09 +02:00
diagnostic_filter_test.py Add flake8-ycm to test requirements 2018-05-30 02:53:28 +02:00
event_notification_test.py Update JavaScript support and documentation 2018-07-25 22:15:01 +02:00
mock_utils.py Add support for Java diagnostics and asynchronous messages 2018-02-10 16:29:27 +00:00
omni_completer_test.py Convert strings from omnifunc into dictionaries 2018-10-14 18:07:54 +02:00
paths_test.py Drop Python 2.6 and Python 3.3 2018-01-30 18:34:50 +01:00
postcomplete_test.py Handle null characters in completion response 2018-11-17 01:42:05 +01:00
syntax_parse_test.py Do not install aliases from future 2017-03-18 18:24:48 +01:00
test_utils.py Fix Flake8 errors 2018-10-26 23:07:38 +02:00
vimsupport_test.py Fix Flake8 errors 2018-10-26 23:07:38 +02:00
youcompleteme_test.py Fix Flake8 errors 2018-10-26 23:07:38 +02:00