{"id":13393903,"url":"https://github.com/ycm-core/YouCompleteMe","last_synced_at":"2025-03-13T19:31:51.847Z","repository":{"id":3017792,"uuid":"4037197","full_name":"ycm-core/YouCompleteMe","owner":"ycm-core","description":"A code-completion engine for Vim","archived":false,"fork":false,"pushed_at":"2024-10-13T21:53:03.000Z","size":36954,"stargazers_count":25450,"open_issues_count":26,"forks_count":2806,"subscribers_count":559,"default_branch":"master","last_synced_at":"2024-10-30T06:57:38.624Z","etag":null,"topics":["code-analysis","code-completion","semantic-engine","vim"],"latest_commit_sha":null,"homepage":"http://ycm-core.github.io/YouCompleteMe/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ycm-core.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"COPYING.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-04-16T03:12:14.000Z","updated_at":"2024-10-30T04:00:12.000Z","dependencies_parsed_at":"2023-07-10T02:21:32.118Z","dependency_job_id":"91e689fb-eea1-4fb3-9dbd-b58019466f08","html_url":"https://github.com/ycm-core/YouCompleteMe","commit_stats":{"total_commits":2429,"total_committers":197,"mean_commits":12.32994923857868,"dds":0.5516673528200906,"last_synced_commit":"63ab13e95141c252c545f9a6c7144ced6790d68f"},"previous_names":["valloric/youcompleteme"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycm-core%2FYouCompleteMe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycm-core%2FYouCompleteMe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycm-core%2FYouCompleteMe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ycm-core%2FYouCompleteMe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ycm-core","download_url":"https://codeload.github.com/ycm-core/YouCompleteMe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242956533,"owners_count":20212456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-analysis","code-completion","semantic-engine","vim"],"created_at":"2024-07-30T17:01:02.234Z","updated_at":"2025-03-13T19:31:51.823Z","avatar_url":"https://github.com/ycm-core.png","language":"Python","funding_links":[],"categories":["Install Vundle","Python","Integrated Development Environment","HarmonyOS","Cross-Platform","文本编辑器扩展","vim","Emacs [elpy](https://github.com/jorgenschaefer/elpy)：Emacs Python 开发环境。","Uncategorized"],"sub_categories":["Caveats","Windows Manager","JavaScript","YAML"],"readme":"YouCompleteMe: a code-completion engine for Vim\n===============================================\n\n[![Gitter room](https://img.shields.io/gitter/room/Valloric/YouCompleteMe.svg)](https://gitter.im/Valloric/YouCompleteMe)\n[![Build status](https://dev.azure.com/YouCompleteMe/YCM/_apis/build/status/ycm-core.YouCompleteMe?branchName=master)](https://dev.azure.com/YouCompleteMe/YCM/_build?definitionId=3\u0026branchName=master)\n[![Coverage status](https://img.shields.io/codecov/c/github/ycm-core/YouCompleteMe/master.svg)](https://codecov.io/gh/ycm-core/YouCompleteMe)\n\nHelp, Advice, Support\n---------------------\n\nLooking for help, advice, or support? Having problems getting YCM to work?\n\nFirst carefully read the [installation instructions](#installation) for your OS.\nWe recommend you use the supplied `install.py` - the \"full\" installation guide\nis for rare, advanced use cases and most users should use `install.py`.\n\nIf the server isn't starting and you're getting a \"YouCompleteMe unavailable\"\nerror, check the [Troubleshooting][wiki-troubleshooting] guide.\n\nNext, check the [User Guide](#user-guide) section on the semantic completer that\nyou are using. For C/C++/Objective-C/Objective-C++/CUDA, you  _must_ read [this\nsection](#c-family-semantic-completion).\n\nFinally, check the [FAQ][wiki-faq].\n\nIf, after reading the installation and user guides, and checking the FAQ, you're\nstill having trouble, check the [contacts](#contact) section below for how to\nget in touch.\n\nPlease do **NOT** go to #vim on Freenode for support. Please contact the\nYouCompleteMe maintainers directly using the [contact details](#contact) below.\n\n# Vundle\n\nPlease note that the below instructions suggest using Vundle. Currently there\nare problems with Vundle, so here are some [alternative instructions](https://github.com/ycm-core/YouCompleteMe/issues/4134#issuecomment-1446235584) using Vim packages.\n\nContents\n--------\n\n- [Intro](#intro)\n- [Installation](#installation)\n    - [Requirements](#requirements)\n    - [macOS](#macos)\n    - [Linux 64-bit](#linux-64-bit)\n    - [Windows](#windows)\n    - [Full Installation Guide](#full-installation-guide)\n- [Quick Feature Summary](#quick-feature-summary)\n- [User Guide](#user-guide)\n    - [General Usage](#general-usage)\n    - [Client-Server Architecture](#client-server-architecture)\n    - [Completion String Ranking](#completion-string-ranking)\n    - [General Semantic Completion](#general-semantic-completion)\n    - [Signature Help](#signature-help)\n    - [Semantic Highlighting](#semantic-highlighting)\n    - [Inlay Hints](#inlay-hints)\n    - [C-family Semantic Completion](#c-family-semantic-completion)\n    - [Java Semantic Completion](#java-semantic-completion)\n    - [C# Semantic Completion](#c-semantic-completion)\n    - [Python Semantic Completion](#python-semantic-completion)\n    - [Rust Semantic Completion](#rust-semantic-completion)\n    - [Go Semantic Completion](#go-semantic-completion)\n    - [JavaScript and TypeScript Semantic Completion](#javascript-and-typescript-semantic-completion)\n    - [Semantic Completion for Other Languages](#semantic-completion-for-other-languages)\n    - [LSP Configuration](#lsp-configuration)\n    - [Writing New Semantic Completers](#writing-new-semantic-completers)\n    - [Diagnostic Display](#diagnostic-display)\n        - [Diagnostic Highlighting Groups](#diagnostic-highlighting-groups)\n    - [Symbol Search](#symbol-search)\n    - [Type/Call Hierarchy](#typecall-hierarchy)\n- [Commands](#commands)\n    - [YcmCompleter subcommands](#ycmcompleter-subcommands)\n        - [GoTo Commands](#goto-commands)\n        - [Semantic Information Commands](#semantic-information-commands)\n        - [Refactoring Commands](#refactoring-commands)\n        - [Miscellaneous Commands](#miscellaneous-commands)\n- [Functions](#functions)\n- [Autocommands](#autocommands)\n- [Options](#options)\n- [FAQ](#faq)\n- [Contributor Code of Conduct](#contributor-code-of-conduct)\n- [Contact](#contact)\n- [License](#license)\n- [Sponsorship](#sponsorship)\n\n\nIntro\n-----\n\nYouCompleteMe is a fast, as-you-type, fuzzy-search code completion,\ncomprehension and refactoring engine for [Vim][].\n\nIt has several completion engines built-in and supports any protocol-compliant\nLanguage Server, so can work with practically any language. YouCompleteMe\ncontains:\n\n- an identifier-based engine that works with every programming language,\n- a powerful [clangd][]-based engine that provides native semantic code\n  completion for C/C++/Objective-C/Objective-C++/CUDA (from now on referred to\n  as \"the C-family languages\"),\n- a [Jedi][]-based completion engine for Python 2 and 3,\n- an [OmniSharp-Roslyn][]-based completion engine for C#,\n- a [Gopls][]-based completion engine for Go,\n- a [TSServer][]-based completion engine for JavaScript and TypeScript,\n- a [rust-analyzer][]-based completion engine for Rust,\n- a [jdt.ls][]-based completion engine for Java.\n- a [generic Language Server Protocol implementation for any language](#plugging-an-arbitrary-lsp-server)\n- and an omnifunc-based completer that uses data from Vim's omnicomplete system\n  to provide semantic completions for many other languages (Ruby, PHP, etc.).\n\n![YouCompleteMe GIF completion demo](https://i.imgur.com/0OP4ood.gif)\n\nHere's an explanation of what happened in the last GIF demo above.\n\nFirst, realize that **no keyboard shortcuts had to be pressed** to get the list\nof completion candidates at any point in the demo. The user just types and the\nsuggestions pop up by themselves. If the user doesn't find the completion\nsuggestions relevant and/or just wants to type, they can do so; the completion\nengine will not interfere.\n\nWhen the user sees a useful completion string being offered, they press the TAB\nkey to accept it. This inserts the completion string. Repeated presses of the\nTAB key cycle through the offered completions.\n\nIf the offered completions are not relevant enough, the user can continue typing\nto further filter out unwanted completions.\n\nA critical thing to notice is that the completion **filtering is NOT based on\nthe input being a string prefix of the completion** (but that works too). The\ninput needs to be a _[subsequence][] match_ of a completion. This is a fancy way\nof saying that any input characters need to be present in a completion string in\nthe order in which they appear in the input. So `abc` is a subsequence of\n`xaybgc`, but not of `xbyxaxxc`. After the filter, a complicated sorting system\nranks the completion strings so that the most relevant ones rise to the top of\nthe menu (so you usually need to press TAB just once).\n\n**All of the above works with any programming language** because of the\nidentifier-based completion engine. It collects all of the identifiers in the\ncurrent file and other files you visit (and your tags files) and searches them\nwhen you type (identifiers are put into per-filetype groups).\n\nThe demo also shows the semantic engine in use. When the user presses `.`, `-\u003e`\nor `::` while typing in insert mode (for C++; different triggers are used for\nother languages), the semantic engine is triggered (it can also be triggered\nwith a keyboard shortcut; see the rest of the docs).\n\nThe last thing that you can see in the demo is YCM's diagnostic display features\n(the little red X that shows up in the left gutter; inspired by [Syntastic][])\nif you are editing a C-family file. As the completer engine compiles your file\nand detects warnings or errors, they will be presented in various ways. You\ndon't need to save your file or press any keyboard shortcut to trigger this, it\n\"just happens\" in the background.\n\n**And that's not all...**\n\nYCM might be the only Vim completion engine with the correct Unicode support.\nThough we do assume UTF-8 everywhere.\n\n![YouCompleteMe GIF unicode demo](https://user-images.githubusercontent.com/10026824/34471853-af9cf32a-ef53-11e7-8229-de534058ddc4.gif)\n\nYCM also provides [semantic IDE-like features](#quick-feature-summary) in a\nnumber of languages, including:\n\n- displaying signature help (argument hints) when entering the arguments to a\n  function call (Vim only)\n- [finding declarations, definitions, usages](#goto-commands), etc.\n  of identifiers, and an [interactive symbol finder](#symbol-search)\n- [displaying type information](#the-gettype-subcommand) for classes,\n  variables, functions etc.,\n- displaying documentation for methods, members, etc. in the [preview\n  window](#the-getdoc-subcommand), or in a\n  [popup next to the cursor](#the-gycm_auto_hover-option) (Vim only)\n- [fixing common coding errors](#the-fixit-subcommand), like missing\n  semi-colons, typos, etc.,\n- [semantic renaming](#the-refactorrename-subcommand) of variables across files,\n- formatting code,\n- removing unused imports, sorting imports, etc.\n\nFor example, here's a demo of signature help:\n\n![Signature Help Early Demo](https://user-images.githubusercontent.com/10584846/58738348-5060da80-83fd-11e9-9537-d07fdbf4554c.gif)\n\nBelow we can see YCM being able to do a few things:\n\n- Retrieve references across files\n- Go to declaration/definition\n- Expand `auto` in C++\n- Fix some common errors, and provide refactorings, with `FixIt`\n- Not shown in the GIF are `GoToImplementation` and `GoToType`\n  for servers that support it.\n\n![YouCompleteMe GIF subcommands demo](https://i.imgur.com/nmUUbdl.gif)\n\nAnd here's some documentation being shown in a hover popup, automatically and\nmanually:\n\n![hover demo](https://user-images.githubusercontent.com/10584846/80312146-91af6500-87db-11ea-996b-7396f3134d1f.gif)\n\nFeatures vary by file type, so make sure to check out the [file type feature\nsummary](#quick-feature-summary) and the\n[full list of completer subcommands](#ycmcompleter-subcommands) to\nfind out what's available for your favourite languages.\n\nYou'll also find that YCM has filepath completers (try typing `./` in a file)\nand a completer that integrates with [UltiSnips][].\n\nInstallation\n------------\n\n### Requirements\n\n| Runtime | Min Version | Recommended Version (full support) | Python |\n|---------|-------------|------------------------------------|--------|\n| Vim     | 9.1.0016    | 9.1.0016                           | 3.8    |\n| Neovim  | 0.5         | Vim 9.1.0016                       | 3.8    |\n\n#### Supported Vim Versions\n\nOur policy is to support the Vim version that's in the latest LTS of Ubuntu.\n\nVim must have a [working Python 3 runtime](#supported-python-runtime).\n\nFor Neovim users, our policy is to require the latest released version.\nCurrently, Neovim 0.5.0 is required.  Please note that some features are not\navailable in Neovim, and Neovim is not officially supported.\n\n#### Supported Python runtime\n\nYCM has two components: A server and a client. Both the server and client\nrequire Python 3.8 or later 3.x release. \n\nFor the Vim client, Vim must be, compiled with `--enable-shared` (or\n`--enable-framework` on macOS). You can check if this is working with `:py3\nimport sys; print( sys.version)`. It should say something like `3.8.2 (...)`.\n\nFor Neovim, you must have a python 3.8 runtime and the Neovim python\nextensions. See Neovim's `:help provider-python` for how to set that up.\n\nFor the server, you must run the `install.py` script with a python 3.8 (or\nlater) runtime. Anaconda etc. are not supported. YCM will remember the runtime\nyou used to run `install.py` and will use that when launching the server, so if\nyou usually use anaconda, then make sure to use the full path to a real cpython3,\ne.g. `/usr/bin/python3 install.py --all` etc.\n\nOur policy is to support the python3 version that's available in the latest\nUbuntu LTS (similar to our Vim version policy). We don't increase the Python\nruntime version without a reason, though. Typically, we do this when the current\npython version we're using goes out of support. At that time we will typically\npick a version that will be supported for a number of years.\n\n#### Supported Compilers\n\nIn order to provide the best possible performance and stability, ycmd has\nupdated its code to C++17. This requires a version bump of the minimum\nsupported compilers. The new requirements are:\n\n| Compiler | Current Min    |\n|----------|----------------|\n| GCC      | 8              |\n| Clang    | 7              |\n| MSVC     | 15.7 (VS 2017) |\n\nYCM requires CMake 3.13 or greater. If your CMake is too old, you may be able to\nsimply `pip install --user cmake` to get a really new version.\n\n#### Individual completer requirements\n\nWhen enabling language support for a particular language, there may be runtime\nrequirements, such as needing a very recent Java Development Kit for Java\nsupport. In general, YCM is not in control of the required versions for the\ndownstream compilers, though we do our best to signal where we know them.\n\n### macOS\n\n#### Quick start, installing all completers\n\n- Install YCM plugin via [Vundle][]\n- Install CMake, MacVim and Python 3; Note that the pre-installed *macOS system*\n  Vim is not supported (due to it having broken Python integration).\n\n```\n$ brew install cmake python go nodejs\n```\n\n- Install mono from [Mono Project](mono-install-macos) (NOTE: on Intel Macs you\n  can also `brew install mono`. On arm Macs, you may require Rosetta)\n\n- For Java support you must install a JDK, one way to do this is with Homebrew:\n\n```\n$ brew install java\n$ sudo ln -sfn $(brew --prefix java)/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk\n```\n\n- Pre-installed macOS *system* Vim does not support Python 3. So you need to\n  install either a Vim that supports Python 3 OR [MacVim][] with\n  [Homebrew][brew]:\n\n  - Option 1: Installing a Vim that supports Python 3\n  \n  ```\n  brew install vim\n  ```\n\n  - Option 2: Installing [MacVim][]\n  \n  ```\n  brew install macvim\n  ```\n\n- Compile YCM.\n\n  - For Intel and arm64 Macs, the bundled libclang/clangd work:\n\n    ```\n    cd ~/.vim/bundle/YouCompleteMe\n    python3 install.py --all\n    ```\n\n  - If you have troubles with finding system frameworks or C++ standard library,\n    try using the homebrew llvm:\n\n    ```\n    brew install llvm\n    cd ~/.vim/bundle/YouCompleteMe\n    python3 install.py --system-libclang --all\n    ```\n\n    And edit your vimrc to add the following line to use the Homebrew llvm's\n    clangd:\n\n    ```viml\n    \" Use homebrew's clangd\n    let g:ycm_clangd_binary_path = trim(system('brew --prefix llvm')).'/bin/clangd'\n    ```\n\n\n- For using an arbitrary LSP server, check [the relevant\n  section](#plugging-an-arbitrary-lsp-server)\n\n#### Explanation for the quick start\n\nThese instructions (using `install.py`) are the quickest way to install\nYouCompleteMe, however they may not work for everyone. If the following\ninstructions don't work for you, check out the [full installation\nguide](#full-installation-guide).\n\nA supported Vim version with Python 3 is required. [MacVim][] is a good option,\neven if you only use the terminal. YCM won't work with the pre-installed Vim\nfrom Apple as its Python support is broken. If you don't already use a Vim\nthat supports Python 3 or [MacVim][], install it with [Homebrew][brew]. Install\nCMake as well:\n\n    brew install vim cmake     \n    \n   OR\n\n    brew install macvim cmake\n\nInstall YouCompleteMe with [Vundle][].\n\n**Remember:** YCM is a plugin with a compiled component. If you **update** YCM\nusing Vundle and the `ycm_core` library APIs have changed (happens\nrarely), YCM will notify you to recompile it. You should then rerun the install\nprocess.\n\n**NOTE:** If you want C-family completion, you MUST have the latest Xcode\ninstalled along with the latest Command Line Tools (they are installed\nautomatically when you run `clang` for the first time, or manually by running\n`xcode-select --install`)\n\nCompiling YCM **with** semantic support for C-family languages through\n**clangd**:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\n./install.py --clangd-completer\n```\n\nCompiling YCM **without** semantic support for C-family languages:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\n./install.py\n```\n\n\nThe following additional language support options are available:\n\n- C# support: install by downloading the [Mono macOS package][mono-install-macos]\n  and add `--cs-completer` when calling `install.py`.\n- Go support: install [Go][go-install] and add `--go-completer` when calling\n  `install.py`.\n- JavaScript and TypeScript support: install [Node.js 18+ and npm][npm-install] and\n  add `--ts-completer` when calling `install.py`.\n- Rust support: add `--rust-completer` when calling `install.py`.\n- Java support: install [JDK 17][jdk-install] and add\n  `--java-completer` when calling `install.py`.\n\nTo simply compile with everything enabled, there's a `--all` flag. So, to\ninstall with all language features, ensure `xbuild`, `go`, `node` and `npm`\ntools are installed and in your `PATH`, then simply run:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\n./install.py --all\n```\n\nThat's it. You're done. Refer to the _User Guide_ section on how to use YCM.\nDon't forget that if you want the C-family semantic completion engine to work,\nyou will need to provide the compilation flags for your project to YCM. It's all\nin the User Guide.\n\nYCM comes with sane defaults for its options, but you still may want to take a\nlook at what's available for configuration. There are a few interesting options\nthat are conservatively turned off by default that you may want to turn on.\n\n### Linux 64-bit\n\nThe following assume you're using Ubuntu 24.04.\n\n#### Quick start, installing all completers\n\n- Install YCM plugin via [Vundle][]\n- Install CMake, Vim and Python\n\n```\napt install build-essential cmake vim-nox python3-dev\n```\n\n- Install mono-complete, go, node, java, and npm\n\n```\napt install mono-complete golang nodejs openjdk-17-jdk openjdk-17-jre npm\n```\n\n- Compile YCM\n\n```\ncd ~/.vim/bundle/YouCompleteMe\npython3 install.py --all\n```\n\n- For plugging an arbitrary LSP server, check [the relevant section](#plugging-an-arbitrary-lsp-server)\n\n#### Explanation for the quick start\n\nThese instructions (using `install.py`) are the quickest way to install\nYouCompleteMe, however they may not work for everyone. If the following\ninstructions don't work for you, check out the [full installation\nguide](#full-installation-guide).\n\nMake sure you have a supported version of Vim with Python 3 support and a\nsupported compiler. The latest LTS of Ubuntu is the minimum platform for simple\ninstallation. For earlier releases or other distributions, you may have to do\nsome work to acquire the dependencies.\n\nIf your Vim version is too old, you may need to [compile Vim from\nsource][vim-build] (don't worry, it's easy).\n\nInstall YouCompleteMe with [Vundle][].\n\n**Remember:** YCM is a plugin with a compiled component. If you **update** YCM\nusing Vundle and the `ycm_core` library APIs have changed (which happens rarely), YCM\nwill notify you to recompile it. You should then rerun the installation process.\n\nInstall development tools, CMake, and Python headers:\n\n- Fedora-like distributions:\n\n```\nsudo dnf install cmake gcc-c++ make python3-devel\n```\n\n- Ubuntu LTS:\n\n```\nsudo apt install build-essential cmake3 python3-dev\n```\n\nCompiling YCM **with** semantic support for C-family languages through\n**clangd**:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\npython3 install.py --clangd-completer\n```\n\nCompiling YCM **without** semantic support for C-family languages:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\npython3 install.py\n```\n\nThe following additional language support options are available:\n\n- C# support: install [Mono][mono-install-linux] and add `--cs-completer`\n  when calling `install.py`.\n- Go support: install [Go][go-install] and add `--go-completer` when calling\n  `install.py`.\n- JavaScript and TypeScript support: install [Node.js 18+ and npm][npm-install] and\n  add `--ts-completer` when calling `install.py`.\n- Rust support: add `--rust-completer` when calling `install.py`.\n- Java support: install [JDK 17][jdk-install] and add\n  `--java-completer` when calling `install.py`.\n\nTo simply compile with everything enabled, there's a `--all` flag. So, to\ninstall with all language features, ensure `xbuild`, `go`, `node`, and `npm`\ntools are installed and in your `PATH`, then simply run:\n\n```\ncd ~/.vim/bundle/YouCompleteMe\npython3 install.py --all\n```\n\nThat's it. You're done. Refer to the _User Guide_ section on how to use YCM.\nDon't forget that if you want the C-family semantic completion engine to work,\nyou will need to provide the compilation flags for your project to YCM. It's all\nin the User Guide.\n\nYCM comes with sane defaults for its options, but you still may want to take a\nlook at what's available for configuration. There are a few interesting options\nthat are conservatively turned off by default that you may want to turn on.\n\n### Windows\n\n#### Quick start, installing all completers\n\n- Install YCM plugin via [Vundle][]\n- Install [Visual Studio Build Tools 2019][visual-studio-download]\n- Install CMake, Vim and Python\n- Install go, node and npm\n- Compile YCM\n\n```\ncd YouCompleteMe\npython3 install.py --all\n```\n\n- Add `set encoding=utf-8` to your [vimrc][]\n- For plugging an arbitrary LSP server, check [the relevant section](#plugging-an-arbitrary-lsp-server)\n\n#### Explanation for the quick start\n\nThese instructions (using `install.py`) are the quickest way to install\nYouCompleteMe, however they may not work for everyone. If the following\ninstructions don't work for you, check out the [full installation\nguide](#full-installation-guide).\n\n**Important:** we assume that you are using the `cmd.exe` command prompt and\nthat you know how to add an executable to the PATH environment variable.\n\nMake sure you have a supported Vim version with Python 3 support. You\ncan check the version and which Python is supported by typing `:version` inside\nVim. Look at the features included: `+python3/dyn` for Python 3.\nTake note of the Vim architecture, i.e. 32 or\n64-bit. It will be important when choosing the Python installer. We recommend\nusing a 64-bit client. [Daily updated installers of 32-bit and 64-bit Vim with\nPython 3 support][vim-win-download] are available.\n\nAdd the following line to your [vimrc][] if not already present.:\n\n```viml\nset encoding=utf-8\n```\n\nThis option is required by YCM. Note that it does not prevent you from editing a\nfile in another encoding than UTF-8.  You can do that by specifying [the `++enc`\nargument][++enc] to the `:e` command.\n\nInstall YouCompleteMe with [Vundle][].\n\n**Remember:** YCM is a plugin with a compiled component. If you **update** YCM\nusing Vundle and the `ycm_core` library APIs have changed (happens\nrarely), YCM will notify you to recompile it. You should then rerun the install\nprocess.\n\nDownload and install the following software:\n\n- [Python 3][python-win-download]. Be sure to pick the version\n  corresponding to your Vim architecture. It is _Windows x86_ for a 32-bit Vim\n  and _Windows x86-64_ for a 64-bit Vim. We recommend installing Python 3.\n  Additionally, the version of Python you install must match up exactly with\n  the version of Python that Vim is looking for. Type `:version` and look at the\n  bottom of the page at the list of compiler flags. Look for flags that look\n  similar to `-DDYNAMIC_PYTHON3_DLL=\\\"python36.dll\\\"`. This indicates\n  that Vim is looking for Python 3.6. You'll need one or the other installed,\n  matching the version number exactly.\n- [CMake][cmake-download]. Add CMake executable to the PATH environment\n  variable.\n- [Build Tools for Visual Studio 2019][visual-studio-download]. During setup,\n  select _C++ build tools_ in _Workloads_.\n\nCompiling YCM **with** semantic support for C-family languages through\n**clangd**:\n\n```\ncd %USERPROFILE%/vimfiles/bundle/YouCompleteMe\npython install.py --clangd-completer\n```\n\nCompiling YCM **without** semantic support for C-family languages:\n\n```\ncd %USERPROFILE%/vimfiles/bundle/YouCompleteMe\npython install.py\n```\n\nThe following additional language support options are available:\n\n- C# support: add `--cs-completer` when calling `install.py`.\n  Be sure that [the build utility `msbuild` is in your PATH][add-msbuild-to-path].\n- Go support: install [Go][go-install] and add `--go-completer` when calling\n  `install.py`.\n- JavaScript and TypeScript support: install [Node.js 18+ and npm][npm-install] and\n  add `--ts-completer` when calling `install.py`.\n- Rust support: add `--rust-completer` when calling `install.py`.\n- Java support: install [JDK 17][jdk-install] and add\n  `--java-completer` when calling `install.py`.\n\nTo simply compile with everything enabled, there's a `--all` flag. So, to\ninstall with all language features, ensure `msbuild`, `go`, `node` and `npm`\ntools are installed and in your `PATH`, then simply run:\n\n```\ncd %USERPROFILE%/vimfiles/bundle/YouCompleteMe\npython install.py --all\n```\n\nYou can specify the Microsoft Visual C++ (MSVC) version using the `--msvc`\noption. YCM officially supports MSVC 15 (2017), MSVC 16 (Visual Studio 2019) \nand MSVC 17 (Visual Studio 17 2022).\n\nThat's it. You're done. Refer to the _User Guide_ section on how to use YCM.\nDon't forget that if you want the C-family semantic completion engine to work,\nyou will need to provide the compilation flags for your project to YCM. It's all\nin the User Guide.\n\nYCM comes with sane defaults for its options, but you still may want to take a\nlook at what's available for configuration. There are a few interesting options\nthat are conservatively turned off by default that you may want to turn on.\n\n### Full Installation Guide\n\nThe [full installation guide][wiki-full-install] has been moved to the wiki.\n\nQuick Feature Summary\n-----\n\n### General (all languages)\n\n* Super-fast identifier completer including tags files and syntax elements\n* Intelligent suggestion ranking and filtering\n* File and path suggestions\n* Suggestions from Vim's omnifunc\n* UltiSnips snippet suggestions\n\n### C-family languages (C, C++, Objective C, Objective C++, CUDA)\n\n* Semantic auto-completion with automatic fixes\n* Signature help\n* Real-time diagnostic display\n* Go to include/declaration/definition (`GoTo`, etc.)\n* Go to alternate file (e.g. associated header `GoToAlternateFile`)\n* Find Symbol (`GoToSymbol`), with interactive search\n* Document outline (`GoToDocumentOutline`), with interactive search\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Automatically fix certain errors (`FixIt`)\n* Perform refactoring (`FixIt`)\n* Reference finding (`GoToReferences`)\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n* Code formatting (`Format`)\n* Semantic highlighting\n* Inlay hints\n* Type hierarchy\n* Call hierarchy\n\n### C♯\n\n* Semantic auto-completion\n* Signature help\n* Real-time diagnostic display\n* Go to declaration/definition (`GoTo`, etc.)\n* Go to implementation (`GoToImplementation`)\n* Find Symbol (`GoToSymbol`), with interactive search\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Automatically fix certain errors (`FixIt`)\n* Perform refactoring (`FixIt`)\n* Management of OmniSharp-Roslyn server instance\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n* Code formatting (`Format`)\n\n### Python\n\n* Semantic auto-completion\n* Signature help\n* Go to definition (`GoTo`)\n* Find Symbol (`GoToSymbol`), with interactive search\n* Reference finding (`GoToReferences`)\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n\n### Go\n\n* Semantic auto-completion\n* Signature help\n* Real-time diagnostic display\n* Go to declaration/definition (`GoTo`, etc.)\n* Go to type definition (`GoToType`)\n* Go to implementation (`GoToImplementation`)\n* Document outline (`GoToDocumentOutline`), with interactive search\n* Automatically fix certain errors (`FixIt`)\n* Perform refactoring (`FixIt`)\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Code formatting (`Format`)\n* Management of `gopls` server instance\n* Inlay hints\n* Call hierarchy\n\n### JavaScript and TypeScript\n\n* Semantic auto-completion with automatic import insertion\n* Signature help\n* Real-time diagnostic display\n* Go to definition (`GoTo`, `GoToDefinition`, and `GoToDeclaration` are\n  identical)\n* Go to type definition (`GoToType`)\n* Go to implementation (`GoToImplementation`)\n* Find Symbol (`GoToSymbol`), with interactive search\n* Reference finding (`GoToReferences`)\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Automatically fix certain errors and perform refactoring (`FixIt`)\n* Perform refactoring (`FixIt`)\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n* Code formatting (`Format`)\n* Organize imports (`OrganizeImports`)\n* Management of `TSServer` server instance\n* Inlay hints\n* Call hierarchy\n\n### Rust\n\n* Semantic auto-completion\n* Real-time diagnostic display\n* Go to declaration/definition (`GoTo`, etc.)\n* Go to implementation (`GoToImplementation`)\n* Reference finding (`GoToReferences`)\n* Document outline (`GoToDocumentOutline`), with interactive search\n* View documentation comments for identifiers (`GetDoc`)\n* Automatically fix certain errors (`FixIt`)\n* Perform refactoring (`FixIt`)\n* Type information for identifiers (`GetType`)\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n* Code formatting (`Format`)\n* Management of `rust-analyzer` server instance\n* Semantic highlighting\n* Inlay hints\n* Call hierarchy\n\n### Java\n\n* Semantic auto-completion with automatic import insertion\n* Signature help\n* Real-time diagnostic display\n* Go to definition (`GoTo`, `GoToDefinition`, and `GoToDeclaration` are\n  identical)\n* Go to type definition (`GoToType`)\n* Go to implementation (`GoToImplementation`)\n* Find Symbol (`GoToSymbol`), with interactive search\n* Reference finding (`GoToReferences`)\n* Document outline (`GoToDocumentOutline`), with interactive search\n* View documentation comments for identifiers (`GetDoc`)\n* Type information for identifiers (`GetType`)\n* Automatically fix certain errors including code generation (`FixIt`)\n* Renaming symbols (`RefactorRename \u003cnew name\u003e`)\n* Code formatting (`Format`)\n* Organize imports (`OrganizeImports`)\n* Detection of Java projects\n* Execute custom server command (`ExecuteCommand \u003cargs\u003e`)\n* Management of `jdt.ls` server instance\n* Semantic highlighting\n* Inlay hints\n* Type hierarchy\n* Call hierarchy\n\nUser Guide\n----------\n\n### General Usage\n\nIf the offered completions are too broad, keep typing characters; YCM will\ncontinue refining the offered completions based on your input.\n\nFiltering is \"smart-case\" and \"smart-[diacritic][]\" sensitive; if you are\ntyping only lowercase letters, then it's case-insensitive. If your input\ncontains uppercase letters, then the uppercase letters in your query must\nmatch uppercase letters in the completion strings (the lowercase letters still\nmatch both). On top of that, a letter with no diacritic marks will match that\nletter with or without marks:\n\n\u003ctable\u003e\n\u003ctbody\u003e\n\u003ctr\u003e\n  \u003cth\u003ematches\u003c/th\u003e\n  \u003cth\u003efoo\u003c/th\u003e\n  \u003cth\u003efôo\u003c/th\u003e\n  \u003cth\u003efOo\u003c/th\u003e\n  \u003cth\u003efÔo\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003cth\u003efoo\u003c/th\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003cth\u003efôo\u003c/th\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003cth\u003efOo\u003c/th\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n  \u003cth\u003efÔo\u003c/th\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e❌\u003c/td\u003e\n  \u003ctd\u003e✔️\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\nUse the TAB key to accept a completion and continue pressing TAB to cycle\nthrough the completions. Use Shift-TAB to cycle backward. Note that if you're\nusing console Vim (that is, not gvim or MacVim) then it's likely that the\nShift-TAB binding will not work because the console will not pass it to Vim.\nYou can remap the keys; see the [Options](#options) section below.\n\nKnowing a little bit about how YCM works internally will prevent confusion. YCM\nhas several completion engines: an identifier-based completer that collects all\nof the identifiers in the current file and other files you visit (and your tags\nfiles) and searches them when you type (identifiers are put into per-filetype\ngroups).\n\nThere are also several semantic engines in YCM. There are libclang-based and\nclangd-based completers that provide semantic completion for C-family languages.\nThere's a Jedi-based completer for semantic completion for Python. There's also\nan omnifunc-based completer that uses data from Vim's omnicomplete system to\nprovide semantic completions when no native completer exists for that language\nin YCM.\n\nThere are also other completion engines, like the UltiSnips completer and the\nfilepath completer.\n\nYCM automatically detects which completion engine would be the best in any\nsituation. On occasion, it queries several of them at once, merges the\noutputs and presents the results to you.\n\n### Client-Server Architecture\n\nYCM has a client-server architecture; the Vim part of YCM is only a thin client\nthat talks to the [ycmd HTTP+JSON server][ycmd] that has the vast majority of\nYCM logic and functionality. The server is started and stopped automatically as\nyou start and stop Vim.\n\n### Completion String Ranking\n\nThe subsequence filter removes any completions that do not match the input, but\nthen the sorting system kicks in. It's actually very complicated and uses lots\nof factors, but suffice it to say that \"word boundary\" (WB) subsequence\ncharacter matches are \"worth\" more than non-WB matches. In effect, this means\nthat given an input of \"gua\", the completion \"getUserAccount\" would be ranked higher\nin the list than the \"Fooguxa\" completion (both of which are subsequence\nmatches). Word-boundary characters are all capital characters, characters\npreceded by an underscore, and the first letter character in the completion\nstring.\n\n### Signature Help\n\nValid signatures are displayed in a second popup menu and the current signature\nis highlighted along with the current argument.\n\nSignature help is triggered in insert mode automatically when\n`g:ycm_auto_trigger` is enabled and is not supported when it is not enabled.\n\nThe signatures popup is hidden when there are no matching signatures or when you\nleave insert mode. If you want to manually control when it is visible, you can\nmap something to `\u003cplug\u003eYCMToggleSignatureHelp` (see below).\n\nFor more details on this feature and a few demos, check out the\n[PR that proposed it][signature-help-pr].\n\n#### Dismiss signature help\n\nThe signature help popup sometimes gets in the way. You can toggle its\nvisibility with a mapping. YCM provides the \"Plug\" mapping\n`\u003cPlug\u003e(YCMToggleSignatureHelp)` for this.\n\nFor example, to hide/show the signature help popup by pressing Ctrl+l in insert\nmode: `imap \u003csilent\u003e \u003cC-l\u003e \u003cPlug\u003e(YCMToggleSignatureHelp)`.\n\n_NOTE_: No default mapping is provided because insert mappings are very\ndifficult to create without breaking or overriding some existing functionality.\nCtrl-l is not a suggestion, just an example.\n\n### Semantic highlighting\n\nSemantic highlighting is the process where the buffer text is coloured according\nto the underlying semantic type of the word, rather than classic syntax\nhighlighting based on regular expressions. This can be powerful additional data\nthat we can process very quickly.\n\nThis feature is only supported in Vim.\n\nFor example, here is a function with classic highlighting:\n\n![highliting-classic](https://user-images.githubusercontent.com/10584846/173137003-a265e8b0-84db-4993-98f0-03ee81b9de94.png)\n\nAnd here is the same function with semantic highlighting:\n\n![highliting-semantic](https://user-images.githubusercontent.com/10584846/173137012-7547de0b-145f-45fa-ace3-18943acd2141.png)\n\nAs you can see, the function calls, macros, etc. are correctly identified. \n\nThis can be enabled globally with `let g:ycm_enable_semantic_highlighting=1` or\nper buffer, by setting `b:ycm_enable_semantic_highlighting`.\n\n#### Customising the highlight groups\n\nYCM uses text properties (see `:help text-prop-intro`) for semantic\nhighlighting. In order to customise the coloring, you can define the text\nproperties that are used.\n\nIf you define a text property named `YCM_HL_\u003ctoken type\u003e`, then it will be used\nin place of the defaults. The `\u003ctoken type\u003e` is defined as the Language Server\nProtocol semantic token type, defined in the [LSP Spec](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens).\n\nSome servers also use custom values. In this case, YCM prints a warning\nincluding the token type name that you can customise.\n\nFor example, to render `parameter` tokens using the `Normal` highlight group,\nyou can do this:\n\n```viml\ncall prop_type_add( 'YCM_HL_parameter', { 'highlight': 'Normal' } )\n```\n\nMore generally, this pattern can be useful for customising the groups:\n\n```viml\nlet MY_YCM_HIGHLIGHT_GROUP = {\n      \\   'typeParameter': 'PreProc',\n      \\   'parameter': 'Normal',\n      \\   'variable': 'Normal',\n      \\   'property': 'Normal',\n      \\   'enumMember': 'Normal',\n      \\   'event': 'Special',\n      \\   'member': 'Normal',\n      \\   'method': 'Normal',\n      \\   'class': 'Special',\n      \\   'namespace': 'Special',\n      \\ }\n\nfor tokenType in keys( MY_YCM_HIGHLIGHT_GROUP )\n  call prop_type_add( 'YCM_HL_' . tokenType,\n                    \\ { 'highlight': MY_YCM_HIGHLIGHT_GROUP[ tokenType ] } )\nendfor\n```\n\n## Inlay hints\n\n**NOTE**: Highly experimental feature, requiring Vim 9.0.214 or later (not\nsupported in NeoVim).\n\nWhen `g:ycm_enable_inlay_hints` (globally) or `b:ycm_enable_inlay_hints` (for a\nspecific buffer) is set to `1`, then YCM will insert inlay hints as supported by\nthe language semantic engine.\n\nAn inlay hint is text that is rendered on the screen that is not part of the buffer and\nis often used to mark up the type or name of arguments, parameters, etc. which\nhelp the developer understand the semantics of the code.\n\nHere are some examples:\n\n* C\n\n![c-inlay](https://user-images.githubusercontent.com/10584846/185708054-68074fc0-e50c-4a65-887c-da6f372b8982.png)\n\n* TypeScript\n\n![ts-inlay](https://user-images.githubusercontent.com/10584846/185708156-b52970ce-005f-4f0b-97e7-bdf8feeefedc.png)\n\n* Go\n\n![go-inlay](https://user-images.githubusercontent.com/10584846/185708242-e42dab6f-1847-46f1-8585-2d9f2c8a76dc.png)\n\n### Highlight groups\n\nBy default, YCM renders the inlay hints with the `NonText` highlight group. To\noverride this, define the `YcmInlayHint` highlight yourself, e.g. in your\n`.vimrc`:\n\n```viml\nhi link YcmInlayHint Comment\n```\n\nSimilar to semantic highlighting above, you can override specific highlighting\nfor different inlay hint types by defining text properties named after the kind\nof inlay hint, for example:\n\n```viml\ncall prop_type_add( 'YCM_INLAY_Type', #{ highlight: 'Comment' } )\n```\n\nThe list of inlay hint kinds can be found in `python/ycm/inlay_hints.py`\n\n### Options\n\n* `g:ycm_enable_inlay_hints` or `b:ycm_enable_inlay_hints` - enable/disable\n  globally or for local buffer\n* `g:ycm_clear_inlay_hints_in_insert_mode` - set to `1` to remove all inlay\n  hints when entering insert mode and reinstate them when leaving insert mode\n\n### Toggling\n\nInlay hints can add a lot of text to the screen and may be distracting. You can\ntoggle them on/off instantly, by mapping something to\n`\u003cPlug\u003e(YCMToggleInlayHints)`, for example:\n\n```viml\nnnoremap \u003csilent\u003e \u003clocalleader\u003eh \u003cPlug\u003e(YCMToggleInlayHints)\n```\n\nNo default mapping is provided for this due to the personal nature of mappings.\n\n### General Semantic Completion\n\nYou can use Ctrl+Space to trigger the completion suggestions anywhere, even\nwithout a string prefix. This is useful to see which top-level functions are\navailable for use.\n\n### C-family Semantic Completion\n\n**NOTE:** YCM originally used the `libclang` based engine for C-family, but\nusers should migrate to clangd, as it provides more features and better\nperformance. Users who rely on `override_filename` in their `.ycm_extra_conf.py`\nwill need to stay on the old `libclang` engine. Instructions on how to stay on\nthe old engine are available on [the wiki][libclang-instructions].\n\nSome of the features of clangd:\n\n- **Project wide indexing**: Clangd has both dynamic and static index support.\n  The dynamic index stores up-to-date symbols coming from any files you are\n  currently editing, whereas static index contains project-wide symbol\n  information. This symbol information is used for code completion and code\n  navigation. Whereas libclang is limited to the current translation unit(TU).\n- **Code navigation**: Clangd provides all the GoTo requests libclang provides and it\n  improves those using the above-mentioned index information to contain\n  project-wide information rather than just the current TU.\n- **Rename**: Clangd can perform semantic rename operations on the current\n  file, whereas libclang doesn't support such functionality.\n- **Code Completion**: Clangd can perform code completions at a lower latency\n  than libclang; also, it has information about all the symbols in your\n  project so it can suggest items outside your current TU and also provides\n  proper `#include` insertions for those items.\n- **Signature help**: Clangd provides signature help so that you can see the\n  names and types of arguments when calling functions.\n- **Format Code**: Clangd provides code formatting either for the selected\n  lines or the whole file, whereas libclang doesn't have such functionality.\n- **Performance**: Clangd has faster re-parse and code completion times\n  compared to libclang.\n\n#### Installation\n\nOn supported architectures, the `install.py` script will download a suitable\nclangd (`--clangd-completer`) or libclang (`--clang-completer`) for you.\nSupported architectures are:\n\n* Linux glibc \u003e= 2.39 (Intel, armv7-a, aarch64) - built on ubuntu 24.04\n* MacOS \u003e=10.15 (Intel, arm64)\n  - For Intel, compatibility per clang.llvm.org downloads\n  - For arm64, macOS 10.15+\n* Windows (Intel) - compatibility per clang.llvm.org downloads\n\n***clangd***:\n\nTypically, clangd is installed by the YCM installer (either with `--all` or with\n`--clangd-completer`). This downloads a pre-built `clangd` binary for your\narchitecture. If your OS or architecture is not supported or is too old, you can\ninstall a compatible `clangd` and use [`g:ycm_clangd_binary_path`]() to point to\nit.\n\n***libclang***:\n\n`libclang` can be enabled also with `--all` or `--clang-completer`. As with\n`clangd`, YCM will try and download a version of `libclang` that is suitable for\nyour environment, but again if your environment can't be supported, you can\nbuild or acquire `libclang` for yourself and specify it when building, as:\n\n```\n$ EXTRA_CMAKE_ARGS='-DPATH_TO_LLVM_ROOT=/path/to/your/llvm' ./install.py --clang-completer --system-libclang\n```\n\nPlease note that if using custom `clangd` or `libclang` it _must_ match the\nversion that YCM requires. Currently YCM requires ***clang 17.0.1***.\n\n#### Compile flags\n\nIn order to perform semantic analysis such as code completion, `GoTo`, and\ndiagnostics, YouCompleteMe uses `clangd`, which makes use of\nclang compiler, sometimes also referred to as LLVM. Like any compiler,\nclang also requires a set of compile flags in order to parse your code. Simply\nput: If clang can't parse your code, YouCompleteMe can't provide semantic\nanalysis.\n\nThere are 2 methods that can be used to provide compile flags to clang:\n\n#### Option 1: Use a [compilation database][compdb]\n\nThe easiest way to get YCM to compile your code is to use a compilation\ndatabase.  A compilation database is usually generated by your build system\n(e.g. `CMake`) and contains the compiler invocation for each compilation unit in\nyour project.\n\nFor information on how to generate a compilation database, see the [clang\ndocumentation][compdb]. In short:\n\n- If using CMake, add `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` when configuring (or\n  add `set( CMAKE_EXPORT_COMPILE_COMMANDS ON )` to `CMakeLists.txt`) and copy or\n  symlink the generated database to the root of your project.\n- If using Ninja, check out the `compdb` tool (`-t compdb`) in its\n  [docs][ninja-compdb].\n- If using GNU make, check out [compiledb][] or [Bear][].\n- For other build systems, check out\n  [`.ycm_extra_conf.py`](#option-2-provide-the-flags-manually) below.\n\nIf no [`.ycm_extra_conf.py`](#option-2-provide-the-flags-manually) is found,\nYouCompleteMe automatically tries to load a compilation database if there is\none.\n\nYCM looks for a file named `compile_commands.json` in the directory of the\nopened file or in any directory above it in the hierarchy (recursively); when\nthe file is found before a local `.ycm_extra_conf.py`, YouCompleteMe stops\nsearching the directories and lets clangd take over and handle the flags.\n\n#### Option 2: Provide the flags manually\n\nIf you don't have a compilation database or aren't able to generate one,\nyou have to tell YouCompleteMe how to compile your code some other way.\n\nEvery C-family project is different. It is not possible for YCM to guess what\ncompiler flags to supply for your project. Fortunately, YCM provides a mechanism\nfor you to generate the flags for a particular file with _arbitrary complexity_.\nThis is achieved by requiring you to provide a Python module that implements a\ntrivial function that, given the file name as an argument, returns a list of\ncompiler flags to use to compile that file.\n\nYCM looks for a `.ycm_extra_conf.py` file in the directory of the opened file or\nin any directory above it in the hierarchy (recursively); when the file is\nfound, it is loaded (only once!) as a Python module. YCM calls a `Settings`\nmethod in that module which should provide it with the information necessary to\ncompile the current file. You can also provide a path to a global configuration\nfile with the\n[`g:ycm_global_ycm_extra_conf`](#the-gycm_global_ycm_extra_conf-option) option,\nwhich will be used as a fallback. To prevent the execution of malicious code\nfrom a file you didn't write YCM will ask you once per `.ycm_extra_conf.py` if\nit is safe to load. This can be disabled and you can white-/blacklist files. See\nthe [`g:ycm_confirm_extra_conf`](#the-gycm_confirm_extra_conf-option) and\n[`g:ycm_extra_conf_globlist`](#the-gycm_extra_conf_globlist-option) options\nrespectively.\n\nThis system was designed this way so that the user can perform any arbitrary\nsequence of operations to produce a list of compilation flags YCM should hand\nto Clang.\n\n**NOTE**: It is highly recommended to include `-x \u003clanguage\u003e` flag to libclang.\nThis is so that the correct language is detected, particularly for header files.\nCommon values are `-x c` for C, `-x c++` for C++, `-x objc` for Objective-C, and\n`-x cuda` for CUDA.\n\nTo give you an impression, if your C++ project is trivial, and your usual\ncompilation command is: `g++ -Wall -Wextra -Werror -o FILE.o FILE.cc`, then the\nfollowing `.ycm_extra_conf.py` is enough to get semantic analysis from\nYouCompleteMe:\n\n```python\ndef Settings( **kwargs ):\n  return {\n    'flags': [ '-x', 'c++', '-Wall', '-Wextra', '-Werror' ],\n  }\n```\n\nAs you can see from the trivial example, YCM calls the `Settings` method which\nreturns a dictionary with a single element `'flags'`. This element is a `list`\nof compiler flags to pass to libclang for the current file. The absolute path of\nthat file is accessible under the `filename` key of the `kwargs` dictionary.\nThat's it! This is actually enough for most projects, but for complex projects\nit is not uncommon to integrate directly with an existing build system using the\nfull power of the Python language.\n\nFor a more elaborate example,\n[see ycmd's own `.ycm_extra_conf.py`][ycmd_flags_example]. You should be able to\nuse it _as a starting point_. **Don't** just copy/paste that file somewhere and\nexpect things to magically work; **your project needs different flags**. Hint:\njust replace the strings in the `flags` variable with compilation flags\nnecessary for your project. That should be enough for 99% of projects.\n\nYou could also consider using [YCM-Generator][ygen] to generate the\n`ycm_extra_conf.py` file.\n\n#### Errors during compilation\n\nIf Clang encounters errors when compiling the header files that your file\nincludes, then it's probably going to take a long time to get completions.  When\nthe completion menu finally appears, it's going to have a large number of\nunrelated completion strings (type/function names that are not actually\nmembers). This is because Clang fails to build a precompiled preamble for your\nfile if there are any errors in the included headers and that preamble is key to\ngetting fast completions.\n\nCall the `:YcmDiags` command to see if any errors or warnings were detected in\nyour file.\n\n### Java Semantic Completion\n\n#### Java Quick Start\n\n1. Ensure that you have enabled the Java completer. See the\n   [installation guide](#installation) for details.\n\n2. Create a project file (gradle or maven) file in the root directory of your\n   Java project, by following the instructions below.\n\n3. (Optional) [Configure the LSP server](#lsp-configuration). The [jdt.ls\n   configuration options][jdtls-preferences] can be found in their codebase.\n\n4. If you previously used Eclim or Syntastic for Java, disable them for Java.\n\n5. Edit a Java file from your project.\n\n#### Java Project Files\n\nIn order to provide semantic analysis, the Java completion engine requires\nknowledge of your project structure. In particular, it needs to know the class\npath to use, when compiling your code. Fortunately [jdt.ls][]\nsupports [eclipse project files][eclipse-project],\n[maven projects][mvn-project] and [gradle projects][gradle-project].\n\n**NOTE:** Our recommendation is to use either Maven or Gradle projects.\n\n#### Diagnostic display - Syntastic\n\nThe native support for Java includes YCM's native real-time diagnostics display.\nThis can conflict with other diagnostics plugins like Syntastic, so when\nenabling Java support, please **manually disable Syntastic Java diagnostics**.\n\nAdd the following to your `vimrc`:\n\n```viml\nlet g:syntastic_java_checkers = []\n```\n\n#### Diagnostic display - Eclim\n\nThe native support for Java includes YCM's native real-time diagnostics display.\nThis can conflict with other diagnostics plugins like Eclim, so when enabling\nJava support, please **manually disable Eclim Java diagnostics**.\n\nAdd the following to your `vimrc`:\n\n```viml\nlet g:EclimFileTypeValidate = 0\n```\n\n**NOTE**: We recommend disabling Eclim entirely when editing Java with YCM's\nnative Java support. This can be done temporarily with `:EclimDisable`.\n\n#### Eclipse Projects\n\nEclipse-style projects require two files: [.project][eclipse-dot-project] and\n[.classpath][eclipse-dot-classpath].\n\nIf your project already has these files due to previously being set up within\nEclipse, then no setup is required. [jdt.ls][] should load the project just\nfine (it's basically eclipse after all).\n\nHowever, if not, it is possible (easy in fact) to craft them manually, though it\nis not recommended. You're better off using Gradle or Maven (see below).\n\n[A simple eclipse style project example][ycmd-eclipse-project] can be found in\nthe ycmd test directory. Normally all that is required is to copy these files to\nthe root of your project and to edit the `.classpath` to add additional\nlibraries, such as:\n\n```xml\n  \u003cclasspathentry kind=\"lib\" path=\"/path/to/external/jar\" /\u003e\n  \u003cclasspathentry kind=\"lib\" path=\"/path/to/external/java/source\" /\u003e\n```\n\nIt may also be necessary to change the directory in which your source files are\nlocated (paths are relative to the .project file itself):\n\n```xml\n  \u003cclasspathentry kind=\"src\" output=\"target/classes\" path=\"path/to/src/\" /\u003e\n```\n\n**NOTE**: The eclipse project and classpath files are not a public interface\nand it is highly recommended to use Maven or Gradle project definitions if you\ndon't already use Eclipse to manage your projects.\n\n#### Maven Projects\n\nMaven needs a file named [pom.xml][mvn-project] in the root of the project.\nOnce again a simple [pom.xml][ycmd-mvn-pom-xml] can be found in the ycmd source.\n\nThe format of [pom.xml][mvn-project] files is way beyond the scope of this\ndocument, but we do recommend using the various tools that can generate them for\nyou, if you're not familiar with them already.\n\n#### Gradle Projects\n\nGradle projects require a [build.gradle][gradle-project]. Again, there is a\n[trivial example in ycmd's tests][ycmd-gradle-project].\n\nThe format of [build.gradle][gradle-project] files are way beyond the scope of\nthis document, but we do recommend using the various tools that can generate\nthem for you if you're not familiar with them already.\n\nSome users have experienced issues with their jdt.ls  when using the Groovy\nlanguage for their build.gradle. As such, try using\n[Kotlin](https://github.com/ycm-core/lsp-examples#kotlin) instead.\n\n#### Troubleshooting\n\nIf you're not getting completions or diagnostics, check the server health:\n\n* The Java completion engine takes a while to start up and parse your project.\n  You should be able to see its progress in the command line, and\n  `:YcmDebugInfo`. Ensure that the following lines are present:\n\n```\n--   jdt.ls Java Language Server running\n--   jdt.ls Java Language Server Startup Status: Ready\n```\n\n* If the above lines don't appear after a few minutes, check the jdt.ls and ycmd\n  log files using [`:YcmToggleLogs` ](#the-ycmtogglelogs-command). The jdt.ls\n  log file is called `.log` (for some reason).\n\nIf you get a message about \"classpath is incomplete\", then make sure you have\ncorrectly configured the [project files](#java-project-files).\n\nIf you get messages about unresolved imports, then make sure you have\ncorrectly configured the [project files](#java-project-files), in particular\ncheck that the classpath is set correctly.\n\n### C# Semantic Completion\n\nYCM relies on [OmniSharp-Roslyn][] to provide completion and code navigation.\nOmniSharp-Roslyn needs a solution file for a C# project and there are two ways\nof letting YCM know about your solution files.\n\n#### Automatically discovered solution files\n\nYCM will scan all parent directories of the file currently being edited and look\nfor a file with `.sln` extension.\n\n#### Manually specified solution files\n\nIf YCM loads `.ycm_extra_conf.py` which contains `CSharpSolutionFile` function,\nYCM will try to use that to determine the solution file. This is useful when one\nwants to override the default behaviour and specify a solution file that is not\nin any of the parent directories of the currently edited file. Example:\n\n```python\ndef CSharpSolutionFile( filepath ):\n  # `filepath` is the path of the file user is editing\n  return '/path/to/solution/file' # Can be relative to the `.ycm_extra_conf.py`\n```\n\nIf the path returned by `CSharpSolutionFile` is not an actual file, YCM will\nfall back to the other way of finding the file.\n\n#### Use with .NET 6.0 and .NET SDKs\n\nYCM ships with older version of OmniSharp-Roslyn based on Mono runtime.\nIt is possible to use it with .NET 6.0 and newer, but it requires manual setup.\n\n1. Download NET 6.0 version of the OmniSharp server for your system from\n[releases](https://github.com/OmniSharp/omnisharp-roslyn/releases/)\n1. Set `g:ycm_roslyn_binary_path` to the unpacked executable `OmniSharp`\n1. Create a solution file if one doesn't already exist, it is currently required\nby YCM for internal bookkeeping\n    1. Run `dotnet new sln` at the root of your project\n    1. Run `dotnet sln add \u003cproject1.csproj\u003e \u003cproject2.csproj\u003e ...`\n    for all of your projects\n1. Run `:YcmRestartServer`\n\n### Python Semantic Completion\n\nYCM relies on the [Jedi][] engine to provide completion and code navigation. By\ndefault, it will pick the version of Python running the [ycmd server][ycmd] and\nuse its `sys.path`. While this is fine for simple projects, this needs to be\nconfigurable when working with virtual environments or in a project with\nthird-party packages. The next sections explain how to do that.\n\n#### Working with virtual environments\n\nA common practice when working on a Python project is to install its\ndependencies in a virtual environment and develop the project inside that\nenvironment. To support this, YCM needs to know the interpreter path of the\nvirtual environment. You can specify it by creating a `.ycm_extra_conf.py` file\nat the root of your project with the following contents:\n\n```python\ndef Settings( **kwargs ):\n  return {\n    'interpreter_path': '/path/to/virtual/environment/python'\n  }\n```\n\nHere, `/path/to/virtual/environment/python` is the path to the Python used\nby the virtual environment you are working in. Typically, the executable can be\nfound in the `Scripts` folder of the virtual environment directory on Windows\nand in the `bin` folder on other platforms.\n\nIf you don't like having to create a `.ycm_extra_conf.py` file at the root of\nyour project and would prefer to specify the interpreter path with a Vim option,\nread the [Configuring through Vim options](#configuring-through-vim-options)\nsection.\n\n#### Working with third-party packages\n\nAnother common practice is to put the dependencies directly into the project and\nadd their paths to `sys.path` at runtime in order to import them. YCM needs to\nbe told about this path manipulation to support those dependencies. This can be\ndone by creating a `.ycm_extra_conf.py` file at the root of the project. This\nfile must define a `Settings( **kwargs )` function returning a dictionary with\nthe list of paths to prepend to `sys.path` under the `sys_path` key. For\ninstance, the following `.ycm_extra_conf.py` adds the paths\n`/path/to/some/third_party/package` and `/path/to/another/third_party/package`\nat the start of `sys.path`:\n\n```python\ndef Settings( **kwargs ):\n  return {\n    'sys_path': [\n      '/path/to/some/third_party/package',\n      '/path/to/another/third_party/package'\n    ]\n  }\n```\n\nIf you would rather prepend paths to `sys.path` with a Vim option, read the\n[Configuring through Vim options](#configuring-through-vim-options) section.\n\nIf you need further control on how to add paths to `sys.path`, you should define\nthe `PythonSysPath( **kwargs )` function in the `.ycm_extra_conf.py` file. Its\nkeyword arguments are `sys_path` which contains the default `sys.path`, and\n`interpreter_path` which is the path to the Python interpreter. Here's a trivial\nexample that inserts the `/path/to/third_party/package` path at the second\nposition of `sys.path`:\n\n```python\ndef PythonSysPath( **kwargs ):\n  sys_path = kwargs[ 'sys_path' ]\n  sys_path.insert( 1, '/path/to/third_party/package' )\n  return sys_path\n```\n\nA more advanced example can be found in [YCM's own\n`.ycm_extra_conf.py`][ycm_flags_example].\n\n#### Configuring through Vim options\n\nYou may find it inconvenient to have to create a `.ycm_extra_conf.py` file at the\nroot of each one of your projects in order to set the path to the Python\ninterpreter and/or add paths to `sys.path` and would prefer to be able to\nconfigure those through Vim options. Don't worry, this is possible by using the\n[`g:ycm_extra_conf_vim_data`](#the-gycm_extra_conf_vim_data-option) option and\ncreating a global extra configuration file. Let's take an example. Suppose that\nyou want to set the interpreter path with the `g:ycm_python_interpreter_path`\noption and prepend paths to `sys.path` with the `g:ycm_python_sys_path` option.\nSuppose also that you want to name the global extra configuration file\n`global_extra_conf.py` and that you want to put it in your HOME folder. You\nshould then add the following lines to your vimrc:\n\n```viml\nlet g:ycm_python_interpreter_path = ''\nlet g:ycm_python_sys_path = []\nlet g:ycm_extra_conf_vim_data = [\n  \\  'g:ycm_python_interpreter_path',\n  \\  'g:ycm_python_sys_path'\n  \\]\nlet g:ycm_global_ycm_extra_conf = '~/global_extra_conf.py'\n```\n\nThen, create the `~/global_extra_conf.py` file with the following contents:\n\n```python\ndef Settings( **kwargs ):\n  client_data = kwargs[ 'client_data' ]\n  return {\n    'interpreter_path': client_data[ 'g:ycm_python_interpreter_path' ],\n    'sys_path': client_data[ 'g:ycm_python_sys_path' ]\n  }\n```\n\nThat's it. You are done. Note that you don't need to restart the server when\nsetting one of the options. YCM will automatically pick the new values.\n\n### Rust Semantic Completion\n\nYCM uses [rust-analyzer][] for Rust semantic completion.\n\nNOTE: Previously, YCM used [rls][] for rust completion. This is no longer\nsupported, as the Rust community has decided on [rust-analyzer][] as the future\nof Rust tooling.\n\nCompletions and GoTo commands within the current crate and its dependencies\nshould work out of the box with no additional configuration (provided that you\nbuilt YCM with the `--rust-completer` flag; see the [*Installation*\nsection](#installation) for details). The install script takes care of\ninstalling [the Rust source code][rust-src], so no configuration is necessary.\n\n`rust-analyzer` supports a myriad of options. These are configured using [LSP\nconfiguration](#lsp-configuration), and are [documented here](https://rust-analyzer.github.io/manual.html#configuration]).\n\n### Go Semantic Completion\n\nCompletions and GoTo commands should work out of the box (provided that you\nbuilt YCM with the `--go-completer` flag; see the [*Installation*\nsection](#installation) for details). The server only works for projects with\nthe \"canonical\" layout.\n\n`gopls` also has a load of [documented options](https://github.com/golang/tools/blob/master/gopls/doc/settings.md).\n\nYou can set these in your `.ycm_extra_conf.py`. For example, to set the build tags:\n\n```python\ndef Settings( **kwargs ):\n  if kwargs[ 'language' ] == 'go':\n    return {\n       'ls': {\n         'build.buildFlags': [ '-tags=debug' ] }\n       }\n    }\n```\n\n### JavaScript and TypeScript Semantic Completion\n\n**NOTE:** YCM originally used the [Tern][] engine for JavaScript but due to\n[Tern][] not being maintained anymore by its main author and the [TSServer][]\nengine offering more features, YCM is moving to [TSServer][]. This won't affect\nyou if you were already using [Tern][] but you are encouraged to do the switch\nby deleting the `third_party/ycmd/third_party/tern_runtime/node_modules`\ndirectory in YCM folder. If you are a new user but still want to use [Tern][],\nyou should pass the `--js-completer` option to the `install.py` script during\ninstallation. Further instructions on how to set up YCM with [Tern][] are\navailable on [the wiki][tern-instructions].\n\nAll JavaScript and TypeScript features are provided by the [TSServer][] engine,\nwhich is included in the TypeScript SDK. To enable these features, install\n[Node.js 18+ and npm][npm-install] and call the `install.py` script with the\n`--ts-completer` flag.\n\n[TSServer][] relies on [the `jsconfig.json` file][jsconfig.json] for JavaScript\nand [the `tsconfig.json` file][tsconfig.json] for TypeScript to analyze your\nproject. Ensure the file exists at the root of your project.\n\nTo get diagnostics in JavaScript, set the `checkJs` option to `true` in your\n`jsconfig.json` file:\n\n```json\n{\n    \"compilerOptions\": {\n        \"checkJs\": true\n    }\n}\n```\n\n### Semantic Completion for Other Languages\n\nC-family, C#, Go, Java, Python, Rust, and JavaScript/TypeScript languages are\nsupported natively by YouCompleteMe using the [Clang][], [OmniSharp-Roslyn][],\n[Gopls][], [jdt.ls][], [Jedi][], [rust-analyzer][], and [TSServer][] engines,\nrespectively. Check the [installation](#installation) section for instructions\nto enable these features if desired.\n\n#### Plugging an arbitrary LSP server\n\nSimilar to other LSP clients, YCM can use an arbitrary LSP server with the help\nof [`g:ycm_language_server`](#the-gycm_language_server-option) option. An\nexample of a value of this option would be:\n\n```viml\nlet g:ycm_language_server = \n  \\ [ \n  \\   {\n  \\     'name': 'yaml',\n  \\     'cmdline': [ '/path/to/yaml/server/yaml-language-server', '--stdio' ],\n  \\     'filetypes': [ 'yaml' ]\n  \\   },\n  \\   {\n  \\     'name': 'csharp',\n  \\     'cmdline': [ 'OmniSharp', '-lsp' ],\n  \\     'filetypes': [ 'csharp' ],\n  \\     'project_root_files': [ '*.csproj', '*.sln' ]\n  \\   },\n  \\   {\n  \\     'name': 'godot',\n  \\     'filetypes': [ 'gdscript' ],\n  \\     'port': 6008,\n  \\     'project_root_files': [ 'project.godot' ]\n  \\    }\n  \\ ]\n```\n\nEach dictionary contains the following keys:\n\n* `name` (string, mandatory): When [configuring a LSP\n  server](#lsp-configuration) the value of the `name` key will be used as the\n  `kwargs[ 'language' ]`. Can be anything you like.\n* `filetypes` (list of string, mandatory): List of Vim filetypes this server\n  should be used for.\n* `project_root_files` (list of string, optional): List of filenames to search\n  for when trying to determine the project's root. Uses python's pathlib for\n  glob matching.\n* `cmdline` (list of strings, optional): If supplied, the server is started with\n  this command line (each list element is a command line word). Typically, the\n  server should be started with STDIO communication. If not supplied, `port`\n  must be supplied.\n* `port` (number, optional): If supplied, ycmd will connect to the server at\n  `localhost:\u003cport\u003e` using TCP (remote servers are not supported).\n* `capabilities` (dict, optional): If supplied, this is a dictionary that is\n  merged with the LSP client capabilities reported to the language server. This\n  can be used to enable or disable certain features, such as the support for\n  configuration sections (`workspace/configuration`).\n\nSee [the LSP Examples](https://github.com/ycm-core/lsp-examples) project for more\nexamples of configuring the likes of PHP, Ruby, Kotlin, and D.\n\n#### LSP Configuration\n\nMany LSP servers allow some level of user configuration. YCM enables this with\nthe help of `.ycm_extra_conf.py` files. Here's an example of jdt.ls user\nexamples of configuring the likes of PHP, Ruby, Kotlin, D, and many, many more.\n\n```python\ndef Settings( **kwargs ):\n  if kwargs[ 'language' ] == 'java':\n    return {\n      'ls': {\n        'java.format.onType.enabled': True\n      }\n    }\n```\n\nThe `ls` key tells YCM that the dictionary should be passed to the LSP server.\nFor each of the LSP server's configuration, you should look up the respective\nserver's documentation.\n\nSome servers request settings from arbitrary 'sections' of configuration. There\nis no concept of configuration sections in Vim, so you can specify an additional\n`config_sections` dictionary which maps section to a dictionary of config\nrequired by the server. For example:\n\n```python\ndef Settings( **kwargs ):\n  if kwargs[ 'language' ] == 'java':\n    return {\n      'ls': {\n        'java.format.onType.enabled': True\n      },\n      'config_sections': {\n        'some section': {\n          'some option': 'some value'\n        }\n    }\n```\n\nThe sections and options/values are completely server-specific and rarely well\ndocumented.\n\n#### Using `omnifunc` for semantic completion\n\nYCM will use your `omnifunc` (see `:h omnifunc` in Vim) as a source for semantic\ncompletions if it does not have a native semantic completion engine for your\nfile's filetype. Vim comes with rudimentary omnifuncs for various languages like\nRuby, PHP, etc. It depends on the language.\n\nYou can get a stellar omnifunc for Ruby with [Eclim][]. Just make sure you have\nthe _latest_ Eclim installed and configured (this means Eclim `\u003e= 2.2.*` and\nEclipse `\u003e= 4.2.*`).\n\nAfter installing Eclim remember to create a new Eclipse project within your\napplication by typing `:ProjectCreate \u003cpath-to-your-project\u003e -n ruby` inside Vim\nand don't forget to have `let g:EclimCompletionMethod = 'omnifunc'` in your\nvimrc. This will make YCM and Eclim play nice; YCM will use Eclim's omnifuncs as\nthe data source for semantic completions and provide the auto-triggering and\nsubsequence-based matching (and other YCM features) on top of it.\n\n### Writing New Semantic Completers\n\nYou have two options here: writing an `omnifunc` for Vim's omnicomplete system\nthat YCM will then use through its omni-completer, or a custom completer for YCM\nusing the [Completer API][completer-api].\n\nHere are the differences between the two approaches:\n\n- You have to use VimScript to write the omnifunc, but get to use Python to\n  write for the Completer API; this by itself should make you want to use the\n  API.\n- The Completer API is a _much_ more powerful way to integrate with YCM and it\n  provides a wider set of features. For instance, you can make your Completer\n  query your semantic back-end in an asynchronous fashion, thus not blocking\n  Vim's GUI thread while your completion system is processing stuff. This is\n  impossible with VimScript. All of YCM's completers use the Completer API.\n- Performance with the Completer API is better since Python executes faster than\n  VimScript.\n\nIf you want to use the `omnifunc` system, see the relevant Vim docs with `:h\ncomplete-functions`. For the Completer API, see [the API docs][completer-api].\n\nIf you want to upstream your completer into YCM's source, you should use the\nCompleter API.\n\n### Diagnostic Display\n\nYCM will display diagnostic notifications for the C-family, C#, Go, Java,\nJavaScript, Rust, and TypeScript languages. Since YCM continuously recompiles\nyour file as you type, you'll get notified of errors and warnings in your file\nas fast as possible.\n\nHere are the various pieces of the diagnostic UI:\n\n- Icons show up in the Vim gutter on lines that have a diagnostic.\n- Regions of text related to diagnostics are highlighted (by default, a red\n  wavy underline in `gvim` and a red background in `vim`).\n- Moving the cursor to a line with a diagnostic echoes the diagnostic text.\n- Vim's location list is automatically populated with diagnostic data (off by\n  default, see options).\n\nThe new diagnostics (if any) will be displayed the next time you press any key\non the keyboard. So if you stop typing and just wait for the new diagnostics to\ncome in, that _will not work_. You need to press some key for the GUI to update.\n\nHaving to press a key to get the updates is unfortunate, but cannot be changed\ndue to the way Vim internals operate; there is no way that a background task can\nupdate Vim's GUI after it has finished running.  You _have to_ press a key. This\nwill make YCM check for any pending diagnostics updates.\n\nYou _can_ force a full, blocking compilation cycle with the\n`:YcmForceCompileAndDiagnostics` command (you may want to map that command to a\nkey; try putting `nnoremap \u003cF5\u003e :YcmForceCompileAndDiagnostics\u003cCR\u003e` in your\nvimrc). Calling this command will force YCM to immediately recompile your file\nand display any new diagnostics it encounters. Do note that recompilation with\nthis command may take a while and during this time the Vim GUI _will_ be\nblocked.\n\nYCM will display a short diagnostic message when you move your cursor to the\nline with the error. You can get a detailed diagnostic message with the\n`\u003cleader\u003ed` key mapping (can be changed in the options) YCM provides when your\ncursor is on the line with the diagnostic.\n\nYou can also see the full diagnostic message for all the diagnostics in the\ncurrent file in Vim's `locationlist`, which can be opened with the `:lopen` and\n`:lclose` commands (make sure you have set `let\ng:ycm_always_populate_location_list = 1` in your vimrc). A good way to toggle\nthe display of the `locationlist` with a single key mapping is provided by\nanother (very small) Vim plugin called [ListToggle][] (which also makes it\npossible to change the height of the `locationlist` window), also written by\nyours truly.\n\n#### Diagnostic Highlighting Groups\n\nYou can change the styling for the highlighting groups YCM uses. For the signs\nin the Vim gutter, the relevant groups are:\n\n- `YcmErrorSign`, which falls back to group `SyntasticErrorSign` and then\n  `error` if they exist\n- `YcmWarningSign`, which falls back to group `SyntasticWarningSign` and then\n  `todo` if they exist\n\nYou can also style the line that has the warning/error with these groups:\n\n- `YcmErrorLine`, which falls back to group `SyntasticErrorLine` if it exists\n- `YcmWarningLine`, which falls back to group `SyntasticWarningLine` if it\n  exists\n\nFinally, you can also style the popup for the detailed diagnostics (it is shown\nif `g:ycm_show_detailed_diag_in_popup` is set) using the group `YcmErrorPopup`,\nwhich falls back to `ErrorMsg`.\n\nNote that the line highlighting groups only work when the\n[`g:ycm_enable_diagnostic_signs`](#the-gycm_enable_diagnostic_signs-option)\noption is set. If you want highlighted lines but no signs in the Vim gutter,\nset the `signcolumn` option to `no` in your vimrc:\n\n```viml\nset signcolumn=no\n```\n\nThe syntax groups used to highlight regions of text with errors/warnings:\n- `YcmErrorSection`, which falls back to group `SyntasticError` if it exists and\n  then `SpellBad`\n- `YcmWarningSection`, which falls back to group `SyntasticWarning` if it exists\n  and then `SpellCap`\n\nHere's how you'd change the style for a group:\n\n```viml\nhighlight YcmErrorLine guibg=#3f0000\n```\n\n### Symbol Search\n\n***This feature requires Vim and is not supported in Neovim***\n\nYCM provides a way to search for and jump to a symbol in the current project or\ndocument when using supported languages.\n\nYou can search for symbols in the current workspace when the `GoToSymbol`\nrequest is supported and the current document when `GoToDocumentOutline` is\nsupported.\n\nHere's a quick demo: \n\n[![asciicast](https://asciinema.org/a/4JmYLAaz5hOHbZDD0hbsQpY8C.svg)](https://asciinema.org/a/4JmYLAaz5hOHbZDD0hbsQpY8C)\n\nAs you can see, you can type and YCM filters down the list as you type. The\ncurrent set of matches are displayed in a popup window in the centre of the\nscreen and you can select an entry with the keyboard, to jump to that position.\nAny matches are then added to the quickfix list.\n\nTo enable:\n\n* `nmap \u003csomething\u003e \u003cPlug\u003e(YCMFindSymbolInWorkspace)`\n* `nmap \u003csomething\u003e \u003cPlug\u003e(YCMFindSymbolInDocument)`\n\ne.g.\n\n* `nmap \u003cleader\u003eyfw \u003cPlug\u003e(YCMFindSymbolInWorkspace)`\n* `nmap \u003cleader\u003eyfd \u003cPlug\u003e(YCMFindSymbolInDocument)`\n\nWhen searching, YCM opens a prompt buffer at the top of the screen for the\ninput and puts you in insert mode. This means that you can hit `\u003cEsc\u003e` to go\ninto normal mode and use any other input commands that are supported in prompt\nbuffers. As you type characters, the search is updated.\n\nInitially, results are queried from all open filetypes. You can hit `\u003cC-f\u003e` to\nswitch to just the current filetype while the popup is open.\n\nWhile the popup is open, the following keys are intercepted:\n\n* `\u003cC-j\u003e`, `\u003cDown\u003e`, `\u003cC-n\u003e`, `\u003cTab\u003e` - select the next item\n* `\u003cC-k\u003e`, `\u003cUp\u003e`, `\u003cC-p\u003e`, `\u003cS-Tab\u003e` - select the previous item\n* `\u003cPageUp\u003e`, `\u003ckPageUp\u003e` - jump up one screenful of items \n* `\u003cPageDown\u003e`, `\u003ckPageDown\u003e` - jump down one screenful of items\n* `\u003cHome\u003e`, `\u003ckHome\u003e` - jump to first item\n* `\u003cEnd\u003e`, `\u003ckEnd\u003e` - jump to last item\n* `\u003cCR\u003e` - jump to the selected item\n* `\u003cC-c\u003e` cancel/dismiss the popup\n* `\u003cC-f\u003e` - toggle results from all file types or just the current filetype\n\nThe search is also cancelled if you leave the prompt buffer window at any time,\nso you can use window commands `\u003cC-w\u003e...` for example.\n\n#### Closing the popup\n\n***NOTE***: Pressing `\u003cEsc\u003e` does not close the popup - you must use `Ctrl-c`\nfor that, or use a window command (e.g. `\u003cCtrl-w\u003ej`) or the mouse to leave the\nprompt buffer window.\n\n### Type/Call Hierarchy\n\n***This feature requires Vim and is not supported in Neovim***\n\n**NOTE**: This feature is highly experimental and offered in the hope that it is\nuseful. Please help us by reporting issues and offering feedback.\n\nYCM provides a way to view and navigate hierarchies. The following hierarchies\nare supported:\n\n* Type hierachy `\u003cPlug\u003e(YCMTypeHierarchy)`: Display subtypes and supertypes\n  of the symbol under cursor. Expand down to subtypes and up to supertypes.\n* Call hierarchy `\u003cPlug\u003e(YCMCallHierarchy)`: Display callees and callers of\n  the symbol under cursor. Expand down to callers and up to callees.\n\nTake a look at this [![asciicast](https://asciinema.org/a/659925.svg)](https://asciinema.org/a/659925)\nfor brief demo.\n\nHierarchy UI can be initiated by mapping something to the indicated plug\nmappings, for example:\n\n```viml\nnmap \u003cleader\u003eyth \u003cPlug\u003e(YCMTypeHierarchy)\nnmap \u003cleader\u003eych \u003cPlug\u003e(YCMCallHierarchy)\n```\n\nThis opens a \"modal\" popup showing the current element in the hierarchy tree.\nThe current tree root is aligned to the left and child and parent nodes are\nexpanded to the right. Expand the tree \"down\" with `\u003cTab\u003e and \"up\" with\n`\u003cS-Tab\u003e`.\n\nThe \"root\" of the tree can be re-focused to the selected item with\n`\u003cS-Tab\u003e` and further `\u003cS-Tab\u003e` will show the parents of the selected item. This\ncan take a little getting used to, but it's particularly important with multiple\ninheritance where a \"child\" of the current root may actually have other,\ninvisible, parent links. `\u003cS-Tab\u003e` on that row will show these by setting the\ndisplay root to the selected item.\n\nWhen the hierarchy is displayed, the following keys are intercepted:\n\n* `\u003cTab\u003e`: Drill into the hierarchy at the selected item: expand and show\n  children of the selected item.\n* `\u003cS-Tab\u003e`: Show parents of the selected item. When applied to sub-types, this\n  will re-root the tree at that type, so that all parent types (are displayed).\n  Similar for callers.\n* `\u003cCR\u003e`: Jump to the symbol currently selected.\n* `\u003cDown\u003e`, `\u003cC-n\u003e`, `\u003cC-j\u003e`, `j`: Select the next item\n* `\u003cUp\u003e`, `\u003cC-p\u003e`, `\u003cC-k\u003e`, `k`; Select the previous item\n* Any other key: closes the popup without jumping to any location\n\n**Note:** you might think the call hierarchy tree is inverted, but we think\nthis way round is more intuitive because this is the typical way that call\nstacks are displayed (with the current function at the top, and its callers\nbelow). \n\nCommands\n--------\n\n### The `:YcmRestartServer` command\n\nIf the [ycmd completion server][ycmd] suddenly stops for some reason, you can\nrestart it with this command.\n\n### The `:YcmForceCompileAndDiagnostics` command\n\nCalling this command will force YCM to immediately recompile your file\nand display any new diagnostics it encounters. Do note that recompilation with\nthis command may take a while and during this time the Vim GUI _will_ be\nblocked.\n\nYou may want to map this command to a key; try putting `nnoremap \u003cF5\u003e\n:YcmForceCompileAndDiagnostics\u003cCR\u003e` in your vimrc.\n\n### The `:YcmDiags` command\n\nCalling this command will fill Vim's `locationlist` with errors or warnings if\nany were detected in your file and then open it. If a given error or warning can\nbe fixed by a call to `:YcmCompleter FixIt`, then ` (FixIt available)` is\nappended to the error or warning text. See the `FixIt` completer subcommand for\nmore information.\n\n**NOTE:** The absence of ` (FixIt available)` does not strictly imply a fix-it\nis not available as not all completers are able to provide this indication. For\nexample, the c-sharp completer provides many fix-its but does not add this\nadditional indication.\n\nThe `g:ycm_open_loclist_on_ycm_diags` option can be used to prevent the location\nlist from opening, but still have it filled with new diagnostic data. See the\n_Options_ section for details.\n\n### The `:YcmShowDetailedDiagnostic` command\n\nThis command shows the full diagnostic text when the user's cursor is on the\nline with the diagnostic.\n\nAn options argument can be passed. If the argument is `popup` the diagnostic\ntext will be displayed in a popup at the cursor position.\n\nIf you prefer the detailed diagnostic to always be shown in a popup, then\n`let g:ycm_show_detailed_diag_in_popup=1`.\n\n### The `:YcmDebugInfo` command\n\nThis will print out various debug information for the current file. Useful to\nsee what compile commands will be used for the file if you're using the semantic\ncompletion engine.\n\n### The `:YcmToggleLogs` command\n\nThis command presents the list of logfiles created by YCM, the [ycmd\nserver][ycmd], and the semantic engine server for the current filetype, if any.\nOne of these logfiles can be opened in the editor (or closed if already open) by\nentering the corresponding number or by clicking on it with the mouse.\nAdditionally, this command can take the logfile names as arguments. Use the\n`\u003cTAB\u003e` key (or any other key defined by the `wildchar` option) to complete the\narguments or to cycle through them (depending on the value of the `wildmode`\noption). Each logfile given as an argument is directly opened (or closed if\nalready open) in the editor. Only for debugging purposes.\n\n### The `:YcmCompleter` command\n\nThis command gives access to a number of additional [IDE-like\nfeatures](#quick-feature-summary) in YCM, for things like semantic GoTo, type\ninformation, FixIt, and refactoring.\n\nThis command accepts a range that can either be specified through a selection in\none of Vim's visual modes (see `:h visual-use`) or on the command line. For\ninstance, `:2,5YcmCompleter` will apply the command from line 2 to line 5. This\nis useful for [the `Format` subcommand](#the-format-subcommand).\n\nCall `YcmCompleter` without further arguments for a list of the commands you can\ncall for the current completer.\n\nSee the [file type feature summary](#quick-feature-summary) for an overview of\nthe features available for each file type. See the _YcmCompleter subcommands_\nsection for more information on the available subcommands and their usage.\n\nSome commands, like `Format` accept a range, like `:%YcmCompleter Format`.\n\nSome commands like `GetDoc` and the various `GoTo` commands respect modifiers,\nlike `:rightbelow YcmCompleter GetDoc`, `:vertical YcmCompleter GoTo`.\n\nYcmCompleter Subcommands\n------------------------\n\n**NOTE:** See the docs for the `YcmCompleter` command before tackling this\nsection.\n\nThe invoked subcommand is automatically routed to the currently active semantic\ncompleter, so `:YcmCompleter GoToDefinition` will invoke the `GoToDefinition`\nsubcommand on the Python semantic completer if the currently active file is a\nPython one and on the Clang completer if the currently active file is a C-family\nlanguage one.\n\nYou may also want to map the subcommands to something less verbose; for\ninstance, `nnoremap \u003cleader\u003ejd :YcmCompleter GoTo\u003cCR\u003e`\nmaps the `\u003cleader\u003ejd` sequence to the longer subcommand invocation.\n\n### GoTo Commands\n\nThese commands are useful for jumping around and exploring code. When moving\nthe cursor, the subcommands add entries to Vim's `jumplist` so you can use\n`CTRL-O` to jump back to where you were before invoking the command (and\n`CTRL-I` to jump forward; see `:h jumplist` for details). If there is more\nthan one destination, the quickfix list (see `:h quickfix`) is populated with\nthe available locations and opened to the full width at the bottom of the screen.\nYou can change this behavior by using [the `YcmQuickFixOpened`\nautocommand](#the-ycmquickfixopened-autocommand).\n\n#### The `GoToInclude` subcommand\n\nLooks up the current line for a header and jumps to it.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda`\n\n#### The `GoToAlternateFile` subcommand\n\nJump to the associated file, as defined by the language server. Typically this\nwill jump you to the associated header file for a C or C++ translation unit.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda` (clangd only)\n\n#### The `GoToDeclaration` subcommand\n\nLooks up the symbol under the cursor and jumps to its declaration.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript,\npython, rust, typescript`\n\n#### The `GoToDefinition` subcommand\n\nLooks up the symbol under the cursor and jumps to its definition.\n\n**NOTE:** For C-family languages **this only works in certain situations**,\nnamely when the definition of the symbol is in the current translation unit. A\ntranslation unit consists of the file you are editing and all the files you are\nincluding with `#include` directives (directly or indirectly) in that file.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript,\npython, rust, typescript`\n\n#### The `GoTo` subcommand\n\nThis command tries to perform the \"most sensible\" GoTo operation it can.\nCurrently, this means that it tries to look up the symbol under the cursor and\njumps to its definition if possible; if the definition is not accessible from\nthe current translation unit, jumps to the symbol's declaration. For\nC-family languages, it first tries to look up the current line for a header and\njump to it. For C#, implementations are also considered and preferred.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript,\npython, rust, typescript`\n\n#### The `GoToImprecise` subcommand\n\nWARNING: This command trades correctness for speed!\n\nSame as the `GoTo` command except that it doesn't recompile the file with\nlibclang before looking up nodes in the AST. This can be very useful when you're\nediting files that take time to compile but you know that you haven't made any\nchanges since the last parse that would lead to incorrect jumps. When you're\njust browsing around your codebase, this command can spare you quite a bit of\nlatency.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda`\n\n#### The `GoToSymbol \u003csymbol query\u003e` subcommand\n\nFinds the definition of all symbols matching a specified string. Note that this\ndoes not use any sort of smart/fuzzy matching. However, an [interactive symbol\nsearch](#symbol-search) is also available.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, java, javascript, python, typescript`\n\n#### The `GoToReferences` subcommand\n\nThis command attempts to find all of the references within the project to the\nidentifier under the cursor and populates the quickfix list with those\nlocations.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, java, javascript, python, typescript, rust`\n\n#### The `GoToImplementation` subcommand\n\nLooks up the symbol under the cursor and jumps to its implementation (i.e.\nnon-interface). If there are multiple implementations, instead provides a list\nof implementations to choose from.\n\nSupported in filetypes: `cs, go, java, rust, typescript, javascript`\n\n#### The `GoToImplementationElseDeclaration` subcommand\n\nLooks up the symbol under the cursor and jumps to its implementation if one,\nelse jump to its declaration. If there are multiple implementations, instead\nprovides a list of implementations to choose from.\n\nSupported in filetypes: `cs`\n\n#### The `GoToType` subcommand\n\nLooks up the symbol under the cursor and jumps to the definition of its type\ne.g. if the symbol is an object, go to the definition of its class.\n\nSupported in filetypes: `go, java, javascript, typescript`\n\n#### The `GoToDocumentOutline` subcommand\n\nProvides a list of symbols in the current document, in the quickfix list. See also\n[interactive symbol search](#symbol-search).\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, go, java, rust`\n\n#### The `GoToCallers` and `GoToCallees` subcommands\n\nNote: A much more powerful call and type hierarchy can be viewd interactively.\nSee [interactive type and call hierarchy](#interactive-type-and-call-hierarchy).\n\nPopulate the quickfix list with the callers, or callees respectively, of the\nfunction associated with the current cursor position. The semantics of this\ndiffer depending on the filetype and language server.\n\nOnly supported for LSP servers that provide the `callHierarchyProvider`\ncapability.\n\n### Semantic Information Commands\n\nThese commands are useful for finding static information about the code, such\nas the types of variables, viewing declarations, and documentation strings.\n\n#### The `GetType` subcommand\n\nEchos the type of the variable or method under the cursor, and where it differs,\nthe derived type.\n\nFor example:\n\n```c++\n    std::string s;\n```\n\nInvoking this command on `s` returns `std::string =\u003e std::basic_string\u003cchar\u003e`\n\n**NOTE:** Causes re-parsing of the current translation unit.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, java, javascript,\ngo, python, typescript, rust`\n\n#### The `GetTypeImprecise` subcommand\n\nWARNING: This command trades correctness for speed!\n\nSame as the `GetType` command except that it doesn't recompile the file with\nlibclang before looking up nodes in the AST. This can be very useful when you're\nediting files that take time to compile but you know that you haven't made any\nchanges since the last parse that would lead to incorrect type. When you're\njust browsing around your codebase, this command can spare you quite a bit of\nlatency.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda`\n\n#### The `GetParent` subcommand\n\nEchos the semantic parent of the point under the cursor.\n\nThe semantic parent is the item that semantically contains the given position.\n\nFor example:\n\n```c++\nclass C {\n    void f();\n};\n\nvoid C::f() {\n\n}\n```\n\nIn the out-of-line definition of `C::f`, the semantic parent is the class `C`,\nof which this function is a member.\n\nIn the example above, both declarations of `C::f` have `C` as their semantic\ncontext, while the lexical context of the first `C::f` is `C` and the lexical\ncontext of the second `C::f` is the translation unit.\n\nFor global declarations, the semantic parent is the translation unit.\n\n**NOTE:** Causes re-parsing of the current translation unit.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda`\n\n#### The `GetDoc` subcommand\n\nDisplays the preview window populated with quick info about the identifier\nunder the cursor. Depending on the file type, this includes things like:\n\n* The type or declaration of identifier,\n* Doxygen/javadoc comments,\n* Python docstrings,\n* etc.\n\nThe documentation is opened in the preview window, and options like\n`previewheight` are respected. If you would like to customise the height and\nposition of this window, we suggest a custom command that:\n\n* Sets `previewheight` temporarily\n* Runs the `GetDoc` command with supplied modifiers\n* Restores `previewheight`.\n\nFor example:\n\n```viml\ncommand -count ShowDocWithSize\n  \\ let g:ph=\u0026previewheight \n  \\ \u003cbar\u003e set previewheight=\u003ccount\u003e\n  \\ \u003cbar\u003e \u003cmods\u003e YcmCompleter GetDoc\n  \\ \u003cbar\u003e let \u0026previewheight=g:ph\n```\n\nYou can then use something like `:botright vertical 80ShowDocWithSize`. Here's an\nexample of that: https://asciinema.org/a/hE6Pi1gU6omBShwFna8iwGEe9\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript,\npython, typescript, rust`\n\n#### The `GetDocImprecise` subcommand\n\nWARNING: This command trades correctness for speed!\n\nSame as the `GetDoc` command except that it doesn't recompile the file with\nlibclang before looking up nodes in the AST. This can be very useful when you're\nediting files that take long to compile but you know that you haven't made any\nchanges since the last parse that would lead to incorrect docs. When you're\njust browsing around your codebase, this command can spare you quite a bit of\nlatency.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda`\n\n### Refactoring Commands\n\nThese commands make changes to your source code in order to perform refactoring\nor code correction. YouCompleteMe does not perform any action which cannot be\nundone, and never saves or writes files to the disk.\n\n#### The `FixIt` subcommand\n\nWhere available, attempts to make changes to the buffer to correct diagnostics,\nor perform refactoring, on the current line or selection. Where multiple\nsuggestions are available (such as when there are multiple ways to resolve a\ngiven warning, or where multiple diagnostics are reported for the current line,\nor multiple refactoring tweaks are available), the options are presented and\none can be selected.\n\nCompleters that provide diagnostics may also provide trivial modifications to\nthe source in order to correct the diagnostic. Examples include syntax errors\nsuch as missing trailing semi-colons, spurious characters, or other errors which\nthe semantic engine can deterministically suggest corrections. A small demo\npresenting how diagnostics can be fixed with clangd:\n\n![YcmCompleter-FixIt-OnDiagnostic](https://user-images.githubusercontent.com/17928698/206855014-9131a49b-87e8-4ed4-8d91-f2fe7808a0b9.gif)\n\nCompleters (LSPs) may also provide refactoring tweaks, which may be available\neven when no diagnostic is presented for the current line. These include\nfunction extraction, variable extraction, `switch` population, constructor\ngeneration, ... The tweaks work for a selection as well. Consult your LSP for\navailable refactorings. A demonstration of refactoring capabilities with clangd:\n\n![YouCompleter-FixIt-Refactoring](https://user-images.githubusercontent.com/17928698/206855713-3588c8de-d0f5-4725-b65e-bc51110252cc.gif)\n\nIf no fix-it is available for the current line, or there is no diagnostic on the\ncurrent line, this command has no effect on the current buffer. If any\nmodifications are made, the number of changes made to the buffer is echo'd and\nthe user may use the editor's undo command to revert.\n\nWhen a diagnostic is available, and `g:ycm_echo_current_diagnostic` is enabled,\nthen the text ` (FixIt)` is appended to the echo'd diagnostic when the\ncompleter is able to add this indication. The text ` (FixIt available)` is\nalso appended to the diagnostic text in the output of the `:YcmDiags` command\nfor any diagnostics with available fix-its (where the completer can provide this\nindication).\n\n**NOTE:** Causes re-parsing of the current translation unit.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript,\nrust, typescript`\n\n#### The `RefactorRename \u003cnew name\u003e` subcommand\n\nIn supported file types, this command attempts to perform a semantic rename of\nthe identifier under the cursor. This includes renaming declarations,\ndefinitions, and usages of the identifier, or any other language-appropriate\naction. The specific behavior is defined by the semantic engine in use.\n\nSimilar to `FixIt`, this command applies automatic modifications to your source\nfiles. Rename operations may involve changes to multiple files, which may or may\nnot be open in Vim buffers at the time. YouCompleteMe handles all of this for\nyou. The behavior is described in [the following section](#multi-file-refactor).\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, java, javascript, python, typescript, rust, cs`\n\n#### Python refactorings\n\nThe following additional commands are supported for Python:\n\n* `RefactorInline`\n* `RefactorExtractVariable`\n* `RefactorExtractFunction`\n\nSee the [jedi docs][jedi-refactor-doc] for what they do.\n\nSupported in filetypes: `python`\n\n#### Multi-file Refactor\n\nWhen a Refactor or FixIt command touches multiple files, YouCompleteMe attempts\nto apply those modifications to any existing open, visible buffer in the current\ntab. If no such buffer can be found, YouCompleteMe opens the file in a new\nsmall horizontal split at the top of the current window, applies the change,\nand then *hides* the window. **NOTE:** The buffer remains open, and must be\nmanually saved. A confirmation dialog is opened prior to doing this to remind\nyou that this is about to happen.\n\nOnce the modifications have been made, the quickfix list (see `:help quickfix`)\nis populated with the locations of all modifications. This can be used to review\nall automatic changes made by using `:copen`. Typically, use the `CTRL-W\n\u003center\u003e` combination to open the selected file in a new split. It is possible to\ncustomize how the quickfix window is opened by using [the `YcmQuickFixOpened`\nautocommand](#the-ycmquickfixopened-autocommand).\n\nThe buffers are *not* saved automatically. That is, you must save the modified\nbuffers manually after reviewing the changes from the quickfix list. Changes\ncan be undone using Vim's powerful undo features (see `:help undo`). Note\nthat Vim's undo is per-buffer, so to undo all changes, the undo commands must\nbe applied in each modified buffer separately.\n\n**NOTE:** While applying modifications, Vim may find files that are already\nopen and have a swap file. The command is aborted if you select Abort or Quit in\nany such prompts. This leaves the Refactor operation partially complete and must\nbe manually corrected using Vim's undo features. The quickfix list is *not*\npopulated in this case. Inspect `:buffers` or equivalent (see `:help buffers`)\nto see the buffers that were opened by the command.\n\n#### The `Format` subcommand\n\nThis command formats the whole buffer or some part of it according to the value\nof the Vim options `shiftwidth` and `expandtab` (see `:h 'sw'` and `:h et`\nrespectively). To format a specific part of your document, you can either select\nit in one of Vim's visual modes (see `:h visual-use`) and run the command or\ndirectly enter the range on the command line, e.g. `:2,5YcmCompleter Format` to\nformat it from line 2 to line 5.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, java, javascript, go, typescript, rust, cs`\n\n#### The `OrganizeImports` subcommand\n\nThis command removes unused imports and sorts imports in the current file. It\ncan also group imports from the same module in TypeScript and resolve imports\nin Java.\n\nSupported in filetypes: `java, javascript, typescript`\n\n### Miscellaneous Commands\n\nThese commands are for general administration, rather than IDE-like features.\nThey cover things like the semantic engine server instance and compilation\nflags.\n\n#### The `ExecuteCommand \u003cargs\u003e` subcommand\n\nSome LSP completers (currently only Java completers) support executing\nserver-specific commands. Consult the [jdt.ls][] documentation to find out\nwhat commands are supported and which arguments are expected.\n\nThe support for `ExecuteCommand` was implemented to support plugins like\n[Vimspector][] to debug java, but isn't limited to that specific use case.\n\n#### The `RestartServer` subcommand\n\nRestarts the downstream semantic engine server for those semantic engines that\nwork as separate servers that YCM talks to.\n\nSupported in filetypes: `c, cpp, objc, objcpp, cuda, cs, go, java, javascript, rust, typescript`\n\n#### The `ReloadSolution` subcommand\n\nInstruct the Omnisharp-Roslyn server to clear its cache and reload all files\nfrom the disk.  This is useful when files are added, removed, or renamed in the\nsolution, files are changed outside of Vim, or whenever Omnisharp-Roslyn cache\nis out-of-sync.\n\nSupported in filetypes: `cs`\n\nFunctions\n--------\n\n### The `youcompleteme#GetErrorCount` function\n\nGet the number of YCM Diagnostic errors. If no errors are present, this function\nreturns 0.\n\nFor example:\n\n```viml\n  call youcompleteme#GetErrorCount()\n```\n\nBoth this function and `youcompleteme#GetWarningCount` can be useful when\nintegrating YCM with other Vim plugins. For example, a [lightline][] user could\nadd a diagnostics section to their statusline which would display the number of\nerrors and warnings.\n\n### The `youcompleteme#GetWarningCount` function\n\nGet the number of YCM Diagnostic warnings. If no warnings are present, this\nfunction returns 0.\n\nFor example:\n\n```viml\n  call youcompleteme#GetWarningCount()\n```\n\n### The `youcompleteme#GetCommandResponse( ... )` function\n\nRun a [completer subcommand](#ycmcompleter-subcommands) and return the result as\na string. This can be useful for example to display the `GetDoc` output in a\npopup window, e.g.:\n\n```viml\nlet s:ycm_hover_popup = -1\nfunction s:Hover()\n  let response = youcompleteme#GetCommandResponse( 'GetDoc' )\n  if response == ''\n    return\n  endif\n\n  call popup_hide( s:ycm_hover_popup )\n  let s:ycm_hover_popup = popup_atcursor( balloon_split( response ), {} )\nendfunction\n\n\" CursorHold triggers in normal mode after a delay\nautocmd CursorHold * call s:Hover()\n\" Or, if you prefer, a mapping:\nnnoremap \u003csilent\u003e \u003cleader\u003eD :call \u003cSID\u003eHover()\u003cCR\u003e\n```\n\n**NOTE**: This is only an example, for real hover support, see\n[`g:ycm_auto_hover`](#the-gycm_auto_hover-option).\n\nIf the completer subcommand result is not a string (for example, it's a FixIt or\na Location), or if the completer subcommand raises an error, an empty string is\nreturned, so that calling code does not have to check for complex error\nconditions.\n\nThe arguments to the function are the same as the arguments to the\n`:YcmCompleter` ex command, e.g. the name of the subcommand, followed by any\nadditional subcommand arguments. As with the `YcmCompleter` command, if the\nfirst argument is `ft=\u003cfiletype\u003e` the request is targeted at the specified\nfiletype completer. This i","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fycm-core%2FYouCompleteMe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fycm-core%2FYouCompleteMe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fycm-core%2FYouCompleteMe/lists"}