[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-2204":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":23,"hasPages":23,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},2204,"YouCompleteMe","ycm-core\u002FYouCompleteMe","ycm-core","A code-completion engine for Vim","http:\u002F\u002Fycm-core.github.io\u002FYouCompleteMe\u002F",null,"Python",25903,2756,545,19,0,1,7,45,"GNU General Public License v3.0",false,"master",true,[25,26,27,28],"code-analysis","code-completion","semantic-engine","vim","2026-06-12 02:00:38","YouCompleteMe: a code-completion engine for Vim\n===============================================\n\n[![Gitter room](https:\u002F\u002Fimg.shields.io\u002Fgitter\u002Froom\u002FValloric\u002FYouCompleteMe.svg)](https:\u002F\u002Fgitter.im\u002FValloric\u002FYouCompleteMe)\n[![Build status](https:\u002F\u002Fdev.azure.com\u002FYouCompleteMe\u002FYCM\u002F_apis\u002Fbuild\u002Fstatus\u002Fycm-core.YouCompleteMe?branchName=master)](https:\u002F\u002Fdev.azure.com\u002FYouCompleteMe\u002FYCM\u002F_build?definitionId=3&branchName=master)\n[![Coverage status](https:\u002F\u002Fimg.shields.io\u002Fcodecov\u002Fc\u002Fgithub\u002Fycm-core\u002FYouCompleteMe\u002Fmaster.svg)](https:\u002F\u002Fcodecov.io\u002Fgh\u002Fycm-core\u002FYouCompleteMe)\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\u002FC++\u002FObjective-C\u002FObjective-C++\u002FCUDA, 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:\u002F\u002Fgithub.com\u002Fycm-core\u002FYouCompleteMe\u002Fissues\u002F4134#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\u002FCall 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\u002FC++\u002FObjective-C\u002FObjective-C++\u002FCUDA (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:\u002F\u002Fi.imgur.com\u002F0OP4ood.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\u002For 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 `.`, `->`\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:\u002F\u002Fuser-images.githubusercontent.com\u002F10026824\u002F34471853-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:\u002F\u002Fuser-images.githubusercontent.com\u002F10584846\u002F58738348-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\u002Fdefinition\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:\u002F\u002Fi.imgur.com\u002FnmUUbdl.gif)\n\nAnd here's some documentation being shown in a hover popup, automatically and\nmanually:\n\n![hover demo](https:\u002F\u002Fuser-images.githubusercontent.com\u002F10584846\u002F80312146-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 `.\u002F` 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.12   |\n| Neovim  | 0.5         | Vim 9.1.0016                       | 3.12   |\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.12 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.12.0 (...)`.\n\nFor Neovim, you must have a python 3.12 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.12 (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. `\u002Fusr\u002Fbin\u002Fpython3 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)\u002Flibexec\u002Fopenjdk.jdk \u002FLibrary\u002FJava\u002FJavaVirtualMachines\u002Fopenjdk.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\u002Fclangd work:\n\n    ```\n    cd ~\u002F.vim\u002Fbundle\u002FYouCompleteMe\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 ~\u002F.vim\u002Fbundle\u002FYouCompleteMe\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')).'\u002Fbin\u002Fclangd'\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 ~\u002F.vim\u002Fbundle\u002FYouCompleteMe\n.\u002Finstall.py --clangd-completer\n```\n\nCompiling YCM **without** semantic support for C-family languages:\n\n```\ncd ~\u002F.vim\u002Fbundle\u002FYouCompleteMe\n.\u002Finstall.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 ~\u002F.vim\u002Fbundle\u002FYouCompleteMe\n.\u002Finstall.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 ~\u002F.vim\u002Fbundle\u002FYouCompleteMe\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 ~\u002F.vim\u002Fbundle\u002FYouCompleteMe\npython3 install.py --clangd-completer\n```\n\nCompiling YCM **without** semantic support for C-family languages:\n\n```\ncd ~\u002F.vim\u002Fbundle\u002FYouCompleteMe\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 ~\u002F.vim\u002Fbundle\u002FYouCompleteMe\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***NOTE***: Windows support is *deprecated* and *unmaintained*. We will do our\nbest to keep it working, but we no longer test it in CI and there is a high\nlikelihood of breakages.\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\u002Fdyn` 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%\u002Fvimfiles\u002Fbundle\u002FYouCompleteMe\npython install.py --clangd-completer\n```\n\nCompiling YCM **without** semantic support for C-family languages:\n\n```\ncd %USERPROFILE%\u002Fvimfiles\u002Fbundle\u002FYouCompleteMe\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%\u002Fvimfiles\u002Fbundle\u002FYouCompleteMe\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\u002Fdeclaration\u002Fdefinition (`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>`)\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\u002Fdefinition (`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>`)\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>`)\n\n### Go\n\n* Semantic auto-completion\n* Signature help\n* Real-time diagnostic display\n* Go to declaration\u002Fdefinition (`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>`)\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\u002Fdefinition (`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>`)\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>`)\n* Code formatting (`Format`)\n* Organize imports (`OrganizeImports`)\n* Detection of Java projects\n* Execute custom server command (`ExecuteCommand \u003Cargs>`)\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>\n\u003Ctbody>\n\u003Ctr>\n  \u003Cth>matches\u003C\u002Fth>\n  \u003Cth>foo\u003C\u002Fth>\n  \u003Cth>fôo\u003C\u002Fth>\n  \u003Cth>fOo\u003C\u002Fth>\n  \u003Cth>fÔo\u003C\u002Fth>\n\u003C\u002Ftr>\n\u003Ctr>\n  \u003Cth>foo\u003C\u002Fth>\n  \u003Ctd>✔️\u003C\u002Ftd>\n  \u003Ctd>✔️\u003C\u002Ftd>\n  \u003Ctd>✔️\u003C\u002Ftd>\n  \u003Ctd>✔️\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n  \u003Cth>fôo\u003C\u002Fth>\n  \u003Ctd>❌\u003C\u002Ftd>\n  \u003Ctd>✔️\u003C\u002Ftd>\n  \u003Ctd>❌\u003C\u002Ftd>\n  \u003Ctd>✔️\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n  \u003Cth>fOo\u003C\u002Fth>\n  \u003Ctd>❌\u003C\u002Ftd>\n  \u003Ctd>❌\u003C\u002Ftd>\n  \u003Ctd>✔️\u003C\u002Ftd>\n  \u003Ctd>✔️\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003Ctr>\n  \u003Cth>fÔo\u003C\u002Fth>\n  \u003Ctd>❌\u003C\u002Ftd>\n  \u003Ctd>❌\u003C\u002Ftd>\n  \u003Ctd>❌\u003C\u002Ftd>\n  \u003Ctd>✔️\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\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>YCMToggleSignatureHelp` (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>(YCMToggleSignatureHelp)` for this.\n\nFor example, to hide\u002Fshow the signature help popup by pressing Ctrl+l in insert\nmode: `imap \u003Csilent> \u003CC-l> \u003CPlug>(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:\u002F\u002Fuser-images.githubusercontent.com\u002F10584846\u002F173137003-a265e8b0-84db-4993-98f0-03ee81b9de94.png)\n\nAnd here is the same function with semantic highlighting:\n\n![highliting-semantic](https:\u002F\u002Fuser-images.githubusercontent.com\u002F10584846\u002F173137012-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>`, then it will be used\nin place of the defaults. The `\u003Ctoken type>` is defined as the Language Server\nProtocol semantic token type, defined in the [LSP Spec](https:\u002F\u002Fmicrosoft.github.io\u002Flanguage-server-protocol\u002Fspecifications\u002Flsp\u002F3.17\u002Fspecification\u002F#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:\u002F\u002Fuser-images.githubusercontent.com\u002F10584846\u002F185708054-68074fc0-e50c-4a65-887c-da6f372b8982.png)\n\n* TypeScript\n\n![ts-inlay](https:\u002F\u002Fuser-images.githubusercontent.com\u002F10584846\u002F185708156-b52970ce-005f-4f0b-97e7-bdf8feeefedc.png)\n\n* Go\n\n![go-inlay](https:\u002F\u002Fuser-images.githubusercontent.com\u002F10584846\u002F185708242-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\u002Fycm\u002Finlay_hints.py`\n\n### Options\n\n* `g:ycm_enable_inlay_hints` or `b:ycm_enable_inlay_hints` - enable\u002Fdisable\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\u002Foff instantly, by mapping something to\n`\u003CPlug>(YCMToggleInlayHints)`, for example:\n\n```viml\nnnoremap \u003Csilent> \u003Clocalleader>h \u003CPlug>(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 >= 2.39 (Intel, armv7-a, aarch64) - built on ubuntu 24.04\n* MacOS >=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=\u002Fpath\u002Fto\u002Fyour\u002Fllvm' .\u002Finstall.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-\u002Fblacklist 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>` 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\u002Fpaste 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\u002Ffunction 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=\"\u002Fpath\u002Fto\u002Fexternal\u002Fjar\" \u002F>\n  \u003Cclasspathentry kind=\"lib\" path=\"\u002Fpath\u002Fto\u002Fexternal\u002Fjava\u002Fsource\" \u002F>\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\u002Fclasses\" path=\"path\u002Fto\u002Fsrc\u002F\" \u002F>\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:\u002F\u002Fgithub.com\u002Fycm-core\u002Flsp-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 '\u002Fpath\u002Fto\u002Fsolution\u002Ffile' # 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:\u002F\u002Fgithub.com\u002FOmniSharp\u002Fomnisharp-roslyn\u002Freleases\u002F)\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> \u003Cproject2.csproj> ...`\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': '\u002Fpath\u002Fto\u002Fvirtual\u002Fenvironment\u002Fpython'\n  }\n```\n\nHere, `\u002Fpath\u002Fto\u002Fvirtual\u002Fenvironment\u002Fpython` 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`\u002Fpath\u002Fto\u002Fsome\u002Fthird_party\u002Fpackage` and `\u002Fpath\u002Fto\u002Fanother\u002Fthird_party\u002Fpackage`\nat the start of `sys.path`:\n\n```python\ndef Settings( **kwargs ):\n  return {\n    'sys_path': [\n      '\u002Fpath\u002Fto\u002Fsome\u002Fthird_party\u002Fpackage',\n      '\u002Fpath\u002Fto\u002Fanother\u002Fthird_party\u002Fpackage'\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 `\u002Fpath\u002Fto\u002Fthird_party\u002Fpackage` 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, '\u002Fpath\u002Fto\u002Fthird_party\u002Fpackage' )\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\u002For 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 = '~\u002Fglobal_extra_conf.py'\n```\n\nThen, create the `~\u002Fglobal_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:\u002F\u002Frust-analyzer.github.io\u002Fmanual.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:\u002F\u002Fgithub.com\u002Fgolang\u002Ftools\u002Fblob\u002Fmaster\u002Fgopls\u002Fdoc\u002Fsettings.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\u002Fycmd\u002Fthird_party\u002Ftern_runtime\u002Fnode_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\u002FTypeScript 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': [ '\u002Fpath\u002Fto\u002Fyaml\u002Fserver\u002Fyaml-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: `name`, `cmdline`, `port`,\n`filetypes`, `capabilities`, `project_root_files`, `additional_workspace_dirs`,\n`triggerCharacters`, and `settings`. The full description of each key can be\nfound in the [ycmd][language_server-configuration] repository.\n\nSee [the LSP Examples](https:\u002F\u002Fgithub.com\u002Fycm-core\u002Flsp-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\nde","YouCompleteMe 是一个为 Vim 编辑器设计的代码补全引擎。它通过提供语义感知的代码补全、签名帮助和语法高亮等功能，显著提高了编程效率。项目采用 Python 语言开发，并支持多种主流编程语言如 C\u002FC++、Java、Python 等的智能补全。此外，YouCompleteMe 还具备客户端-服务器架构，使得其在处理大型代码库时也能保持高效响应。非常适合那些习惯使用 Vim 作为主要开发工具且希望提升编码体验的开发者们。",2,"2026-06-11 02:48:52","top_language"]