@@ -78,8 +78,7 @@ YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for
78
78
- a [ Clang] [ ] -based engine that provides native semantic code
79
79
completion for C/C++/Objective-C/Objective-C++/CUDA (from now on referred to
80
80
as "the C-family languages"),
81
- - a [ clangd] [ ] -based ** experimental** completion engine for the C-family
82
- languages.
81
+ - a powerful [ clangd] [ ] -based completion engine for the C-family languages.
83
82
- a [ Jedi] [ ] -based completion engine for Python 2 and 3,
84
83
- an [ OmniSharp-Roslyn] [ ] -based completion engine for C#,
85
84
- a [ Gopls] [ ] -based completion engine for Go,
@@ -146,6 +145,8 @@ features plus extra:
146
145
YCM also provides [ semantic IDE-like features] ( #quick-feature-summary ) in a
147
146
number of languages, including:
148
147
148
+ - displaying signature help (argument hints) when entering the arguments to a
149
+ function call
149
150
- finding declarations, definitions, usages, etc. of identifiers,
150
151
- displaying type information for classes, variables, functions etc.,
151
152
- displaying documentation for methods, members, etc. in the preview window,
@@ -154,6 +155,10 @@ number of languages, including:
154
155
- formatting code,
155
156
- removing unused imports, sorting imports, etc.
156
157
158
+ For example, here's a demo of signature help:
159
+
160
+ ![ Signature Help Early Demo] ( https://user-images.githubusercontent.com/10584846/58738348-5060da80-83fd-11e9-9537-d07fdbf4554c.gif )
161
+
157
162
Features vary by file type, so make sure to check out the [ file type feature
158
163
summary] ( #quick-feature-summary ) and the
159
164
[ full list of completer subcommands] ( #ycmcompleter-subcommands ) to
@@ -197,7 +202,7 @@ Compiling YCM **with** semantic support for C-family languages through
197
202
./install.py --clang-completer
198
203
199
204
Compiling YCM ** with** semantic support for C-family languages through
200
- ** experimental clangd** :
205
+ ** clangd** :
201
206
202
207
cd ~/.vim/bundle/YouCompleteMe
203
208
./install.py --clangd-completer
@@ -261,6 +266,8 @@ later are recent enough. You can see the version of Vim installed by running
261
266
` vim --version ` . If the version is too old, you may need to [ compile Vim from
262
267
source] [ vim-build ] (don't worry, it's easy).
263
268
269
+ ** NOTE** : For all features, such as signature help, use Vim 8.1.1875 or later.
270
+
264
271
Install YouCompleteMe with [ Vundle] [ ] .
265
272
266
273
** Remember:** YCM is a plugin with a compiled component. If you ** update** YCM
@@ -288,7 +295,7 @@ Compiling YCM **with** semantic support for C-family languages through
288
295
python3 install.py --clang-completer
289
296
290
297
Compiling YCM ** with** semantic support for C-family languages through
291
- ** experimental clangd** :
298
+ ** clangd** :
292
299
293
300
cd ~/.vim/bundle/YouCompleteMe
294
301
python3 install.py --clangd-completer
@@ -356,6 +363,8 @@ Vim. Look at the features included: `+python/dyn` for Python 2 and
356
363
using a 64-bit client. [ Daily updated installers of 32-bit and 64-bit Vim with
357
364
Python 2 and Python 3 support] [ vim-win-download ] are available.
358
365
366
+ ** NOTE** : For all features, such as signature help, use Vim 8.1.1875 or later.
367
+
359
368
Add the line:
360
369
361
370
set encoding=utf-8
@@ -396,7 +405,7 @@ Compiling YCM **with** semantic support for C-family languages through
396
405
python install.py --clang-completer
397
406
398
407
Compiling YCM ** with** semantic support for C-family languages through
399
- ** experimental clangd** :
408
+ ** clangd** :
400
409
401
410
cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
402
411
python install.py --clangd-completer
@@ -460,6 +469,8 @@ guide](#full-installation-guide).
460
469
461
470
Make sure you have Vim 7.4.1578 with Python 2 or Python 3 support.
462
471
472
+ ** NOTE** : For all features, such as signature help, use Vim 8.1.1875 or later.
473
+
463
474
OpenBSD 5.5 and later have a Vim that's recent enough. You can see the version of
464
475
Vim installed by running ` vim --version ` .
465
476
@@ -481,7 +492,7 @@ Compiling YCM **with** semantic support for C-family languages through
481
492
./install.py --clang-completer
482
493
483
494
Compiling YCM ** with** semantic support for C-family languages through
484
- ** experimental clangd** :
495
+ ** clangd** :
485
496
486
497
cd ~/.vim/bundle/YouCompleteMe
487
498
./install.py --clangd-completer
@@ -571,6 +582,9 @@ process.
571
582
Vim: ` :echo has('python') || has('python3') ` . The output should be 1. If
572
583
it's 0, then get a version of Vim with Python support.
573
584
585
+ ** NOTE** : For all features, such as signature help, use Vim 8.1.1875 or
586
+ later.
587
+
574
588
On Windows, check also if your Vim architecture is 32 or 64-bit. This is
575
589
critical because it must match the Python and the YCM libraries
576
590
architectures. We recommend using a 64-bit Vim.
@@ -589,16 +603,16 @@ process.
589
603
** Download the latest version of ` libclang ` ** . Clang is an open-source
590
604
compiler that can compile C-family languages. The ` libclang ` library it
591
605
provides is used to power the YCM semantic completion engine for those
592
- languages. YCM is designed to work with libclang version 8 .0.0 or higher.
606
+ languages. YCM is designed to work with libclang version 9 .0.0 or higher.
593
607
594
- In addition to ` libclang ` , YCM also supports an ** experimental **
595
- [ clangd ] [ ] -based completer. You can download the latest version of
596
- [ clangd ] [ ] from [ llvm.org releases] [ clang-download ] . Follow Step 4 to learn
597
- how to tell YCM where to find clangd binary. Please note that YCM is
598
- designed to work with [ clangd ] [ ] version 8 .0.0 or higher.
608
+ In addition to ` libclang ` , YCM also supports a [ clangd ] [ ] -based completer.
609
+ You can download the latest version of [ clangd ] [ ] from [ llvm.org
610
+ releases] [ clang-download ] . Follow Step 4 to learn how to tell YCM where to
611
+ find clangd binary. Please note that YCM is designed to work with [ clangd ] [ ]
612
+ version 9 .0.0 or higher.
599
613
600
614
You can use the system libclang or clangd _ only if you are sure it is
601
- version 8 .0.0 or higher_ , otherwise don't. Even if it is, we recommend using
615
+ version 9 .0.0 or higher_ , otherwise don't. Even if it is, we recommend using
602
616
the [ official binaries from llvm.org] [ clang-download ] if at all possible.
603
617
Make sure you download the correct archive file for your OS.
604
618
@@ -791,6 +805,7 @@ Quick Feature Summary
791
805
### C-family languages (C, C++, Objective C, Objective C++, CUDA)
792
806
793
807
* Semantic auto-completion with automatic fixes
808
+ * Signature help (when [using clangd](#selecting-a-c-family-completion-engine))
794
809
* Real-time diagnostic display
795
810
* Go to include/declaration/definition (`GoTo`, etc.)
796
811
* View documentation comments for identifiers (`GetDoc`)
@@ -811,6 +826,7 @@ Quick Feature Summary
811
826
### Python
812
827
813
828
* Semantic auto-completion
829
+ * Signature help
814
830
* Go to definition (`GoTo`)
815
831
* Reference finding (`GoToReferences`)
816
832
* View documentation comments for identifiers (`GetDoc`)
@@ -819,6 +835,7 @@ Quick Feature Summary
819
835
### Go
820
836
821
837
* Semantic auto-completion
838
+ * Signature help
822
839
* Real-time diagnostic display
823
840
* Go to declaration/definition (`GoTo`, etc.)
824
841
* Go to type definition (`GoToType`)
@@ -860,10 +877,8 @@ Quick Feature Summary
860
877
861
878
### Java
862
879
863
- **NOTE**: Java support is currently experimental. Please let us know your
864
- [feedback](#contact).
865
-
866
880
* Semantic auto-completion with automatic import insertion
881
+ * Signature help
867
882
* Real-time diagnostic display
868
883
* Go to definition (`GoTo`, `GoToDefinition`, and `GoToDeclaration` are
869
884
identical)
@@ -980,6 +995,21 @@ matches). A word-boundary character are all capital characters, characters
980
995
preceded by an underscore and the first letter character in the completion
981
996
string.
982
997
998
+ ### Signature Help
999
+
1000
+ Signature help is an **experimental** feature for which we value your feedback.
1001
+ Valid signatures are displayed in a second popup menu and the current signature
1002
+ is highlighed along with the current arguemnt.
1003
+
1004
+ Signature help is triggered in insert mode automatically when
1005
+ `g:ycm_auto_trigger` is enabled and is not supported when it is not enabled.
1006
+
1007
+ The signatures popup is hidden when there are no matching signatures or when you
1008
+ leave insert mode. There is no key binding to clear the popup.
1009
+
1010
+ For more details on this feature and a few demos, check out the
1011
+ [PR that proposed it][signature-help-pr].
1012
+
983
1013
### General Semantic Completion
984
1014
985
1015
You can use Ctrl+Space to trigger the completion suggestions anywhere, even
@@ -1014,9 +1044,7 @@ documentation][compdb]. In short:
1014
1044
[docs][ninja-compdb].
1015
1045
- If using GNU make, check out [compiledb][] or [Bear][].
1016
1046
- For other build systems, check out
1017
- [`.ycm_extra_conf.py`](#option-2-provide-the-flags-manually) below. Note that
1018
- **experimental** [clangd][]-based completer doesn't support this option. So it
1019
- (and anything after this point) only applies to `libclang`-based completer.
1047
+ [`.ycm_extra_conf.py`](#option-2-provide-the-flags-manually) below.
1020
1048
1021
1049
If no [`.ycm_extra_conf.py`](#option-2-provide-the-flags-manually) is found,
1022
1050
YouCompleteMe automatically tries to load a compilation database if there is
@@ -1124,33 +1152,30 @@ your file.
1124
1152
#### Selecting a C-family completion engine
1125
1153
1126
1154
Currently YCM supports two completion engines for C-family semantic completion.
1127
- One libclang-based and an ** experimental** [ clangd] -based completer. When in
1128
- doubt we recommend using the libclang-based engine. Here is a quick comparison
1129
- of the two completer engines:
1130
-
1131
- - ** Project wide indexing** : Clangd has both dynamic and static index support.
1132
- The dynamic index stores up-to-date symbols coming from any files you are
1133
- currently editing, whereas static index contains project-wide symbol
1134
- information. This symbol information is used for code completion and code
1135
- navigation. Whereas libclang is limited to the current translation unit(TU).
1136
- - ** Code navigation** : Clangd provides all the GoTo requests libclang provides and it
1137
- improves those using the above mentioned index information to contain
1138
- project-wide information rather than just the current TU.
1139
- - ** Rename** : Clangd can perform semantic rename operations on the current
1140
- file, whereas libclang doesn’t support such functionality.
1141
- - ** Code Completion** : Clangd can perform code completions at a lower latency
1142
- than libclang; also, it has information about all the symbols in your
1143
- project so it can suggest items outside your current TU and also provides
1144
- proper ` #include ` insertions for those items.
1145
- - ** Format Code** : Clangd provides code formatting either for the selected
1146
- lines or the whole file, whereas libclang doesn’t have such functionality.
1147
- - ** Performance** : Clangd has faster reparse and code completion times
1148
- compared to libclang.
1149
-
1150
- Note that for clangd to have some of the above mentioned functionality, you need
1151
- to enable clangd indexing by adding ` -background-index ` to
1152
- [ g: ycm_clangd_args ] ( #the-gycm_clangd_args-option ) . Clangd will automatically
1153
- enable indexing in version 9.
1155
+ One libclang-based and an [ clangd] -based completer. When in doubt we recommend
1156
+ using the libclang-based engine. Here is a quick comparison of the two completer
1157
+ engines:
1158
+
1159
+ - ** Project wide indexing** : Clangd has both dynamic and static index support.
1160
+ The dynamic index stores up-to-date symbols coming from any files you are
1161
+ currently editing, whereas static index contains project-wide symbol
1162
+ information. This symbol information is used for code completion and code
1163
+ navigation. Whereas libclang is limited to the current translation unit(TU).
1164
+ - ** Code navigation** : Clangd provides all the GoTo requests libclang provides and it
1165
+ improves those using the above mentioned index information to contain
1166
+ project-wide information rather than just the current TU.
1167
+ - ** Rename** : Clangd can perform semantic rename operations on the current
1168
+ file, whereas libclang doesn’t support such functionality.
1169
+ - ** Code Completion** : Clangd can perform code completions at a lower latency
1170
+ than libclang; also, it has information about all the symbols in your
1171
+ project so it can suggest items outside your current TU and also provides
1172
+ proper ` #include ` insertions for those items.
1173
+ - ** Signature help** : Clangd provides signature help so that you can see the
1174
+ names and types of arguments when calling functions.
1175
+ - ** Format Code** : Clangd provides code formatting either for the selected
1176
+ lines or the whole file, whereas libclang doesn’t have such functionality.
1177
+ - ** Performance** : Clangd has faster reparse and code completion times
1178
+ compared to libclang.
1154
1179
1155
1180
To enable:
1156
1181
@@ -1159,13 +1184,10 @@ To enable:
1159
1184
1160
1185
to ` install.py ` while following the [ installation guide] ( #installation ) . As
1161
1186
mentioned before, pass ` --clang-completer ` when in doubt, since the
1162
- [ clangd] [ ] -based completer is still experimental .
1187
+ [ clangd] [ ] -based completer is still in heavy development .
1163
1188
1164
1189
### Java Semantic Completion
1165
1190
1166
- ** NOTE** : Java support is currently experimental. Please let us know your
1167
- [ feedback] ( #contact ) .
1168
-
1169
1191
#### Java quick Start
1170
1192
1171
1193
1 . Ensure that you have enabled the Java completer. See the
@@ -1181,7 +1203,7 @@ mentioned before, pass `--clang-completer` when in doubt, since the
1181
1203
1182
1204
5 . Edit a Java file from your project.
1183
1205
1184
- For the best experience, we highly recommend at least Vim 8.0.1493 when using
1206
+ For the best experience, we highly recommend at least Vim 8.1.1875 when using
1185
1207
Java support with YouCompleteMe.
1186
1208
1187
1209
#### Java Project Files
@@ -3141,6 +3163,20 @@ Default: `[]`
3141
3163
let g:ycm_language_server = []
3142
3164
```
3143
3165
3166
+ ### The ` g:ycm_disable_signature_help ` option
3167
+
3168
+ This option allows you to disable all signature help for all completion engines.
3169
+ There is no way to disable it per-completer. This option is _ reserved_ , meaning
3170
+ that while signature help support remains experimental, its values and meaning
3171
+ may change and it may be removed in a future version.
3172
+
3173
+ Default: ` 0 `
3174
+
3175
+ ``` viml
3176
+ " Disable signature help
3177
+ let g:ycm_disable_signature_help = 1
3178
+ ```
3179
+
3144
3180
FAQ
3145
3181
---
3146
3182
@@ -3315,7 +3351,7 @@ to go through the full installation guide by hand.
3315
3351
### I see ` undefined symbol: clang_getCompletionFixIt ` in the server logs.
3316
3352
3317
3353
This means that the server is trying to load a version of libclang that is too
3318
- old. You need at least libclang 8 .0.0. We recommend running the ` install.py `
3354
+ old. You need at least libclang 9 .0.0. We recommend running the ` install.py `
3319
3355
script without ` --system-libclang ` or downloading the [ latest prebuilt binaries
3320
3356
from llvm.org] [ clang-download ] when going through the [ full installation
3321
3357
guide] ( #full-installation-guide ) .
@@ -3422,6 +3458,10 @@ current file and simple prefix-based filtering.
3422
3458
YCM needs a version of Vim with the timers feature to achieve full
3423
3459
asynchronicity. This feature is available since Vim 7.4.1578.
3424
3460
3461
+ YCM provides powerful new functionality like signature help by using new
3462
+ features in Vim such as popup windows, and new APIs such as ` pum_getpos ` . This
3463
+ requires Vim 8.1.1875 and we strongly recommend using this version or later.
3464
+
3425
3465
### Nasty bugs happen if I have the ` vim-autoclose ` plugin installed
3426
3466
3427
3467
Use the [ delimitMate] [ ] plugin instead. It does the same thing without
@@ -3752,3 +3792,4 @@ This software is licensed under the [GPL v3 license][gpl].
3752
3792
[ vimspector ] : https://github.com/puremourning/vimspector
3753
3793
[ roslyn-releases ] : https://github.com/OmniSharp/omnisharp-roslyn/releases
3754
3794
[ compiledb ] : https://pypi.org/project/compiledb/
3795
+ [ signature-help-pr ] : https://github.com/ycm-core/ycmd/pull/1255
0 commit comments