Skip to content

Commit 2707cc0

Browse files
committed
Update README for signature help
clangd no longer experrimental. Note version of Vim required for full functionality. And other updates in ycmd: - pull request #1315: Update RLS to build 2019-09-05 - pull request #1312: Upgrade to TypeScript version 3.6.3 - pull request #1301: Update go completer - pull request #1317: Update JDT to 0.42.0 - pull request #1316: Roslyn update - pull request #1331: specify a range for LSP codeAction request - pull request #1335: Update jdt.ls to snapshot 45 - pull request #1334: LLVM9 update - pull request #1333: Add GetDoc for clangd completer - pull request #1332: OnBufferVisit for clangd completer - pull request #1336: added support for typescriptreact (.tsx) files - pull request #1339: user configuration of Format JDT completer - pull request #1343: Revert #1275 (fixes issues with python GoTo) - pull request #1324: SignatureHelp: Support signature for clangd - pull request #1344: SignatureHelp: Python - pull request #1345: SignatureHelp: Java - pull request #1346: SignatureHelp: Go
1 parent 4e7797c commit 2707cc0

File tree

1 file changed

+93
-52
lines changed

1 file changed

+93
-52
lines changed

README.md

Lines changed: 93 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ YouCompleteMe is a fast, as-you-type, fuzzy-search code completion engine for
7878
- a [Clang][]-based engine that provides native semantic code
7979
completion for C/C++/Objective-C/Objective-C++/CUDA (from now on referred to
8080
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.
8382
- a [Jedi][]-based completion engine for Python 2 and 3,
8483
- an [OmniSharp-Roslyn][]-based completion engine for C#,
8584
- a [Gopls][]-based completion engine for Go,
@@ -146,6 +145,8 @@ features plus extra:
146145
YCM also provides [semantic IDE-like features](#quick-feature-summary) in a
147146
number of languages, including:
148147

148+
- displaying signature help (argument hints) when entering the arguments to a
149+
function call
149150
- finding declarations, definitions, usages, etc. of identifiers,
150151
- displaying type information for classes, variables, functions etc.,
151152
- displaying documentation for methods, members, etc. in the preview window,
@@ -154,6 +155,10 @@ number of languages, including:
154155
- formatting code,
155156
- removing unused imports, sorting imports, etc.
156157

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+
157162
Features vary by file type, so make sure to check out the [file type feature
158163
summary](#quick-feature-summary) and the
159164
[full list of completer subcommands](#ycmcompleter-subcommands) to
@@ -197,7 +202,7 @@ Compiling YCM **with** semantic support for C-family languages through
197202
./install.py --clang-completer
198203

199204
Compiling YCM **with** semantic support for C-family languages through
200-
**experimental clangd**:
205+
**clangd**:
201206

202207
cd ~/.vim/bundle/YouCompleteMe
203208
./install.py --clangd-completer
@@ -261,6 +266,8 @@ later are recent enough. You can see the version of Vim installed by running
261266
`vim --version`. If the version is too old, you may need to [compile Vim from
262267
source][vim-build] (don't worry, it's easy).
263268

269+
**NOTE**: For all features, such as signature help, use Vim 8.1.1875 or later.
270+
264271
Install YouCompleteMe with [Vundle][].
265272

266273
**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
288295
python3 install.py --clang-completer
289296

290297
Compiling YCM **with** semantic support for C-family languages through
291-
**experimental clangd**:
298+
**clangd**:
292299

293300
cd ~/.vim/bundle/YouCompleteMe
294301
python3 install.py --clangd-completer
@@ -356,6 +363,8 @@ Vim. Look at the features included: `+python/dyn` for Python 2 and
356363
using a 64-bit client. [Daily updated installers of 32-bit and 64-bit Vim with
357364
Python 2 and Python 3 support][vim-win-download] are available.
358365

366+
**NOTE**: For all features, such as signature help, use Vim 8.1.1875 or later.
367+
359368
Add the line:
360369

361370
set encoding=utf-8
@@ -396,7 +405,7 @@ Compiling YCM **with** semantic support for C-family languages through
396405
python install.py --clang-completer
397406

398407
Compiling YCM **with** semantic support for C-family languages through
399-
**experimental clangd**:
408+
**clangd**:
400409

401410
cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe
402411
python install.py --clangd-completer
@@ -460,6 +469,8 @@ guide](#full-installation-guide).
460469

461470
Make sure you have Vim 7.4.1578 with Python 2 or Python 3 support.
462471

472+
**NOTE**: For all features, such as signature help, use Vim 8.1.1875 or later.
473+
463474
OpenBSD 5.5 and later have a Vim that's recent enough. You can see the version of
464475
Vim installed by running `vim --version`.
465476

@@ -481,7 +492,7 @@ Compiling YCM **with** semantic support for C-family languages through
481492
./install.py --clang-completer
482493

483494
Compiling YCM **with** semantic support for C-family languages through
484-
**experimental clangd**:
495+
**clangd**:
485496

486497
cd ~/.vim/bundle/YouCompleteMe
487498
./install.py --clangd-completer
@@ -571,6 +582,9 @@ process.
571582
Vim: `:echo has('python') || has('python3')`. The output should be 1. If
572583
it's 0, then get a version of Vim with Python support.
573584

585+
**NOTE**: For all features, such as signature help, use Vim 8.1.1875 or
586+
later.
587+
574588
On Windows, check also if your Vim architecture is 32 or 64-bit. This is
575589
critical because it must match the Python and the YCM libraries
576590
architectures. We recommend using a 64-bit Vim.
@@ -589,16 +603,16 @@ process.
589603
**Download the latest version of `libclang`**. Clang is an open-source
590604
compiler that can compile C-family languages. The `libclang` library it
591605
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.
593607

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.
599613

600614
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
602616
the [official binaries from llvm.org][clang-download] if at all possible.
603617
Make sure you download the correct archive file for your OS.
604618

@@ -791,6 +805,7 @@ Quick Feature Summary
791805
### C-family languages (C, C++, Objective C, Objective C++, CUDA)
792806
793807
* Semantic auto-completion with automatic fixes
808+
* Signature help (when [using clangd](#selecting-a-c-family-completion-engine))
794809
* Real-time diagnostic display
795810
* Go to include/declaration/definition (`GoTo`, etc.)
796811
* View documentation comments for identifiers (`GetDoc`)
@@ -811,6 +826,7 @@ Quick Feature Summary
811826
### Python
812827
813828
* Semantic auto-completion
829+
* Signature help
814830
* Go to definition (`GoTo`)
815831
* Reference finding (`GoToReferences`)
816832
* View documentation comments for identifiers (`GetDoc`)
@@ -819,6 +835,7 @@ Quick Feature Summary
819835
### Go
820836
821837
* Semantic auto-completion
838+
* Signature help
822839
* Real-time diagnostic display
823840
* Go to declaration/definition (`GoTo`, etc.)
824841
* Go to type definition (`GoToType`)
@@ -860,10 +877,8 @@ Quick Feature Summary
860877
861878
### Java
862879
863-
**NOTE**: Java support is currently experimental. Please let us know your
864-
[feedback](#contact).
865-
866880
* Semantic auto-completion with automatic import insertion
881+
* Signature help
867882
* Real-time diagnostic display
868883
* Go to definition (`GoTo`, `GoToDefinition`, and `GoToDeclaration` are
869884
identical)
@@ -980,6 +995,21 @@ matches). A word-boundary character are all capital characters, characters
980995
preceded by an underscore and the first letter character in the completion
981996
string.
982997
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+
9831013
### General Semantic Completion
9841014
9851015
You can use Ctrl+Space to trigger the completion suggestions anywhere, even
@@ -1014,9 +1044,7 @@ documentation][compdb]. In short:
10141044
[docs][ninja-compdb].
10151045
- If using GNU make, check out [compiledb][] or [Bear][].
10161046
- 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.
10201048
10211049
If no [`.ycm_extra_conf.py`](#option-2-provide-the-flags-manually) is found,
10221050
YouCompleteMe automatically tries to load a compilation database if there is
@@ -1124,33 +1152,30 @@ your file.
11241152
#### Selecting a C-family completion engine
11251153

11261154
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.
11541179

11551180
To enable:
11561181

@@ -1159,13 +1184,10 @@ To enable:
11591184

11601185
to `install.py` while following the [installation guide](#installation). As
11611186
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.
11631188

11641189
### Java Semantic Completion
11651190

1166-
**NOTE**: Java support is currently experimental. Please let us know your
1167-
[feedback](#contact).
1168-
11691191
#### Java quick Start
11701192

11711193
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
11811203

11821204
5. Edit a Java file from your project.
11831205

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
11851207
Java support with YouCompleteMe.
11861208

11871209
#### Java Project Files
@@ -3141,6 +3163,20 @@ Default: `[]`
31413163
let g:ycm_language_server = []
31423164
```
31433165

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+
31443180
FAQ
31453181
---
31463182

@@ -3315,7 +3351,7 @@ to go through the full installation guide by hand.
33153351
### I see `undefined symbol: clang_getCompletionFixIt` in the server logs.
33163352

33173353
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`
33193355
script without `--system-libclang` or downloading the [latest prebuilt binaries
33203356
from llvm.org][clang-download] when going through the [full installation
33213357
guide](#full-installation-guide).
@@ -3422,6 +3458,10 @@ current file and simple prefix-based filtering.
34223458
YCM needs a version of Vim with the timers feature to achieve full
34233459
asynchronicity. This feature is available since Vim 7.4.1578.
34243460

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+
34253465
### Nasty bugs happen if I have the `vim-autoclose` plugin installed
34263466

34273467
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].
37523792
[vimspector]: https://github.com/puremourning/vimspector
37533793
[roslyn-releases]: https://github.com/OmniSharp/omnisharp-roslyn/releases
37543794
[compiledb]: https://pypi.org/project/compiledb/
3795+
[signature-help-pr]: https://github.com/ycm-core/ycmd/pull/1255

0 commit comments

Comments
 (0)