From c5284f95e56818404bd1226c4d673a99ef142855 Mon Sep 17 00:00:00 2001 From: micbou Date: Sun, 10 Sep 2017 11:14:11 +0200 Subject: [PATCH 1/4] Update ycmd Include following changes: - add option to make relative paths in flags from extra conf absolute; - fix compilation on Haiku; - add libclang detection on FreeBSD; - write python used during build before installing completers; - support unknown languages from tags; - update Universal Ctags languages list; - resolve symlinks in extra conf glob patterns; - update JediHTTP; - update Boost to 1.65.0; - filter and sort candidates when query is empty; - improve LLVM root path search for prebuilt binaries; - inline critical utility functions; - do not sort header paths in filename completer; - implement partial sorting; - add max_num_candidates option; - fix multiline comments and strings issues; - update Clang to 5.0.0. --- third_party/ycmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/ycmd b/third_party/ycmd index 64637740..3ad0300e 160000 --- a/third_party/ycmd +++ b/third_party/ycmd @@ -1 +1 @@ -Subproject commit 6463774035e61a660ad9150a592b8829eb37fd10 +Subproject commit 3ad0300e94edc13799e8bf7b831de8b57153c5aa From 70121844fe7a02c5aaf979c497fd6685f0ec9553 Mon Sep 17 00:00:00 2001 From: micbou Date: Tue, 5 Sep 2017 16:44:15 +0200 Subject: [PATCH 2/4] Add maximum number candidates options to documentation --- README.md | 37 +++++++++++++ doc/youcompleteme.txt | 126 +++++++++++++++++++++++++++--------------- 2 files changed, 118 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 5e8fde1b..152ef220 100644 --- a/README.md +++ b/README.md @@ -1742,6 +1742,43 @@ Default: `0` let g:ycm_min_num_identifier_candidate_chars = 0 ``` +### The `g:ycm_max_num_candidates` option + +This option controls the maximum number of semantic completion suggestions shown +in the completion menu. This only applies to suggestions from semantic +completion engines; see [the `g:ycm_max_identifier_candidates` +option](#the-gycm_max_num_identifier_candidates-option) to limit the number of +suggestions from the identifier-based engine. + +A special value of `0` means there is no limit. + +**NOTE:** Setting this option to `0` or to a value greater than `100` is not +recommended as it will slow down completion when there are a very large number +of suggestions. + +Default: `50` + +```viml +let g:ycm_max_num_candidates = 50 +``` + +### The `g:ycm_max_num_identifier_candidates` option + +This option controls the maximum number of completion suggestions from the +identifier-based engine shown in the completion menu. + +A special value of `0` means there is no limit. + +**NOTE:** Setting this option to `0` or to a value greater than `100` is not +recommended as it will slow down completion when there are a very large number +of suggestions. + +Default: `10` + +```viml +let g:ycm_max_num_identifier_candidates = 10 +``` + ### The `g:ycm_auto_trigger` option When set to `0`, this option turns off YCM's identifier completer (the diff --git a/doc/youcompleteme.txt b/doc/youcompleteme.txt index 4f0f879a..f72f4036 100644 --- a/doc/youcompleteme.txt +++ b/doc/youcompleteme.txt @@ -83,51 +83,53 @@ Contents ~ 10. Options |youcompleteme-options| 1. The |g:ycm_min_num_of_chars_for_completion| option 2. The |g:ycm_min_num_identifier_candidate_chars| option - 3. The |g:ycm_auto_trigger| option - 4. The |g:ycm_filetype_whitelist| option - 5. The |g:ycm_filetype_blacklist| option - 6. The |g:ycm_filetype_specific_completion_to_disable| option - 7. The |g:ycm_show_diagnostics_ui| option - 8. The |g:ycm_error_symbol| option - 9. The |g:ycm_warning_symbol| option - 10. The |g:ycm_enable_diagnostic_signs| option - 11. The |g:ycm_enable_diagnostic_highlighting| option - 12. The |g:ycm_echo_current_diagnostic| option - 13. The |g:ycm_filter_diagnostics| option - 14. The |g:ycm_always_populate_location_list| option - 15. The |g:ycm_open_loclist_on_ycm_diags| option - 16. The |g:ycm_complete_in_comments| option - 17. The |g:ycm_complete_in_strings| option - 18. The |g:ycm_collect_identifiers_from_comments_and_strings| option - 19. The |g:ycm_collect_identifiers_from_tags_files| option - 20. The |g:ycm_seed_identifiers_with_syntax| option - 21. The |g:ycm_extra_conf_vim_data| option - 22. The |g:ycm_server_python_interpreter| option - 23. The |g:ycm_keep_logfiles| option - 24. The |g:ycm_log_level| option - 25. The |g:ycm_auto_start_csharp_server| option - 26. The |g:ycm_auto_stop_csharp_server| option - 27. The |g:ycm_csharp_server_port| option - 28. The |g:ycm_csharp_insert_namespace_expr| option - 29. The |g:ycm_add_preview_to_completeopt| option - 30. The |g:ycm_autoclose_preview_window_after_completion| option - 31. The |g:ycm_autoclose_preview_window_after_insertion| option - 32. The |g:ycm_max_diagnostics_to_display| option - 33. The |g:ycm_key_list_select_completion| option - 34. The |g:ycm_key_list_previous_completion| option - 35. The |g:ycm_key_list_stop_completion| option - 36. The |g:ycm_key_invoke_completion| option - 37. The |g:ycm_key_detailed_diagnostics| option - 38. The |g:ycm_global_ycm_extra_conf| option - 39. The |g:ycm_confirm_extra_conf| option - 40. The |g:ycm_extra_conf_globlist| option - 41. The |g:ycm_filepath_completion_use_working_dir| option - 42. The |g:ycm_semantic_triggers| option - 43. The |g:ycm_cache_omnifunc| option - 44. The |g:ycm_use_ultisnips_completer| option - 45. The |g:ycm_goto_buffer_command| option - 46. The |g:ycm_disable_for_files_larger_than_kb| option - 47. The |g:ycm_python_binary_path| option + 3. The |g:ycm_max_num_candidates| option + 4. The |g:ycm_max_num_identifier_candidates| option + 5. The |g:ycm_auto_trigger| option + 6. The |g:ycm_filetype_whitelist| option + 7. The |g:ycm_filetype_blacklist| option + 8. The |g:ycm_filetype_specific_completion_to_disable| option + 9. The |g:ycm_show_diagnostics_ui| option + 10. The |g:ycm_error_symbol| option + 11. The |g:ycm_warning_symbol| option + 12. The |g:ycm_enable_diagnostic_signs| option + 13. The |g:ycm_enable_diagnostic_highlighting| option + 14. The |g:ycm_echo_current_diagnostic| option + 15. The |g:ycm_filter_diagnostics| option + 16. The |g:ycm_always_populate_location_list| option + 17. The |g:ycm_open_loclist_on_ycm_diags| option + 18. The |g:ycm_complete_in_comments| option + 19. The |g:ycm_complete_in_strings| option + 20. The |g:ycm_collect_identifiers_from_comments_and_strings| option + 21. The |g:ycm_collect_identifiers_from_tags_files| option + 22. The |g:ycm_seed_identifiers_with_syntax| option + 23. The |g:ycm_extra_conf_vim_data| option + 24. The |g:ycm_server_python_interpreter| option + 25. The |g:ycm_keep_logfiles| option + 26. The |g:ycm_log_level| option + 27. The |g:ycm_auto_start_csharp_server| option + 28. The |g:ycm_auto_stop_csharp_server| option + 29. The |g:ycm_csharp_server_port| option + 30. The |g:ycm_csharp_insert_namespace_expr| option + 31. The |g:ycm_add_preview_to_completeopt| option + 32. The |g:ycm_autoclose_preview_window_after_completion| option + 33. The |g:ycm_autoclose_preview_window_after_insertion| option + 34. The |g:ycm_max_diagnostics_to_display| option + 35. The |g:ycm_key_list_select_completion| option + 36. The |g:ycm_key_list_previous_completion| option + 37. The |g:ycm_key_list_stop_completion| option + 38. The |g:ycm_key_invoke_completion| option + 39. The |g:ycm_key_detailed_diagnostics| option + 40. The |g:ycm_global_ycm_extra_conf| option + 41. The |g:ycm_confirm_extra_conf| option + 42. The |g:ycm_extra_conf_globlist| option + 43. The |g:ycm_filepath_completion_use_working_dir| option + 44. The |g:ycm_semantic_triggers| option + 45. The |g:ycm_cache_omnifunc| option + 46. The |g:ycm_use_ultisnips_completer| option + 47. The |g:ycm_goto_buffer_command| option + 48. The |g:ycm_disable_for_files_larger_than_kb| option + 49. The |g:ycm_python_binary_path| option 11. FAQ |youcompleteme-faq| 1. I used to be able to 'import vim' in '.ycm_extra_conf.py', but now can't |youcompleteme-i-used-to-be-able-to-import-vim-in-.ycm_extra_conf.py-but-now-cant| 2. I get 'ImportError' exceptions that mention 'PyInit_ycm_core' or 'initycm_core' |youcompleteme-i-get-importerror-exceptions-that-mention-pyinit_ycm_core-or-initycm_core| @@ -2034,6 +2036,40 @@ Default: '0' let g:ycm_min_num_identifier_candidate_chars = 0 < ------------------------------------------------------------------------------- +The *g:ycm_max_num_candidates* option + +This option controls the maximum number of semantic completion suggestions +shown in the completion menu. This only applies to suggestions from semantic +completion engines; see the 'g:ycm_max_identifier_candidates' option to limit +the number of suggestions from the identifier-based engine. + +A special value of '0' means there is no limit. + +**NOTE:** Setting this option to '0' or to a value greater than '100' is not +recommended as it will slow down completion when there are a very large number +of suggestions. + +Default: '50' +> + let g:ycm_max_num_candidates = 50 +< +------------------------------------------------------------------------------- +The *g:ycm_max_num_identifier_candidates* option + +This option controls the maximum number of completion suggestions from the +identifier-based engine shown in the completion menu. + +A special value of '0' means there is no limit. + +**NOTE:** Setting this option to '0' or to a value greater than '100' is not +recommended as it will slow down completion when there are a very large number +of suggestions. + +Default: '10' +> + let g:ycm_max_num_identifier_candidates = 10 +< +------------------------------------------------------------------------------- The *g:ycm_auto_trigger* option When set to '0', this option turns off YCM's identifier completer (the as-you- From ed9f0b9449bd913af7f87020dcf5fa7ceab48a61 Mon Sep 17 00:00:00 2001 From: micbou Date: Sun, 10 Sep 2017 11:30:53 +0200 Subject: [PATCH 3/4] Update extra conf link in documentation --- README.md | 2 +- doc/youcompleteme.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 152ef220..95d675e7 100644 --- a/README.md +++ b/README.md @@ -3101,7 +3101,7 @@ This software is licensed under the [GPL v3 license][gpl]. [vim]: http://www.vim.org/ [syntastic]: https://github.com/scrooloose/syntastic [lightline]: https://github.com/itchyny/lightline.vim -[flags_example]: https://raw.githubusercontent.com/Valloric/ycmd/6463774035e61a660ad9150a592b8829eb37fd10/cpp/ycm/.ycm_extra_conf.py +[flags_example]: https://raw.githubusercontent.com/Valloric/ycmd/3ad0300e94edc13799e8bf7b831de8b57153c5aa/cpp/ycm/.ycm_extra_conf.py [compdb]: http://clang.llvm.org/docs/JSONCompilationDatabase.html [subsequence]: https://en.wikipedia.org/wiki/Subsequence [listtoggle]: https://github.com/Valloric/ListToggle diff --git a/doc/youcompleteme.txt b/doc/youcompleteme.txt index f72f4036..d21a352b 100644 --- a/doc/youcompleteme.txt +++ b/doc/youcompleteme.txt @@ -3423,7 +3423,7 @@ References ~ [44] http://clang.llvm.org/docs/JSONCompilationDatabase.html [45] https://ninja-build.org/manual.html [46] https://github.com/rizsotto/Bear -[47] https://raw.githubusercontent.com/Valloric/ycmd/6463774035e61a660ad9150a592b8829eb37fd10/cpp/ycm/.ycm_extra_conf.py +[47] https://raw.githubusercontent.com/Valloric/ycmd/3ad0300e94edc13799e8bf7b831de8b57153c5aa/cpp/ycm/.ycm_extra_conf.py [48] https://github.com/rdnetto/YCM-Generator [49] http://ternjs.net/doc/manual.html#configuration [50] http://ternjs.net/doc/manual.html#server From c5bec8f6901a84ccce56ee8833e2ff8715405953 Mon Sep 17 00:00:00 2001 From: micbou Date: Sun, 10 Sep 2017 12:13:21 +0200 Subject: [PATCH 4/4] Expect GetCompletions_Cache_List_Unicode test to fail This test is expected to fail since we now filter and sort candidates on empty query. --- python/ycm/tests/omni_completer_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/ycm/tests/omni_completer_test.py b/python/ycm/tests/omni_completer_test.py index 0bc1e2a9..fabf2a37 100644 --- a/python/ycm/tests/omni_completer_test.py +++ b/python/ycm/tests/omni_completer_test.py @@ -393,6 +393,8 @@ def OmniCompleter_GetCompletions_NoCache_ObjectListObject_test( ycm ): ) +@ExpectedFailure( 'Filtering on unicode is not supported by the server', + contains_string( "value for 'completions' was <[]>" ) ) @YouCompleteMeInstance( { 'cache_omnifunc': 1 } ) def OmniCompleter_GetCompletions_Cache_List_Unicode_test( ycm ): def Omnifunc( findstart, base ):