Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,10 @@ installing [the Rust source code][rust-src], so no configuration is necessary.
`rust-analyzer` supports a myriad of options. These are configured using [LSP
configuration](#lsp-configuration), and are [documented here](https://rust-analyzer.github.io/manual.html#configuration]).

For global (`$VIMRC`-level) configuration without a `.ycm_extra_conf.py`, you can
also use the [`g:ycm_completer_settings`](#the-gycm_completer_settings-option)
option.

### Go Semantic Completion

Completions and GoTo commands should work out of the box (provided that you
Expand All @@ -1565,6 +1569,10 @@ def Settings( **kwargs ):
}
```

For global (`$VIMRC`-level) configuration without a `.ycm_extra_conf.py`, you can
also use the [`g:ycm_completer_settings`](#the-gycm_completer_settings-option)
option.

### JavaScript and TypeScript Semantic Completion

**NOTE:** YCM originally used the [Tern][] engine for JavaScript but due to
Expand Down Expand Up @@ -1648,6 +1656,8 @@ Many LSP servers allow some level of user configuration. YCM enables this with
the help of `.ycm_extra_conf.py` files. Here's an example of jdt.ls user
examples of configuring the likes of PHP, Ruby, Kotlin, D, and many, many more.

See also [`g:ycm_completer_settings`](#the-gycm_completer_settings-option).

```python
def Settings( **kwargs ):
if kwargs[ 'language' ] == 'java':
Expand Down Expand Up @@ -3852,6 +3862,44 @@ tells YCM where is the TSServer executable located.
Similar to [the `gopls` path](#the-gycm-gopls-binaty-path), this option
tells YCM where is the Omnisharp-Roslyn executable located.

### The `g:ycm_completer_settings` option

Sets global LSP configuration for ycmd's predefined completers (Java, Go, Rust,
C-family) without needing per-project `.ycm_extra_conf.py` files.

The dictionary keys map to completer names: `java`, `go`, `rust`, and
`cpp`/`c`/`objc`/`objcpp`/`cuda` for C-family. The values are dictionaries of
server settings - equivalent to the `ls` key in the `Settings()` function of
`.ycm_extra_conf.py`.

**Settings priority** (lowest to highest):
1. Hardcoded completer defaults
2. `g:ycm_completer_settings`
3. The `ls` key returned by `Settings()` in `.ycm_extra_conf.py`

Example:

```viml
let g:ycm_completer_settings = {
\ 'go': {
\ 'hoverKind': 'SynopsisDocumentation'
\ },
\ 'rust': {
\ 'diagnostics': {
\ 'disabled': [
\ 'inactive-code',
\ ]
\ },
\ }
\}
```

Default: `{}`

```viml
let g:ycm_completer_settings = {}
```

### The `g:ycm_update_diagnostics_in_insert_mode` option

With async diagnostics, LSP servers might send new diagnostics mid-typing.
Expand Down
37 changes: 37 additions & 0 deletions doc/youcompleteme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ Contents ~
64. The |g:ycm_tsserver_binary_path| option
65. The |g:ycm_roslyn_binary_path| option
66. The |g:ycm_update_diagnostics_in_insert_mode| option
67. The |g:ycm_completer_settings| option
12. FAQ |youcompleteme-faq|
13. Contributor Code of Conduct |youcompleteme-contributor-code-of-conduct|
14. Contact |youcompleteme-contact|
Expand Down Expand Up @@ -4069,6 +4070,42 @@ The *g:ycm_roslyn_binary_path* option
Similar to the 'gopls' path, this option tells YCM where is the
Omnisharp-Roslyn executable located.

-------------------------------------------------------------------------------
The *g:ycm_completer_settings* option

Sets global LSP configuration for ycmd's predefined completers (Java, Go, Rust,
C-family) without needing per-project '.ycm_extra_conf.py' files.

The dictionary keys map to completer names: 'java', 'go', 'rust', and
'cpp'/'c'/'objc'/'objcpp'/'cuda' for C-family. The values are dictionaries of
server settings - equivalent to the 'ls' key in the 'Settings()' function of
'.ycm_extra_conf.py'.

Settings priority (lowest to highest):
1. Hardcoded completer defaults
2. 'g:ycm_completer_settings'
3. The 'ls' key returned by 'Settings()' in '.ycm_extra_conf.py'

Example:
>
let g:ycm_completer_settings = {
\ 'go': {
\ 'hoverKind': 'SynopsisDocumentation'
\ },
\ 'rust': {
\ 'diagnostics': {
\ 'disabled': [
\ 'inactive-code',
\ ]
\ },
\ }
\}
<

Default: '{}'
>
let g:ycm_completer_settings = {}
<
-------------------------------------------------------------------------------
The *g:ycm_update_diagnostics_in_insert_mode* option

Expand Down
Loading