[
  {
    "path": ".coveragerc",
    "content": "[run]\nplugins = covimerage\n\n[report]\nomit =\n    */tests/*\n    */test/*\n    */third_party/*\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "blank_issues_enabled: false\ncontact_links:\n  - name: Questions and support\n    url: 'https://github.com/ycm-core/YouCompleteMe/tree/master?tab=readme-ov-file#help-advice-support'\n    about: Please ask and answer questions here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/issue.md",
    "content": "---\n\nname: Issue\nabout: Report a bug or suggest an enhancement\n\n---\n\n# Issue Prelude\n\n**Please complete these steps and check these boxes (by putting an `x` inside\nthe brackets) _before_ filing your issue:**\n\n- [ ] I have read and understood YCM's [CONTRIBUTING][cont] document.\n- [ ] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.\n- [ ] I have read and understood YCM's [README][readme], **especially the\n  [Frequently Asked Questions][faq] section.**\n- [ ] I have searched YCM's issue tracker to find issues similar to the one I'm\n  about to report and couldn't find an answer to my problem. ([Example Google\n  search.][search])\n- [ ] If filing a bug report, I have included the output of `vim --version`.\n- [ ] If filing a bug report, I have included the output of `:YcmDebugInfo`.\n- [ ] If filing a bug report, I have attached the contents of the logfiles using\n  the `:YcmToggleLogs` command.\n- [ ] If filing a bug report, I have included which OS (including specific OS\n  version) I am using.\n- [ ] If filing a bug report, I have included a minimal test case that reproduces\n  my issue, using `vim -Nu /path/to/YCM/vimrc_ycm_minimal`, including what I\n  expected to happen and what actually happened.\n- [ ] If filing a installation failure report, I have included the entire output\n  of `install.py` (or `cmake`/`make`/`ninja`) including its invocation\n- [ ] **I understand this is an open-source project staffed by volunteers and\n  that any help I receive is a selfless, heartfelt _gift_ of their free time. I\n  know I am not entitled to anything and will be polite and courteous.**\n- [ ] **I understand my issue may be closed if it becomes obvious I didn't\n  actually perform all of these steps.**\n\nThank you for adhering to this process! It ensures your issue is resolved\nquickly and that neither your nor our time is needlessly wasted.\n\n# Issue Details\n\n> Provide a clear description of the problem, including the following key\n> questions:\n\n* What did you do?\n\n> Include steps to reproduce here.\n\n1. `vim -Nu /path/to/YCM/ycm_vimrc_minimal`\n2. `:edit test.py`\n3. Enter insert mode and type `.....`\n\n> Include description of a minimal test case, including any actual code required\n> to reproduce the issue.\n\n> If you made changes to `vimrc_ycm_minimal`, pase them here:\n\n```\n<contents of ycm_vimrc_minimal>\n```\n\n* What did you expect to happen?\n\n> Include description of the expected behaviour.\n\n* What actually happened?\n\n> Include description of the observed behaviour, including actual output,\n> screenshots, etc.\n\n# Diagnostic data\n\n## Output of `vim --version`\n\n```\nPaste output here\n```\n\n## Output of `YcmDebugInfo`\n\n```\nPaste output here\n```\n\n## Output of `YcmDiags`\n\n```\nPaste output here\n```\n\n## Output of `git rev-parse HEAD` in YouCompleteMe installation directory\n\n```\npaste output here\n```\n\n## Contents of YCM, ycmd and completion engine logfiles\n\n> Reproduce the issue with `vim -Nu /path/to/YCM/vimrc_ycm_minimal`, which\n> enabled debug logging and other useful diagnostics.  Include a link to a\n> [gist][] containing all of the log files listed by `:YcmToggleLogs`.\n\n## OS version, distribution, etc.\n\n> Include system information here.\n\n## Output of build/install commands\n\n> Include link to a [gist][] containing the invocation and entire output of\n> `install.py` if reporting an installation issue.\n\n[cont]: https://github.com/ycm-core/YouCompleteMe/blob/master/CONTRIBUTING.md\n[code]: https://github.com/ycm-core/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md\n[readme]: https://github.com/ycm-core/YouCompleteMe/blob/master/README.md\n[faq]: https://github.com/ycm-core/YouCompleteMe/wiki/FAQ\n[search]: https://www.google.com/search?q=site%3Ahttps%3A%2F%2Fgithub.com%2Fycm-core%2FYouCompleteMe%2Fissues%20python%20mac\n[gist]: https://gist.github.com/\n"
  },
  {
    "path": ".github/PULL_REQUEST_TEMPLATE.md",
    "content": "# PR Prelude\n\nThank you for working on YCM! :)\n\n**Please complete these steps and check these boxes (by putting an `x` inside\nthe brackets) _before_ filing your PR:**\n\n- [ ] I have read and understood YCM's [CONTRIBUTING][cont] document.\n- [ ] I have read and understood YCM's [CODE_OF_CONDUCT][code] document.\n- [ ] I have included tests for the changes in my PR. If not, I have included a\n  rationale for why I haven't.\n- [ ] **I understand my PR may be closed if it becomes obvious I didn't\n  actually perform all of these steps.**\n\n# Why this change is necessary and useful\n\n[Please explain **in detail** why the changes in this PR are needed.]\n\n[cont]: https://github.com/ycm-core/YouCompleteMe/blob/master/CONTRIBUTING.md\n[code]: https://github.com/ycm-core/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: CI\n\non:\n  workflow_dispatch:\n  pull_request:\n  push:\n    branches:\n      - master\n\njobs:\n  python-tests:\n    strategy:\n      fail-fast: false\n      matrix:\n        runs-on: [ ubuntu-24.04, macos-14 ]\n        python-arch: [ 'x64' ]\n        include:\n          - runs-on: macos-14\n            python-arch: 'arm64'\n        exclude:\n          - runs-on: macos-14\n            python-arch: \"x64\"\n    env:\n      COVERAGE: true\n    name: \"${{ matrix.runs-on }} - Python 3.12 ${{ matrix.python-arch }}\"\n    runs-on: ${{ matrix.runs-on }}\n    steps:\n    - uses: actions/checkout@v4\n      with:\n        submodules: recursive\n        fetch-depth: 0\n    - name: Install Python\n      uses: actions/setup-python@v5\n      with:\n        python-version: \"3.12\"\n        architecture: ${{ matrix.python-arch }}\n    - name: Run pip\n      run: python3 -m pip install -r python/test_requirements.txt\n    - name: Run tests\n      run: python3 run_tests.py --quiet python/ycm/tests\n    - name: summarise coverage\n      run: coverage xml\n    - name: Upload coverage data\n      uses: codecov/codecov-action@v4\n      with:\n        name: \"${{ runner.os }}-3.12-${{ matrix.python-arch }}\"\n        token: ${{ secrets.CODECOV_TOKEN }}\n\n  vim-tests:\n    strategy:\n      fail-fast: false\n      matrix:\n        vim: [ 'new', 'old' ]\n        arch: [ 'x86_64' ]\n    runs-on: ubuntu-24.04\n    container: 'youcompleteme/ycm-vim-${{ matrix.arch }}-py3:test'\n    env:\n      COVERAGE: true\n      YCM_TEST_STDOUT: true\n    name: \"Vim tests - ${{ matrix.vim }}\"\n    steps:\n    - uses: actions/checkout@v4\n      with:\n        submodules: recursive\n        fetch-depth: 0\n    - name: Install dependencies\n      run: sudo -H pip3 install --break-system-packages -r python/test_requirements.txt\n    - name: Install Java\n      uses: actions/setup-java@v4\n      with:\n        java-version: 21\n        distribution: 'temurin'\n    - name: Build ycmd\n      run: python3 ./install.py --force-sudo --ts-completer --clangd-completer --java-completer\n    - name: Run tests in old vim\n      # System vim should be oldest supported.\n      if: matrix.vim == 'old'\n      run: ./test/run_vim_tests --vim /usr/bin/vim\n    - name: Run tests in new vim\n      if: matrix.vim == 'new'\n      run: ./test/run_vim_tests\n    - name: Combine and summarise coverage\n      run: coverage combine && coverage xml\n    - name: Upload coverage data\n      uses: codecov/codecov-action@v4\n      with:\n        name: \"vim-tests-${{ matrix.vim }}\"\n        token: ${{ secrets.CODECOV_TOKEN }}\n"
  },
  {
    "path": ".github/workflows/lock_old_issues.yaml",
    "content": "name: \"Lock Old Issues\"\n\non:\n  schedule:\n    - cron: '0 0 * * *'\n  workflow_dispatch:\n\njobs:\n  lock:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: dessant/lock-threads@v2\n        with:\n          github-token: ${{ github.token }}\n          issue-lock-inactive-days: '60'\n          # issue-exclude-created-before: ''\n          # issue-exclude-labels: ''\n          # issue-lock-labels: ''\n          # issue-lock-comment: ''\n          # issue-lock-reason: 'resolved'\n          # pr-lock-inactive-days: '365'\n          # pr-exclude-created-before: ''\n          # pr-exclude-labels: ''\n          # pr-lock-labels: ''\n          # pr-lock-comment: ''\n          # pr-lock-reason: 'resolved'\n          process-only: 'issues'\n"
  },
  {
    "path": ".github/workflows/update_vim_docs.yaml",
    "content": "name: \"Update vim docs\"\n\non:\n  push:\n    branches:\n      - master\n    paths:\n      - 'README.md'\n  workflow_dispatch:\n\njobs:\n  update-vim-docs:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v2\n      - name: 'Update local repo'\n        run: './update-vim-docs'\n      - name: 'Check diffs'\n        run: 'git diff'\n      - name: 'Create pull request'\n        uses: peter-evans/create-pull-request@v4\n        id: cpr\n        with:\n          token: ${{ secrets.VIMSPECTOR_UPDATE_BOT_PAT }}\n          push-to-fork: VimspectorUpdateBot/YouCompleteMe\n          commit-message: \"Update vim docs\"\n          branch: 'auto/update-vim-docs'\n          delete-branch: true\n          title: \"[Auto] Update vim docs\"\n          body: \"Update the vim docs after recent changes\"\n          labels: \"auto\"\n      - name: Check outputs\n        run: |\n          echo \"Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}\"\n          echo \"Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}\"\n"
  },
  {
    "path": ".gitignore",
    "content": "# Compiled Object files\n*.slo\n*.lo\n*.o\n\n# Compiled Dynamic libraries\n*.dll\n*.so\n*.dylib\n\n# Compiled Static libraries\n*.lai\n*.la\n*.a\n\n# Python\n*.py[cod]\n\n# Installer logs\npip-log.txt\n\n# Unit test / coverage reports\n.coverage\ncover/\n.tox\nnosetests.xml\n.noseids\n\n#Translations\n*.mo\n\n#Mr Developer\n.mr.developer.cfg\n\n# custom\nycm_core_tests\n\n# When we use the bcp tool to copy over the parts of boost we care about, it\n# also copies some cruft files we don't need; this ignores them\ncpp/BoostParts/libs/*/build\ncpp/BoostParts/libs/*/test\n\n# These folders in cpp/llvm contain lots of upstream cruft we don't care\n# about and would rather not have in our tree...\ncpp/llvm/docs/*\ncpp/llvm/tools/clang/www/*\n\n# ... but excluding these LLVMBuild.txt files breaks the build so we need to\n# explicitely include them\n!LLVMBuild.txt\n\n# Exclude auto generated vim doc tags.\ndoc/tags\n\n# Coverage files\n.coverage\n.coverage.*\ncoverage.xml\n.readme.utf-8.add.spl\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"third_party/ycmd\"]\n\tpath = third_party/ycmd\n\turl = https://github.com/ycm-core/ycmd\n"
  },
  {
    "path": ".mergify.yml",
    "content": "# https://blog.mergify.com/strict-mode-deprecation/\nqueue_rules:\n  - name: duplicated default from Automatic merge on Azure Pipelines and Reviewable\n      successes\n    queue_conditions:\n      - base=master\n      - \"#approved-reviews-by>=2\"\n      - status-success=ubuntu-24.04 - Python 3.9 x64\n      - status-success=macos-14 - Python 3.9 arm64\n      # - status-success=windows-2019 - Python 3.9 x64\n      # - status-success=windows-2019 - Python 3.9 x86\n      - status-success=Vim tests - new\n      - status-success=Vim tests - old\n      - status-success=code-review/reviewable\n    merge_conditions:\n      - status-success=ubuntu-24.04 - Python 3.9 x64\n      - status-success=macos-14 - Python 3.9 arm64\n      - status-success=windows-2019 - Python 3.9 x64\n      - status-success=windows-2019 - Python 3.9 x86\n      - status-success=Vim tests - new\n      - status-success=Vim tests - old\n    merge_method: merge\n  - name: duplicated default from Manual merge on Azure Pipelines and Maintainer Override\n    queue_conditions:\n      - base=master\n      - status-success=ubuntu-24.04 - Python 3.9 x64\n      - status-success=macos-14 - Python 3.9 arm64\n      - status-success=windows-2019 - Python 3.9 x64\n      - status-success=windows-2019 - Python 3.9 x86\n      - status-success=Vim tests - new\n      - status-success=Vim tests - old\n      - \"#approved-reviews-by>=1\"\n      - \"#changes-requested-reviews-by=0\"\n      - label=\"Ship It!\"\n    merge_conditions:\n      - status-success=ubuntu-24.04 - Python 3.9 x64\n      - status-success=macos-14 - Python 3.9 arm64\n      - status-success=windows-2019 - Python 3.9 x64\n      - status-success=windows-2019 - Python 3.9 x86\n      - status-success=Vim tests - new\n      - status-success=Vim tests - old\n    merge_method: merge\n  - name: duplicated default from Manual merge on Pipelines and Maintainer Override\n      from owner PR\n    queue_conditions:\n      - base=master\n      - author=puremourning\n      - status-success=ubuntu-24.04 - Python 3.9 x64\n      - status-success=macos-14 - Python 3.9 arm64\n      - status-success=windows-2019 - Python 3.9 x64\n      - status-success=windows-2019 - Python 3.9 x86\n      - status-success=Vim tests - new\n      - status-success=Vim tests - old\n      - \"#changes-requested-reviews-by=0\"\n      - label=\"Ship It!\"\n    merge_conditions:\n      - status-success=ubuntu-24.04 - Python 3.9 x64\n      - status-success=macos-14 - Python 3.9 arm64\n      - status-success=windows-2019 - Python 3.9 x64\n      - status-success=windows-2019 - Python 3.9 x86\n      - status-success=Vim tests - new\n      - status-success=Vim tests - old\n    merge_method: merge\n  - name: duplicated default from Merge auto pr when approved\n    queue_conditions:\n      - author=VimspectorUpdateBot\n      - label=auto\n      - base=master\n      - status-success=code-review/reviewable\n      - \"#approved-reviews-by>=1\"\n      - \"#changes-requested-reviews-by=0\"\n    merge_conditions:\n      - status-success=ubuntu-24.04 - Python 3.9 x64\n      - status-success=macos-14 - Python 3.9 arm64\n      - status-success=windows-2019 - Python 3.9 x64\n      - status-success=windows-2019 - Python 3.9 x86\n      - status-success=Vim tests - new\n      - status-success=Vim tests - old\n    merge_method: merge\n\npull_request_rules:\n  - name: Automatic merge on Azure Pipelines and Reviewable successes\n    conditions:\n      - base=master\n      - \"#approved-reviews-by>=2\"\n      - status-success=ubuntu-24.04 - Python 3.9 x64\n      - status-success=macos-14 - Python 3.9 arm64\n      # - status-success=windows-2019 - Python 3.9 x64\n      # - status-success=windows-2019 - Python 3.9 x86\n      - status-success=Vim tests - new\n      - status-success=Vim tests - old\n      - status-success=code-review/reviewable\n    actions: &merge-actions\n      comment:\n        message: Thanks for sending a PR!\n\n  - name: Manual merge on Azure Pipelines and Maintainer Override\n    conditions:\n      - base=master\n      - status-success=ubuntu-24.04 - Python 3.9 x64\n      - status-success=macos-14 - Python 3.9 arm64\n      # - status-success=windows-2019 - Python 3.9 x64\n      # - status-success=windows-2019 - Python 3.9 x86\n      - status-success=Vim tests - new\n      - status-success=Vim tests - old\n\n      - \"#approved-reviews-by>=1\"\n      - \"#changes-requested-reviews-by=0\"\n\n      - label=\"Ship It!\"\n    actions:\n      <<: *merge-actions\n  - name: Manual merge on Pipelines and Maintainer Override from owner PR\n    conditions:\n      - base=master\n      - author=puremourning\n      - status-success=ubuntu-24.04 - Python 3.9 x64\n      - status-success=macos-14 - Python 3.9 arm64\n      # - status-success=windows-2019 - Python 3.9 x64\n      # - status-success=windows-2019 - Python 3.9 x86\n      - status-success=Vim tests - new\n      - status-success=Vim tests - old\n\n      - \"#changes-requested-reviews-by=0\"\n      - label=\"Ship It!\"\n    actions:\n      <<: *merge-actions\n  - name: Merge auto pr when approved\n    conditions:\n      - author=VimspectorUpdateBot\n      - label=auto\n      - base=master\n      # Review\n      - status-success=code-review/reviewable\n      - \"#approved-reviews-by>=1\"\n      - \"#changes-requested-reviews-by=0\"\n    actions:\n      <<: *merge-actions\n  - name: Automatic merge on Azure Pipelines and Reviewable successes + Manual merge\n      on Azure Pipelines and Maintainer Override + Manual merge on Pipelines and Maintainer\n      Override from owner PR + Merge auto pr when approved\n    conditions: []\n    actions:\n      queue:\n"
  },
  {
    "path": ".readme.utf-8.add",
    "content": "AST\nAutocommands\nCMake\nCUDA\nCompleters\nCtags\nCtrl\nCursorHold\nDoxygen\nEclim\nEclim's\nFixIt\nFreenode\nGitter\nGoTo\nGopls\nHomebrew\nHomebrew\nICCF\nJDK\nJSON\nKotlin\nLLVM\nLSP\nLTS\nListToggle\nMSVC\nMacVim\nNeovim\nOmniSharp\nOmnisharp\nSyntastic\nTSServer\nTypeScript\nUltiSnips\nVimScript\nVimspector\nVundle\nWB\nYCM\nYCM's\nYcmCompleter\nYouCompleteMe\nasciicast\nasync\nautocommand\nclangd\nclangd's\nclasspath\ncoc\ncompiledb\ncompleteopt\ncompleters\nconf\nconfig\nconfiguration\ncsharp\nctags\ndocstrings\necho'd\nfilepath\nfilesystem\nfiletype\nfiletypes\nfreenode\nglobbing\ngopls\ngradle\ngvim\njavadoc\njdt\njs\nkeypress\nlagginess\nlibclang\nlightline\nlsp\nmacOS\nmd\nnpm\nomnicomplete\nomnicompletion\nomnifunc\nomnifuncs\nonType\npopup\nprecompiled\npy\nquickfix\nrealtime\nrls\nstatusline\nsys\ntoolchain\nunicode\nunsetting\nv3\nvimrc\nwhitelist\nwhitelisted\nwhitespace\nxbuild\nxml\nycm\nycmd\nycmd's\n"
  },
  {
    "path": ".vimspector.json",
    "content": "{\n  \"$schema\": \"https://puremourning.github.io/vimspector/schema/vimspector.schema.json\",\n  \"configurations\": {\n    \"Python: Attach To Vim\": {\n      \"variables\": {\n        \"port\": \"5678\",\n        \"host\": \"localhost\"\n      },\n      \"adapter\": \"multi-session\",\n      \"configuration\": {\n        \"request\": \"attach\"\n      }\n    },\n    \"python - launch pytest\": {\n      \"adapter\": \"debugpy\",\n      \"variables\": [\n        {\n          \"python\": {\n            \"shell\": \"/bin/bash -c 'if [ -z \\\"${dollar}VIRTUAL_ENV\\\" ]; then echo $$(which python3); else echo \\\"${dollar}VIRTUAL_ENV/bin/python\\\"; fi'\"\n          }\n        },\n        {\n          \"python_path\": {\n            \"shell\": [\n              \"${python}\",\n              \"${workspaceRoot}/run_tests.py\",\n              \"--dump-path\"\n            ]\n          }\n        }\n      ],\n      \"configuration\": {\n        \"name\": \"Python run test\",\n        \"type\": \"debugpy\",\n        \"request\": \"launch\",\n\n        \"cwd\": \"${workspaceRoot}\",\n        \"stopOnEntry\": false,\n        \"console\": \"integratedTerminal\",\n        \"justMyCode\": true,\n        \"logToFile\": true,\n        \"showReturnValue\": true,\n\n        \"debugOptions\": [],\n\n        \"module\": \"unittest\",\n        \"python\": \"${python}\",\n        \"args\": [\n          \"-v\",\n          \"${Test}\"\n        ],\n        \"env\": {\n          \"PYTHONPATH\": \"${python_path}\",\n          \"LD_LIBRARY_PATH\": \"${workspaceRoot}/third_party/ycmd/third_party/clang/lib\",\n          \"YCM_TEST_NO_RETRY\": \"1\"\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": ".ycm_extra_conf.py",
    "content": "# This file is NOT licensed under the GPLv3, which is the license for the rest\n# of YouCompleteMe.\n#\n# Here's the license text for this file:\n#\n# This is free and unencumbered software released into the public domain.\n#\n# Anyone is free to copy, modify, publish, use, compile, sell, or\n# distribute this software, either in source code form or as a compiled\n# binary, for any purpose, commercial or non-commercial, and by any\n# means.\n#\n# In jurisdictions that recognize copyright laws, the author or authors\n# of this software dedicate any and all copyright interest in the\n# software to the public domain. We make this dedication for the benefit\n# of the public at large and to the detriment of our heirs and\n# successors. We intend this dedication to be an overt act of\n# relinquishment in perpetuity of all present and future rights to this\n# software under copyright law.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\n# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n# OTHER DEALINGS IN THE SOFTWARE.\n#\n# For more information, please refer to <http://unlicense.org/>\n\nimport os.path as p\nimport subprocess\n\nDIR_OF_THIS_SCRIPT = p.abspath( p.dirname( __file__ ) )\nDIR_OF_THIRD_PARTY = p.join( DIR_OF_THIS_SCRIPT, 'third_party' )\n\n\ndef GetStandardLibraryIndexInSysPath( sys_path ):\n  for index, path in enumerate( sys_path ):\n    if p.isfile( p.join( path, 'os.py' ) ):\n      return index\n  raise RuntimeError( 'Could not find standard library path in Python path.' )\n\n\ndef PythonSysPath( **kwargs ):\n  sys_path = kwargs[ 'sys_path' ]\n\n  dependencies = [ p.join( DIR_OF_THIS_SCRIPT, 'python' ),\n                   p.join( DIR_OF_THIRD_PARTY, 'requests-futures' ),\n                   p.join( DIR_OF_THIRD_PARTY, 'ycmd' ),\n                   p.join( DIR_OF_THIRD_PARTY, 'requests_deps', 'idna' ),\n                   p.join( DIR_OF_THIRD_PARTY, 'requests_deps', 'chardet' ),\n                   p.join( DIR_OF_THIRD_PARTY,\n                           'requests_deps',\n                           'urllib3',\n                           'src' ),\n                   p.join( DIR_OF_THIRD_PARTY, 'requests_deps', 'certifi' ),\n                   p.join( DIR_OF_THIRD_PARTY, 'requests_deps', 'requests' ) ]\n\n  # The concurrent.futures module is part of the standard library on Python 3.\n  interpreter_path = kwargs[ 'interpreter_path' ]\n  major_version = int( subprocess.check_output( [\n    interpreter_path, '-c', 'import sys; print( sys.version_info[ 0 ] )' ]\n  ).rstrip().decode( 'utf8' ) )\n  if major_version == 2:\n    dependencies.append( p.join( DIR_OF_THIRD_PARTY, 'pythonfutures' ) )\n\n  sys_path[ 0:0 ] = dependencies\n  sys_path.insert( GetStandardLibraryIndexInSysPath( sys_path ) + 1,\n                   p.join( DIR_OF_THIRD_PARTY, 'python-future', 'src' ) )\n\n  return sys_path\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "We, the maintainers, pledge to treat all contributors with respect and require that contributors reciprocate.\n\nThe maintainers will not tolerate unwelcome, impolite, abusive or unprofessional behaviour.\n\nAt the discretion of the maintainers, users who persist in behaving in a way that is unwelcome may be subject to a ban.\n\nThis applies to all interactions related to this project and any associated projects.\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "Writing issue reports\n=====================\n\n### Bugs and features only\n\nFirst things first: **the issue tracker is NOT for tech support**. It is for\nreporting bugs and requesting features. If your issue amounts to \"I can't get\nYCM to work on my machine\" and the reason why is obviously related to your\nmachine configuration and the problem would not be resolved with _reasonable_\nchanges to the YCM codebase, then the issue is likely to be closed.\n\n### Where to go for help\n\n**A good place to ask questions is the [Gitter room][gitter] or the\n[ycm-users][] Google group**. Rule of thumb: if you're not sure whether your\nproblem is a real bug, ask on the room or the group. \n\nDon't go to `#vim` on freenode for support. See the \n[readme][help-advice-support] for further help.\n\n### Installation problem - read the docs\n\n**YCM compiles just fine**; [the build bots say so][build-bots]. If the bots are\ngreen and YCM doesn't compile on your machine, then _your machine is the root\ncause_. Now read the first paragraph again.\n\nRealize that quite literally _thousands_ of people have gotten YCM to work\nsuccessfully so if you can't, it's probably because you have a peculiar\nsystem/Vim configuration or you didn't go through the docs carefully enough.\nIt's very unlikely to be caused by an actual bug in YCM because someone would\nhave already found it and reported it.\n\nThis leads us to point #2: **make sure you have checked the docs before\nreporting an issue**. The docs are extensive and cover a ton of things; there's\nalso an FAQ at the bottom that quite possibly addresses your problem.\n\nFor installation problems, make sure that any issue report includes the entire\noutput of any build or installation commands, including **the command used to\nrun them**.\n\nFor common issues such as \"the ycmd server SHUT DOWN\", please check the GitHub\nWiki.\n\n### Other problems - check the issue tracker\n\nFurther, **search the issue tracker for similar issues** before creating a new\none. There's no point in duplication; if an existing issue addresses your\nproblem, please comment there instead of creating a duplicate. However, if the\nissue you found is **closed as resolved** (e.g. with a PR or the original user's\nproblem was resolved), raise a **new issue**, because you've found a new\nproblem. Reference the original issue if you think that's useful information.\n\nPlease note: Closed issues which have been inactive for 60 days will be locked,\nthis helps to keep discussions focussed. If you believe you are still\nexperiencing an issue which has been closed, please raise a new issue,\ncompleting the issue template.\n\nIf you do find a similar _open_ issue, **don't just post 'me too' or similar**\nresponses. This almost never helps resolve the issue, and just causes noise for\nthe maintainers. Only post if it will aid the maintainers in solving the issue;\nif there are existing diagnostics requested in the thread, perform\nthem and post the results.\n\nWhen replying, follow the instructions for getting the required diagnostics for\nposting a new issue (see below), and add them to your response. This is likely\nto help the maintainers find a fix for you, rather than have them spend time\nrequesting them again. To be clear, the maintainers *always* need the\ndiagnostics (debug info, log files, versions, etc.) even for responses on\nexisting issues.\n\nYou should also **search the archives of the [ycm-users][] mailing list**.\n\n### Check your YCM version\n\nLastly, **make sure you are running the latest version of YCM**. The issue you\nhave encountered may have already been fixed. **Don't forget to recompile\nycm_core.so too** (usually by just running `install.py` again).\n\n## Creating an issue \n\nOK, so we've reached this far. You need to create an issue. First realize that\nthe time it takes to fix your issue is a multiple of how long it takes the\ndeveloper to reproduce it. The easier it is to reproduce, the quicker it'll be\nfixed.\n\nHere are the things you should do when creating an issue:\n\n1. Most importantly, **read and complete the issue template**. The maintainers\n   rely on the style and structure of the issue template to quickly resolve your\n   issue. If you don't complete it in full, then the maintainers may elect to\n   ignore or simply close your issue. This isn't personal, it's just that they\n   are busy too.\n2. **Check that your issue reproduces with a minimal configuration**. Run `vim\n   -Nu /path/to/YCM/vimrc_ycm_minimal` and reproduce this issue. If it doesn't\n   repro, then copy your ycm-specific settings into this file and try again. If\n   it still doesn't repro, the issue is likely with another plugin.\n3. **Write a step-by-step procedure that when performed repeatedly reproduces\n   your issue.** If we can't reproduce the issue, then we can't fix it. It's\n   that simple.\n4. Explain **what you expected to happen**, and **what actually happened**.\n   This helps us understand if it is a bug, or just a misunderstanding of the\n   behavior.\n5. Add the output of [the `:YcmDebugInfo` command][ycm-debug-info-command]. Make\n   sure that when you run this, your cursor is in the file that is experiencing\n   the issue.\n6. Reproduce your issue using `vim -Nu /path/to/YCM/vimrc_ycm_minimal` \n    and attach the contents of the logfiles. Use [the\n   `:YcmToggleLogs` command][ycm-toggle-logs-command] to directly open them in\n   Vim.\n7. **Create a test case for your issue**. This is critical. Don't talk about how\n   \"when I have X in my file\" or similar, _create a file with X in it_ and put\n   the contents inside code blocks in your issue description. Try to make this\n   test file _as small as possible_. Don't just paste a huge, 500 line source\n   file you were editing and present that as a test. _Minimize_ the file so that\n   the problem is reproduced with the smallest possible amount of test data.\n8. **Include your OS and OS version.**\n9. **Include the output of `vim --version`.**\n\n\nCreating good pull requests\n===========================\n\n1.  **Follow the code style of the existing codebase.**\n    - The Python code **DOES NOT** follow PEP 8. This is not an oversight, this\n      is by choice. You can dislike this as much as you want, but you still need\n      to follow the existing style. Look at other Python files to see what the\n      style is.\n    - The C++ code has an automated formatter (`style_format.sh` that runs\n      `astyle`) but it's not perfect. Again, look at the other C++ files and\n      match the code style you see.\n    - Same thing for VimScript. Match the style of the existing code.\n\n2.  **Your code needs to be well written and easy to maintain**. This is of the\n    _utmost_ importance. Other people will have to maintain your code so don't\n    just throw stuff against the wall until things kinda work.\n\n3.  **Split your pull request into several smaller ones if possible.** This\n    makes it easier to review your changes, which means they will be merged\n    faster.\n\n4.  **Write tests for your code**. If you're changing the VimScript code then\n    you don't have to since it's hard to test that code. This is also why you\n    should strive to implement your change in Python if at all possible (and if\n    it makes sense to do so). Python is also _much_ faster than VimScript.\n\n5.  **Explain in detail why your pull request makes sense.** Ask yourself, would\n    this feature be helpful to others? Not just a few people, but a lot of YCM’s\n    users? See, good features are useful to many. If your feature is only useful\n    to you and _maybe_ a couple of others, then that’s not a good feature.\n    There is such a thing as “feature overload”. When software accumulates so\n    many features of which most are only useful to a handful, then that software\n    has become “bloated”. We don’t want that.\n\n    Requests for features that are obscure or are helpful to but a few, or are\n    not part of YCM's \"vision\" will be rejected. Yes, even if you provide a\n    patch that completely implements it.\n\n    Please include details on exactly what you would like to see, and why. The\n    why is important - it's not always clear why a feature is really useful. And\n    sometimes what you want can be done in a different way if the reason for the\n    change is known. _What goal is your change trying to accomplish?_\n\n\n[build-bots]: https://dev.azure.com/YouCompleteMe/YCM/_build/latest?definitionId=1&branchName=master\n[ycm-users]: https://groups.google.com/forum/?hl=en#!forum/ycm-users\n[gitter]: https://gitter.im/Valloric/YouCompleteMe\n[help-advice-support]: https://github.com/ycm-core/YouCompleteMe#help-advice-support\n[ycm-debug-info-command]: https://github.com/ycm-core/YouCompleteMe#the-ycmdebuginfo-command\n[ycm-toggle-logs-command]: https://github.com/ycm-core/YouCompleteMe#the-ycmtogglelogs-command\n"
  },
  {
    "path": "COPYING.txt",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <http://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    <program>  Copyright (C) <year>  <name of author>\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<http://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<http://www.gnu.org/philosophy/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "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&branchName=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 `.`, `->`\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.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. `/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***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/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 <new 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/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 <new 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 <new name>`)\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 <new 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/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 <new 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 <new name>`)\n* Code formatting (`Format`)\n* Organize imports (`OrganizeImports`)\n* Detection of Java projects\n* Execute custom server command (`ExecuteCommand <args>`)\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<table>\n<tbody>\n<tr>\n  <th>matches</th>\n  <th>foo</th>\n  <th>fôo</th>\n  <th>fOo</th>\n  <th>fÔo</th>\n</tr>\n<tr>\n  <th>foo</th>\n  <td>✔️</td>\n  <td>✔️</td>\n  <td>✔️</td>\n  <td>✔️</td>\n</tr>\n<tr>\n  <th>fôo</th>\n  <td>❌</td>\n  <td>✔️</td>\n  <td>❌</td>\n  <td>✔️</td>\n</tr>\n<tr>\n  <th>fOo</th>\n  <td>❌</td>\n  <td>❌</td>\n  <td>✔️</td>\n  <td>✔️</td>\n</tr>\n<tr>\n  <th>fÔo</th>\n  <td>❌</td>\n  <td>❌</td>\n  <td>❌</td>\n  <td>✔️</td>\n</tr>\n</tbody>\n</table>\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 `<plug>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`<Plug>(YCMToggleSignatureHelp)` for this.\n\nFor example, to hide/show the signature help popup by pressing Ctrl+l in insert\nmode: `imap <silent> <C-l> <Plug>(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_<token type>`, then it will be used\nin place of the defaults. The `<token type>` 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`<Plug>(YCMToggleInlayHints)`, for example:\n\n```viml\nnnoremap <silent> <localleader>h <Plug>(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=/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 <language>` 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  <classpathentry kind=\"lib\" path=\"/path/to/external/jar\" />\n  <classpathentry kind=\"lib\" path=\"/path/to/external/java/source\" />\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  <classpathentry kind=\"src\" output=\"target/classes\" path=\"path/to/src/\" />\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 <project1.csproj> <project2.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': '/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: `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://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 `>= 2.2.*` and\nEclipse `>= 4.2.*`).\n\nAfter installing Eclim remember to create a new Eclipse project within your\napplication by typing `:ProjectCreate <path-to-your-project> -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 <F5> :YcmForceCompileAndDiagnostics<CR>` 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`<leader>d` 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 <something> <Plug>(YCMFindSymbolInWorkspace)`\n* `nmap <something> <Plug>(YCMFindSymbolInDocument)`\n\ne.g.\n\n* `nmap <leader>yfw <Plug>(YCMFindSymbolInWorkspace)`\n* `nmap <leader>yfd <Plug>(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 `<Esc>` 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 `<C-f>` 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* `<C-j>`, `<Down>`, `<C-n>`, `<Tab>` - select the next item\n* `<C-k>`, `<Up>`, `<C-p>`, `<S-Tab>` - select the previous item\n* `<PageUp>`, `<kPageUp>` - jump up one screenful of items \n* `<PageDown>`, `<kPageDown>` - jump down one screenful of items\n* `<Home>`, `<kHome>` - jump to first item\n* `<End>`, `<kEnd>` - jump to last item\n* `<CR>` - jump to the selected item\n* `<C-c>` cancel/dismiss the popup\n* `<C-f>` - 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 `<C-w>...` for example.\n\n#### Closing the popup\n\n***NOTE***: Pressing `<Esc>` does not close the popup - you must use `Ctrl-c`\nfor that, or use a window command (e.g. `<Ctrl-w>j`) 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 `<Plug>(YCMTypeHierarchy)`: Display subtypes and supertypes\n  of the symbol under cursor. Expand down to subtypes and up to supertypes.\n* Call hierarchy `<Plug>(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 <leader>yth <Plug>(YCMTypeHierarchy)\nnmap <leader>ych <Plug>(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 `<Tab>` and \"up\" with `<S-Tab>`.\n\nThe \"root\" of the tree can be re-focused to the selected item with\n`<S-Tab>` and further `<S-Tab>` 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. `<S-Tab>` 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* `<Tab>`: Drill into the hierarchy at the selected item: expand and show\n  children of the selected item.\n* `<S-Tab>`: 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* `<CR>`: Jump to the symbol currently selected.\n* `<Down>`, `<C-n>`, `<C-j>`, `j`: Select the next item\n* `<Up>`, `<C-p>`, `<C-k>`, `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 <F5>\n:YcmForceCompileAndDiagnostics<CR>` 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`<TAB>` 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 <leader>jd :YcmCompleter GoTo<CR>`\nmaps the `<leader>jd` 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 <symbol query>` 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 => std::basic_string<char>`\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=&previewheight \n  \\ <bar> set previewheight=<count>\n  \\ <bar> <mods> YcmCompleter GetDoc\n  \\ <bar> let &previewheight=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 <new name>` 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<enter>` 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 <args>` 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 <silent> <leader>D :call <SID>Hover()<CR>\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=<filetype>` the request is targeted at the specified\nfiletype completer. This is an advanced usage and not necessary in most cases.\n\nNOTE: The request is run synchronously and blocks Vim until the response is\nreceived, so we do not recommend running this as part of an autocommand that\ntriggers frequently.\n\n### The `youcompleteme#GetCommandResponseAsync( callback, ... )` function\n\nThis works exactly like `youcompleteme#GetCommandResponse`, except that instead\nof returning the result, you supply a `callback` argument. This argument must be\na `FuncRef` to a function taking a single argument `response`. This callback\nwill be called with the command response at some point later, or immediately.\n\nAs with `youcompleteme#GetCommandResponse()`, this function will call the\ncallback with `''` (an empty string) if the request is not sent, or if there was\nsome sort of error.\n\nHere's an example that's similar to the one above:\n\n```viml\n\nlet s:ycm_hover_popup = -1\nfunction! s:ShowDataPopup( response ) abort\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\nfunction! s:GetData() abort\n  call youcompleteme#GetCommandResponseAsync(\n    \\ function( 's:ShowDataPopup' ),\n    \\ 'GetDoc' )\nendfunction\n\nautocommand CursorHold * call s:GetData()\n```\n\nAgain, see [`g:ycm_auto_hover`](#the-gycm_auto_hover-option) for proper hover\nsupport.\n\n**NOTE**: The callback may be called immediately, in the stack frame that called\nthis function.\n\n**NOTE**: Only one command request can be outstanding at once. Attempting to\nrequest a second response while the first is outstanding will result in the\nsecond callback being immediately called with `''`.\n\nAutocommands\n------------\n\n### The `YcmLocationOpened` autocommand\n\nThis `User` autocommand is fired when YCM opens the location list window in\nresponse to the `YcmDiags` command. By default, the location list window is\nopened to the bottom of the current window and its height is set to fit all\nentries. This behavior can be overridden by using the `YcmLocationOpened`\nautocommand which is triggered while the cursor is in the location list window.\nFor instance:\n\n```viml\nfunction! s:CustomizeYcmLocationWindow()\n  \" Move the window to the top of the screen.\n  wincmd K\n  \" Set the window height to 5.\n  5wincmd _\n  \" Switch back to the working window.\n  wincmd p\nendfunction\n\nautocmd User YcmLocationOpened call s:CustomizeYcmLocationWindow()\n```\n\n### The `YcmQuickFixOpened` autocommand\n\nThis `User` autocommand is fired when YCM opens the quickfix window in response\nto the `GoTo*` and `RefactorRename` subcommands. By default, the quickfix window\nis opened to full width at the bottom of the screen and its height is set to fit\nall entries. This behavior can be overridden by using the `YcmQuickFixOpened`\nautocommand which is triggered while the cursor is in the quickfix window. For\ninstance:\n\n```viml\nfunction! s:CustomizeYcmQuickFixWindow()\n  \" Move the window to the top of the screen.\n  wincmd K\n  \" Set the window height to 5.\n  5wincmd _\nendfunction\n\nautocmd User YcmQuickFixOpened call s:CustomizeYcmQuickFixWindow()\n```\n\nOptions\n-------\n\nAll options have reasonable defaults so if the plug-in works after installation\nyou don't need to change any options. These options can be configured in your\n[vimrc script][vimrc] by including a line like this:\n\n```viml\nlet g:ycm_min_num_of_chars_for_completion = 1\n```\n\nNote that after changing an option in your [vimrc script][vimrc] you have to\nrestart [ycmd][] with the `:YcmRestartServer` command for the changes to take\neffect.\n\n### The `g:ycm_min_num_of_chars_for_completion` option\n\nThis option controls the number of characters the user needs to type before\nidentifier-based completion suggestions are triggered. For example, if the\noption is set to `2`, then when the user types a second alphanumeric character\nafter a whitespace character, completion suggestions will be triggered. This\noption is NOT used for semantic completion.\n\nSetting this option to a high number like `99` effectively turns off the\nidentifier completion engine and just leaves the semantic engine.\n\nDefault: `2`\n\n```viml\nlet g:ycm_min_num_of_chars_for_completion = 2\n```\n\n### The `g:ycm_min_num_identifier_candidate_chars` option\n\nThis option controls the minimum number of characters that a completion\ncandidate coming from the identifier completer must have to be shown in the\npopup menu.\n\nA special value of `0` means there is no limit.\n\n**NOTE:** This option only applies to the identifier completer; it has no effect\non the various semantic completers.\n\nDefault: `0`\n\n```viml\nlet g:ycm_min_num_identifier_candidate_chars = 0\n```\n\n### The `g:ycm_max_num_candidates` option\n\nThis option controls the maximum number of semantic completion suggestions shown\nin the completion menu. This only applies to suggestions from semantic\ncompletion engines; see [the `g:ycm_max_identifier_candidates`\noption](#the-gycm_max_num_identifier_candidates-option) to limit the number of\nsuggestions from the identifier-based engine.\n\nA special value of `0` means there is no limit.\n\n**NOTE:** Setting this option to `0` or to a value greater than `100` is not\nrecommended as it will slow down completion when there is a very large number\nof suggestions.\n\nDefault: `50`\n\n```viml\nlet g:ycm_max_num_candidates = 50\n```\n\n### The `g:ycm_max_num_candidates_to_detail` option\n\nSome completion engines require completion candidates to be 'resolved' in order\nto get detailed info such as inline documentation, method signatures, etc.  This\ninformation is displayed by YCM in the preview window, or if `completeopt`\ncontains `popup`, in the info popup next to the completion menu.\n\nBy default, if the info popup is in use, and there are more than 10 candidates,\nYCM will defer resolving candidates until they are selected in the completion\nmenu.  Otherwise, YCM must resolve the details upfront, which can be costly.\n\nIf neither `popup` nor `preview` are in `completeopt`, YCM disables resolving\naltogether as the information would not be displayed.\n\nThis setting can be used to override these defaults and  controls the number of\ncompletion candidates that should be resolved upfront. Typically users do not\nneed to change this, as YCM will work out an appropriate value based on your\n`completeopt` and `g:ycm_add_preview_to_completeopt` settings. However, you may\noverride this calculation by setting this value to a number:\n\n* `-1` - Resolve all candidates upfront\n* `0` - Never resolve any candidates upfront.\n* `> 0` - Resolve up to this many candidates upfront. If the number of\n  candidates is greater than this value, no candidates are resolved.\n\nIn the latter two cases, if `completeopt` contains `popup`, then candidates are\nresolved on demand asynchronously.\n\nDefault:\n\n* `0` if neither `popup` nor `preview` are in `completeopt`.\n* `10` if `popup` is in completeopt.\n* `-1` if `preview` is in completeopt.\n\nExample:\n\n```viml\nlet g:ycm_max_num_candidates_to_detail = 0\n```\n\n### The `g:ycm_max_num_identifier_candidates` option\n\nThis option controls the maximum number of completion suggestions from the\nidentifier-based engine shown in the completion menu.\n\nA special value of `0` means there is no limit.\n\n**NOTE:** Setting this option to `0` or to a value greater than `100` is not\nrecommended as it will slow down completion when there is a very large number\nof suggestions.\n\nDefault: `10`\n\n```viml\nlet g:ycm_max_num_identifier_candidates = 10\n```\n\n### The `g:ycm_auto_trigger` option\n\nWhen set to `0`, this option turns off YCM's identifier completer (the\nas-you-type popup) _and_ the semantic triggers (the popup you'd get after typing\n`.` or `->` in say C++). You can still force semantic completion with the\n`<C-Space>` shortcut.\n\nIf you want to just turn off the identifier completer but keep the semantic\ntriggers, you should set `g:ycm_min_num_of_chars_for_completion` to a high\nnumber like `99`.\n\nWhen `g:ycm_auto_trigger` is `0`, YCM sets the `completefunc`, so that you can\nmanually trigger normal completion using `C-x C-u`.\n\nIf you want to map something else to trigger completion, such as `C-d`,\nthen you can map it to `<plug>(YCMComplete)`. For example:\n\n```viml\nlet g:ycm_auto_trigger = 0\nimap <c-d> <plug>(YCMComplete)\n```\n\nNOTE: It's not possible to map one of the keys in\n`g:ycm_key_list_select_completion` (or similar) to `<plug>(YCMComplete)`. In\npractice that means that you can't use `<Tab>` for this.\n\nDefault: `1`\n\n```viml\nlet g:ycm_auto_trigger = 1\n```\n\n### The `g:ycm_filetype_whitelist` option\n\nThis option controls for which Vim filetypes (see `:h filetype`) should YCM be\nturned on. The option value should be a Vim dictionary with keys being filetype\nstrings (like `python`, `cpp`, etc.) and values being unimportant (the\ndictionary is used like a hash set, meaning that only the keys matter).\n\nThe `*` key is special and matches all filetypes. By default, the whitelist\ncontains only this `*` key.\n\nYCM also has a `g:ycm_filetype_blacklist` option that lists filetypes for which\nYCM shouldn't be turned on. YCM will work only in filetypes that both the\nwhitelist and the blacklist allow (the blacklist \"allows\" a filetype by _not_\nhaving it as a key).\n\nFor example, let's assume you want YCM to work in files with the `cpp` filetype.\nThe filetype should then be present in the whitelist either directly (`cpp` key\nin the whitelist) or indirectly through the special `*` key. It should _not_ be\npresent in the blacklist.\n\nFiletypes that are blocked by either of the lists will be completely ignored\nby YCM, meaning that neither the identifier-based completion engine nor the\nsemantic engine will operate in them.\n\nYou can get the filetype of the current file in Vim with `:set ft?`.\n\nDefault: `{'*': 1}`\n\n```viml\nlet g:ycm_filetype_whitelist = {'*': 1}\n```\n\n** Completion in buffers with no filetype **\n\nThere is one exception to the above rule. YCM supports completion in buffers\nwith no filetype set, but this must be _explicitly_ whitelisted. To identify\nbuffers with no filetype, we use the `ycm_nofiletype` pseudo-filetype. To enable\ncompletion in buffers with no filetype, set:\n\n```viml\nlet g:ycm_filetype_whitelist = {\n  \\ '*': 1,\n  \\ 'ycm_nofiletype': 1\n  \\ }\n```\n\n### The `g:ycm_filetype_blacklist` option\n\nThis option controls for which Vim filetypes (see `:h filetype`) should YCM be\nturned off. The option value should be a Vim dictionary with keys being filetype\nstrings (like `python`, `cpp`, etc.) and values being unimportant (the\ndictionary is used like a hash set, meaning that only the keys matter).\n\nSee the `g:ycm_filetype_whitelist` option for more details on how this works.\n\nDefault: `[see next line]`\n\n```viml\nlet g:ycm_filetype_blacklist = {\n      \\ 'tagbar': 1,\n      \\ 'notes': 1,\n      \\ 'markdown': 1,\n      \\ 'netrw': 1,\n      \\ 'unite': 1,\n      \\ 'text': 1,\n      \\ 'vimwiki': 1,\n      \\ 'pandoc': 1,\n      \\ 'infolog': 1,\n      \\ 'leaderf': 1,\n      \\ 'mail': 1\n      \\}\n```\n\nIn addition, `ycm_nofiletype` (representing buffers with no filetype set)\nis blacklisted if `ycm_nofiletype` is not _explicitly_ whitelisted (using\n`g:ycm_filetype_whitelist`).\n\n### The `g:ycm_filetype_specific_completion_to_disable` option\n\nThis option controls for which Vim filetypes (see `:h filetype`) should the YCM\nsemantic completion engine be turned off. The option value should be a Vim\ndictionary with keys being filetype strings (like `python`, `cpp`, etc.) and\nvalues being unimportant (the dictionary is used like a hash set, meaning that\nonly the keys matter). The listed filetypes will be ignored by the YCM semantic\ncompletion engine, but the identifier-based completion engine will still trigger\nin files of those filetypes.\n\nNote that even if semantic completion is not turned off for a specific filetype,\nyou will not get semantic completion if the semantic engine does not support\nthat filetype.\n\nYou can get the filetype of the current file in Vim with `:set ft?`.\n\nDefault: `[see next line]`\n\n```viml\nlet g:ycm_filetype_specific_completion_to_disable = {\n      \\ 'gitcommit': 1\n      \\}\n```\n\n### The `g:ycm_filepath_blacklist` option\n\nThis option controls for which Vim filetypes (see `:h filetype`) should filepath\ncompletion be disabled. The option value should be a Vim dictionary with keys\nbeing filetype strings (like `python`, `cpp`, etc.) and values being unimportant\n(the dictionary is used like a hash set, meaning that only the keys matter).\n\nThe `*` key is special and matches all filetypes. Use this key if you want to\ncompletely disable filepath completion:\n\n```viml\nlet g:ycm_filepath_blacklist = {'*': 1}\n```\n\nYou can get the filetype of the current file in Vim with `:set ft?`.\n\nDefault: `[see next line]`\n\n```viml\nlet g:ycm_filepath_blacklist = {\n      \\ 'html': 1,\n      \\ 'jsx': 1,\n      \\ 'xml': 1,\n      \\}\n```\n\n### The `g:ycm_show_diagnostics_ui` option\n\nWhen set, this option turns on YCM's diagnostic display features. See the\n_Diagnostic display_ section in the _User Manual_ for more details.\n\nSpecific parts of the diagnostics UI (like the gutter signs, text highlighting,\ndiagnostic echo, and auto location list population) can be individually turned on\nor off. See the other options below for details.\n\nNote that YCM's diagnostics UI is only supported for C-family languages.\n\nWhen set, this option also makes YCM remove all Syntastic checkers set for the\n`c`, `cpp`, `objc`, `objcpp`, and `cuda` filetypes since this would conflict\nwith YCM's own diagnostics UI.\n\nIf you're using YCM's identifier completer in C-family languages but cannot use\nthe clang-based semantic completer for those languages _and_ want to use the GCC\nSyntastic checkers, unset this option.\n\nDefault: `1`\n\n```viml\nlet g:ycm_show_diagnostics_ui = 1\n```\n\n### The `g:ycm_error_symbol` option\n\nYCM will use the value of this option as the symbol for errors in the Vim\ngutter.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the `g:syntastic_error_symbol` option\nbefore using this option's default.\n\nDefault: `>>`\n\n```viml\nlet g:ycm_error_symbol = '>>'\n```\n\n### The `g:ycm_warning_symbol` option\n\nYCM will use the value of this option as the symbol for warnings in the Vim\ngutter.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the `g:syntastic_warning_symbol` option\nbefore using this option's default.\n\nDefault: `>>`\n\n```viml\nlet g:ycm_warning_symbol = '>>'\n```\n\n### The `g:ycm_enable_diagnostic_signs` option\n\nWhen this option is set, YCM will put icons in Vim's gutter on lines that have a\ndiagnostic set. Turning this off will also turn off the `YcmErrorLine` and\n`YcmWarningLine` highlighting.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the `g:syntastic_enable_signs` option\nbefore using this option's default.\n\nDefault: `1`\n\n```viml\nlet g:ycm_enable_diagnostic_signs = 1\n```\n\n### The `g:ycm_enable_diagnostic_highlighting` option\n\nWhen this option is set, YCM will highlight regions of text that are related to\nthe diagnostic that is present on a line, if any.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the `g:syntastic_enable_highlighting`\noption before using this option's default.\n\nDefault: `1`\n\n```viml\nlet g:ycm_enable_diagnostic_highlighting = 1\n```\n\n### The `g:ycm_echo_current_diagnostic` option\n\nWhen this option is set to 1, YCM will echo the text of the diagnostic present\non the current line when you move your cursor to that line. If a `FixIt` is\navailable for the current diagnostic, then ` (FixIt)` is appended.\n\nIf you have a Vim that supports virtual text, you can set this option\nto the string `virtual-text`, and the diagnostic will be displayed inline with\nthe text, right aligned in the window and wrapping to the next line if there is\nnot enough space, for example:\n\n![Virtual text diagnostic demo][diagnostic-echo-virtual-text1]\n\n![Virtual text diagnostic demo][diagnostic-echo-virtual-text2]\n\n**NOTE**: It's _strongly_ recommended to also set\n`g:ycm_update_diagnostics_in_insert_mode` to `0` when using `virtual-text` for\ndiagnostics. This is due to the increased amount of distraction provided by\ndrawing diagnostics next to your input position.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the `g:syntastic_echo_current_error`\noption before using this option's default.\n\nDefault: `1`\n\nValid values:\n\n* `0` - disabled\n* `1` - echo diagnostic to the command area\n* `'virtual-text'` - display the dignostic to the right of the line in the\n  window using virtual text\n\n```viml\nlet g:ycm_echo_current_diagnostic = 1\n\" Or, when you have Vim supporting virtual text\nlet g:ycm_echo_current_diagnostic = 'virtual-text'\n```\n\n### The `g:ycm_auto_hover` option\n\nThis option controls whether or not YCM shows documentation in a popup at the\ncursor location after a short delay. Only supported in Vim.\n\nWhen this option is set to `'CursorHold'`, the popup is displayed on the\n`CursorHold` autocommand. See `:help CursorHold` for the details, but this means\nthat it is displayed after `updatetime` milliseconds.  When set to an empty\nstring, the popup is not automatically displayed.\n\nIn addition to this setting, there is the `<plug>(YCMHover)` mapping, which can\nbe used to manually trigger or hide the popup (it works like a toggle).\nFor example:\n\n```viml\nnmap <leader>D <plug>(YCMHover)\n```\n\nAfter dismissing the popup with this mapping, it will not be automatically\ntriggered again until the cursor is moved (i.e. `CursorMoved` autocommand).\n\nThe displayed documentation depends on what the completer for the current\nlanguage supports. It's selected heuristically in this order of preference:\n\n1. `GetHover` with `markdown` syntax\n2. `GetDoc` with no syntax\n3. `GetType` with the syntax of the current file. \n\nYou can customise this by manually setting up `b:ycm_hover` to your liking. This\nbuffer-local variable can be set to a dictionary with the following keys:\n\n* `command`: The YCM completer subcommand which should be run on hover\n* `syntax`: The syntax to use (as in `set syntax=`) in the popup window for\n  highlighting.\n* `popup_params`: The params passed to a popup window which gets opened.\n\nFor example, to use C/C++ syntax highlighting in the popup for C-family\nlanguages, add something like this to your vimrc:\n\n```viml\naugroup MyYCMCustom\n  autocmd!\n  autocmd FileType c,cpp let b:ycm_hover = {\n    \\ 'command': 'GetDoc',\n    \\ 'syntax': &filetype\n    \\ }\naugroup END\n```\n\nYou can also modify the opened popup with `popup_params` key.\nFor example, you can limit the popup's maximum width and add a border to it:\n\n```viml\naugroup MyYCMCustom\n  autocmd!\n  autocmd FileType c,cpp let b:ycm_hover = {\n    \\ 'command': 'GetDoc',\n    \\ 'syntax': &filetype\n    \\ 'popup_params': {\n    \\     'maxwidth': 80,\n    \\     'border': [],\n    \\     'borderchars': ['─', '│', '─', '│', '┌', '┐', '┘', '└'],\n    \\   },\n    \\ }\naugroup END\n```\nSee `:help popup_create-arguments` for the list of available popup window options.\n\nDefault: `'CursorHold'`\n\n### The `g:ycm_filter_diagnostics` option\n\nThis option controls which diagnostics will be rendered by YCM. This option\nholds a dictionary of key-values, where the keys are Vim's filetype strings\ndelimited by commas and values are dictionaries describing the filter.\n\nA filter is a dictionary of key-values, where the keys are the type of filter,\nand the value is a list of arguments to that filter. In the case of just a\nsingle item in the list, you may omit the brackets and just provide the argument\ndirectly. If any filter matches a diagnostic, it will be dropped and YCM will\nnot render it.\n\nThe following filter types are supported:\n\n- \"regex\": Accepts a string [regular expression][python-re]. This type matches\nwhen the regex (treated as case-insensitive) is found anywhere in the diagnostic\ntext (`re.search`, not `re.match`)\n- \"level\": Accepts a string level, either \"warning\" or \"error.\" This type\nmatches when the diagnostic has the same level, that is,\nspecifying `level: \"error\"` will remove **all** errors from the diagnostics.\n\n**NOTE:** The regex syntax is **NOT** Vim's, it's [Python's][python-re].\n\nDefault: `{}`\n\nThe following example will do, for Java filetype only:\n- Remove **all** error level diagnostics, and,\n- Also remove anything that contains `ta<something>co`\n\n```viml\nlet g:ycm_filter_diagnostics = {\n  \\ \"java\": {\n  \\      \"regex\": [ \"ta.+co\", ... ],\n  \\      \"level\": \"error\",\n  \\      ...\n  \\    }\n  \\ }\n```\n\n### The `g:ycm_always_populate_location_list` option\n\nWhen this option is set, YCM will populate the location list automatically every\ntime it gets new diagnostic data. This option is off by default so as not to\ninterfere with other data you might have placed in the location list.\n\nSee `:help location-list` in Vim to learn more about the location list.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the\n`g:syntastic_always_populate_loc_list` option before using this option's\ndefault.\n\nNote: if YCM's errors aren't visible, it might be that YCM is updating an older location list. See `:help :lhistory` and `:lolder`.\n\nDefault: `0`\n\n```viml\nlet g:ycm_always_populate_location_list = 0\n```\n\n### The `g:ycm_open_loclist_on_ycm_diags` option\n\nWhen this option is set, `:YcmDiags` will automatically open the location list\nafter forcing a compilation and filling the list with diagnostic data.\n\nSee `:help location-list` in Vim to learn more about the location list.\n\nDefault: `1`\n\n```viml\nlet g:ycm_open_loclist_on_ycm_diags = 1\n```\n\n### The `g:ycm_complete_in_comments` option\n\nWhen this option is set to `1`, YCM will show the completion menu even when\ntyping inside comments.\n\nDefault: `0`\n\n```viml\nlet g:ycm_complete_in_comments = 0\n```\n\n### The `g:ycm_complete_in_strings` option\n\nWhen this option is set to `1`, YCM will show the completion menu even when\ntyping inside strings.\n\nNote that this is turned on by default so that you can use the filename\ncompletion inside strings. This is very useful for instance in C-family files\nwhere typing `#include \"` will trigger the start of filename completion. If you\nturn off this option, you will turn off filename completion in such situations\nas well.\n\nDefault: `1`\n\n```viml\nlet g:ycm_complete_in_strings = 1\n```\n\n### The `g:ycm_collect_identifiers_from_comments_and_strings` option\n\nWhen this option is set to `1`, YCM's identifier completer will also collect\nidentifiers from strings and comments. Otherwise, the text in comments and\nstrings will be ignored.\n\nDefault: `0`\n\n```viml\nlet g:ycm_collect_identifiers_from_comments_and_strings = 0\n```\n\n### The `g:ycm_collect_identifiers_from_tags_files` option\n\nWhen this option is set to `1`, YCM's identifier completer will also collect\nidentifiers from tags files. The list of tags files to examine is retrieved from\nthe `tagfiles()` Vim function which examines the `tags` Vim option. See `:h\n'tags'` for details.\n\nYCM will re-index your tags files if it detects that they have been modified.\n\nThe only supported tag format is the [Exuberant Ctags format][ctags-format]. The\nformat from \"plain\" ctags is NOT supported. Ctags needs to be called with the\n`--fields=+l` option (that's a lowercase `L`, not a one) because YCM needs the\n`language:<lang>` field in the tags output.\n\nSee the _FAQ_ for pointers if YCM does not appear to read your tag files.\n\nThis option is off by default because it makes Vim slower if your tags are on a\nnetwork directory.\n\nDefault: `0`\n\n```viml\nlet g:ycm_collect_identifiers_from_tags_files = 0\n```\n\n### The `g:ycm_seed_identifiers_with_syntax` option\n\nWhen this option is set to `1`, YCM's identifier completer will seed its\nidentifier database with the keywords of the programming language you're\nwriting.\n\nSince the keywords are extracted from the Vim syntax file for the filetype, all\nkeywords may not be collected, depending on how the syntax file was written.\nUsually at least 95% of the keywords are successfully extracted.\n\nDefault: `0`\n\n```viml\nlet g:ycm_seed_identifiers_with_syntax = 0\n```\n\n### The `g:ycm_extra_conf_vim_data` option\n\nIf you're using semantic completion for C-family files, this option might come\nhandy; it's a way of sending data from Vim to your `Settings` function in\nyour `.ycm_extra_conf.py` file.\n\nThis option is supposed to be a list of VimScript expression strings that are\nevaluated for every request to the [ycmd server][ycmd] and then passed to your\n`Settings` function as a `client_data` keyword argument.\n\nFor instance, if you set this option to `['v:version']`, your `Settings`\nfunction will be called like this:\n\n```python\n# The '801' value is of course contingent on Vim 8.1; in 8.0 it would be '800'\nSettings( ..., client_data = { 'v:version': 801 } )\n```\n\nSo the `client_data` parameter is a dictionary mapping Vim expression strings to\ntheir values at the time of the request.\n\nThe correct way to define parameters for your `Settings` function:\n\n```python\ndef Settings( **kwargs ):\n```\n\nYou can then get to `client_data` with `kwargs['client_data']`.\n\nDefault: `[]`\n\n```viml\nlet g:ycm_extra_conf_vim_data = []\n```\n\n### The `g:ycm_server_python_interpreter` option\n\nYCM will by default search for an appropriate Python interpreter on your system.\nYou can use this option to override that behavior and force the use of a\nspecific interpreter of your choosing.\n\n**NOTE:** This interpreter is only used for the [ycmd server][ycmd]. The YCM\nclient running inside Vim always uses the Python interpreter that's embedded\ninside Vim.\n\nDefault: `''`\n\n```viml\nlet g:ycm_server_python_interpreter = ''\n```\n\n### The `g:ycm_keep_logfiles` option\n\nWhen this option is set to `1`, YCM and the [ycmd completion server][ycmd] will\nkeep the logfiles around after shutting down (they are deleted on shutdown by\ndefault).\n\nTo see where the log files are, call `:YcmDebugInfo`.\n\nDefault: `0`\n\n```viml\nlet g:ycm_keep_logfiles = 0\n```\n\n### The `g:ycm_log_level` option\n\nThe logging level that YCM and the [ycmd completion server][ycmd] use. Valid\nvalues are the following, from most verbose to least verbose:\n- `debug`\n- `info`\n- `warning`\n- `error`\n- `critical`\n\nNote that `debug` is _very_ verbose.\n\nDefault: `info`\n\n```viml\nlet g:ycm_log_level = 'info'\n```\n\n### The `g:ycm_auto_start_csharp_server` option\n\nWhen set to `1`, the OmniSharp-Roslyn server will be automatically started\n(once per Vim session) when you open a C# file.\n\nDefault: `1`\n\n```viml\nlet g:ycm_auto_start_csharp_server = 1\n```\n\n### The `g:ycm_auto_stop_csharp_server` option\n\nWhen set to `1`, the OmniSharp-Roslyn server will be automatically stopped upon\nclosing Vim.\n\nDefault: `1`\n\n```viml\nlet g:ycm_auto_stop_csharp_server = 1\n```\n\n### The `g:ycm_csharp_server_port` option\n\nWhen g:ycm_auto_start_csharp_server is set to `1`, specifies the port for\nthe OmniSharp-Roslyn server to listen on. When set to `0` uses an unused port provided\nby the OS.\n\nDefault: `0`\n\n```viml\nlet g:ycm_csharp_server_port = 0\n```\n\n### The `g:ycm_csharp_insert_namespace_expr` option\n\nBy default, when YCM inserts a namespace, it will insert the `using` statement\nunder the nearest `using` statement. You may prefer that the `using` statement is\ninserted somewhere, for example, to preserve sorting. If so, you can set this\noption to override this behavior.\n\nWhen this option is set, instead of inserting the `using` statement itself, YCM\nwill set the global variable `g:ycm_namespace_to_insert` to the namespace to\ninsert, and then evaluate this option's value as an expression. The option's\nexpression is responsible for inserting the namespace - the default insertion\nwill not occur.\n\nDefault: ''\n\n```viml\nlet g:ycm_csharp_insert_namespace_expr = ''\n```\n\n### The `g:ycm_add_preview_to_completeopt` option\n\nWhen this option is set to `1`, YCM will add the `preview` string to Vim's\n`completeopt` option (see `:h completeopt`). If your `completeopt` option\nalready has `preview` set, there will be no effect. Alternatively, when set to\n`popup` and your version of Vim supports popup windows (see `:help popup`), the\n`popup` string will be used instead. You can see the current state of your\n`completeopt` setting with `:set completeopt?` (yes, the question mark is\nimportant).\n\nWhen `preview` is present in `completeopt`, YCM will use the `preview` window at\nthe top of the file to store detailed information about the current completion\ncandidate (but only if the candidate came from the semantic engine). For\ninstance, it would show the full function prototype and all the function\noverloads in the window if the current completion is a function name.\n\nWhen `popup` is present in `completeopt`, YCM will instead use a `popup`\nwindow to the side of the completion popup for storing detailed information\nabout the current completion candidate. In addition, YCM may truncate the\ndetailed completion information in order to give the popup sufficient room\nto display that detailed information.\n\nDefault: `0`\n\n```viml\nlet g:ycm_add_preview_to_completeopt = 0\n```\n\n### The `g:ycm_autoclose_preview_window_after_completion` option\n\nWhen this option is set to `1`, YCM will auto-close the `preview` window after\nthe user accepts the offered completion string. If there is no `preview` window\ntriggered because there is no `preview` string in `completeopt`, this option is\nirrelevant. See the `g:ycm_add_preview_to_completeopt` option for more details.\n\nDefault: `0`\n\n```viml\nlet g:ycm_autoclose_preview_window_after_completion = 0\n```\n\n### The `g:ycm_autoclose_preview_window_after_insertion` option\n\nWhen this option is set to `1`, YCM will auto-close the `preview` window after\nthe user leaves insert mode. This option is irrelevant if\n`g:ycm_autoclose_preview_window_after_completion` is set or if no `preview`\nwindow is triggered. See the `g:ycm_add_preview_to_completeopt` option for more\ndetails.\n\nDefault: `0`\n\n```viml\nlet g:ycm_autoclose_preview_window_after_insertion = 0\n```\n\n### The `g:ycm_max_diagnostics_to_display` option\n\nThis option controls the maximum number of diagnostics shown to the user when\nerrors or warnings are detected in the file. This option is only relevant for\nthe C-family, C#, Java, JavaScript, and TypeScript languages.\n\nA special value of `0` means there is no limit.\n\nDefault: `30`\n\n```viml\nlet g:ycm_max_diagnostics_to_display = 30\n```\n\n### The `g:ycm_key_list_select_completion` option\n\nThis option controls the key mappings used to select the first completion\nstring.  Invoking any of them repeatedly cycles forward through the completion\nlist.\n\nSome users like adding `<Enter>` to this list.\n\nDefault: `['<TAB>', '<Down>']`\n\n```viml\nlet g:ycm_key_list_select_completion = ['<TAB>', '<Down>']\n```\n\n### The `g:ycm_key_list_previous_completion` option\n\nThis option controls the key mappings used to select the previous completion\nstring. Invoking any of them repeatedly cycles backward through the completion\nlist.\n\nNote that one of the defaults is `<S-TAB>` which means Shift-TAB. That mapping\nwill probably only work in GUI Vim (Gvim or MacVim) and not in plain console Vim\nbecause the terminal usually does not forward modifier key combinations to Vim.\n\nDefault: `['<S-TAB>', '<Up>']`\n\n```viml\nlet g:ycm_key_list_previous_completion = ['<S-TAB>', '<Up>']\n```\n\n### The `g:ycm_key_list_stop_completion` option\n\nThis option controls the key mappings used to close the completion menu. This is\nuseful when the menu is blocking the view, when you need to insert the `<TAB>`\ncharacter, or when you want to expand a snippet from [UltiSnips][] and navigate\nthrough it.\n\nDefault: `['<C-y>']`\n\n```viml\nlet g:ycm_key_list_stop_completion = ['<C-y>']\n```\n\n### The `g:ycm_key_invoke_completion` option\n\nThis option controls the key mapping used to invoke the completion menu for\nsemantic completion. By default, semantic completion is triggered automatically\nafter typing characters appropriate for the language, such as `.`, `->`, `::`,\netc. in insert mode (if semantic completion support has been compiled in). This\nkey mapping can be used to trigger semantic completion anywhere. Useful for\nsearching for top-level functions and classes.\n\nConsole Vim (not Gvim or MacVim) passes `<Nul>` to Vim when the user types\n`<C-Space>` so YCM will make sure that `<Nul>` is used in the map command when\nyou're editing in console Vim, and `<C-Space>` in GUI Vim. This means that you\ncan just press `<C-Space>` in both the console and GUI Vim and YCM will do the right\nthing.\n\nSetting this option to an empty string will make sure no mapping is created.\n\nDefault: `<C-Space>`\n\n```viml\nlet g:ycm_key_invoke_completion = '<C-Space>'\n```\n\n### The `g:ycm_key_detailed_diagnostics` option\n\nThis option controls the key mapping used to show the full diagnostic text when\nthe user's cursor is on the line with the diagnostic. It basically calls\n`:YcmShowDetailedDiagnostic`.\n\nSetting this option to an empty string will make sure no mapping is created.\n\nIf you prefer the detailed diagnostic to be shown in a popup, then\n`let g:ycm_show_detailed_diag_in_popup=1`.\n\nDefault: `<leader>d`\n\n```viml\nlet g:ycm_key_detailed_diagnostics = '<leader>d'\n```\n\n### The `g:ycm_show_detailed_diag_in_popup` option\n\nMakes `:YcmShowDetailedDiagnostic` always show in a popup rather than echoing to\nthe command line.\n\nDefault: 0\n\n```viml\nlet g:ycm_show_detailed_diag_in_popup = 0\n```\n\n### The `g:ycm_global_ycm_extra_conf` option\n\nNormally, YCM searches for a `.ycm_extra_conf.py` file for compilation flags\n(see the User Guide for more details on how this works). This option specifies\na fallback path to a config file which is used if no `.ycm_extra_conf.py` is\nfound.\n\nYou can place such a global file anywhere in your filesystem.\n\nDefault: `''`\n\n```viml\nlet g:ycm_global_ycm_extra_conf = ''\n```\n\n### The `g:ycm_confirm_extra_conf` option\n\nWhen this option is set to `1` YCM will ask once per `.ycm_extra_conf.py` file\nif it is safe to be loaded. This is to prevent the execution of malicious code\nfrom a `.ycm_extra_conf.py` file you didn't write.\n\nTo selectively get YCM to ask/not ask about loading certain `.ycm_extra_conf.py`\nfiles, see the `g:ycm_extra_conf_globlist` option.\n\nDefault: `1`\n\n```viml\nlet g:ycm_confirm_extra_conf = 1\n```\n\n### The `g:ycm_extra_conf_globlist` option\n\nThis option is a list that may contain several globbing patterns. If a pattern\nstarts with a `!` all `.ycm_extra_conf.py` files matching that pattern will be\nblacklisted, that is they won't be loaded and no confirmation dialog will be\nshown. If a pattern does not start with a `!` all files matching that pattern\nwill be whitelisted. Note that this option is not used when confirmation is\ndisabled using `g:ycm_confirm_extra_conf` and that items earlier in the list\nwill take precedence over the later ones.\n\nRules:\n\n* `*`       matches everything\n* `?`       matches any single character\n* `[seq]`   matches any character in seq\n* `[!seq]`  matches any char not in seq\n\nExample:\n\n```viml\nlet g:ycm_extra_conf_globlist = ['~/dev/*','!~/*']\n```\n\n* The first rule will match everything contained in the `~/dev` directory so\n  `.ycm_extra_conf.py` files from there will be loaded.\n* The second rule will match everything in the home directory so a\n  `.ycm_extra_conf.py` file from there won't be loaded.\n* As the first rule takes precedence everything in the home directory excluding\n  the `~/dev` directory will be blacklisted.\n\n**NOTE:** The glob pattern is first expanded with Python's\n`os.path.expanduser()` and then resolved with `os.path.abspath()` before being\nmatched against the filename.\n\nDefault: `[]`\n\n```viml\nlet g:ycm_extra_conf_globlist = []\n```\n\n### The `g:ycm_filepath_completion_use_working_dir` option\n\nBy default, YCM's filepath completion will interpret relative paths like `../`\nas being relative to the folder of the file of the currently active buffer.\nSetting this option will force YCM to always interpret relative paths as being\nrelative to Vim's current working directory.\n\nDefault: `0`\n\n```viml\nlet g:ycm_filepath_completion_use_working_dir = 0\n```\n\n### The `g:ycm_semantic_triggers` option\n\nThis option controls the character-based triggers for the various semantic\ncompletion engines. The option holds a dictionary of key-values, where the keys\nare Vim's filetype strings delimited by commas and values are lists of strings,\nwhere the strings are the triggers.\n\nSetting key-value pairs on the dictionary _adds_ semantic triggers to the\ninternal default set (listed below). You cannot remove the default triggers,\nonly add new ones.\n\nA \"trigger\" is a sequence of one or more characters that trigger semantic\ncompletion when typed. For instance, C++ (`cpp` filetype) has `.` listed as a\ntrigger. So when the user types `foo.`, the semantic engine will trigger and\nserve `foo`'s list of member functions and variables. Since C++ also has `->`\nlisted as a trigger, the same thing would happen when the user typed `foo->`.\n\nIt's also possible to use a regular expression as a trigger. You have to prefix\nyour trigger with `re!` to signify it's a regex trigger. For instance,\n`re!\\w+\\.` would only trigger after the `\\w+\\.` regex matches.\n\n**NOTE:** The regex syntax is **NOT** Vim's, it's [Python's][python-re].\n\nDefault: `[see next line]`\n\n```viml\nlet g:ycm_semantic_triggers =  {\n  \\   'c': ['->', '.'],\n  \\   'objc': ['->', '.', 're!\\[[_a-zA-Z]+\\w*\\s', 're!^\\s*[^\\W\\d]\\w*\\s',\n  \\            're!\\[.*\\]\\s'],\n  \\   'ocaml': ['.', '#'],\n  \\   'cpp,cuda,objcpp': ['->', '.', '::'],\n  \\   'perl': ['->'],\n  \\   'php': ['->', '::'],\n  \\   'cs,d,elixir,go,groovy,java,javascript,julia,perl6,python,scala,typescript,vb': ['.'],\n  \\   'ruby,rust': ['.', '::'],\n  \\   'lua': ['.', ':'],\n  \\   'erlang': [':'],\n  \\ }\n```\n\n### The `g:ycm_cache_omnifunc` option\n\nSome omnicompletion engines do not work well with the YCM cache—in particular,\nthey might not produce all possible results for a given prefix. By unsetting\nthis option you can ensure that the omnicompletion engine is re-queried on every\nkeypress. That will ensure all completions will be presented but might cause\nstuttering and lag if the omnifunc is slow.\n\nDefault: `1`\n\n```viml\nlet g:ycm_cache_omnifunc = 1\n```\n\n### The `g:ycm_use_ultisnips_completer` option\n\nBy default, YCM will query the UltiSnips plugin for possible completions of\nsnippet triggers. This option can turn that behavior off.\n\nDefault: `1`\n\n```viml\nlet g:ycm_use_ultisnips_completer = 1\n```\n\n### The `g:ycm_goto_buffer_command` option\n\nDefines where `GoTo*` commands result should be opened. Can take one of the\nfollowing values: `'same-buffer'`, `'split'`, or `'split-or-existing-window'`.\nIf this option is set to the `'same-buffer'` but current buffer can not be\nswitched (when buffer is modified and `nohidden` option is set), then result\nwill be opened in a split. When the option is set to\n`'split-or-existing-window'`, if the result is already open in a window of the\ncurrent tab page (or any tab pages with the `:tab` modifier; see below), it will\njump to that window. Otherwise, the result will be opened in a split as if the\noption was set to `'split'`.\n\nTo customize the way a new window is split, prefix the `GoTo*` command with one\nof the following modifiers: `:aboveleft`, `:belowright`, `:botright`,\n`:leftabove`, `:rightbelow`, `:topleft`, and `:vertical`. For instance, to\nsplit vertically to the right of the current window, run the command:\n\n```viml\n:rightbelow vertical YcmCompleter GoTo\n```\n\nTo open in a new tab page, use the `:tab` modifier with the `'split'` or\n`'split-or-existing-window'` options e.g.:\n\n```viml\n:tab YcmCompleter GoTo\n```\n\nDefault: `'same-buffer'`\n\n```viml\nlet g:ycm_goto_buffer_command = 'same-buffer'\n```\n\n### The `g:ycm_disable_for_files_larger_than_kb` option\n\nDefines the max size (in Kb) for a file to be considered for completion. If this\noption is set to 0 then no check is made on the size of the file you're opening.\n\nDefault: 1000\n\n```viml\nlet g:ycm_disable_for_files_larger_than_kb = 1000\n```\n\n### The `g:ycm_use_clangd` option\n\nThis option controls whether **clangd** should be used as a completion engine for\nC-family languages. Can take one of the following values: `1`, `0`, with\nmeanings:\n\n- `1`: YCM will use clangd if clangd binary exists in third party or it was\nprovided with `ycm_clangd_binary_path` option.\n- `0`: YCM will never use clangd completer.\n\nDefault: `1`\n\n```viml\nlet g:ycm_use_clangd = 1\n```\n\n### The `g:ycm_clangd_binary_path` option\n\nWhen `ycm_use_clangd` option is set to `1`, this option sets the path to\n**clangd** binary.\n\nDefault: `''`\n\n```viml\nlet g:ycm_clangd_binary_path = ''\n```\n\n### The `g:ycm_clangd_args` option\n\nThis option controls the command line arguments passed to the clangd binary. It\nappends new options and overrides the existing ones.\n\nDefault: `[]`\n\n```viml\nlet g:ycm_clangd_args = []\n```\n\n### The `g:ycm_clangd_uses_ycmd_caching` option\n\nThis option controls which ranking and filtering algorithm to use for completion\nitems. It can take values:\n\n- `1`: Uses ycmd's caching and filtering logic.\n- `0`: Uses clangd's caching and filtering logic.\n\nDefault: `1`\n\n```viml\nlet g:ycm_clangd_uses_ycmd_caching = 1\n```\n\n### The `g:ycm_language_server` option\n\nThis option lets YCM use an arbitrary Language Server Protocol (LSP) server, not\nunlike many other completion systems.  The officially supported completers are\nfavoured over custom LSP ones, so overriding an existing completer means first\nmaking sure YCM won't choose that existing completer in the first place.\n\nA simple working example of this option can be found in the section called\n[\"Semantic Completion for Other Languages\"](#semantic-completion-for-other-languages).\n\nMany working examples can be found in the YCM [lsp-examples][] repository.\n\nDefault: `[]`\n\n```viml\nlet g:ycm_language_server = []\n```\n\n### The `g:ycm_disable_signature_help` option\n\nThis option allows you to disable all signature help for all completion engines.\nThere is no way to disable it per-completer.\n\nDefault: `0`\n\n```viml\n\" Disable signature help\nlet g:ycm_disable_signature_help = 1\n```\n\n### The `g:ycm_signature_help_disable_syntax` option\n\nSet this to 1 to disable syntax highlighting in the signature help popup. Thiis\ncan help if your colourscheme doesn't work well with the default highliting and\ninverse video.\n\nDefault: `0`\n\n```viml\n\" Disable signature help syntax highliting\nlet g:ycm_signature_help_disable_syntax = 1\n```\n\n### The `g:ycm_gopls_binary_path` option\n\nIn case the system-wide `gopls` binary is newer than the bundled one, setting\nthis option to the path of the system-wide `gopls` would make YCM use that one\ninstead.\n\nIf the path is just `gopls`, YCM will search in `$PATH`.\n\n\n### The `g:ycm_gopls_args` option\n\nSimilar to [the `g:ycm_clangd_args`](#the-gycm-clangd-args), this option allows\npassing additional flags to the `gopls` command line.\n\nDefault: `[]`\n\n```viml\nlet g:ycm_gopls_args = []\n```\n\n\n### The `g:ycm_rls_binary_path` and `g:ycm_rustc_binary_path` options\n\nYCM no longer uses RLS for rust, and these options are therefore no longer\nsupported.\n\nTo use a custom rust-analyzer, see `g:ycm_rust_toolchain_root`.\n\n### The `g:ycm_rust_toolchain_root` option\n\nOptionally specify the path to a custom rust toolchain including at least a\nsupported version of `rust-analyzer`.\n\n\n### The `g:ycm_tsserver_binary_path` option\n\nSimilar to [the `gopls` path](#the-gycm-gopls-binaty-path), this option\ntells YCM where is the TSServer executable located.\n\n### The `g:ycm_roslyn_binary_path` option\n\nSimilar to [the `gopls` path](#the-gycm-gopls-binaty-path), this option\ntells YCM where is the Omnisharp-Roslyn executable located.\n\n### The `g:ycm_update_diagnostics_in_insert_mode` option\n\nWith async diagnostics, LSP servers might send new diagnostics mid-typing.\nIf seeing these new diagnostics while typing is not desired, this option can\nbe set to 0.\n\nWhen this option is set to `0`, diagnostic signs, virtual text, and highlights\nare cleared when entering insert mode and replaced when leaving insert mode.\nThis reduces visual noise while editing.\n\nIn addition, this option is recommended when `g:ycm_echo_current_diagnostic` is\nset to `virtual-text` as it prevents updating the virtual text while you are\ntyping.\n\nDefault: `1`\n\n```viml\nlet g:ycm_update_diagnostics_in_insert_mode = 1\n```\n\nFAQ\n---\n\nThe FAQ section has been moved to the [wiki][wiki-faq].\n\nContributor Code of Conduct\n---------------------------\n\nPlease note that this project is released with a [Contributor Code of\nConduct][ccoc]. By participating in this project you agree to abide by its\nterms.\n\n\nContact\n-------\n\nIf you have questions about the plugin or need help, please join the [Gitter\nroom][gitter] or use the [ycm-users][] mailing list.\n\nIf you have bug reports or feature suggestions, please use the [issue\ntracker][tracker]. Before you do, please carefully read\n[CONTRIBUTING.md][contributing-md] as this asks for important diagnostics which\nthe team will use to help get you going.\n\nThe latest version of the plugin is available at\n<https://ycm-core.github.io/YouCompleteMe/>.\n\nThe author's homepage is <https://val.markovic.io>.\n\nPlease do **NOT** go to #vim, Reddit, or Stack Overflow for support. Please\ncontact the YouCompleteMe maintainers directly using the [contact\ndetails](#contact).\n\nLicense\n-------\n\nThis software is licensed under the [GPL v3 license][gpl].\n© 2015-2018 YouCompleteMe contributors\n\nSponsorship\n-----------\n\nIf you like YCM so much that you're willing to part with your hard-earned cash, please consider donating to one of the following charities, which are meaningful to the current maintainers (in no particular order):\n\n* [Hector's Greyhound Rescue](https://www.hectorsgreyhoundrescue.org)\n* [Be Humane](https://www.budihuman.rs/en)\n* [Cancer Research UK](https://www.cancerresearchuk.org)\n* [ICCF Holland](https://iccf.nl)\n* Any charity of your choosing.\n\nPlease note: The YCM maintainers do not specifically endorse nor necessarily have any relationship with the above charities. Disclosure: It is noted that one key maintainer is a family with Trustees of Greyhound Rescue Wales.\n\n\n[ycmd]: https://github.com/ycm-core/ycmd\n[Clang]: https://clang.llvm.org/\n[vundle]: https://github.com/VundleVim/Vundle.vim#about\n[brew]: https://brew.sh\n[cmake-download]: https://cmake.org/download/\n[macvim]: https://macvim-dev.github.io/macvim/\n[vimrc]: https://vimhelp.appspot.com/starting.txt.html#vimrc\n[gpl]: https://www.gnu.org/copyleft/gpl.html\n[vim]: https://www.vim.org/\n[syntastic]: https://github.com/scrooloose/syntastic\n[lightline]: https://github.com/itchyny/lightline.vim\n[ycm_flags_example]: https://github.com/ycm-core/YouCompleteMe/blob/master/.ycm_extra_conf.py\n[ycmd_flags_example]: https://raw.githubusercontent.com/ycm-core/ycmd/66030cd94299114ae316796f3cad181cac8a007c/.ycm_extra_conf.py\n[compdb]: https://clang.llvm.org/docs/JSONCompilationDatabase.html\n[subsequence]: https://en.wikipedia.org/wiki/Subsequence\n[listtoggle]: https://github.com/Valloric/ListToggle\n[vim-build]: https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source\n[tracker]: https://github.com/ycm-core/YouCompleteMe/issues?state=open\n[completer-api]: https://github.com/ycm-core/ycmd/blob/master/ycmd/completers/completer.py\n[eclim]: http://eclim.org/\n[jedi]: https://github.com/davidhalter/jedi\n[ultisnips]: https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt\n[ctags-format]: http://ctags.sourceforge.net/FORMAT\n[ycm-users]: https://groups.google.com/forum/?hl=en#!forum/ycm-users\n[omnisharp-roslyn]: https://github.com/OmniSharp/omnisharp-roslyn\n[python-re]: https://docs.python.org/2/library/re.html#regular-expression-syntax\n[Bear]: https://github.com/rizsotto/Bear\n[ygen]: https://github.com/rdnetto/YCM-Generator\n[Gopls]: https://github.com/golang/go/wiki/gopls\n[gopls-preferences]: https://github.com/golang/tools/blob/master/internal/lsp/server.go\n[TSServer]: https://github.com/Microsoft/TypeScript/tree/master/src/server\n[jsconfig.json]: https://code.visualstudio.com/docs/languages/jsconfig\n[tsconfig.json]: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html\n[vim-win-download]: https://github.com/vim/vim-win32-installer/releases\n[python-win-download]: https://www.python.org/downloads/windows/\n[visual-studio-download]: https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16\n[mono-install-macos]: https://www.mono-project.com/download/stable/\n[mono-install-linux]: https://www.mono-project.com/download/stable/#download-lin\n[go-install]: https://golang.org/doc/install\n[npm-install]: https://docs.npmjs.com/getting-started/installing-node#1-install-nodejs--npm\n[tern-instructions]: https://github.com/ycm-core/YouCompleteMe/wiki/JavaScript-Semantic-Completion-through-Tern\n[libclang-instructions]: https://github.com/ycm-core/YouCompleteMe/wiki/C-family-Semantic-Completion-through-libclang\n[Tern]: https://ternjs.net\n[rls]: https://github.com/rust-lang/rls\n[rust-analyzer]: https://rust-analyzer.github.io\n[rust-src]: https://www.rust-lang.org/downloads.html\n[add-msbuild-to-path]: https://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1\n[ccoc]: https://github.com/ycm-core/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md\n[gitter]: https://gitter.im/Valloric/YouCompleteMe\n[ninja-compdb]: https://ninja-build.org/manual.html\n[++enc]: http://vimdoc.sourceforge.net/htmldoc/editing.html#++enc\n[contributing-md]: https://github.com/ycm-core/YouCompleteMe/blob/master/CONTRIBUTING.md\n[jdt.ls]: https://github.com/eclipse/eclipse.jdt.ls\n[jdk-install]: https://adoptium.net/en-GB/temurin/releases\n[mvn-project]: https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html\n[eclipse-project]: https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fproject_description_file.html\n[gradle-project]: https://docs.gradle.org/current/userguide/tutorial_java_projects.html\n[eclipse-dot-project]: https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fproject_description_file.html\n[eclipse-dot-classpath]: https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjdt%2Fcore%2FIClasspathEntry.html\n[ycmd-eclipse-project]: https://github.com/ycm-core/ycmd/tree/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_eclipse_project\n[ycmd-mvn-pom-xml]: https://github.com/ycm-core/ycmd/blob/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_maven_project/pom.xml\n[ycmd-gradle-project]: https://github.com/ycm-core/ycmd/tree/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_gradle_project\n[jdtls-preferences]: https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java\n[diacritic]: https://www.unicode.org/glossary/#diacritic\n[clangd]: https://clang.llvm.org/extra/clangd.html\n[vimspector]: https://github.com/puremourning/vimspector\n[compiledb]: https://pypi.org/project/compiledb/\n[signature-help-pr]: https://github.com/ycm-core/ycmd/pull/1255\n[wiki-faq]: https://github.com/ycm-core/YouCompleteMe/wiki/FAQ\n[wiki-full-install]: https://github.com/ycm-core/YouCompleteMe/wiki/Full-Installation-Guide\n[wiki-troubleshooting]: https://github.com/ycm-core/YouCompleteMe/wiki/Troubleshooting-steps-for-ycmd-server-SHUT-DOWN\n[lsp-examples]: https://github.com/ycm-core/lsp-examples\n[language_server-configuration]: https://github.com/ycm-core/ycmd#language_server-configuration\n[diagnostic-echo-virtual-text1]: https://user-images.githubusercontent.com/10584846/185707973-39703699-0263-47d3-82ac-639d52259bea.png\n[diagnostic-echo-virtual-text2]: https://user-images.githubusercontent.com/10584846/185707993-14ff5fd7-c082-4e5a-b825-f1364e619b6a.png\n[jedi-refactor-doc]: https://jedi.readthedocs.io/en/latest/docs/api.html#jedi.Script.extract_variable\n"
  },
  {
    "path": "autoload/youcompleteme/filetypes.vim",
    "content": "\" Copyright (C) 2011-2018 YouCompleteMe contributors\n\"\n\" This file is part of YouCompleteMe.\n\"\n\" YouCompleteMe is free software: you can redistribute it and/or modify\n\" it under the terms of the GNU General Public License as published by\n\" the Free Software Foundation, either version 3 of the License, or\n\" (at your option) any later version.\n\"\n\" YouCompleteMe is distributed in the hope that it will be useful,\n\" but WITHOUT ANY WARRANTY; without even the implied warranty of\n\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\" GNU General Public License for more details.\n\"\n\" You should have received a copy of the GNU General Public License\n\" along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\nfunction! s:HasAnyKey( dict, keys ) abort\n  for key in a:keys\n    if has_key( a:dict, key )\n      return 1\n    endif\n  endfor\n  return 0\nendfunction\n\nfunction! youcompleteme#filetypes#AllowedForFiletype( filetype ) abort\n  let whitelist_allows = type( g:ycm_filetype_whitelist ) != v:t_dict ||\n        \\ has_key( g:ycm_filetype_whitelist, '*' ) ||\n        \\ s:HasAnyKey( g:ycm_filetype_whitelist, split( a:filetype, '\\.' ) )\n  let blacklist_allows = type( g:ycm_filetype_blacklist ) != v:t_dict ||\n        \\ !s:HasAnyKey( g:ycm_filetype_blacklist, split( a:filetype, '\\.' ) )\n\n  return whitelist_allows && blacklist_allows\nendfunction\n"
  },
  {
    "path": "autoload/youcompleteme/finder.vim",
    "content": "\" Copyright (C) 2021 YouCompleteMe contributors\n\"\n\" This file is part of YouCompleteMe.\n\"\n\" YouCompleteMe is free software: you can redistribute it and/or modify\n\" it under the terms of the GNU General Public License as published by\n\" the Free Software Foundation, either version 3 of the License, or\n\" (at your option) any later version.\n\"\n\" YouCompleteMe is distributed in the hope that it will be useful,\n\" but WITHOUT ANY WARRANTY; without even the implied warranty of\n\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\" GNU General Public License for more details.\n\"\n\" You should have received a copy of the GNU General Public License\n\" along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\" This is basic vim plugin boilerplate\nlet s:save_cpo = &cpoptions\nset cpoptions&vim\n\nscriptencoding utf-8\n\n\"\n\" Explanation for how this module works:\n\"\n\" The entry point is youcompleteme#finder#FindSymbol, which takes a scope\n\" argument:\n\"\n\" * 'document' scope - search document symbols - GoToDocumentOutline\n\" * 'workspace' scope - search workspace symbols - GoToSymbol\n\"\n\" In general, the approach is:\n\" - create a prompt buffer, and display it to use for input of a query\n\" - open up a popup to display the results in the middle of the screen\n\" - as the query changes, re-query the server to get the newly filtered results\n\" - as the server returns results, update the contents of the results-popup\n\" - use a popup-filter to implement some interractivity with the results, such\n\"   as down/up, and select item\n\" - when an item is selected, open its buffer in the window that was current\n\"   when the search started and jump to the selected item.\n\" - then populate the quickfix list with any matching results and close the\n\"   popup and prompt buffer.\n\"\n\" However, there is an important wrinke/distinction that leads to the code being\n\" a little more complicated than that: the 'search' mechanism for workspace and\n\" document symbols is different.\n\"\n\" The reaosn for this differece is what the servers provide in response to the 2\n\" requests:\n\"\n\" * 'document' scope - we use ycmd's filtering and sorting.\n\"    GoToDocumentOutline (LSP documentSymbol) request does not take any filter\n\"    argument. It returns all symbols in the current document. Therefore, we use\n\"    ycmd's filter_and_sort_candidates endpoint to use our own fuzzy search on\n\"    the results. This is a _great_ experience, it's _super_ fast and familar to\n\"    YCM users.\n\" * 'workspace' scope - we have to rely on the downstream server's filtering and\n\"   sorting.\n\"   GoToSymbol (LSP workspaceSymbol) request takes a query parameter to search\n\"   with. While the LSP spec states that an empty query means 'return\n\"   everything', no servers actually implement that, so we have to pass our\n\"   query down to the server.\n\"\n\" The result of this is that while a lot of the code is shared, there are\n\" slightly different steps involved in the process:\n\"\n\" * for 'document' requests, as soon as the popup is opened, we issue a\n\"   GoToDocumentOutline request, storing the results as `raw_results`, then\n\"   then immediately start filtering it with filter_and_sort_candidates, storing\n\"   the filtered results in `results`\n\" * for 'workspace' requests, as soon as the popup is opened, we issue a\n\"   GoToSymbol request with an empty query. This usually returns nothing, but if\n\"   any servers return anything then it would be stored in 'results'. As the\n\"   user types, we repeat the GoToSymbol request and update the 'results'\n\"\n\" In order to simplify the re-query code, we put the function used to filter\n\" results in the state variable as 'query_func'.\n\"\n\" As the expereince of completely different filtering and sorting for workspace\n\" vs document is so jarring, by default we actually pass all restuls from\n\" 'workspace' search through filter_and_sort_candidates too. This isn't perfect\n\" because it breaks the mental model when the server's filtering is dumb, but it\n\" at least means that sorting is consistent. This can be disabled by setting\n\" g:ycm_refilter_workspace_symbols to 0.\n\"\n\" The key functions are:\n\"\n\"  - FindSymbol - initiate the request - open the popup/prompt buffer, set up\n\"  the state object to defaults and initiate the first request\n\"  (RequestDocumentSymbols for 'documnt' and SearchWorkspace for 'workspace' )\n\"\n\"  - RequestDocumentSymbols - perform the GoToDocumentOutline request and store\n\"    the results in 'raw_results'\n\"\n\"  - SearchDocument - perform filter_and_sort_candidates request on the\n\"    'raw_results', and store the results in 'results', then call\n\"    \"HandleSymbolSearchResults\"\n\"\n\"  - SearchWorkspace - perform GoToSymbol request for all open filetypes,\n\"     and store the results in 'raw_results' as a dict mapping\n\"     filetype->results. Merge the results in to 'results', then call\n\"     \"HandleSymbolSearchResults\"\n\"\n\"  - HandleSymbolSearchResults - redraw the popup with the 'results'\n\"\n\"  - HandleKeyPress - handle a keypress while the popup is visible, intercepts\n\"    things to handle interractivity\n\"\n\"  - PopupClosed - callback when the popup is closed. This openes the result in\n\"    the original window.\n\"\n\" The other functions are utility for the most part and handle things like\n\" TextChangedI event, starting/stopping drawing the spinner and such.\n\nlet s:icon_spinner = [ '/', '-', '\\', '|', '/', '-', '\\', '|' ]\nlet s:icon_done = 'X'\nlet s:spinner_delay = 100\nlet s:prompt = 'Find Symbol: '\nlet s:find_symbol_status = {}\n\n\" Entry point {{{\n\nfunction! youcompleteme#finder#FindSymbol( scope ) abort\n  if !py3eval( 'vimsupport.VimSupportsPopupWindows()' )\n    echo 'Sorry, this feature is not supported in your editor'\n    return\n  endif\n\n  call youcompleteme#symbol#InitSymbolProperties()\n\n  let s:find_symbol_status = {\n        \\ 'selected': -1,\n        \\ 'query': '',\n        \\ 'results': [],\n        \\ 'raw_results': v:none,\n        \\ 'all_filetypes': v:true,\n        \\ 'pending': [],\n        \\ 'winid': win_getid(),\n        \\ 'bufnr': bufnr(),\n        \\ 'prompt_bufnr': -1,\n        \\ 'prompt_winid': -1,\n        \\ 'filter': v:none,\n        \\ 'id': v:none,\n        \\ 'cursorline_match': v:none,\n        \\ 'spinner': 0,\n        \\ 'spinner_timer': -1,\n        \\ }\n\n  let opts = {\n        \\ 'padding': [ 1, 2, 1, 2 ],\n        \\ 'wrap': 0,\n        \\ 'minwidth': &columns / 3 * 2,\n        \\ 'minheight': &lines / 3 * 2,\n        \\ 'maxwidth': &columns / 3 * 2,\n        \\ 'maxheight': &lines / 3 * 2,\n        \\ 'line': &lines / 6,\n        \\ 'col': &columns / 6,\n        \\ 'pos': 'topleft',\n        \\ 'drag': 1,\n        \\ 'resize': 1,\n        \\ 'close': 'button',\n        \\ 'border': [],\n        \\ 'callback': function( 's:PopupClosed' ),\n        \\ 'filter': function( 's:HandleKeyPress' ),\n        \\ 'highlight': 'Normal',\n        \\ }\n\n  if &ambiwidth ==# 'single' && &encoding ==? 'utf-8'\n    let opts[ 'borderchars' ] = [ '─', '│', '─', '│', '╭', '╮', '┛', '╰' ]\n  endif\n\n  if a:scope ==# 'document'\n    let s:find_symbol_status.query_func = function( 's:SearchDocument' )\n  else\n    let s:find_symbol_status.query_func = function( 's:SearchWorkspace' )\n  endif\n\n  let s:find_symbol_status.id = popup_create( 'Type to query for stuff', opts )\n\n  \" Kick off the request now\n  if a:scope ==# 'document'\n    call s:RequestDocumentSymbols()\n  else\n    call s:SearchWorkspace( '', v:true )\n  endif\n\n  let bufnr = bufadd( '_ycm_filter_' )\n  silent call bufload( bufnr )\n  silent topleft 1split _ycm_filter_\n  \" Disable ycm/completion in this buffer\n  call setbufvar( bufnr, 'ycm_largefile', 1 )\n\n  let s:find_symbol_status.prompt_bufnr = bufnr\n  let s:find_symbol_status.prompt_winid = win_getid()\n\n  setlocal buftype=prompt noswapfile modifiable nomodified noreadonly\n  setlocal nobuflisted bufhidden=delete textwidth=0\n  call prompt_setprompt( bufnr(), s:prompt )\n  augroup YCMPromptFindSymbol\n    autocmd!\n    autocmd TextChanged,TextChangedI <buffer> call s:OnQueryTextChanged()\n    autocmd WinLeave <buffer> call s:Cancel()\n    autocmd CmdLineEnter <buffer> call s:Cancel()\n  augroup END\n  startinsert\nendfunction\n\nfunction! s:OnQueryTextChanged() abort\n  if s:find_symbol_status.id < 0\n    return\n  endif\n\n  let bufnr = s:find_symbol_status.prompt_bufnr\n  let query = getbufline( bufnr, '$' )[ 0 ]\n  let s:find_symbol_status.query = query[ len( s:prompt ) : ]\n\n  \" really, re-query if we can\n  call s:RequeryFinderPopup( v:true )\n\n  call win_execute( s:find_symbol_status.prompt_winid, 'setlocal nomodified' )\nendfunction\n\n\nfunction! s:Cancel() abort\n  if s:find_symbol_status.id < 0\n    return\n  endif\n\n  call popup_close( s:find_symbol_status.id, -1 )\nendfunction\n\" }}}\n\n\" Popup and keyboard events {{{\n\nfunction! s:HandleKeyPress( id, key ) abort\n  let redraw = 0\n  let handled = 0\n  let requery = 0\n\n  \" The input for the search/query is taken from the prompt buffer and the\n  \" TextChangedI event\n  if a:key ==# \"\\<C-j>\" ||\n        \\ a:key ==# \"\\<Down>\" ||\n        \\ a:key ==# \"\\<C-n>\" ||\n        \\ a:key ==# \"\\<Tab>\"\n    let s:find_symbol_status.selected += 1\n    \" wrap\n    if s:find_symbol_status.selected >= len( s:find_symbol_status.results )\n      let s:find_symbol_status.selected = 0\n    endif\n    let redraw = 1\n    let handled = 1\n  elseif a:key ==# \"\\<C-k>\" ||\n        \\ a:key ==# \"\\<Up>\" ||\n        \\ a:key ==# \"\\<C-p>\" ||\n        \\ a:key ==# \"\\<S-Tab>\"\n    let s:find_symbol_status.selected -= 1\n    \" wrap\n    if s:find_symbol_status.selected < 0\n      let s:find_symbol_status.selected =\n            \\ len( s:find_symbol_status.results ) - 1\n    endif\n    let redraw = 1\n    let handled = 1\n  elseif a:key ==# \"\\<PageDown>\" || a:key ==# \"\\<kPageDown>\"\n    let s:find_symbol_status.selected +=\n          \\ popup_getpos( s:find_symbol_status.id ).core_height\n    \" Don't wrap\n    if s:find_symbol_status.selected >= len( s:find_symbol_status.results )\n      let s:find_symbol_status.selected =\n            \\ len( s:find_symbol_status.results ) - 1\n    endif\n    let redraw = 1\n    let handled = 1\n  elseif a:key ==# \"\\<PageUp>\" || a:key ==# \"\\<kPageUp>\"\n    let s:find_symbol_status.selected -=\n          \\ popup_getpos( s:find_symbol_status.id ).core_height\n    \" Don't wrap\n    if s:find_symbol_status.selected < 0\n      let s:find_symbol_status.selected = 0\n    endif\n    let redraw = 1\n    let handled = 1\n  elseif a:key ==# \"\\<C-c>\"\n    call popup_close( a:id, -1 )\n    let handled = 1\n  elseif a:key ==# \"\\<CR>\"\n    if s:find_symbol_status.selected >= 0\n      call popup_close( a:id, s:find_symbol_status.selected )\n      let handled = 1\n    endif\n  elseif a:key ==# \"\\<Home>\" || a:key ==# \"\\<kHome>\"\n    let s:find_symbol_status.selected = 0\n    let redraw = 1\n    let handled = 1\n  elseif a:key ==# \"\\<End>\" || a:key ==# \"\\<kEnd>\"\n    let s:find_symbol_status.selected = len( s:find_symbol_status.results ) - 1\n    let redraw = 1\n    let handled = 1\n  elseif a:key ==# \"\\<C-f>\"\n    \" TOggle filetypes?\n    let s:find_symbol_status.all_filetypes = !s:find_symbol_status.all_filetypes\n    let redraw = 0\n    let requery = 1\n    let handled = 1\n  endif\n\n  if requery\n    call s:RequeryFinderPopup( v:true )\n  elseif redraw\n    call s:RedrawFinderPopup()\n  endif\n\n  return handled\nendfunction\n\n\n\" Handle the popup closing: jump to the selected item\nfunction! s:PopupClosed( id, selected ) abort\n  stopinsert\n  call win_gotoid( s:find_symbol_status.prompt_winid )\n  silent bwipe!\n\n  \" Return to original window\n  call win_gotoid( s:find_symbol_status.winid )\n\n  if a:selected >= 0\n    let selected = s:find_symbol_status.results[ a:selected ]\n\n    py3 vimsupport.JumpToLocation(\n          \\ filename = vimsupport.ToUnicode( vim.eval( 'selected.filepath' ) ),\n          \\ line = int( vim.eval( 'selected.line_num' ) ),\n          \\ column = int( vim.eval( 'selected.column_num' ) ),\n          \\ modifiers = '',\n          \\ command = 'same-buffer'\n          \\ )\n\n    if len( s:find_symbol_status.results ) > 1\n      \" Also, populate the quickfix list\n      py3 vimsupport.SetQuickFixList(\n            \\ [ vimsupport.BuildQfListItem( x ) for x in\n            \\ vim.eval( 's:find_symbol_status.results' ) ] )\n\n\n      \" Emulate :echo, to avoid a redraw getting rid of the message.\n      let txt = 'Added ' . len( getqflist() ) . ' entries to quickfix list.'\n      call popup_notification(\n            \\ txt,\n            \\ {\n              \\  'line':      1,\n              \\  'col':       &columns - len( txt ),\n              \\  'padding':   [ 0, 0, 0, 0 ],\n              \\  'border':    [ 0, 0, 0, 0 ],\n              \\  'highlight': 'PMenu'\n            \\ } )\n\n      \" But don't open it, as this could take up valuable actual screen space\n      \" py3 vimsupport.OpenQuickFixList()\n    endif\n  endif\n\n\n  call s:EndRequest()\n  let s:find_symbol_status.id = -1\nendfunction\n\n\"}}}\n\n\" Results handling and re-query {{{\n\n\" Render a set of results returned from the filter/search function\nfunction! s:HandleSymbolSearchResults( results ) abort\n  let s:find_symbol_status.results = []\n\n  if s:find_symbol_status.id < 0\n    \" Popup was closed, ignore this event\n    return\n  endif\n\n  let s:find_symbol_status.results = a:results\n  call s:RedrawFinderPopup()\n\n  \" Re-query but no change in the query text\n  call s:RequeryFinderPopup( v:false )\nendfunction\n\n\n\" Set the popup text\nfunction! s:RedrawFinderPopup() abort\n  \" Clamp selected. If there are any results, the first one is selected by\n  \" default\n  let s:find_symbol_status.selected = max( [\n        \\   s:find_symbol_status.selected,\n        \\   len( s:find_symbol_status.results ) > 0 ? 0 : -1\n        \\ ] )\n  let s:find_symbol_status.selected = min( [\n        \\   s:find_symbol_status.selected,\n        \\   len( s:find_symbol_status.results ) - 1\n        \\ ] )\n\n  if empty( s:find_symbol_status.results )\n    call popup_settext( s:find_symbol_status.id, 'No results' )\n    let s:find_symbol_status.selected = -1\n  else\n    let popup_width = popup_getpos( s:find_symbol_status.id ).core_width\n\n    let buffer = []\n\n    let len_filetype = 0\n\n    for result in s:find_symbol_status.results\n      let len_filetype = max( [ len_filetype, len( result[ 'filetype' ] ) ] )\n    endfor\n\n    if len_filetype > 0\n      let filetype_sep = ' '\n    else\n      let filetype_sep = ''\n    endif\n\n    let available_width = popup_width - len_filetype - len( filetype_sep )\n\n    for result in s:find_symbol_status.results\n      \" Calculate  the text to use. Try and include the full path and line\n      \" number, (right aligned), but truncate if there isn't space for the\n      \" description and the file path. Include at least 8 spaces between them\n      \" (if there's room).\n      if result->has_key( 'extra_data' )\n        let kind = result[ 'extra_data' ][ 'kind' ]\n        let name = result[ 'extra_data' ][ 'name' ]\n        let desc = kind .. ': ' .. name\n        let prop = youcompleteme#symbol#GetPropForSymbolKind( kind )\n        let props = [\n            \\ { 'col': 1,\n            \\   'length': len( kind ) + 2,\n            \\   'type': 'YCM-symbol-Normal'  },\n            \\ { 'col': len( kind ) + 3,\n            \\   'length': len( name ),\n            \\   'type': prop },\n            \\ ]\n      elseif result->has_key( 'description' )\n        let desc = result[ 'description' ]\n        let props = [\n            \\ { 'col': 1, 'length': len( desc ), 'type': 'YCM-symbol-Normal' },\n            \\ ]\n      else\n        let desc = 'Invalid entry: ' . string( result )\n        let props = []\n      endif\n\n      let line_num = result[ 'line_num' ]\n      let path = fnamemodify( result[ 'filepath' ], ':.' )\n               \\ .. ':'\n               \\ .. line_num\n      let path_includes_line = 1\n\n      let spaces = available_width - strdisplaywidth( desc ) - strdisplaywidth( path )\n      let spacing = 4\n      if spaces < spacing\n        let spaces = spacing\n        let space_for_path = available_width - spacing - len( desc )\n        let path_includes_line = space_for_path - 3 > len( line_num ) + 1\n        if space_for_path > 3\n          let path = '...' . strpart( path, len( path ) - space_for_path + 3 )\n        elseif space_for_path <= 0\n          let path = ''\n        else\n          let path_includes_line = 0\n          let path = '...'\n        endif\n      endif\n\n      let line = desc\n             \\ .. repeat( ' ', spaces )\n             \\ .. path\n             \\ .. filetype_sep\n             \\ .. result[ 'filetype' ]\n\n      if len( path ) > 0\n        if path_includes_line\n          let props += [\n                \\ { 'col': len( desc ) + spaces + 1,\n                \\   'length': len( path ) - len( line_num ),\n                \\   'type': 'YCM-symbol-file' },\n                \\ { 'col': len( desc ) + spaces + 1 + len( path ) - len( line_num ),\n                \\   'length': len( line_num ),\n                \\   'type': 'YCM-symbol-line-num' },\n                \\ ]\n        else\n          let props += [\n                \\ { 'col': len( desc ) + spaces + 1,\n                \\   'length': len( path ),\n                \\   'type': 'YCM-symbol-file' },\n                \\ ]\n        endif\n      endif\n\n      if len_filetype > 0\n        let props += [\n            \\ { 'col': popup_width - len_filetype + len( filetype_sep ),\n            \\   'length': len_filetype,\n            \\   'type': 'YCM-symbol-filetype' },\n            \\ ]\n      endif\n\n      call add( buffer, { 'text': line, 'props': props } )\n    endfor\n\n    call popup_settext( s:find_symbol_status.id, buffer )\n  endif\n\n  if s:find_symbol_status.selected > -1\n    \" Move the cursor so that cursorline highlights the selected item. Also\n    \" scroll the window if the selected item is not in view. To make scrolling\n    \" feel natural we position the current line a the bottom of the window if\n    \" the new current line is below the current viewport, and at the top if the\n    \" new current line is above the viewport.\n    let new_line =  s:find_symbol_status.selected + 1\n    let pos = popup_getpos( s:find_symbol_status.id )\n\n    call win_execute( s:find_symbol_status.id,\n                    \\ 'call cursor( [' . string( new_line ) . ', 1] )' )\n\n    if new_line < pos.firstline\n      \" New line is above the viewport, scroll so that this line is at the top\n      \" of the window.\n      call win_execute( s:find_symbol_status.id, \"normal z\\<CR>\" )\n    elseif new_line >= ( pos.firstline + pos.core_height )\n      \" New line is below the viewport, scroll so that this line is at the\n      \" bottom of the window.\n      call win_execute( s:find_symbol_status.id, ':normal z-' )\n    endif\n    \" Otherwise, new item is already displayed - don't scroll the window.\n\n    if !getwinvar( s:find_symbol_status.id, '&cursorline' )\n      call win_execute( s:find_symbol_status.id,\n                      \\ 'set cursorline cursorlineopt&' )\n    endif\n  else\n    call win_execute( s:find_symbol_status.id, 'set nocursorline' )\n  endif\n\nendfunction\n\nfunction! s:SetTitle() abort\n  if s:find_symbol_status.spinner_timer > -1\n    let status = s:icon_spinner[ s:find_symbol_status.spinner ]\n  else\n    let status = s:icon_done\n  endif\n\n  call popup_setoptions( s:find_symbol_status.id, {\n        \\ 'title': ' [' . status . '] Search for symbol: '\n        \\            . s:find_symbol_status.query . ' '\n        \\ } )\nendfunction\n\n\n\n\" Re-query or re-filter by calling the filter function\nfunction! s:RequeryFinderPopup( new_query ) abort\n  \" Update the title even if we delay the query, as this makes the UI feel\n  \" snappy\n  call s:SetTitle()\n\n  call win_execute( s:find_symbol_status.winid,\n        \\ 'call s:find_symbol_status.query_func('\n        \\ . 's:find_symbol_status.query,'\n        \\ . 'a:new_query )' )\nendfunction\n\nfunction! s:ParseGoToResponse( filetype, results ) abort\n  if type( a:results ) == v:t_none || empty( a:results )\n    let results = []\n  elseif type( a:results ) != v:t_list\n    if type( a:results ) == v:t_dict && has_key( a:results, 'error' )\n      let results = []\n    else\n      let results = [ a:results ]\n    endif\n  else\n    let results = a:results\n  endif\n\n  call map( results, { _, r -> extend( r, {\n      \\   'key': r->get( 'extra_data', {} )->get( 'name', r[ 'description' ] ),\n      \\   'filetype': a:filetype\n      \\ } ) } )\n  return results\nendfunction\n\n\" }}}\n\n\" Spinner {{{\n\nfunction! s:StartRequest() abort\n  call s:EndRequest()\n\n  let s:find_symbol_status.spinner = 0\n  let s:find_symbol_status.spinner_timer = timer_start( s:spinner_delay,\n        \\ function( 's:TickSpinner' ) )\n\n  call s:SetTitle()\nendfunction\n\nfunction! s:EndRequest() abort\n  call timer_stop( s:find_symbol_status.spinner_timer )\n\n  let s:find_symbol_status.spinner_timer = -1\n\n  call s:SetTitle()\nendfunction\n\nfunction! s:TickSpinner( timer_id ) abort\n  let s:find_symbol_status.spinner = ( s:find_symbol_status.spinner + 1 ) %\n        \\ len( s:icon_spinner )\n\n  let s:find_symbol_status.spinner_timer = timer_start( s:spinner_delay,\n        \\ function( 's:TickSpinner' ) )\n\n  call s:SetTitle()\nendfunction\n\n\" }}}\n\n\" Workspace search {{{\n\nfunction! s:SearchWorkspace( query, new_query ) abort\n\n  if a:new_query\n    if s:find_symbol_status.raw_results is# v:none\n      let raw_results = {}\n    else\n      let raw_results = copy( s:find_symbol_status.raw_results )\n    endif\n\n    let s:find_symbol_status.raw_results = {}\n    \" FIXME: We might still get results for any pending results. There is no\n    \" cancellation mechanism implemented for the async request!\n    let s:find_symbol_status.pending = []\n\n    if s:find_symbol_status.all_filetypes\n      let ft_buffer_map = py3eval( 'vimsupport.AllOpenedFiletypes()' )\n    else\n      let current_filetypes = py3eval( 'vimsupport.CurrentFiletypes()' )\n      let ft_buffer_map = {}\n      for ft in current_filetypes\n        let ft_buffer_map[ ft ] = [ bufnr() ]\n      endfor\n    endif\n\n    for ft in keys( ft_buffer_map )\n      if !youcompleteme#filetypes#AllowedForFiletype( ft )\n        continue\n      endif\n\n      let s:find_symbol_status.raw_results[ ft ] = v:none\n      if has_key( raw_results, ft ) && raw_results[ ft ] is# v:none\n        call add( s:find_symbol_status.pending,\n                \\ [ ft, ft_buffer_map[ ft ][ 0 ] ] )\n      else\n        call youcompleteme#GetRawCommandResponseAsync(\n              \\ function( 's:HandleWorkspaceSymbols', [ ft ] ),\n              \\ 'GoToSymbol',\n              \\ '--bufnr=' . ft_buffer_map[ ft ][ 0 ],\n              \\ 'ft=' . ft,\n              \\ a:query )\n      endif\n    endfor\n\n    if !empty( s:find_symbol_status.raw_results )\n      \" We sent some requests\n      call s:StartRequest()\n    endif\n  else\n    \" Just requery those completer filetypes that we're not currently waiting\n    \" for\n    for [ ft, bufnr ] in copy( s:find_symbol_status.pending )\n      if s:find_symbol_status.raw_results[ ft ] isnot# v:none\n        call filter( s:find_symbol_status.pending, { v -> v !=# ft } )\n        let s:find_symbol_status.raw_results[ ft ] = v:none\n        call youcompleteme#GetRawCommandResponseAsync(\n              \\ function( 's:HandleWorkspaceSymbols', [ ft ] ),\n              \\ 'GoToSymbol',\n              \\ '--bufnr=' . bufnr,\n              \\ 'ft=' . ft,\n              \\ a:query )\n      endif\n    endfor\n  endif\nendfunction\n\n\nfunction! s:HandleWorkspaceSymbols( filetype, results ) abort\n\n  let s:find_symbol_status.raw_results[ a:filetype ] =\n        \\ s:ParseGoToResponse( a:filetype, a:results )\n\n  \" Collate the results from each filetype\n  let results = []\n  let waiting = 0\n  for ft in keys( s:find_symbol_status.raw_results )\n    if s:find_symbol_status.raw_results[ ft ] is v:none\n      let waiting = 1\n      continue\n    endif\n\n    call extend( results, s:find_symbol_status.raw_results[ ft ] )\n  endfor\n\n  let query = s:find_symbol_status.query\n\n  if g:ycm_refilter_workspace_symbols && !empty( results )\n    \" This is kinda wonky, but seems to work well enough.\n    \"\n    \" We get the server to give us a result set, then use our own\n    \" filter_and_sort_candidates on the result set filtered by the server\n    \"\n    \" The reason for this is:\n    \"  - server filterins will differ by server and this leads to horrible wonky\n    \"    user experience\n    \"  - ycmd filter is consistent, even if not perfect\n    \"  - servers are supposed to return _all_ symbols if we request a query of\n    \"    \"\" but not all servers actually do\n    \"\n    \" So as a compromise we let the server filter the results, then we\n    \" _refilter_ and sort them using ycmd's method. This provides consistency\n    \" with the filtering and sorting on the completion popup menu, with the\n    \" disadvantage of additional latency.\n    \"\n    \" We're not currently sure this is going to be perfecct, so we have a hidden\n    \" option to disable this re-filter/sort.\n    \"\n    let results = py3eval(\n          \\ 'ycm_state.FilterAndSortItems( vim.eval( \"results\" ),'\n          \\ .                              ' \"key\",'\n          \\ .                              ' vim.eval( \"query\" ) )' )\n  endif\n\n  if !waiting\n    call s:EndRequest()\n  endif\n  eval s:HandleSymbolSearchResults( results )\nendfunction\n\n\" }}}\n\n\" Document Search {{{\n\nfunction! s:SearchDocument( query, new_query ) abort\n  if !a:new_query\n    return\n  endif\n\n  if type( s:find_symbol_status.raw_results ) == v:t_none\n    call popup_settext( s:find_symbol_status.id,\n          \\ 'No symbols found in document' )\n    return\n  endif\n\n  \" No spinner, because this is actually a synchronous call\n\n  \" Call filter_and_sort_candidates on the results (synchronously)\n  let response = py3eval(\n        \\ 'ycm_state.FilterAndSortItems( '\n        \\ . ' vim.eval( \"s:find_symbol_status.raw_results\" ),'\n        \\ . ' \"key\",'\n        \\ . ' vim.eval( \"a:query\" ) )' )\n\n  eval s:HandleSymbolSearchResults( response )\nendfunction\n\n\nfunction! s:RequestDocumentSymbols()\n  call s:StartRequest()\n  call youcompleteme#GetRawCommandResponseAsync(\n        \\ function( 's:HandleDocumentSymbols' ),\n        \\ 'GoToDocumentOutline' )\nendfunction\n\n\nfunction! s:HandleDocumentSymbols( results ) abort\n  call s:EndRequest()\n  let s:find_symbol_status.raw_results = s:ParseGoToResponse( '', a:results )\n  call s:SearchDocument( '', v:true )\nendfunction\n\n\" }}}\n\n\" Utility for testing {{{\n\nfunction! youcompleteme#finder#GetState() abort\n  return s:find_symbol_status\nendfunction\n\n\" }}}\n\n\" This is basic vim plugin boilerplate\nlet &cpoptions = s:save_cpo\nunlet s:save_cpo\n\n\" vim: foldmethod=marker\n"
  },
  {
    "path": "autoload/youcompleteme/hierarchy.vim",
    "content": "\" Copyright (C) 2021 YouCompleteMe contributors\n\"\n\" This file is part of YouCompleteMe.\n\"\n\" YouCompleteMe is free software: you can redistribute it and/or modify\n\" it under the terms of the GNU General Public License as published by\n\" the Free Software Foundation, either version 3 of the License, or\n\" (at your option) any later version.\n\"\n\" YouCompleteMe is distributed in the hope that it will be useful,\n\" but WITHOUT ANY WARRANTY; without even the implied warranty of\n\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\" GNU General Public License for more details.\n\"\n\" You should have received a copy of the GNU General Public License\n\" along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\" This is basic vim plugin boilerplate\nlet s:save_cpo = &cpoptions\nset cpoptions&vim\n\nscriptencoding utf-8\n\nlet s:popup_id = -1\nlet s:lines_and_handles = v:null\n\" 1-based index of the selected item in the popup\n\" -1 means none set\n\"  0 means nothing, (Invalid)\nlet s:select = -1\nlet s:kind = ''\n\nlet s:ingored_keys = [\n      \\ \"\\<CursorHold>\",\n      \\ \"\\<MouseMove>\",\n      \\ ]\n\nfunction! youcompleteme#hierarchy#StartRequest( kind )\n  if !py3eval( 'vimsupport.VimSupportsPopupWindows()' )\n    echo 'Sorry, this feature is not supported in your editor'\n    return\n  endif\n\n  call youcompleteme#symbol#InitSymbolProperties()\n  py3 ycm_state.ResetCurrentHierarchy()\n  py3 from ycm.client.command_request import GetRawCommandResponse\n  if a:kind == 'call'\n    let lines_and_handles = py3eval(\n      \\ 'ycm_state.InitializeCurrentHierarchy( GetRawCommandResponse( ' .\n      \\ '[ \"CallHierarchy\" ], False ), ' .\n      \\ 'vim.eval( \"a:kind\" ) )' )\n  else\n    let lines_and_handles = py3eval( \n      \\ 'ycm_state.InitializeCurrentHierarchy( GetRawCommandResponse( ' .\n      \\ '[ \"TypeHierarchy\" ], False ), ' .\n      \\ 'vim.eval( \"a:kind\" ) )' )\n  endif\n  if len( lines_and_handles )\n    let s:lines_and_handles = lines_and_handles\n    let s:kind = a:kind\n    let s:select = 1\n    call s:SetUpMenu()\n  endif\nendfunction\n\nfunction! s:MenuFilter( winid, key )\n  if a:key == \"\\<S-Tab>\"\n    \" Root changes if we're showing super-tree of a sub-tree of the root\n    \" (indicated by the handle being positive)\n    let will_change_root = s:lines_and_handles[ s:select - 1 ][ 1 ] > 0\n    call popup_close(\n          \\ s:popup_id,\n          \\ [ s:select - 1, 'resolve_up', will_change_root ] )\n    return 1\n  endif\n  if a:key == \"\\<Tab>\"\n    \" Root changes if we're showing sub-tree of a super-tree of the root\n    \" (indicated by the handle being negative)\n    let will_change_root = s:lines_and_handles[ s:select - 1 ][ 1 ] < 0\n    call popup_close(\n          \\ s:popup_id,\n          \\ [ s:select - 1, 'resolve_down', will_change_root ] )\n    return 1\n  endif\n  if a:key == \"\\<CR>\"\n    call popup_close( s:popup_id, [ s:select - 1, 'jump', v:none ] )\n    return 1\n  endif\n  if a:key == \"\\<Up>\" || a:key == \"\\<C-p>\" || a:key == \"\\<C-k>\" || a:key == \"k\"\n    let s:select -= 1\n    if s:select < 1\n      let s:select = 1\n    endif\n    call win_execute( s:popup_id,\n                    \\ 'call cursor( [' . string( s:select ) . ', 1 ] )' )\n    call win_execute( s:popup_id,\n                    \\ 'set cursorline cursorlineopt&' )\n    return 1\n  endif\n  if a:key == \"\\<Down>\" || a:key == \"\\<C-n>\" || a:key == \"\\<C-j>\" || a:key == \"j\"\n    let s:select += 1\n    if s:select > len( s:lines_and_handles )\n      let s:select = len( s:lines_and_handles )\n    endif\n    call win_execute( s:popup_id,\n                    \\ 'call cursor( [' . string( s:select ) . ', 1 ] )' )\n    call win_execute( s:popup_id,\n                    \\ 'set cursorline cursorlineopt&' )\n    return 1\n  endif\n  if index( s:ingored_keys, a:key ) >= 0\n    return 0\n  endif\n  \" Close the popup on any other key press\n  call popup_close( s:popup_id, [ s:select - 1, 'cancel', v:none ] )\n  if a:key == \"\\<Esc>\" || a:key == \"\\<C-c>\"\n    return 1\n  endif\n  return 0\nendfunction\n\nfunction! s:MenuCallback( winid, result )\n  let operation = a:result[ 1 ]\n  let selection = a:result[ 0 ]\n  if operation == 'resolve_down'\n    call s:ResolveItem( selection, 'down', a:result[ 2 ] )\n  elseif operation == 'resolve_up'\n    call s:ResolveItem( selection, 'up', a:result[ 2 ] )\n  else\n    if operation == 'jump'\n      let handle = s:lines_and_handles[ selection ][ 1 ]\n      py3 ycm_state.JumpToHierarchyItem( vimsupport.GetIntValue( \"handle\" ) )\n    endif\n    py3 ycm_state.ResetCurrentHierarchy()\n    let s:kind = ''\n    let s:select = 1\n  endif\nendfunction\n\nfunction! s:SetUpMenu()\n  let opts = #{\n    \\   filter: funcref( 's:MenuFilter' ),\n    \\   callback: funcref( 's:MenuCallback' ),\n    \\   wrap: 0,\n    \\   minwidth: &columns * 90/100,\n    \\   maxwidth: &columns * 90/100,\n    \\   maxheight: &lines * 75/100,\n    \\   scrollbar: 1,\n    \\   padding: [ 0, 0, 0, 0 ],\n    \\   highlight: 'Normal',\n    \\   border: [],\n    \\ }\n  if &ambiwidth ==# 'single' && &encoding ==? 'utf-8'\n    let opts[ 'borderchars' ] = [ '─', '│', '─', '│', '╭', '╮', '╯', '╰' ]\n  endif\n\n  let s:popup_id = popup_create( [], opts )\n  let menu_lines = []\n  let popup_width = popup_getpos( s:popup_id ).core_width\n  let tabstop = popup_width / 3\n  for [ item, handle ] in s:lines_and_handles\n    let indent = repeat( ' ', item.indent )\n    let name = indent\n          \\ .. item.icon\n          \\ .. item.kind\n          \\ .. ': ' .. item.symbol\n    \" -2 because:\n    \"   0-based index\n    \"   1 for the tab character\n    let trunc_name = name[ : tabstop - 2 ]\n    let props = []\n    let name_pfx_len = len( indent ) + len( item.icon ) + len( item.kind ) + 2\n    if len( trunc_name ) > name_pfx_len\n      let props += [\n          \\ {\n          \\   'col': name_pfx_len + 1,\n          \\   'length': len( trunc_name ) - name_pfx_len,\n          \\   'type': youcompleteme#symbol#GetPropForSymbolKind( item.kind ),\n          \\ }\n      \\ ]\n    endif\n\n    let file_name = item.filepath .. ':' .. item.line_num\n    let trunc_path = file_name[ : tabstop - 2 ]\n    if len(trunc_path) > 0\n      let props += [\n            \\ {\n            \\   'col': len(trunc_name) + 2,\n            \\   'length': min( [ len(trunc_path), len( item.filepath ) ] ),\n            \\   'type': 'YCM-symbol-file'\n            \\ }\n          \\ ]\n      if len(trunc_path) > len(item.filepath) + 1\n        let props += [\n              \\ {\n              \\   'col': len(trunc_name) + 2 + len(item.filepath) + 1,\n              \\   'length': min( [ len(trunc_path), len( item.line_num ) ] ),\n              \\   'type': 'YCM-symbol-line-num'\n              \\ }\n            \\ ]\n      endif\n    endif\n\n    let trunc_desc = item.description[ : tabstop - 2 ]\n\n    let line = trunc_name\n          \\ . \"\\t\"\n          \\ .. trunc_path\n          \\ . \"\\t\"\n          \\ .. trunc_desc\n    call add( menu_lines, { 'text': line, 'props': props } )\n  endfor\n  call win_execute( s:popup_id,\n                  \\ 'setlocal tabstop=' . tabstop )\n  call popup_settext( s:popup_id, menu_lines )\n  call win_execute( s:popup_id,\n                  \\ 'call cursor( [' . string( s:select ) . ', 1 ] )' )\n  call win_execute( s:popup_id,\n                  \\ 'set cursorline cursorlineopt&' )\nendfunction\n\nfunction! s:ResolveItem( choice, direction, will_change_root )\n  let handle = s:lines_and_handles[ a:choice ][ 1 ]\n  if py3eval(\n      \\ 'ycm_state.ShouldResolveItem( vimsupport.GetIntValue( \"handle\" ), vim.eval( \"a:direction\" ) )' )\n    let lines_and_handles_with_offset = py3eval(\n        \\ 'ycm_state.UpdateCurrentHierarchy( ' .\n        \\ 'vimsupport.GetIntValue( \"handle\" ), ' .\n        \\ 'vim.eval( \"a:direction\" ) )' )\n    let s:lines_and_handles = lines_and_handles_with_offset[ 0 ]\n    if a:will_change_root\n      \" When re-rooting the tree, put the cursor on the new \"root\" item, as this\n      \" helps with orientation. This behaviour is consistent with an expansion\n      \" where we _don't_ re-root the tree, so feels more natural than anything\n      \" else.\n      \" The new root is the element with indent of 0.\n      \" let s:select = 1 + indexof( s:lines_and_handles,\n      \"       \\                     { i, v -> v[0].indent == 0 } )\n      let s:select = 1\n      for item in s:lines_and_handles\n        if item[0].indent == 0\n          break\n        endif\n        let s:select += 1\n      endfor\n    else\n      let s:select += lines_and_handles_with_offset[ 1 ]\n    endif\n  endif\n  call s:SetUpMenu()\nendfunction\n"
  },
  {
    "path": "autoload/youcompleteme/symbol.vim",
    "content": "\" Copyright (C) 2024 YouCompleteMe contributors\n\"\n\" This file is part of YouCompleteMe.\n\"\n\" YouCompleteMe is free software: you can redistribute it and/or modify\n\" it under the terms of the GNU General Public License as published by\n\" the Free Software Foundation, either version 3 of the License, or\n\" (at your option) any later version.\n\"\n\" YouCompleteMe is distributed in the hope that it will be useful,\n\" but WITHOUT ANY WARRANTY; without even the implied warranty of\n\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\" GNU General Public License for more details.\n\"\n\" You should have received a copy of the GNU General Public License\n\" along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\nlet s:highlight_group_for_symbol_kind = {\n      \\ 'Array': 'Identifier',\n      \\ 'Boolean': 'Boolean',\n      \\ 'Class': 'Structure',\n      \\ 'Constant': 'Constant',\n      \\ 'Constructor': 'Function',\n      \\ 'Enum': 'Structure',\n      \\ 'EnumMember': 'Identifier',\n      \\ 'Event': 'Identifier',\n      \\ 'Field': 'Identifier',\n      \\ 'Function': 'Function',\n      \\ 'Interface': 'Structure',\n      \\ 'Key': 'Identifier',\n      \\ 'Method': 'Function',\n      \\ 'Module': 'Include',\n      \\ 'Namespace': 'Type',\n      \\ 'Null': 'Keyword',\n      \\ 'Number': 'Number',\n      \\ 'Object': 'Structure',\n      \\ 'Operator': 'Operator',\n      \\ 'Package': 'Include',\n      \\ 'Property': 'Identifier',\n      \\ 'String': 'String',\n      \\ 'Struct': 'Structure',\n      \\ 'TypeParameter': 'Typedef',\n      \\ 'Variable': 'Identifier',\n      \\ }\nlet s:initialized_text_properties = v:false\n\nfunction! youcompleteme#symbol#InitSymbolProperties() abort\n  if !s:initialized_text_properties\n    call prop_type_add( 'YCM-symbol-Normal', { 'highlight': 'Normal' } )\n    for k in keys( s:highlight_group_for_symbol_kind )\n      call prop_type_add(\n            \\ 'YCM-symbol-' . k,\n            \\ { 'highlight': s:highlight_group_for_symbol_kind[ k ] } )\n    endfor\n    call prop_type_add( 'YCM-symbol-file', { 'highlight': 'Comment' } )\n    call prop_type_add( 'YCM-symbol-filetype', { 'highlight': 'Special' } )\n    call prop_type_add( 'YCM-symbol-line-num', { 'highlight': 'Number' } )\n    let s:initialized_text_properties = v:true\n  endif\nendfunction\n\nfunction! youcompleteme#symbol#GetPropForSymbolKind( kind ) abort\n  if s:highlight_group_for_symbol_kind->has_key( a:kind )\n    return 'YCM-symbol-' . a:kind\n  endif\n\n  return 'YCM-symbol-Normal'\nendfunction\n\n\n"
  },
  {
    "path": "autoload/youcompleteme.vim",
    "content": "\" Copyright (C) 2011-2018 YouCompleteMe contributors\n\"\n\" This file is part of YouCompleteMe.\n\"\n\" YouCompleteMe is free software: you can redistribute it and/or modify\n\" it under the terms of the GNU General Public License as published by\n\" the Free Software Foundation, either version 3 of the License, or\n\" (at your option) any later version.\n\"\n\" YouCompleteMe is distributed in the hope that it will be useful,\n\" but WITHOUT ANY WARRANTY; without even the implied warranty of\n\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\" GNU General Public License for more details.\n\"\n\" You should have received a copy of the GNU General Public License\n\" along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\" This is basic vim plugin boilerplate\nlet s:save_cpo = &cpo\nset cpo&vim\n\n\" NOTE: Neovim reports v:version as 800, which is garbage. For some features\n\" that are supported by our minimum Vim version, we have to guard them against\n\" neovim, which doesn't implement them.\nlet s:is_neovim = has( 'nvim' )\n\n\" Only useful in neovim, for handling text properties... I mean extmarks.\nlet g:ycm_neovim_ns_id = s:is_neovim ? nvim_create_namespace( 'ycm_id' ) : -1\n\n\" This needs to be called outside of a function\nlet s:script_folder_path = escape( expand( '<sfile>:p:h' ), '\\' )\nlet s:force_semantic = 0\nlet s:force_manual = 0\nlet s:completion_stopped = 0\n\" These two variables are initialized in youcompleteme#Enable.\nlet s:default_completion = {}\nlet s:completion = s:default_completion\nlet s:default_signature_help = {}\nlet s:signature_help = s:default_completion\nlet s:previous_allowed_buffer_number = 0\nlet s:pollers = {\n      \\   'completion': {\n      \\     'id': -1,\n      \\     'wait_milliseconds': 10,\n      \\   },\n      \\   'signature_help': {\n      \\     'id': -1,\n      \\     'wait_milliseconds': 10,\n      \\   },\n      \\   'file_parse_response': {\n      \\     'id': -1,\n      \\     'wait_milliseconds': 100,\n      \\   },\n      \\   'server_ready': {\n      \\     'id': -1,\n      \\     'wait_milliseconds': 100,\n      \\   },\n      \\   'receive_messages': {\n      \\     'id': -1,\n      \\     'wait_milliseconds': 100,\n      \\   },\n      \\   'command': {\n      \\     'id': -1,\n      \\     'wait_milliseconds': 100,\n      \\     'requests': {},\n      \\   },\n      \\   'semantic_highlighting': {\n      \\     'id': -1,\n      \\     'wait_milliseconds': 100,\n      \\   },\n      \\   'inlay_hints': {\n      \\     'id': -1,\n      \\     'wait_milliseconds': 100,\n      \\   },\n      \\ }\nlet s:buftype_blacklist = {\n      \\   'help': 1,\n      \\   'terminal': 1,\n      \\   'quickfix': 1,\n      \\   'popup': 1,\n      \\   'nofile': 1,\n      \\ }\nlet s:last_char_inserted_by_user = v:true\nlet s:enable_hover = 0\nlet s:cursorhold_popup = -1\nlet s:enable_inlay_hints = 0\n\nlet s:force_preview_popup = 0\n\nlet s:RESOLVE_NONE = 0\nlet s:RESOLVE_UP_FRONT = 1\nlet s:RESOLVE_ON_DEMAND = 2\nlet s:resolve_completions = s:RESOLVE_NONE\n\nfunction! s:StartMessagePoll()\n  if s:pollers.receive_messages.id < 0\n    let s:pollers.receive_messages.id = timer_start(\n          \\ s:pollers.receive_messages.wait_milliseconds,\n          \\ function( 's:ReceiveMessages' ) )\n  endif\nendfunction\n\n\nfunction! s:ReceiveMessages( timer_id )\n  let poll_again = v:false\n  if s:AllowedToCompleteInCurrentBuffer()\n    let poll_again = py3eval( 'ycm_state.OnPeriodicTick()' )\n  endif\n\n  if poll_again\n    let s:pollers.receive_messages.id = timer_start(\n          \\ s:pollers.receive_messages.wait_milliseconds,\n          \\ function( 's:ReceiveMessages' ) )\n  else\n    \" Don't poll again until we open another buffer\n    let s:pollers.receive_messages.id = -1\n  endif\nendfunction\n\n\nfunction! s:SetUpOptions()\n  call s:SetUpCommands()\n  call s:SetUpCpoptions()\n  call s:SetUpCompleteopt()\n  call s:SetUpKeyMappings()\n\n  if g:ycm_show_diagnostics_ui\n    call s:TurnOffSyntasticForCFamily()\n  endif\n\n  call s:SetUpSigns()\n  call s:SetUpSyntaxHighlighting()\nendfunction\n\n\nfunction! youcompleteme#Enable()\n  call s:SetUpBackwardsCompatibility()\n\n  let completeopt = split( &completeopt, ',' )\n\n  \" Will we add 'popup' to the 'completeopt' (later)\n  let s:force_preview_popup =\n        \\ type( g:ycm_add_preview_to_completeopt ) == v:t_string &&\n          \\ g:ycm_add_preview_to_completeopt ==# 'popup' &&\n          \\ !s:is_neovim\n\n  \" Will we add 'preview' to the 'completeopt' (later)\n  let force_preview =\n        \\ type( g:ycm_add_preview_to_completeopt ) != v:t_string &&\n          \\ g:ycm_add_preview_to_completeopt\n\n  \" Will we be using the preview popup ? That is either the user set it in their\n  \" completeopt or we're going to add it later.\n  let use_preview_popup =\n        \\ s:force_preview_popup ||\n        \\ index( completeopt, 'popup' ) >= 0\n\n  \" We should only ask the server to resolve completion items upfront if we're\n  \" going to display them - that is either:\n  \"  - popup is (or will be) in completeopt\n  \"  - preview is (or will be) in completeopt, or\n  let require_resolve =\n        \\ use_preview_popup ||\n        \\ force_preview ||\n        \\ index( completeopt, 'preview' ) >= 0\n\n  if use_preview_popup && exists( '*popup_findinfo' )\n    \" If the preview popup is going to be used, and on-demand resolve can be\n    \" supported, enable it.\n    let s:resolve_completions = s:RESOLVE_ON_DEMAND\n  elseif require_resolve\n    \" The preview window or info popup is enabled - request the server\n    \" pre-resolves completion items\n    let s:resolve_completions = s:RESOLVE_UP_FRONT\n  else\n    \" Otherwise, there's no point in resolving completions - they'll never be\n    \" displayed.\n  endif\n\n  if !s:SetUpPython()\n    return\n  endif\n\n  call s:SetUpOptions()\n\n  py3 ycm_semantic_highlighting.Initialise()\n  let s:enable_inlay_hints = py3eval( 'ycm_inlay_hints.Initialise()' ) ? 1 : 0\n\n  call youcompleteme#EnableCursorMovedAutocommands()\n  augroup youcompleteme\n    autocmd!\n    \" Note that these events will NOT trigger for the file vim is started with;\n    \" so if you do \"vim foo.cc\", these events will not trigger when that buffer\n    \" is read. This is because youcompleteme#Enable() is called on VimEnter and\n    \" that happens *after* FileType has already triggered for the initial file.\n    \" We don't parse the buffer on the BufRead event since it would only be\n    \" useful if the buffer filetype is set (we ignore the buffer if there is no\n    \" filetype) and if so, the FileType event has triggered before and thus the\n    \" buffer is already parsed.\n    autocmd BufWritePost,FileWritePost * call s:OnFileSave()\n    autocmd FileType * call s:OnFileTypeSet()\n    autocmd BufEnter,CmdwinEnter,WinEnter * call s:OnBufferEnter()\n    autocmd BufUnload * call s:OnBufferUnload()\n    autocmd InsertLeave * call s:OnInsertLeave()\n    autocmd VimLeave * call s:OnVimLeave()\n    autocmd CompleteDone * call s:OnCompleteDone()\n    autocmd CompleteChanged * call s:OnCompleteChanged()\n  augroup END\n\n  \" The FileType event is not triggered for the first loaded file. We wait until\n  \" the server is ready to manually run the s:OnFileTypeSet function.\n  let s:pollers.server_ready.id = timer_start(\n        \\ s:pollers.server_ready.wait_milliseconds,\n        \\ function( 's:PollServerReady' ) )\n\n  let s:default_completion = py3eval( 'vimsupport.NO_COMPLETIONS' )\n  let s:completion = s:default_completion\n\n  if s:PropertyTypeNotDefined( 'YCM-signature-help-current-argument' )\n    hi default YCMInverse term=reverse cterm=reverse gui=reverse\n    call prop_type_add( 'YCM-signature-help-current-argument', {\n          \\   'highlight': 'YCMInverse',\n          \\   'combine':   1,\n          \\   'priority':  50,\n          \\ } )\n  endif\n\n  nnoremap <silent> <plug>(YCMFindSymbolInWorkspace)\n        \\ :call youcompleteme#finder#FindSymbol( 'workspace' )<CR>\n  nnoremap <silent> <plug>(YCMFindSymbolInDocument)\n        \\ :call youcompleteme#finder#FindSymbol( 'document' )<CR>\nendfunction\n\n\nfunction! youcompleteme#EnableCursorMovedAutocommands()\n  augroup ycmcompletemecursormove\n    autocmd!\n    autocmd CursorMoved * call s:OnCursorMovedNormalMode()\n    autocmd CursorMovedI * let s:current_cursor_position = getpos( '.' )\n    autocmd InsertEnter * call s:OnInsertEnter()\n    autocmd TextChanged * call s:OnTextChangedNormalMode()\n    autocmd TextChangedI * call s:OnTextChangedInsertMode( v:false )\n    autocmd TextChangedP * call s:OnTextChangedInsertMode( v:true )\n    autocmd InsertCharPre * call s:OnInsertChar()\n    if exists( '##WinScrolled' )\n      autocmd WinScrolled * call s:OnWinScrolled()\n    endif\n  augroup END\nendfunction\n\n\nfunction! youcompleteme#DisableCursorMovedAutocommands()\n  autocmd! ycmcompletemecursormove\nendfunction\n\n\nfunction! youcompleteme#GetErrorCount()\n  return py3eval( 'ycm_state.GetErrorCount()' )\nendfunction\n\n\nfunction! youcompleteme#GetWarningCount()\n  return py3eval( 'ycm_state.GetWarningCount()' )\nendfunction\n\n\nfunction! s:SetUpPython() abort\n  py3 << EOF\nimport os.path as p\nimport sys\nimport traceback\nimport vim\n\nroot_folder = p.normpath( p.join( vim.eval( 's:script_folder_path' ), '..' ) )\nthird_party_folder = p.join( root_folder, 'third_party' )\n\n# Add dependencies to Python path.\nsys.path[ 0:0 ] = [ p.join( root_folder, 'python' ),\n                    p.join( third_party_folder, 'ycmd' ) ]\n\n# We enclose this code in a try/except block to avoid backtraces in Vim.\ntry:\n  # Import the modules used in this file.\n  from ycm import base, vimsupport, youcompleteme\n  from ycm import semantic_highlighting as ycm_semantic_highlighting\n  from ycm import inlay_hints as ycm_inlay_hints\n\n  if 'ycm_state' in globals():\n    # If re-initializing, pretend that we shut down\n    ycm_state.OnVimLeave()\n    del ycm_state\n\n  # If we're able to resolve completion details asynchronously, set the option\n  # which enables this in the server.\n  if int( vim.eval( 's:resolve_completions == s:RESOLVE_ON_DEMAND' ) ):\n    # resolve a small number upfront, the rest on demand\n    default_options = {\n      'max_num_candidates_to_detail': 10\n    }\n  elif int( vim.eval( 's:resolve_completions == s:RESOLVE_NONE' ) ):\n    # don't resolve any\n    default_options = {\n      'max_num_candidates_to_detail': 0\n    }\n  else:\n    # i.e. s:resolve_completions == s:RESOLVE_UP_FRONT\n    # The server will decide - i.e. resolve everything upfront\n    default_options = {}\n\n  ycm_state = youcompleteme.YouCompleteMe( default_options )\nexcept Exception as error:\n  # We don't use PostVimMessage or EchoText from the vimsupport module because\n  # importing this module may fail.\n  vim.command( 'redraw | echohl WarningMsg' )\n  for line in traceback.format_exc().splitlines():\n    vim.command( \"echom '{0}'\".format( line.replace( \"'\", \"''\" ) ) )\n\n  vim.command( \"echo 'YouCompleteMe unavailable: {0}'\"\n               .format( str( error ).replace( \"'\", \"''\" ) ) )\n  vim.command( 'echohl None' )\n  vim.command( 'return 0' )\nelse:\n  vim.command( 'return 1' )\nEOF\nendfunction\n\n\nfunction! s:SetUpKeyMappings()\n  \" The g:ycm_key_select_completion and g:ycm_key_previous_completion used to\n  \" exist and are now here purely for the sake of backwards compatibility; we\n  \" don't want to break users if we can avoid it.\n\n  if exists('g:ycm_key_select_completion') &&\n        \\ index(g:ycm_key_list_select_completion,\n        \\       g:ycm_key_select_completion) == -1\n    call add(g:ycm_key_list_select_completion, g:ycm_key_select_completion)\n  endif\n\n  if exists('g:ycm_key_previous_completion') &&\n        \\ index(g:ycm_key_list_previous_completion,\n        \\       g:ycm_key_previous_completion) == -1\n    call add(g:ycm_key_list_previous_completion, g:ycm_key_previous_completion)\n  endif\n\n  for key in g:ycm_key_list_select_completion\n    \" With this command, when the completion window is visible, the tab key\n    \" (default) will select the next candidate in the window. In vim, this also\n    \" changes the typed-in text to that of the candidate completion.\n    exe 'inoremap <expr>' . key .  ' pumvisible() ? \"\\<C-n>\" : \"\\' . key .'\"'\n  endfor\n\n  for key in g:ycm_key_list_previous_completion\n    \" This selects the previous candidate for shift-tab (default)\n    exe 'inoremap <expr>' . key . ' pumvisible() ? \"\\<C-p>\" : \"\\' . key .'\"'\n  endfor\n\n  for key in g:ycm_key_list_stop_completion\n    \" When selecting a candidate and closing the completion menu with the <C-y>\n    \" key, the menu will automatically be reopened because of the TextChangedI\n    \" event. We define a command to prevent that.\n    exe 'inoremap <expr>' . key . ' <SID>StopCompletion( \"\\' . key . '\" )'\n  endfor\n\n  if !empty( g:ycm_key_invoke_completion )\n    let invoke_key = g:ycm_key_invoke_completion\n\n    \" Inside the console, <C-Space> is passed as <Nul> to Vim\n    if invoke_key ==# '<C-Space>'\n      imap <Nul> <C-Space>\n    endif\n\n    silent! exe 'inoremap <unique> <silent> ' . invoke_key .\n          \\ ' <C-R>=<SID>RequestSemanticCompletion()<CR>'\n  endif\n\n  if !empty( g:ycm_key_detailed_diagnostics )\n    silent! exe 'nnoremap <unique> ' . g:ycm_key_detailed_diagnostics .\n          \\ ' :YcmShowDetailedDiagnostic<CR>'\n  endif\nendfunction\n\n\nfunction! s:SetUpSigns()\n  \" We try to ensure backwards compatibility with Syntastic if the user has\n  \" already defined styling for Syntastic highlight groups.\n\n  if !hlexists( 'YcmErrorSign' )\n    if hlexists( 'SyntasticErrorSign')\n      highlight default link YcmErrorSign SyntasticErrorSign\n    else\n      highlight default link YcmErrorSign error\n    endif\n  endif\n\n  if !hlexists( 'YcmWarningSign' )\n    if hlexists( 'SyntasticWarningSign')\n      highlight default link YcmWarningSign SyntasticWarningSign\n    else\n      highlight default link YcmWarningSign todo\n    endif\n  endif\n\n  if !hlexists( 'YcmErrorLine' )\n    highlight default link YcmErrorLine SyntasticErrorLine\n  endif\n\n  if !hlexists( 'YcmWarningLine' )\n    highlight default link YcmWarningLine SyntasticWarningLine\n  endif\n\n  call sign_define( [\n    \\ { 'name': 'YcmError',\n    \\   'text': g:ycm_error_symbol,\n    \\   'texthl': 'YcmErrorSign',\n    \\   'linehl': 'YcmErrorLine',\n    \\   'group':  'ycm_signs' },\n    \\ { 'name': 'YcmWarning',\n    \\   'text': g:ycm_warning_symbol,\n    \\   'texthl': 'YcmWarningSign',\n    \\   'linehl': 'YcmWarningLine',\n    \\   'group':  'ycm_signs' }\n    \\ ] )\n\nendfunction\n\n\nfunction! s:SetUpSyntaxHighlighting()\n  \" We try to ensure backwards compatibility with Syntastic if the user has\n  \" already defined styling for Syntastic highlight groups.\n\n  if !hlexists( 'YcmErrorSection' )\n    if hlexists( 'SyntasticError' )\n      highlight default link YcmErrorSection SyntasticError\n    else\n      highlight default link YcmErrorSection SpellBad\n    endif\n  endif\n  if s:PropertyTypeNotDefined( 'YcmErrorProperty' )\n    call prop_type_add( 'YcmErrorProperty', {\n          \\ 'highlight': 'YcmErrorSection',\n          \\ 'priority': 30,\n          \\ 'combine': 0,\n          \\ 'override': 1 } )\n  endif\n\n  \" Used for virtual text\n  if !hlexists( 'YcmInvisible' )\n    highlight default link YcmInvisible Normal\n  endif\n  if !hlexists( 'YcmInlayHint' )\n    highlight default link YcmInlayHint NonText\n  endif\n  if !hlexists( 'YcmErrorText' )\n    if exists( '*hlget' )\n      let YcmErrorText = hlget( 'SpellBad', v:true )[ 0 ]\n      let YcmErrorText.name = 'YcmErrorText'\n      let YcmErrorText.cterm = {}\n      let YcmErrorText.gui = {}\n      let YcmErrorText.term = {}\n      call hlset( [ YcmErrorText ] )\n    else\n      \" approximation\n      hi default link YcmErrorText WarningMsg\n    endif\n  endif\n  if !hlexists( 'YcmWarningText' )\n    if exists( '*hlget' )\n      let YcmWarningText = hlget( 'SpellCap', v:true )[ 0 ]\n      let YcmWarningText.name = 'YcmWarningText'\n      let YcmWarningText.cterm = {}\n      let YcmWarningText.gui = {}\n      let YcmWarningText.term = {}\n      call hlset( [ YcmWarningText] )\n    else\n      \" Lame approximation\n      hi default link YcmWarningText Conceal\n    endif\n  endif\n\n  if s:PropertyTypeNotDefined( 'YcmVirtDiagError' )\n    call prop_type_add( 'YcmVirtDiagError', {\n          \\ 'highlight': 'YcmErrorText',\n          \\ 'priority': 20,\n          \\ 'combine': 0 } )\n  endif\n  if s:PropertyTypeNotDefined( 'YcmVirtDiagWarning' )\n    call prop_type_add( 'YcmVirtDiagWarning', {\n          \\ 'highlight': 'YcmWarningText',\n          \\ 'priority': 19,\n          \\ 'combine': 0 } )\n  endif\n\n\n  if s:PropertyTypeNotDefined( 'YcmVirtDiagPadding' )\n    call prop_type_add( 'YcmVirtDiagPadding', {\n          \\ 'highlight': 'YcmInvisible',\n          \\ 'priority': 100,\n          \\ 'combine': 1 } )\n  endif\n\n  if !hlexists( 'YcmWarningSection' )\n    if hlexists( 'SyntasticWarning' )\n      highlight default link YcmWarningSection SyntasticWarning\n    else\n      highlight default link YcmWarningSection SpellCap\n    endif\n  endif\n  if s:PropertyTypeNotDefined( 'YcmWarningProperty' )\n    call prop_type_add( 'YcmWarningProperty', {\n          \\ 'highlight': 'YcmWarningSection',\n          \\ 'priority': 29,\n          \\ 'combine': 0,\n          \\ 'override': 1 } )\n  endif\n\n  if !hlexists( 'YcmErrorPopup' )\n    highlight default link YcmErrorPopup ErrorMsg\n  endif\nendfunction\n\n\nfunction! s:SetUpBackwardsCompatibility()\n  let complete_in_comments_and_strings =\n        \\ get( g:, 'ycm_complete_in_comments_and_strings', 0 )\n\n  if complete_in_comments_and_strings\n    let g:ycm_complete_in_strings = 1\n    let g:ycm_complete_in_comments = 1\n  endif\n\n  \" ycm_filetypes_to_completely_ignore is the old name for fileype_blacklist\n  if has_key( g:, 'ycm_filetypes_to_completely_ignore' )\n    let g:filetype_blacklist =  g:ycm_filetypes_to_completely_ignore\n  endif\nendfunction\n\n\n\" Needed so that YCM is used instead of Syntastic\nfunction! s:TurnOffSyntasticForCFamily()\n  let g:syntastic_cpp_checkers = []\n  let g:syntastic_c_checkers = []\n  let g:syntastic_objc_checkers = []\n  let g:syntastic_objcpp_checkers = []\n  let g:syntastic_cuda_checkers = []\nendfunction\n\n\nfunction! s:DisableOnLargeFile( buffer )\n  if exists( 'b:ycm_largefile' )\n    return b:ycm_largefile\n  endif\n\n  let threshold = g:ycm_disable_for_files_larger_than_kb * 1024\n  let b:ycm_largefile =\n        \\ threshold > 0 && getfsize( expand( a:buffer ) ) > threshold\n  if b:ycm_largefile\n    py3 vimsupport.PostVimMessage( 'YouCompleteMe is disabled in this buffer;' +\n          \\ ' the file exceeded the max size (see YCM options).' )\n  endif\n  return b:ycm_largefile\nendfunction\n\nfunction! s:PropertyTypeNotDefined( type )\n  return exists( '*prop_type_add' ) &&\n    \\ index( prop_type_list(), a:type ) == -1\nendfunction\n\nfunction! s:AllowedToCompleteInBuffer( buffer )\n  let buftype = getbufvar( a:buffer, '&buftype' )\n\n  if has_key( s:buftype_blacklist, buftype )\n    return 0\n  endif\n\n  let filetype = getbufvar( a:buffer, '&filetype' )\n  if empty( filetype )\n    let filetype = 'ycm_nofiletype'\n  endif\n\n  let allowed = youcompleteme#filetypes#AllowedForFiletype( filetype )\n\n  if !allowed || s:DisableOnLargeFile( a:buffer )\n    return 0\n  endif\n\n  let s:previous_allowed_buffer_number = bufnr( a:buffer )\n  return allowed\nendfunction\n\n\nfunction! s:AllowedToCompleteInCurrentBuffer()\n  return s:AllowedToCompleteInBuffer( '%' )\nendfunction\n\n\nfunction! s:VisitedBufferRequiresReparse()\n  if bufnr( '%' ) ==# s:previous_allowed_buffer_number\n    return 0\n  endif\n\n  return s:AllowedToCompleteInCurrentBuffer()\nendfunction\n\n\nfunction! s:SetUpCpoptions()\n  \" Without this flag in cpoptions, critical YCM mappings do not work. There's\n  \" no way to not have this and have YCM working, so force the flag.\n  set cpoptions+=B\n\n  \" This prevents the display of \"Pattern not found\" & similar messages during\n  \" completion.\n  set shortmess+=c\nendfunction\n\n\nfunction! s:SetUpCompleteopt()\n  \" Some plugins (I'm looking at you, vim-notes) change completeopt by for\n  \" instance adding 'longest'. This breaks YCM. So we force our settings.\n  \" There's no two ways about this: if you want to use YCM then you have to\n  \" have these completeopt settings, otherwise YCM won't work at all.\n\n  \" We need menuone in completeopt, otherwise when there's only one candidate\n  \" for completion, the menu doesn't show up.\n  set completeopt-=menu\n  set completeopt+=menuone\n\n  \" This is unnecessary with our features. People use this option to insert\n  \" the common prefix of all the matches and then add more differentiating chars\n  \" so that they can select a more specific match. With our features, they\n  \" don't need to insert the prefix; they just type the differentiating chars.\n  \" Also, having this option set breaks the plugin.\n  set completeopt-=longest\n\n  if s:resolve_completions == s:RESOLVE_ON_DEMAND\n    set completeopt+=popuphidden\n  endif\n\n  if s:force_preview_popup\n    set completeopt+=popup\n  elseif g:ycm_add_preview_to_completeopt\n    set completeopt+=preview\n  endif\nendfunction\n\n\nfunction! s:EnableCompletingInCurrentBuffer()\n  if !g:ycm_auto_trigger\n    call s:SetCompleteFunc()\n  endif\n  let b:ycm_completing = 1\nendfunction\n\n\nfunction s:StopPoller( poller ) abort\n  call timer_stop( a:poller.id )\n  let a:poller.id = -1\nendfunction\n\n\nfunction! s:OnVimLeave()\n  \" Workaround a NeoVim issue - not shutting down timers correctly\n  \" https://github.com/neovim/neovim/issues/6840\n  for poller in values( s:pollers )\n    call s:StopPoller( poller )\n  endfor\n  py3 ycm_state.OnVimLeave()\nendfunction\n\n\nfunction! s:OnCompleteDone()\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return\n  endif\n\n  let s:last_char_inserted_by_user = v:false\n\n  py3 ycm_state.OnCompleteDone()\n  call s:UpdateSignatureHelp()\nendfunction\n\n\nfunction! s:OnCompleteChanged()\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return\n  endif\n\n  if ! empty( v:event.completed_item )\n    let s:last_char_inserted_by_user = v:false\n    call s:ResolveCompletionItem( v:event.completed_item )\n  endif\n\n  call s:UpdateSignatureHelp()\nendfunction\n\n\nfunction! s:ResolveCompletionItem( item )\n  if s:resolve_completions != s:RESOLVE_ON_DEMAND\n    return\n  endif\n\n  let complete_mode = complete_info( [ 'mode' ] ).mode\n  if complete_mode !=# 'eval' && complete_mode !=# 'function'\n    return\n  endif\n\n  if py3eval( 'ycm_state.ResolveCompletionItem( vim.eval( \"a:item\" ) )' )\n    call s:StopPoller( s:pollers.completion )\n    call timer_start( 0, function( 's:PollResolve', [ a:item ] ) )\n  else\n    call s:ShowInfoPopup( a:item )\n  endif\nendfunction\n\n\nfunction! s:EnableAutoHover()\n  if g:ycm_auto_hover ==# 'CursorHold' && s:enable_hover\n    augroup YcmBufHover\n      autocmd! * <buffer>\n      autocmd CursorHold <buffer> call s:Hover()\n      if exists( '##WinResized' )\n        autocmd WinResized <buffer> call popup_close( s:cursorhold_popup )\n      endif\n      if exists( '##WinScrolled' )\n        autocmd WinScrolled <buffer> call popup_close( s:cursorhold_popup )\n      endif\n    augroup END\n  endif\nendfunction\n\n\nfunction! s:DisableAutoHover()\n  augroup YcmBufHover\n    autocmd! * <buffer>\n  augroup END\nendfunction\n\n\nfunction! s:OnFileTypeSet()\n  \" The contents of the command-line window are empty when the filetype is set\n  \" for the first time. Users should never change its filetype so we only rely\n  \" on the CmdwinEnter event for that window.\n  if !empty( getcmdwintype() )\n    return\n  endif\n\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return\n  endif\n\n  call s:SetUpCompleteopt()\n  call s:EnableCompletingInCurrentBuffer()\n  call s:StartMessagePoll()\n  call s:EnableAutoHover()\n\n  py3 ycm_state.OnFileTypeSet()\n  call s:OnFileReadyToParse( 1 )\nendfunction\n\n\nfunction! s:OnFileSave()\n  let buffer_number = str2nr( expand( '<abuf>' ) )\n  if !s:AllowedToCompleteInBuffer( buffer_number )\n    return\n  endif\n  py3 ycm_state.OnFileSave( vimsupport.GetIntValue( 'buffer_number' ) )\nendfunction\n\n\nfunction! s:AbortAutohoverRequest() abort\n  if g:ycm_auto_hover ==# 'CursorHold' && s:enable_hover\n    let requests = copy( s:pollers.command.requests )\n    for request_id in keys( requests )\n      let request = requests[ request_id ]\n      if request.origin == 'autohover'\n        call remove( s:pollers.command.requests, request_id )\n        py3 ycm_state.FlushCommandRequest( int( vim.eval( \"request_id\" ) ) )\n        call request.callback( '' )\n      endif\n    endfor\n  endif\nendfunction\n\n\nfunction! s:OnBufferEnter()\n  call s:StartMessagePoll()\n  if !s:VisitedBufferRequiresReparse()\n    return\n  endif\n\n  call s:AbortAutohoverRequest()\n\n  call s:SetUpCompleteopt()\n  call s:EnableCompletingInCurrentBuffer()\n\n  py3 ycm_state.UpdateMatches()\n  py3 ycm_state.OnBufferVisit()\n  \" Last parse may be outdated because of changes from other buffers. Force a\n  \" new parse.\n  call s:OnFileReadyToParse( 1 )\nendfunction\n\n\nfunction! s:OnBufferUnload()\n  \" Expanding <abuf> returns the unloaded buffer number as a string but we want\n  \" it as a true number for the getbufvar function.\n  let buffer_number = str2nr( expand( '<abuf>' ) )\n  if !s:AllowedToCompleteInBuffer( buffer_number )\n    return\n  endif\n\n  py3 ycm_state.OnBufferUnload( vimsupport.GetIntValue( 'buffer_number' ) )\nendfunction\n\n\nfunction! s:PollServerReady( timer_id )\n  if !py3eval( 'ycm_state.IsServerAlive()' )\n    py3 ycm_state.NotifyUserIfServerCrashed()\n    \" Server crashed. Don't poll it again.\n    return\n  endif\n\n  if !py3eval( 'ycm_state.CheckIfServerIsReady()' )\n    let s:pollers.server_ready.id = timer_start(\n          \\ s:pollers.server_ready.wait_milliseconds,\n          \\ function( 's:PollServerReady' ) )\n    return\n  endif\n\n  call s:OnFileTypeSet()\nendfunction\n\n\nfunction! s:OnFileReadyToParse( ... )\n  \" Accepts an optional parameter that is either 0 or 1. If 1, send a\n  \" FileReadyToParse event notification, whether the buffer has changed or not;\n  \" effectively forcing a parse of the buffer. Default is 0.\n  let force_parsing = a:0 > 0 && a:1\n\n  \" We only want to send a new FileReadyToParse event notification if the buffer\n  \" has changed since the last time we sent one, or if forced.\n  if force_parsing || py3eval( \"ycm_state.NeedsReparse()\" )\n    \" We switched buffers or something, so clear.\n    \" FIXME: sig help should be buffer local?\n    call s:ClearSignatureHelp()\n    py3 ycm_state.OnFileReadyToParse()\n\n    call s:StopPoller( s:pollers.file_parse_response )\n    let s:pollers.file_parse_response.id = timer_start(\n          \\ s:pollers.file_parse_response.wait_milliseconds,\n          \\ function( 's:PollFileParseResponse' ) )\n\n    call s:UpdateSemanticHighlighting( bufnr(), 1, 0 )\n    call s:UpdateInlayHints( bufnr(), 1, 0 )\n\n  endif\nendfunction\n\nfunction! s:UpdateSemanticHighlighting( bufnr, force, redraw_anyway ) abort\n  call s:StopPoller( s:pollers.semantic_highlighting )\n  if !s:is_neovim &&\n        \\ get( b:, 'ycm_enable_semantic_highlighting',\n        \\   get( g:, 'ycm_enable_semantic_highlighting', 0 ) )\n\n    if py3eval(\n        \\ 'ycm_state.Buffer( int( vim.eval( \"a:bufnr\" ) ) ).'\n        \\ . 'semantic_highlighting.Request( '\n        \\ . '  force=int( vim.eval( \"a:force\" ) ) )' )\n      let s:pollers.semantic_highlighting.id = timer_start(\n            \\ s:pollers.semantic_highlighting.wait_milliseconds,\n            \\ function( 's:PollSemanticHighlighting', [ a:bufnr ] ) )\n    elseif a:redraw_anyway\n      py3 ycm_state.Buffer(\n            \\ int( vim.eval( \"a:bufnr\" ) ) ).semantic_highlighting.Refresh()\n    endif\n  endif\nendfunction\n\n\nfunction s:ShouldUseInlayHintsNow( bufnr )\n  return s:enable_inlay_hints &&\n        \\ getbufvar( a:bufnr, 'ycm_enable_inlay_hints',\n        \\   get( g:, 'ycm_enable_inlay_hints', 0 ) )\nendfunction\n\nfunction! s:UpdateInlayHints( bufnr, force, redraw_anyway ) abort\n  call s:StopPoller( s:pollers.inlay_hints )\n\n  if s:ShouldUseInlayHintsNow( a:bufnr )\n    if py3eval(\n        \\ 'ycm_state.Buffer( int( vim.eval( \"a:bufnr\" ) ) ).'\n        \\ . 'inlay_hints.Request( force=int( vim.eval( \"a:force\" ) ) )' )\n      let s:pollers.inlay_hints.id = timer_start(\n            \\ s:pollers.inlay_hints.wait_milliseconds,\n            \\ function( 's:PollInlayHints', [ a:bufnr ] ) )\n    elseif a:redraw_anyway\n      py3 ycm_state.Buffer( int( vim.eval( \"a:bufnr\" ) ) ).inlay_hints.Refresh()\n    endif\n\n  endif\nendfunction\n\n\nfunction! s:PollFileParseResponse( ... )\n  if !py3eval( \"ycm_state.FileParseRequestReady()\" )\n    let s:pollers.file_parse_response.id = timer_start(\n          \\ s:pollers.file_parse_response.wait_milliseconds,\n          \\ function( 's:PollFileParseResponse' ) )\n    return\n  endif\n\n  py3 ycm_state.HandleFileParseRequest()\n  if py3eval( \"ycm_state.ShouldResendFileParseRequest()\" )\n    call s:OnFileReadyToParse( 1 )\n  endif\nendfunction\n\n\nfunction! s:PollSemanticHighlighting( bufnr, ... ) abort\n  return s:PollScrollable( a:bufnr, 'semantic_highlighting' )\nendfunction\n\n\nfunction! s:PollInlayHints( bufnr, ... ) abort\n  return s:PollScrollable( a:bufnr, 'inlay_hints' )\nendfunction\n\n\nfunction! s:PollScrollable( bufnr, scrollable, ... ) abort\n  if !py3eval(\n      \\ 'ycm_state.Buffer( int( vim.eval( \"a:bufnr\" ) ) )'\n      \\ . '.' . a:scrollable . '.Ready()' )\n    let s:pollers[a:scrollable].id = timer_start(\n          \\ s:pollers[a:scrollable].wait_milliseconds,\n          \\ function( 's:PollScrollable', [ a:bufnr, a:scrollable ] ) )\n  elseif ! py3eval(\n      \\ 'ycm_state.Buffer( int( vim.eval( \"a:bufnr\" ) ) )'\n      \\ . '.' . a:scrollable . '.Update()' )\n    let s:pollers[ a:scrollable ].id = timer_start(\n          \\ s:pollers[ a:scrollable ].wait_milliseconds,\n          \\ function( 's:PollScrollable', [ a:bufnr, a:scrollable ] ) )\n  endif\nendfunction\n\n\n\nfunction! s:SendKeys( keys )\n  \" By default keys are added to the end of the typeahead buffer. If there are\n  \" already keys in the buffer, they will be processed first and may change\n  \" the state that our keys combination was sent for (e.g. <C-X><C-U><C-P> in\n  \" normal mode instead of insert mode or <C-e> outside of completion mode).\n  \" We avoid that by inserting the keys at the start of the typeahead buffer\n  \" with the 'i' option. Also, we don't want the keys to be remapped to\n  \" something else so we add the 'n' option.\n  call feedkeys( a:keys, 'in' )\nendfunction\n\n\nfunction! s:CloseCompletionMenu()\n  if pumvisible()\n    call s:SendKeys( \"\\<C-e>\" )\n  endif\nendfunction\n\n\nfunction! s:OnInsertChar()\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return\n  endif\n\n  let s:last_char_inserted_by_user = v:true\nendfunction\n\n\nfunction! s:StopCompletion( key )\n  call s:StopPoller( s:pollers.completion )\n\n  call s:ClearSignatureHelp()\n\n  if pumvisible()\n    let s:completion_stopped = 1\n    return \"\\<C-y>\"\n  endif\n  return a:key\nendfunction\n\n\nfunction! s:OnCursorMovedNormalMode()\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return\n  endif\n\n  call s:AbortAutohoverRequest()\n\n  py3 ycm_state.OnCursorMoved()\nendfunction\n\n\nfunction! s:OnWinScrolled()\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return\n  endif\n  let bufnr = winbufnr( expand( '<afile>' ) )\n  call s:UpdateSemanticHighlighting( bufnr, 0, 0 )\n  call s:UpdateInlayHints( bufnr, 0, 0 )\nendfunction\n\n\nfunction! s:OnTextChangedNormalMode()\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return\n  endif\n\n  call s:OnFileReadyToParse()\nendfunction\n\n\nfunction! s:OnTextChangedInsertMode( popup_is_visible )\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return\n  endif\n\n  if a:popup_is_visible && !s:last_char_inserted_by_user\n    \" If the last \"input\" wasn't from a user typing (i.e. didn't come from\n    \" InsertCharPre, then ignore this change in the text. This prevents ctrl-n\n    \" or tab from causing us to re-filter the list based on the now-selected\n    \" item.\n    return\n  endif\n\n  let s:current_cursor_position = getpos( '.' )\n  if s:completion_stopped\n    let s:completion_stopped = 0\n    let s:completion = s:default_completion\n    return\n  endif\n\n  call s:IdentifierFinishedOperations()\n\n  \" We have to make sure we correctly leave semantic mode even when the user\n  \" inserts something like a \"operator[]\" candidate string which fails\n  \" CurrentIdentifierFinished check.\n  if s:force_semantic && !py3eval( 'base.LastEnteredCharIsIdentifierChar()' )\n    let s:force_semantic = 0\n    let s:force_manual = 0\n  endif\n\n  if get( b:, 'ycm_completing' ) &&\n        \\ ( g:ycm_auto_trigger || s:force_semantic || s:force_manual ) &&\n        \\ !s:InsideCommentOrStringAndShouldStop() &&\n        \\ !s:OnBlankLine()\n    call s:RequestCompletion()\n    call s:RequestSignatureHelp()\n  endif\n\n  py3 ycm_state.OnCursorMoved()\n\n  if g:ycm_autoclose_preview_window_after_completion\n    call s:ClosePreviewWindowIfNeeded()\n  endif\nendfunction\n\n\nfunction! s:OnInsertEnter() abort\n  let s:current_cursor_position = getpos( '.' )\n  py3 ycm_state.OnInsertEnter()\n  if s:ShouldUseInlayHintsNow( bufnr() ) &&\n        \\ get(g:, 'ycm_clear_inlay_hints_in_insert_mode' )\n    py3 ycm_state.CurrentBuffer().inlay_hints.Clear()\n  endif\nendfunction\n\nfunction! s:OnInsertLeave()\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return\n  endif\n\n  let s:last_char_inserted_by_user = v:false\n\n  call s:StopPoller( s:pollers.completion )\n  let s:force_semantic = 0\n  let s:force_manual = 0\n  let s:completion = s:default_completion\n\n  call s:OnFileReadyToParse()\n  py3 ycm_state.OnInsertLeave()\n  if g:ycm_autoclose_preview_window_after_completion ||\n        \\ g:ycm_autoclose_preview_window_after_insertion\n    call s:ClosePreviewWindowIfNeeded()\n  endif\n\n  call s:ClearSignatureHelp()\n  if s:ShouldUseInlayHintsNow( bufnr() )\n        \\ && get( g:, 'ycm_clear_inlay_hints_in_insert_mode' )\n    \" We cleared inlay hints on insert enter\n    py3 ycm_state.CurrentBuffer().inlay_hints.Refresh()\n  endif\nendfunction\n\n\nfunction! s:ClosePreviewWindowIfNeeded()\n  let current_buffer_name = bufname('')\n\n  \" We don't want to try to close the preview window in special buffers like\n  \" \"[Command Line]\"; if we do, Vim goes bonkers. Special buffers always start\n  \" with '['.\n  if current_buffer_name[ 0 ] == '['\n    return\n  endif\n\n  \" This command does the actual closing of the preview window. If no preview\n  \" window is shown, nothing happens.\n  pclose\nendfunction\n\n\nfunction! s:IdentifierFinishedOperations()\n  if !py3eval( 'base.CurrentIdentifierFinished()' )\n    return\n  endif\n  py3 ycm_state.OnCurrentIdentifierFinished()\n  let s:force_semantic = 0\n  let s:force_manual = 0\n  let s:completion = s:default_completion\nendfunction\n\n\n\" Returns 1 when inside comment and 2 when inside string\nfunction! s:InsideCommentOrString()\n  \" Has to be col('.') -1 because col('.') doesn't exist at this point. We are\n  \" in insert mode when this func is called.\n  let syntax_group = synIDattr(\n        \\ synIDtrans( synID( line( '.' ), col( '.' ) - 1, 1 ) ), 'name')\n\n  if stridx(syntax_group, 'Comment') > -1\n    return 1\n  endif\n\n  if stridx(syntax_group, 'String') > -1\n    return 2\n  endif\n\n  return 0\nendfunction\n\n\nfunction! s:InsideCommentOrStringAndShouldStop()\n  let retval = s:InsideCommentOrString()\n  let inside_comment = retval == 1\n  let inside_string = retval == 2\n\n  if inside_comment && g:ycm_complete_in_comments ||\n        \\ inside_string && g:ycm_complete_in_strings\n    return 0\n  endif\n\n  return retval\nendfunction\n\n\nfunction! s:OnBlankLine()\n  return py3eval( 'not vim.current.line or vim.current.line.isspace()' )\nendfunction\n\n\nfunction! s:RequestCompletion()\n  call s:StopPoller( s:pollers.completion )\n\n  py3 ycm_state.SendCompletionRequest(\n        \\ vimsupport.GetBoolValue( 's:force_semantic' ) )\n\n  if py3eval( 'ycm_state.CompletionRequestReady()' )\n    \" We can't call complete() synchronously in the TextChangedI/TextChangedP\n    \" autocommands (it's designed to be used async only completion). The result\n    \" (somewhat oddly) is that the completion menu is shown, but ctrl-n doesn't\n    \" actually select anything.\n    \" When the request is satisfied synchronously (e.g. the omnicompleter), we\n    \" must return to the main loop before triggering completion, so we use a 0ms\n    \" timer for that.\n    let s:pollers.completion.id = timer_start( 0,\n                                             \\ function( 's:PollCompletion' ) )\n  else\n    \" Otherwise, use our usual poll timeout\n    call s:PollCompletion()\n  endif\nendfunction\n\nfunction! s:ManuallyRequestCompletion() abort\n  \" Since this function is called in a mapping through the expression register\n  \" <C-R>=, its return value is inserted (see :h c_CTRL-R_=). We don't want to\n  \" insert anything so we return an empty string.\n\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return ''\n  endif\n\n  if get( b:, 'ycm_completing' )\n    let s:force_manual = 0\n    call s:RequestCompletion()\n    call s:RequestSignatureHelp()\n  endif\n\n  return ''\nendfunction\n\nfunction! s:SetCompleteFunc()\n   let &completefunc = 'youcompleteme#CompleteFunc'\nendfunction\n\nfunction! youcompleteme#CompleteFunc( findstart, base ) abort\n  call s:ManuallyRequestCompletion()\n  \" Cancel, but silently stay in completion mode.\n  return -2\nendfunction\n\ninoremap <silent> <plug>(YCMComplete) <C-r>=<SID>ManuallyRequestCompletion()<CR>\n\nfunction! s:RequestSemanticCompletion() abort\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return ''\n  endif\n\n  if get( b:, 'ycm_completing' )\n    let s:force_semantic = 1\n    let s:current_cursor_position = getpos( '.' )\n    call s:StopPoller( s:pollers.completion )\n    py3 ycm_state.SendCompletionRequest( True )\n\n    if py3eval( 'ycm_state.CompletionRequestReady()' )\n      \" We can't call complete() synchronously in the TextChangedI/TextChangedP\n      \" autocommands (it's designed to be used async only completion). The\n      \" result (somewhat oddly) is that the completion menu is shown, but ctrl-n\n      \" doesn't actually select anything.  When the request is satisfied\n      \" synchronously (e.g. the omnicompleter), we must return to the main loop\n      \" before triggering completion, so we use a 0ms timer for that.\n      let s:pollers.completion.id = timer_start(\n            \\ 0,\n            \\ function( 's:PollCompletion' ) )\n    else\n      \" Otherwise, use our usual poll timeout\n      call s:PollCompletion()\n    endif\n  endif\n\n  \" Since this function is called in a mapping through the expression register\n  \" <C-R>=, its return value is inserted (see :h c_CTRL-R_=). We don't want to\n  \" insert anything so we return an empty string.\n  return ''\nendfunction\n\n\nfunction! s:PollCompletion( ... )\n  if !py3eval( 'ycm_state.CompletionRequestReady()' )\n    let s:pollers.completion.id = timer_start(\n          \\ s:pollers.completion.wait_milliseconds,\n          \\ function( 's:PollCompletion' ) )\n    return\n  endif\n\n  let s:completion = py3eval( 'ycm_state.GetCompletionResponse()' )\n  if s:current_cursor_position == getpos( '.' )\n    call s:Complete()\n  endif\nendfunction\n\n\nfunction! s:PollResolve( item, ... )\n  if !py3eval( 'ycm_state.CompletionRequestReady()' )\n    let s:pollers.completion.id = timer_start(\n          \\ s:pollers.completion.wait_milliseconds,\n          \\ function( 's:PollResolve', [ a:item ] ) )\n    return\n  endif\n\n  \" Note we re-use the 'completion' request for resolves. This prevents us\n  \" sending a completion request and a resolve request at the same time, as\n  \" resolve requests re-use the request data from the last completion request\n  \" and it must not change.\n  \" We also re-use the poller, so that any new completion request effectively\n  \" cancels this poller.\n  let completion_item =\n        \\ py3eval( 'ycm_state.GetCompletionResponse()[ \"completion\" ]' )\n  if empty( completion_item ) || empty( completion_item.info )\n    return\n  endif\n\n  call s:ShowInfoPopup( completion_item )\nendfunction\n\nfunction! s:ShowInfoPopup( completion_item )\n  let id = popup_findinfo()\n  if id\n    call popup_settext( id, split( a:completion_item.info, '\\n' ) )\n    call popup_show( id )\n  endif\nendfunction\n\n\nfunction! s:ShouldUseSignatureHelp()\n  return py3eval( 'vimsupport.VimSupportsPopupWindows()' )\nendfunction\n\n\nfunction! s:RequestSignatureHelp()\n  if !s:ShouldUseSignatureHelp()\n    return\n  endif\n\n  call s:StopPoller( s:pollers.signature_help )\n\n  if py3eval( 'ycm_state.SendSignatureHelpRequest()' )\n    call s:PollSignatureHelp()\n  endif\nendfunction\n\n\nfunction! s:PollSignatureHelp( ... )\n  if !s:ShouldUseSignatureHelp()\n    return\n  endif\n\n  if a:0 == 0 && s:pollers.signature_help.id >= 0\n    \" OK this is a bug. We have tried to poll for a response while the timer is\n    \" already running. Just return and wait for the timer to fire.\n    return\n  endif\n\n  if !py3eval( 'ycm_state.SignatureHelpRequestReady()' )\n    let s:pollers.signature_help.id = timer_start(\n          \\ s:pollers.signature_help.wait_milliseconds,\n          \\ function( 's:PollSignatureHelp' ) )\n    return\n  endif\n\n  let s:signature_help = py3eval( 'ycm_state.GetSignatureHelpResponse()' )\n  call s:UpdateSignatureHelp()\nendfunction\n\nfunction! s:Complete()\n  \" It's possible for us to be called (by our timer) when we're not _strictly_\n  \" in insert mode. This can happen when mode is temporarily switched, e.g.\n  \" due to Ctrl-r or Ctrl-o or a timer or something. If we're not in insert\n  \" mode _now_ do nothing (FIXME: or should we queue a timer ?)\n  if count( [ 'i', 'R' ], mode() ) == 0\n    return\n  endif\n\n  if s:completion.line != line( '.' )\n    \" Given\n    \"   scb: column where the completion starts before auto-wrapping\n    \"   cb: cursor column before auto-wrapping\n    \"   sca: column where the completion starts after auto-wrapping\n    \"   ca: cursor column after auto-wrapping\n    \" we have\n    \"   ca - sca = cb - scb\n    \"   sca = scb + ca - cb\n    let s:completion.completion_start_column +=\n          \\ col( '.' ) - s:completion.column\n  endif\n  if len( s:completion.completions )\n    let old_completeopt = &completeopt\n    setlocal completeopt+=noselect\n    call complete( s:completion.completion_start_column,\n                 \\ s:completion.completions )\n    let &completeopt = old_completeopt\n  elseif pumvisible()\n    call s:CloseCompletionMenu()\n  endif\nendfunction\n\nfunction! s:UpdateSignatureHelp()\n  if !s:ShouldUseSignatureHelp()\n    return\n  endif\n\n  call py3eval(\n        \\ 'ycm_state.UpdateSignatureHelp( vim.eval( \"s:signature_help\" ) )' )\nendfunction\n\n\nfunction! s:ClearSignatureHelp()\n  if !s:ShouldUseSignatureHelp()\n    return\n  endif\n\n  call s:StopPoller( s:pollers.signature_help )\n  let s:signature_help = s:default_signature_help\n  call py3eval( 'ycm_state.ClearSignatureHelp()' )\nendfunction\n\n\nfunction! youcompleteme#ServerPid()\n  return py3eval( 'ycm_state.ServerPid()' )\nendfunction\n\n\nfunction! s:SetUpCommands()\n  command! YcmRestartServer call s:RestartServer()\n  command! YcmDebugInfo call s:DebugInfo()\n  command! -nargs=* -complete=custom,youcompleteme#LogsComplete -count=0\n        \\ YcmToggleLogs call s:ToggleLogs( <f-count>,\n                                         \\ <f-mods>,\n                                         \\ <f-args>)\n  command! -nargs=* -complete=custom,youcompleteme#SubCommandsComplete -range\n        \\ YcmCompleter call s:CompleterCommand(<q-mods>,\n        \\                                      <count>,\n        \\                                      <line1>,\n        \\                                      <line2>,\n        \\                                      <f-args>)\n  command! YcmDiags call s:ShowDiagnostics()\n  command! -nargs=? YcmShowDetailedDiagnostic\n        \\ call s:ShowDetailedDiagnostic( <f-args> )\n  command! YcmForceCompileAndDiagnostics call s:ForceCompileAndDiagnostics()\nendfunction\n\n\nfunction! s:RestartServer()\n  call s:SetUpOptions()\n\n  py3 ycm_state.RestartServer()\n\n  call s:StopPoller( s:pollers.receive_messages )\n  call s:StopPoller( s:pollers.command )\n  call s:ClearSignatureHelp()\n\n  call s:StopPoller( s:pollers.server_ready )\n  let s:pollers.server_ready.id = timer_start(\n        \\ s:pollers.server_ready.wait_milliseconds,\n        \\ function( 's:PollServerReady' ) )\nendfunction\n\n\nfunction! s:DebugInfo()\n  echom \"Printing YouCompleteMe debug information...\"\n  let debug_info = py3eval( 'ycm_state.DebugInfo()' )\n  echom '-- Resolve completions:'\n        \\ ( s:resolve_completions == s:RESOLVE_ON_DEMAND ? 'On demand' :\n        \\      s:resolve_completions == s:RESOLVE_UP_FRONT ? 'Up front' :\n        \\       'Never' )\n  for line in split( debug_info, \"\\n\" )\n    echom '-- ' . line\n  endfor\nendfunction\n\n\nfunction! s:ToggleLogs( count, ... )\n  py3 ycm_state.ToggleLogs( vimsupport.GetIntValue( 'a:count' ),\n                          \\ *vim.eval( 'a:000' ) )\nendfunction\n\n\nfunction! youcompleteme#LogsComplete( arglead, cmdline, cursorpos )\n  return join( py3eval( 'list( ycm_state.GetLogfiles() )' ), \"\\n\" )\nendfunction\n\n\nfunction! youcompleteme#GetCommandResponse( ... ) abort\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return ''\n  endif\n\n  if !get( b:, 'ycm_completing' )\n    return ''\n  endif\n\n  return py3eval( 'ycm_state.GetCommandResponse( vim.eval( \"a:000\" ) )' )\nendfunction\n\n\nfunction! s:GetCommandResponseAsyncImpl( callback, origin, ... ) abort\n  let request_id = py3eval(\n        \\ 'ycm_state.SendCommandRequestAsync( vim.eval( \"a:000\" ) )' )\n\n  let s:pollers.command.requests[ request_id ] = {\n        \\ 'response_func': 'StringResponse',\n        \\ 'origin': a:origin,\n        \\ 'callback': a:callback\n        \\ }\n  if s:pollers.command.id == -1\n    let s:pollers.command.id = timer_start( s:pollers.command.wait_milliseconds,\n                                          \\ function( 's:PollCommands' ) )\n  endif\nendfunction\n\n\nfunction! youcompleteme#GetCommandResponseAsync( callback, ... ) abort\n  if !s:AllowedToCompleteInCurrentBuffer()\n    eval a:callback( '' )\n    return\n  endif\n\n  if !get( b:, 'ycm_completing' )\n    eval a:callback( '' )\n    return\n  endif\n\n  call s:GetCommandResponseAsyncImpl( callback, 'extern', a:000 )\nendfunction\n\n\nfunction! youcompleteme#GetRawCommandResponseAsync( callback, ... ) abort\n  if !s:AllowedToCompleteInCurrentBuffer()\n    eval a:callback( { 'error': 'ycm not allowed in buffer' } )\n    return\n  endif\n\n  if !get( b:, 'ycm_completing' )\n    eval a:callback( { 'error': 'ycm disabled in buffer' } )\n    return\n  endif\n\n  let request_id = py3eval(\n        \\ 'ycm_state.SendCommandRequestAsync( vim.eval( \"a:000\" ) )' )\n\n  let s:pollers.command.requests[ request_id ] = {\n        \\ 'response_func': 'Response',\n        \\ 'origin': 'extern_raw',\n        \\ 'callback': a:callback\n        \\ }\n  if s:pollers.command.id == -1\n    let s:pollers.command.id = timer_start( s:pollers.command.wait_milliseconds,\n                                          \\ function( 's:PollCommands' ) )\n  endif\nendfunction\n\n\nfunction! s:PollCommands( timer_id ) abort\n  \" Clear the timer id before calling the callback, as the callback might fire\n  \" more requests\n  call s:StopPoller( s:pollers.command )\n\n  \" Must copy the requests because this loop is likely to modify it\n  let requests = copy( s:pollers.command.requests )\n  let poll_again = 0\n  for request_id in keys( requests )\n    let request = requests[ request_id ]\n    if py3eval( 'ycm_state.GetCommandRequest( int( vim.eval( \"request_id\" ) ) )'\n              \\ . 'is None' )\n      \" Possible in case of race conditions and things like RestartServer\n      \" But particularly in the tests\n      let result = v:none\n    elseif !py3eval( 'ycm_state.GetCommandRequest( '\n                   \\ . 'int( vim.eval( \"request_id\" ) ) ).Done()' )\n      \" Not ready yet, poll again and skip this one for now\n      let poll_again = 1\n      continue\n    else\n      let result = py3eval( 'ycm_state.GetCommandRequest( '\n                          \\ . 'int( vim.eval( \"request_id\" ) ) ).'\n                          \\ . request.response_func\n                          \\ . '()' )\n    endif\n\n    \" This request is done\n    call remove( s:pollers.command.requests, request_id )\n    py3 ycm_state.FlushCommandRequest( int( vim.eval( \"request_id\" ) ) )\n    call request[ 'callback' ]( result )\n  endfor\n\n  if poll_again && s:pollers.command.id == -1\n    let s:pollers.command.id = timer_start( s:pollers.command.wait_milliseconds,\n                                          \\ function( 's:PollCommands' ) )\n  endif\nendfunction\n\n\nfunction! s:CompleterCommand( mods, count, line1, line2, ... )\n  py3 ycm_state.SendCommandRequest(\n        \\ vim.eval( 'a:000' ),\n        \\ vim.eval( 'a:mods' ),\n        \\ vimsupport.GetBoolValue( 'a:count != -1' ),\n        \\ vimsupport.GetIntValue( 'a:line1' ),\n        \\ vimsupport.GetIntValue( 'a:line2' ) )\nendfunction\n\n\nfunction! youcompleteme#SubCommandsComplete( arglead, cmdline, cursorpos )\n  return join( py3eval( 'ycm_state.GetDefinedSubcommands()' ), \"\\n\" )\nendfunction\n\n\nfunction! youcompleteme#GetDefinedSubcommands()\n  if !s:AllowedToCompleteInCurrentBuffer()\n    return []\n  endif\n\n  if !exists( 'b:ycm_completing' )\n    return []\n  endif\n\n  return py3eval( 'ycm_state.GetDefinedSubcommands()' )\nendfunction\n\n\nfunction! youcompleteme#OpenGoToList()\n  py3 vimsupport.PostVimMessage(\n        \\ \"'WARNING: youcompleteme#OpenGoToList function is deprecated. \" .\n        \\ \"Do NOT use it.'\" )\n  py3 vimsupport.OpenQuickFixList( True, True )\nendfunction\n\n\nfunction! s:ShowDiagnostics()\n  py3 ycm_state.ShowDiagnostics()\nendfunction\n\n\nfunction! s:ShowDetailedDiagnostic( ... )\n  if ( a:0 && a:1 == 'popup' )\n        \\ || get( g:, 'ycm_show_detailed_diag_in_popup', 0 )\n    py3 ycm_state.ShowDetailedDiagnostic( True )\n  else\n    py3 ycm_state.ShowDetailedDiagnostic( False )\n  endif\nendfunction\n\n\nfunction! s:ForceCompileAndDiagnostics()\n  py3 ycm_state.ForceCompileAndDiagnostics()\nendfunction\n\n\nif exists( '*popup_atcursor' )\n  function s:Hover()\n    if !py3eval( 'ycm_state.NativeFiletypeCompletionUsable()' )\n      \" Cancel the autocommand if it happens to have been set\n      call s:DisableAutoHover()\n      return\n    endif\n\n    if !has_key( b:, 'ycm_hover' )\n      let cmds = youcompleteme#GetDefinedSubcommands()\n      if index( cmds, 'GetHover' ) >= 0\n        let b:ycm_hover = {\n              \\ 'command': 'GetHover',\n              \\ 'syntax': 'markdown',\n              \\ }\n      elseif index( cmds, 'GetDoc' ) >= 0\n        let b:ycm_hover = {\n              \\ 'command': 'GetDoc',\n              \\ 'syntax': '',\n              \\ }\n      elseif index( cmds, 'GetType' ) >= 0\n        let b:ycm_hover = {\n              \\ 'command': 'GetType',\n              \\ 'syntax': &syntax,\n              \\ }\n      else\n        let b:ycm_hover = {}\n      endif\n    endif\n\n    if empty( b:ycm_hover )\n      return\n    endif\n\n    if empty( popup_getpos( s:cursorhold_popup ) )\n      call s:GetCommandResponseAsyncImpl(\n            \\ function( 's:ShowHoverResult' ),\n            \\ 'autohover',\n            \\ b:ycm_hover.command )\n    endif\n  endfunction\n\n\n  function! s:ShowHoverResult( response )\n    call popup_hide( s:cursorhold_popup )\n\n    if empty( a:response ) || !exists( 'b:ycm_hover' )\n      return\n    endif\n\n    \" Try to position the popup at the cursor, but avoid wrapping. If the\n    \" longest line is > screen width (&columns), then we just have to wrap, and\n    \" place the popup at the leftmost column.\n    \"\n    \" Find the longest line (FIXME: probably doesn't work well for multi-byte)\n    let lines = split( a:response, \"\\n\" )\n    let len = max( map( copy( lines ), \"len( v:val )\" ) )\n\n    let wrap = 0\n    let col = 'cursor'\n\n    \" max width is screen columns minus x padding (2)\n    if len >= (&columns - 2)\n      \" There's at least one line > our max - enable word wrap and draw the\n      \" popup at the leftmost column\n      let col = 1\n      let wrap = 1\n    endif\n\n    let popup_params = {\n          \\ 'col': col,\n          \\ 'wrap': wrap,\n          \\ 'padding': [ 0, 1, 0, 1 ],\n          \\ 'moved': 'word',\n          \\ 'maxwidth': &columns,\n          \\ 'close': 'click',\n          \\ 'fixed': 0,\n          \\ }\n\n    if has_key( b:ycm_hover, 'popup_params' )\n      let popup_params = extend( copy( popup_params ),\n                               \\ b:ycm_hover.popup_params )\n    endif\n\n    let s:cursorhold_popup = popup_atcursor( lines, popup_params )\n    call setbufvar( winbufnr( s:cursorhold_popup ),\n                            \\ '&syntax',\n                            \\ b:ycm_hover.syntax )\n  endfunction\n\n\n  function! s:ToggleHover()\n    let pos = popup_getpos( s:cursorhold_popup )\n    if !empty( pos ) && pos.visible\n      call popup_hide( s:cursorhold_popup )\n      let s:cursorhold_popup = -1\n\n      \" Disable the auto-trigger until the next cursor movement.\n      call s:DisableAutoHover()\n      augroup YCMHover\n        autocmd! CursorMoved <buffer>\n        autocmd CursorMoved <buffer> call s:EnableAutoHover()\n      augroup END\n    else\n      call s:Hover()\n    endif\n  endfunction\n\n  let s:enable_hover = 1\n  nnoremap <silent> <plug>(YCMHover) :<C-u>call <SID>ToggleHover()<CR>\nelse\n  \" Don't break people's mappings if this feature is disabled, just do nothing.\n  nnoremap <silent> <plug>(YCMHover) <Nop>\nendif\n\nfunction! youcompleteme#Test_GetPollers()\n  return s:pollers\nendfunction\n\nfunction! s:ToggleSignatureHelp()\n  call py3eval( 'ycm_state.ToggleSignatureHelp()' )\n  \" Because we do this in a insert-mode mapping, we return empty string to\n  \" insert/type nothing\n  return ''\nendfunction\n\nsilent! inoremap <silent> <plug>(YCMToggleSignatureHelp)\n      \\ <C-r>=<SID>ToggleSignatureHelp()<CR>\n\nfunction! s:ToggleInlayHints()\n  let b:ycm_enable_inlay_hints =\n        \\ !get( b:,\n        \\       'ycm_enable_inlay_hints',\n        \\       get( g:, 'ycm_enable_inlay_hints' ) )\n\n  if !b:ycm_enable_inlay_hints && s:enable_inlay_hints\n    py3 ycm_state.CurrentBuffer().inlay_hints.Clear()\n  else\n    call s:UpdateInlayHints( bufnr(), 0, 1 )\n  endif\nendfunction\n\nsilent! nnoremap <silent> <plug>(YCMToggleInlayHints)\n      \\ <cmd>call <SID>ToggleInlayHints()<CR>\n\nsilent! nnoremap <silent> <plug>(YCMTypeHierarchy)\n      \\ <cmd>call youcompleteme#hierarchy#StartRequest( 'type' )<cr>\nsilent! nnoremap <silent> <plug>(YCMCallHierarchy)\n      \\ <cmd>call youcompleteme#hierarchy#StartRequest( 'call' )<cr>\n\n\" This is basic vim plugin boilerplate\nlet &cpo = s:save_cpo\nunlet s:save_cpo\n"
  },
  {
    "path": "codecov.yml",
    "content": "codecov:\n  notify:\n    require_ci_to_pass: yes\n\ncoverage:\n  precision: 2\n  round: down\n  range: 70...100\n\n  status:\n    # Learn more at https://codecov.io/docs#yaml_default_commit_status\n    project: true\n    patch: true\n    changes: true\n\n  # We don't want statistics for the tests themselves.\n  ignore:\n  - .*/tests/.*\n\ncomment:\n  layout: \"header, diff, changes, uncovered\"\n  behavior: default  # update if exists else create new\n"
  },
  {
    "path": "doc/youcompleteme.txt",
    "content": "*youcompleteme*  YouCompleteMe: a code-completion engine for Vim\n\n===============================================================================\nContents ~\n\n 1. Introduction                                   |youcompleteme-introduction|\n  1. Help, Advice, Support                  |youcompleteme-help-advice-support|\n 2. Vundle                                               |youcompleteme-vundle|\n  1. Contents                                          |youcompleteme-contents|\n  2. Intro                                                |youcompleteme-intro|\n  3. Installation                                  |youcompleteme-installation|\n   1. Requirements                                 |youcompleteme-requirements|\n    1. Supported Vim Versions            |youcompleteme-supported-vim-versions|\n    2. Supported Python runtime        |youcompleteme-supported-python-runtime|\n    3. Supported Compilers                  |youcompleteme-supported-compilers|\n    4. Individual completer requirements |youcompleteme-individual-completer-requirements|\n   2. macOS                                               |youcompleteme-macos|\n    1. Quick start, installing all completers |youcompleteme-quick-start-installing-all-completers|\n    2. Explanation for the quick start |youcompleteme-explanation-for-quick-start|\n   3. Linux 64-bit                                 |youcompleteme-linux-64-bit|\n    1. Quick start, installing all completers\n    2. Explanation for the quick start\n   4. Windows                                           |youcompleteme-windows|\n    1. Quick start, installing all completers\n    2. Explanation for the quick start\n   5. Full Installation Guide           |youcompleteme-full-installation-guide|\n  4. Quick Feature Summary                |youcompleteme-quick-feature-summary|\n   1. General (all languages)                           |youcompleteme-general|\n   2. C-family languages (C, C++, Objective C, Objective C++, CUDA) |youcompleteme-c-family-languages|\n   3. C♯                                                      |youcompleteme-c|\n   4. Python                                             |youcompleteme-python|\n   5. Go                                                     |youcompleteme-go|\n   6. JavaScript and TypeScript           |youcompleteme-javascript-typescript|\n   7. Rust                                                 |youcompleteme-rust|\n   8. Java                                                 |youcompleteme-java|\n  5. User Guide                                      |youcompleteme-user-guide|\n   1. General Usage                               |youcompleteme-general-usage|\n   2. Client-Server Architecture     |youcompleteme-client-server-architecture|\n   3. Completion String Ranking       |youcompleteme-completion-string-ranking|\n   4. Signature Help                             |youcompleteme-signature-help|\n    1. Dismiss signature help            |youcompleteme-dismiss-signature-help|\n   5. Semantic highlighting               |youcompleteme-semantic-highlighting|\n    1. Customising the highlight groups |youcompleteme-customising-highlight-groups|\n  6. Inlay hints                                    |youcompleteme-inlay-hints|\n   1. Highlight groups                         |youcompleteme-highlight-groups|\n   2. Options                                           |youcompleteme-options|\n   3. Toggling                                         |youcompleteme-toggling|\n   4. General Semantic Completion   |youcompleteme-general-semantic-completion|\n   5. C-family Semantic Completion |youcompleteme-c-family-semantic-completion|\n    1. Installation\n    2. Compile flags                              |youcompleteme-compile-flags|\n    3. Option 1: Use a compilation database [53] |youcompleteme-option-1-use-compilation-database-53|\n    4. Option 2: Provide the flags manually |youcompleteme-option-2-provide-flags-manually|\n    5. Errors during compilation      |youcompleteme-errors-during-compilation|\n   6. Java Semantic Completion         |youcompleteme-java-semantic-completion|\n    1. Java Quick Start                        |youcompleteme-java-quick-start|\n    2. Java Project Files                    |youcompleteme-java-project-files|\n    3. Diagnostic display - Syntastic |youcompleteme-diagnostic-display-syntastic|\n    4. Diagnostic display - Eclim      |youcompleteme-diagnostic-display-eclim|\n    5. Eclipse Projects                        |youcompleteme-eclipse-projects|\n    6. Maven Projects                            |youcompleteme-maven-projects|\n    7. Gradle Projects                          |youcompleteme-gradle-projects|\n    8. Troubleshooting                          |youcompleteme-troubleshooting|\n   7. C# Semantic Completion              |youcompleteme-c-semantic-completion|\n    1. Automatically discovered solution files |youcompleteme-automatically-discovered-solution-files|\n    2. Manually specified solution files |youcompleteme-manually-specified-solution-files|\n    3. Use with .NET 6.0 and .NET SDKs |youcompleteme-use-with-.net-6.0-.net-sdks|\n   8. Python Semantic Completion     |youcompleteme-python-semantic-completion|\n    1. Working with virtual environments |youcompleteme-working-with-virtual-environments|\n    2. Working with third-party packages |youcompleteme-working-with-third-party-packages|\n    3. Configuring through Vim options |youcompleteme-configuring-through-vim-options|\n   9. Rust Semantic Completion         |youcompleteme-rust-semantic-completion|\n   10. Go Semantic Completion            |youcompleteme-go-semantic-completion|\n   11. JavaScript and TypeScript Semantic Completion |youcompleteme-javascript-typescript-semantic-completion|\n   12. Semantic Completion for Other Languages |youcompleteme-semantic-completion-for-other-languages|\n    1. Plugging an arbitrary LSP server |youcompleteme-plugging-an-arbitrary-lsp-server|\n    2. LSP Configuration                      |youcompleteme-lsp-configuration|\n    3. Using 'omnifunc' for semantic completion |youcompleteme-using-omnifunc-for-semantic-completion|\n   13. Writing New Semantic Completers |youcompleteme-writing-new-semantic-completers|\n   14. Diagnostic Display                    |youcompleteme-diagnostic-display|\n    1. Diagnostic Highlighting Groups |youcompleteme-diagnostic-highlighting-groups|\n   15. Symbol Search                              |youcompleteme-symbol-search|\n    1. Closing the popup                          |youcompleteme-closing-popup|\n   16. Type/Call Hierarchy                  |youcompleteme-type-call-hierarchy|\n  7. Commands                                          |youcompleteme-commands|\n   1. The |:YcmRestartServer| command\n   2. The |:YcmForceCompileAndDiagnostics| command\n   3. The |:YcmDiags| command\n   4. The |:YcmShowDetailedDiagnostic| command\n   5. The |:YcmDebugInfo| command\n   6. The |:YcmToggleLogs| command\n   7. The |:YcmCompleter| command\n  8. YcmCompleter Subcommands          |youcompleteme-ycmcompleter-subcommands|\n   1. GoTo Commands                               |youcompleteme-goto-commands|\n    1. The |GoToInclude| subcommand\n    2. The |GoToAlternateFile| subcommand\n    3. The |GoToDeclaration| subcommand\n    4. The |GoToDefinition| subcommand\n    5. The |GoTo| subcommand\n    6. The |GoToImprecise| subcommand\n    7. The 'GoToSymbol <symbol query>' subcommand     |GoToSymbol-symbol-query|\n    8. The |GoToReferences| subcommand\n    9. The |GoToImplementation| subcommand\n    10. The |GoToImplementationElseDeclaration| subcommand\n    11. The |GoToType| subcommand\n    12. The |GoToDocumentOutline| subcommand\n    13. The |GoToCallers| and 'GoToCallees' subcommands\n   2. Semantic Information Commands |youcompleteme-semantic-information-commands|\n    1. The |GetType| subcommand\n    2. The |GetTypeImprecise| subcommand\n    3. The |GetParent| subcommand\n    4. The |GetDoc| subcommand\n    5. The |GetDocImprecise| subcommand\n   3. Refactoring Commands                 |youcompleteme-refactoring-commands|\n    1. The |FixIt| subcommand\n    2. The 'RefactorRename <new name>' subcommand     |RefactorRename-new-name|\n    3. Python refactorings                  |youcompleteme-python-refactorings|\n    4. Multi-file Refactor                  |youcompleteme-multi-file-refactor|\n    5. The |Format| subcommand\n    6. The |OrganizeImports| subcommand\n   4. Miscellaneous Commands             |youcompleteme-miscellaneous-commands|\n    1. The 'ExecuteCommand <args>' subcommand             |ExecuteCommand-args|\n    2. The |RestartServer| subcommand\n    3. The |ReloadSolution| subcommand\n  9. Functions                                        |youcompleteme-functions|\n   1. The |youcompleteme#GetErrorCount| function\n   2. The |youcompleteme#GetWarningCount| function\n   3. The 'youcompleteme#GetCommandResponse( ... )' function |youcompleteme#GetCommandResponse()|\n   4. The 'youcompleteme#GetCommandResponseAsync( callback, ... )' function |youcompleteme#GetCommandResponseAsync()|\n  10. Autocommands                                 |youcompleteme-autocommands|\n   1. The |YcmLocationOpened| autocommand\n   2. The |YcmQuickFixOpened| autocommand\n  11. Options\n   1. The |g:ycm_min_num_of_chars_for_completion| option\n   2. The |g:ycm_min_num_identifier_candidate_chars| option\n   3. The |g:ycm_max_num_candidates| option\n   4. The |g:ycm_max_num_candidates_to_detail| option\n   5. The |g:ycm_max_num_identifier_candidates| option\n   6. The |g:ycm_auto_trigger| option\n   7. The |g:ycm_filetype_whitelist| option\n   8. The |g:ycm_filetype_blacklist| option\n   9. The |g:ycm_filetype_specific_completion_to_disable| option\n   10. The |g:ycm_filepath_blacklist| option\n   11. The |g:ycm_show_diagnostics_ui| option\n   12. The |g:ycm_error_symbol| option\n   13. The |g:ycm_warning_symbol| option\n   14. The |g:ycm_enable_diagnostic_signs| option\n   15. The |g:ycm_enable_diagnostic_highlighting| option\n   16. The |g:ycm_echo_current_diagnostic| option\n   17. The |g:ycm_auto_hover| option\n   18. The |g:ycm_filter_diagnostics| option\n   19. The |g:ycm_always_populate_location_list| option\n   20. The |g:ycm_open_loclist_on_ycm_diags| option\n   21. The |g:ycm_complete_in_comments| option\n   22. The |g:ycm_complete_in_strings| option\n   23. The |g:ycm_collect_identifiers_from_comments_and_strings| option\n   24. The |g:ycm_collect_identifiers_from_tags_files| option\n   25. The |g:ycm_seed_identifiers_with_syntax| option\n   26. The |g:ycm_extra_conf_vim_data| option\n   27. The |g:ycm_server_python_interpreter| option\n   28. The |g:ycm_keep_logfiles| option\n   29. The |g:ycm_log_level| option\n   30. The |g:ycm_auto_start_csharp_server| option\n   31. The |g:ycm_auto_stop_csharp_server| option\n   32. The |g:ycm_csharp_server_port| option\n   33. The |g:ycm_csharp_insert_namespace_expr| option\n   34. The |g:ycm_add_preview_to_completeopt| option\n   35. The |g:ycm_autoclose_preview_window_after_completion| option\n   36. The |g:ycm_autoclose_preview_window_after_insertion| option\n   37. The |g:ycm_max_diagnostics_to_display| option\n   38. The |g:ycm_key_list_select_completion| option\n   39. The |g:ycm_key_list_previous_completion| option\n   40. The |g:ycm_key_list_stop_completion| option\n   41. The |g:ycm_key_invoke_completion| option\n   42. The |g:ycm_key_detailed_diagnostics| option\n   43. The |g:ycm_show_detailed_diag_in_popup| option\n   44. The |g:ycm_global_ycm_extra_conf| option\n   45. The |g:ycm_confirm_extra_conf| option\n   46. The |g:ycm_extra_conf_globlist| option\n   47. The |g:ycm_filepath_completion_use_working_dir| option\n   48. The |g:ycm_semantic_triggers| option\n   49. The |g:ycm_cache_omnifunc| option\n   50. The |g:ycm_use_ultisnips_completer| option\n   51. The |g:ycm_goto_buffer_command| option\n   52. The |g:ycm_disable_for_files_larger_than_kb| option\n   53. The |g:ycm_use_clangd| option\n   54. The |g:ycm_clangd_binary_path| option\n   55. The |g:ycm_clangd_args| option\n   56. The |g:ycm_clangd_uses_ycmd_caching| option\n   57. The |g:ycm_language_server| option\n   58. The |g:ycm_disable_signature_help| option\n   59. The |g:ycm_signature_help_disable_syntax| option\n   60. The |g:ycm_gopls_binary_path| option\n   61. The |g:ycm_gopls_args| option\n   62. The |g:ycm_rls_binary_path| and 'g:ycm_rustc_binary_path' options\n   63. The |g:ycm_rust_toolchain_root| option\n   64. The |g:ycm_tsserver_binary_path| option\n   65. The |g:ycm_roslyn_binary_path| option\n   66. The |g:ycm_update_diagnostics_in_insert_mode| option\n  12. FAQ                                                   |youcompleteme-faq|\n  13. Contributor Code of Conduct   |youcompleteme-contributor-code-of-conduct|\n  14. Contact                                           |youcompleteme-contact|\n  15. License                                           |youcompleteme-license|\n  16. Sponsorship                                   |youcompleteme-sponsorship|\n 3. References                                       |youcompleteme-references|\n\n===============================================================================\n                                                   *youcompleteme-introduction*\nIntroduction ~\n\nImage: Gitter room [1] Image: Build status [3] Image: Coverage status [5]\n\n-------------------------------------------------------------------------------\n                                            *youcompleteme-help-advice-support*\nHelp, Advice, Support ~\n\nLooking for help, advice, or support? Having problems getting YCM to work?\n\nFirst carefully read the installation instructions for your OS. We recommend\nyou use the supplied 'install.py' - the \"full\" installation guide is for rare,\nadvanced 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 [7] guide.\n\nNext, check the User Guide section on the semantic completer that you are\nusing. For C/C++/Objective-C/Objective-C++/CUDA, you _must_ read this section.\n\nFinally, check the FAQ [8].\n\nIf, after reading the installation and user guides, and checking the FAQ,\nyou're still having trouble, check the contacts section below for how to get in\ntouch.\n\nPlease do **NOT** go to #vim on Freenode for support. Please contact the\nYouCompleteMe maintainers directly using the contact details below.\n\n===============================================================================\n                                                         *youcompleteme-vundle*\nVundle ~\n\nPlease note that the below instructions suggest using Vundle. Currently there\nare problems with Vundle, so here are some alternative instructions [9] using\nVim packages.\n\n-------------------------------------------------------------------------------\n                                                       *youcompleteme-contents*\nContents ~\n\n- Intro\n- Installation\n\n  - Requirements\n  - macOS\n  - Linux 64-bit\n  - Windows\n  - Full Installation Guide\n\n- Quick Feature Summary\n- User Guide\n\n  - General Usage\n  - Client-Server Architecture\n  - Completion String Ranking\n  - General Semantic Completion\n  - Signature Help\n  - Semantic Highlighting\n  - Inlay Hints\n  - C-family Semantic Completion\n  - Java Semantic Completion\n  - C# Semantic Completion\n  - Python Semantic Completion\n  - Rust Semantic Completion\n  - Go Semantic Completion\n  - JavaScript and TypeScript Semantic Completion\n  - Semantic Completion for Other Languages\n  - LSP Configuration\n  - Writing New Semantic Completers\n  - Diagnostic Display\n\n    - Diagnostic Highlighting Groups\n\n  - Symbol Search\n  - Type/Call Hierarchy\n\n- Commands\n\n  - YcmCompleter subcommands\n\n    - GoTo Commands\n    - Semantic Information Commands\n    - Refactoring Commands\n    - Miscellaneous Commands\n\n- Functions\n- Autocommands\n- Options\n- FAQ\n- Contributor Code of Conduct\n- Contact\n- License\n- Sponsorship\n\n-------------------------------------------------------------------------------\n                                                          *youcompleteme-intro*\nIntro ~\n\nYouCompleteMe is a fast, as-you-type, fuzzy-search code completion,\ncomprehension and refactoring engine for Vim [10].\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 [11]-based engine that provides native semantic code\n  completion for C/C++/Objective-C/Objective-C++/CUDA (from now on referred\n  to as \"the C-family languages\"),\n- a Jedi [12]-based completion engine for Python 2 and 3,\n- an OmniSharp-Roslyn [13]-based completion engine for C#,\n- a Gopls [14]-based completion engine for Go,\n- a TSServer [15]-based completion engine for JavaScript and TypeScript,\n- a rust-analyzer [16]-based completion engine for Rust,\n- a jdt.ls [17]-based completion engine for Java.\n- a generic Language Server Protocol implementation for any language\n- and an omnifunc-based completer that uses data from Vim's omnicomplete\n  system to provide semantic completions for many other languages (Ruby, PHP,\n  etc.).\n\n  Image: YouCompleteMe GIF completion demo (see reference [18])\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\ntyping to 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 [19] match_ of a completion. This is a fancy\nway of saying that any input characters need to be present in a completion\nstring in the order in which they appear in the input. So 'abc' is a\nsubsequence of 'xaybgc', but not of 'xbyxaxxc'. After the filter, a complicated\nsorting system ranks the completion strings so that the most relevant ones rise\nto the top of the 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\nfeatures (the little red X that shows up in the left gutter; inspired by\nSyntastic [20]) if you are editing a C-family file. As the completer engine\ncompiles your file and detects warnings or errors, they will be presented in\nvarious ways. You don't need to save your file or press any keyboard shortcut\nto trigger this, it \"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  Image: YouCompleteMe GIF unicode demo (see reference [21])\n\nYCM also provides semantic IDE-like features in a number of languages,\nincluding:\n\n- displaying signature help (argument hints) when entering the arguments to a\n  function call (Vim only)\n- finding declarations, definitions, usages, etc. of identifiers, and an\n  interactive symbol finder\n- displaying type information for classes, variables, functions etc.,\n- displaying documentation for methods, members, etc. in the preview window,\n  or in a popup next to the cursor (Vim only)\n- fixing common coding errors, like missing semi-colons, typos, etc.,\n- semantic renaming 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  Image: Signature Help Early Demo (see reference [22])\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| for servers\n  that support it.\n\n  Image: YouCompleteMe GIF subcommands demo (see reference [23])\n\nAnd here's some documentation being shown in a hover popup, automatically and\nmanually:\n\n  Image: hover demo (see reference [24])\n\nFeatures vary by file type, so make sure to check out the file type feature\nsummary and the full list of completer subcommands to find out what's available\nfor 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 [25].\n\n-------------------------------------------------------------------------------\n                                                   *youcompleteme-installation*\nInstallation ~\n\n-------------------------------------------------------------------------------\n                                                   *youcompleteme-requirements*\nRequirements ~\n\n===============================================================================\n| _Runtime_ | _Min Version_ | _Recommended Version (full support)_ | _Python_ |\n===============================================================================\n| Vim       | 9.1.0016      | 9.1.0016                             | 3.12     |\n-------------------------------------------------------------------------------\n| Neovim    | 0.5           | Vim 9.1.0016                         | 3.12     |\n-------------------------------------------------------------------------------\n\n\n-------------------------------------------------------------------------------\n                                         *youcompleteme-supported-vim-versions*\nSupported 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.\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-------------------------------------------------------------------------------\n                                       *youcompleteme-supported-python-runtime*\nSupported 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\ncpython3, e.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\ncurrent python version we're using goes out of support. At that time we will\ntypically pick a version that will be supported for a number of years.\n\n-------------------------------------------------------------------------------\n                                            *youcompleteme-supported-compilers*\nSupported 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===============================\n| _Compiler_ | _Current Min_  |\n===============================\n| GCC        | 8              |\n-------------------------------\n| Clang      | 7              |\n-------------------------------\n| MSVC       | 15.7 (VS 2017) |\n-------------------------------\n\n\nYCM requires CMake 3.13 or greater. If your CMake is too old, you may be able\nto simply 'pip install --user cmake' to get a really new version.\n\n-------------------------------------------------------------------------------\n                              *youcompleteme-individual-completer-requirements*\nIndividual 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-------------------------------------------------------------------------------\n                                                          *youcompleteme-macos*\nmacOS ~\n\n-------------------------------------------------------------------------------\n                          *youcompleteme-quick-start-installing-all-completers*\nQuick start, installing all completers ~\n\n- Install YCM plugin via Vundle [26]\n- Install CMake, MacVim and Python 3; Note that the pre-installed _macOS\n  system_ Vim is not supported (due to it having broken Python integration).\n>\n  $ brew install cmake python go nodejs\n<\n- Install mono from Mono Project [27] (NOTE: on Intel Macs you can also 'brew\n  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\n  Homebrew:\n>\n  $ brew install java\n  $ sudo ln -sfn $(brew --prefix java)/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk\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 [28] with Homebrew\n  [29]:\n\n- Option 1: Installing a Vim that supports Python 3\n>\n  brew install vim\n<\n- Option 2: Installing MacVim [28]\n>\n  brew install macvim\n<\n- Compile YCM.\n\n- For Intel and arm64 Macs, the bundled libclang/clangd work:\n>\n  cd ~/.vim/bundle/YouCompleteMe\n  python3 install.py --all\n<\n- If you have troubles with finding system frameworks or C++ standard\n  library, try using the homebrew llvm:\n>\n  brew install llvm\n  cd ~/.vim/bundle/YouCompleteMe\n  python3 install.py --system-libclang --all\n<\n  And edit your vimrc to add the following line to use the Homebrew llvm's\n  clangd:\n>\n  \" Use homebrew's clangd\n  let g:ycm_clangd_binary_path = trim(system('brew --prefix llvm')).'/bin/clangd'\n<\n- For using an arbitrary LSP server, check the relevant section\n\n-------------------------------------------------------------------------------\n                                    *youcompleteme-explanation-for-quick-start*\nExplanation 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 guide.\n\nA supported Vim version with Python 3 is required. MacVim [28] is a good\noption, even if you only use the terminal. YCM won't work with the\npre-installed Vim from Apple as its Python support is broken. If you don't\nalready use a Vim that supports Python 3 or MacVim [28], install it with\nHomebrew [29]. Install CMake as well:\n>\n  brew install vim cmake\n<\nOR\n>\n  brew install macvim cmake\n<\nInstall YouCompleteMe with Vundle [26].\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 rarely), YCM\nwill notify you to recompile it. You should then rerun the install process.\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  cd ~/.vim/bundle/YouCompleteMe\n  ./install.py --clangd-completer\n<\nCompiling YCM **without** semantic support for C-family languages:\n>\n  cd ~/.vim/bundle/YouCompleteMe\n  ./install.py\n<\nThe following additional language support options are available:\n\n- C# support: install by downloading the Mono macOS package [30] and add\n  '--cs-completer' when calling 'install.py'.\n\n- Go support: install Go [31] and add '--go-completer' when calling\n  'install.py'.\n\n- JavaScript and TypeScript support: install Node.js 18+ and npm [32] and add\n  '--ts-completer' when calling 'install.py'.\n\n- Rust support: add '--rust-completer' when calling 'install.py'.\n\n- Java support: install JDK 17 [33] and add '--java-completer' when calling\n  '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  cd ~/.vim/bundle/YouCompleteMe\n  ./install.py --all\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\nall in 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-------------------------------------------------------------------------------\n                                                   *youcompleteme-linux-64-bit*\nLinux 64-bit ~\n\nThe following assume you're using Ubuntu 24.04.\n\n-------------------------------------------------------------------------------\nQuick start, installing all completers ~\n\n- Install YCM plugin via Vundle [26]\n- Install CMake, Vim and Python\n>\n  apt install build-essential cmake vim-nox python3-dev\n<\n- Install mono-complete, go, node, java, and npm\n>\n  apt install mono-complete golang nodejs openjdk-17-jdk openjdk-17-jre npm\n<\n- Compile YCM\n>\n  cd ~/.vim/bundle/YouCompleteMe\n  python3 install.py --all\n<\n- For plugging an arbitrary LSP server, check the relevant section\n\n-------------------------------------------------------------------------------\nExplanation 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 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 source [34]\n(don't worry, it's easy).\n\nInstall YouCompleteMe with Vundle [26].\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\nrarely), YCM will notify you to recompile it. You should then rerun the\ninstallation process.\n\nInstall development tools, CMake, and Python headers:\n\n- Fedora-like distributions:\n>\n  sudo dnf install cmake gcc-c++ make python3-devel\n<\n- Ubuntu LTS:\n>\n  sudo apt install build-essential cmake3 python3-dev\n<\nCompiling YCM **with** semantic support for C-family languages through\n**clangd**:\n>\n  cd ~/.vim/bundle/YouCompleteMe\n  python3 install.py --clangd-completer\n<\nCompiling YCM **without** semantic support for C-family languages:\n>\n  cd ~/.vim/bundle/YouCompleteMe\n  python3 install.py\n<\nThe following additional language support options are available:\n\n- C# support: install Mono [35] and add '--cs-completer' when calling\n  'install.py'.\n\n- Go support: install Go [31] and add '--go-completer' when calling\n  'install.py'.\n\n- JavaScript and TypeScript support: install Node.js 18+ and npm [32] and add\n  '--ts-completer' when calling 'install.py'.\n\n- Rust support: add '--rust-completer' when calling 'install.py'.\n\n- Java support: install JDK 17 [33] and add '--java-completer' when calling\n  '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  cd ~/.vim/bundle/YouCompleteMe\n  python3 install.py --all\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\nall in 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-------------------------------------------------------------------------------\n                                                        *youcompleteme-windows*\nWindows ~\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-------------------------------------------------------------------------------\nQuick start, installing all completers ~\n\n- Install YCM plugin via Vundle [26]\n- Install Visual Studio Build Tools 2019 [36]\n- Install CMake, Vim and Python\n- Install go, node and npm\n- Compile YCM\n>\n  cd YouCompleteMe\n  python3 install.py --all\n<\n- Add 'set encoding=utf-8' to your vimrc [37]\n- For plugging an arbitrary LSP server, check the relevant section\n\n-------------------------------------------------------------------------------\nExplanation 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 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 can check\nthe version and which Python is supported by typing ':version' inside Vim. Look\nat the features included: '+python3/dyn' for Python 3. Take note of the Vim\narchitecture, i.e. 32 or 64-bit. It will be important when choosing the Python\ninstaller. We recommend using a 64-bit client. Daily updated installers of\n32-bit and 64-bit Vim with Python 3 support [38] are available.\n\nAdd the following line to your vimrc [37] if not already present.:\n>\n  set encoding=utf-8\n<\nThis option is required by YCM. Note that it does not prevent you from editing\na file in another encoding than UTF-8. You can do that by specifying the\n'|++enc|' argument to the ':e' command.\n\nInstall YouCompleteMe with Vundle [26].\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 rarely), YCM\nwill notify you to recompile it. You should then rerun the install process.\n\nDownload and install the following software:\n\n- Python 3 [39]. Be sure to pick the version corresponding to your Vim\n  architecture. It is _Windows x86_ for a 32-bit Vim and _Windows x86-64_ for\n  a 64-bit Vim. We recommend installing Python 3. Additionally, the version\n  of Python you install must match up exactly with the version of Python that\n  Vim is looking for. Type ':version' and look at the bottom of the page at\n  the list of compiler flags. Look for flags that look similar to\n  '-DDYNAMIC_PYTHON3_DLL=\\\"python36.dll\\\"'. This indicates that Vim is\n  looking for Python 3.6. You'll need one or the other installed, matching\n  the version number exactly.\n\n- CMake [40]. Add CMake executable to the PATH environment variable.\n\n- Build Tools for Visual Studio 2019 [36]. During setup, select _C++ build\n  tools_ in _Workloads_.\n\nCompiling YCM **with** semantic support for C-family languages through\n**clangd**:\n>\n  cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe\n  python install.py --clangd-completer\n<\nCompiling YCM **without** semantic support for C-family languages:\n>\n  cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe\n  python install.py\n<\nThe following additional language support options are available:\n\n- C# support: add '--cs-completer' when calling 'install.py'. Be sure that\n  the build utility 'msbuild' is in your PATH [41].\n\n- Go support: install Go [31] and add '--go-completer' when calling\n  'install.py'.\n\n- JavaScript and TypeScript support: install Node.js 18+ and npm [32] and add\n  '--ts-completer' when calling 'install.py'.\n\n- Rust support: add '--rust-completer' when calling 'install.py'.\n\n- Java support: install JDK 17 [33] and add '--java-completer' when calling\n  '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  cd %USERPROFILE%/vimfiles/bundle/YouCompleteMe\n  python install.py --all\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\nall in 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-------------------------------------------------------------------------------\n                                        *youcompleteme-full-installation-guide*\nFull Installation Guide ~\n\nThe full installation guide [42] has been moved to the wiki.\n\n-------------------------------------------------------------------------------\n                                          *youcompleteme-quick-feature-summary*\nQuick Feature Summary ~\n\n-------------------------------------------------------------------------------\n                                                        *youcompleteme-general*\nGeneral (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-------------------------------------------------------------------------------\n                                             *youcompleteme-c-family-languages*\nC-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 <new name>')\n- Code formatting (|Format|)\n- Semantic highlighting\n- Inlay hints\n- Type hierarchy\n- Call hierarchy\n\n-------------------------------------------------------------------------------\n                                                              *youcompleteme-c*\nC♯ ~\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 <new name>')\n- Code formatting (|Format|)\n\n-------------------------------------------------------------------------------\n                                                         *youcompleteme-python*\nPython ~\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 <new name>')\n\n-------------------------------------------------------------------------------\n                                                             *youcompleteme-go*\nGo ~\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-------------------------------------------------------------------------------\n                                          *youcompleteme-javascript-typescript*\nJavaScript 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 <new name>')\n- Code formatting (|Format|)\n- Organize imports (|OrganizeImports|)\n- Management of 'TSServer' server instance\n- Inlay hints\n- Call hierarchy\n\n-------------------------------------------------------------------------------\n                                                           *youcompleteme-rust*\nRust ~\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 <new name>')\n- Code formatting (|Format|)\n- Management of 'rust-analyzer' server instance\n- Semantic highlighting\n- Inlay hints\n- Call hierarchy\n\n-------------------------------------------------------------------------------\n                                                           *youcompleteme-java*\nJava ~\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 <new name>')\n- Code formatting (|Format|)\n- Organize imports (|OrganizeImports|)\n- Detection of Java projects\n- Execute custom server command ('ExecuteCommand <args>')\n- Management of 'jdt.ls' server instance\n- Semantic highlighting\n- Inlay hints\n- Type hierarchy\n- Call hierarchy\n\n-------------------------------------------------------------------------------\n                                                     *youcompleteme-user-guide*\nUser Guide ~\n\n-------------------------------------------------------------------------------\n                                                  *youcompleteme-general-usage*\nGeneral 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 [43]\" 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 match\nuppercase letters in the completion strings (the lowercase letters still match\nboth). On top of that, a letter with no diacritic marks will match that letter\nwith or without marks:\n\n---------------------------------------------\n| _matches_ | _foo_ | _fôo_ | _fOo_ | _fÔo_ |\n---------------------------------------------\n|   _foo_   | ✔️    | ✔️    | ✔️    | ✔️    |\n---------------------------------------------\n|   _fôo_   | ❌     | ✔️    | ❌     | ✔️    |\n---------------------------------------------\n|   _fOo_   | ❌     | ❌     | ✔️    | ✔️    |\n---------------------------------------------\n|   _fÔo_   | ❌     | ❌     | ❌     | ✔️    |\n---------------------------------------------\n\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 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\nlanguages. There's a Jedi-based completer for semantic completion for Python.\nThere's also an omnifunc-based completer that uses data from Vim's omnicomplete\nsystem to provide semantic completions when no native completer exists for that\nlanguage in 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 outputs\nand presents the results to you.\n\n-------------------------------------------------------------------------------\n                                     *youcompleteme-client-server-architecture*\nClient-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 [44] that has the vast majority of YCM\nlogic and functionality. The server is started and stopped automatically as you\nstart and stop Vim.\n\n-------------------------------------------------------------------------------\n                                      *youcompleteme-completion-string-ranking*\nCompletion 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\nhigher in 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-------------------------------------------------------------------------------\n                                                 *youcompleteme-signature-help*\nSignature 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\nyou leave insert mode. If you want to manually control when it is visible, you\ncan map something to '<plug>YCMToggleSignatureHelp' (see below).\n\nFor more details on this feature and a few demos, check out the PR that\nproposed it [45].\n\n-------------------------------------------------------------------------------\n                                         *youcompleteme-dismiss-signature-help*\nDismiss 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'<Plug>(YCMToggleSignatureHelp)' for this.\n\nFor example, to hide/show the signature help popup by pressing Ctrl+l in insert\nmode: 'imap <silent> <C-l> <Plug>(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-------------------------------------------------------------------------------\n                                          *youcompleteme-semantic-highlighting*\nSemantic highlighting ~\n\nSemantic highlighting is the process where the buffer text is coloured\naccording to the underlying semantic type of the word, rather than classic\nsyntax highlighting based on regular expressions. This can be powerful\nadditional data that 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  Image: highliting-classic (see reference [46])\n\nAnd here is the same function with semantic highlighting:\n\n  Image: highliting-semantic (see reference [47])\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-------------------------------------------------------------------------------\n                                   *youcompleteme-customising-highlight-groups*\nCustomising 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_<token type>', then it will be used\nin place of the defaults. The '<token type>' is defined as the Language Server\nProtocol semantic token type, defined in the LSP Spec [48].\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  call prop_type_add( 'YCM_HL_parameter', { 'highlight': 'Normal' } )\n<\nMore generally, this pattern can be useful for customising the groups:\n>\n  let 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  \n  for tokenType in keys( MY_YCM_HIGHLIGHT_GROUP )\n    call prop_type_add( 'YCM_HL_' . tokenType,\n                      \\ { 'highlight': MY_YCM_HIGHLIGHT_GROUP[ tokenType ] } )\n  endfor\n<\n-------------------------------------------------------------------------------\n                                                    *youcompleteme-inlay-hints*\nInlay 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\nby the language semantic engine.\n\nAn inlay hint is text that is rendered on the screen that is not part of the\nbuffer and is often used to mark up the type or name of arguments, parameters,\netc. which help the developer understand the semantics of the code.\n\nHere are some examples:\n\n- C\n\n  Image: c-inlay (see reference [49])\n\n- TypeScript\n\n  Image: ts-inlay (see reference [50])\n\n- Go\n\n  Image: go-inlay (see reference [51])\n\n-------------------------------------------------------------------------------\n                                               *youcompleteme-highlight-groups*\nHighlight 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  hi link YcmInlayHint Comment\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  call prop_type_add( 'YCM_INLAY_Type', #{ highlight: 'Comment' } )\n<\nThe list of inlay hint kinds can be found in 'python/ycm/inlay_hints.py'\n\n-------------------------------------------------------------------------------\n                                                        *youcompleteme-options*\nOptions ~\n\n- 'g:ycm_enable_inlay_hints' or 'b:ycm_enable_inlay_hints' - enable/disable\n  globally or for local buffer\n\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-------------------------------------------------------------------------------\n                                                       *youcompleteme-toggling*\nToggling ~\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'<Plug>(YCMToggleInlayHints)', for example:\n>\n  nnoremap <silent> <localleader>h <Plug>(YCMToggleInlayHints)\n<\nNo default mapping is provided for this due to the personal nature of mappings.\n\n-------------------------------------------------------------------------------\n                                    *youcompleteme-general-semantic-completion*\nGeneral 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-------------------------------------------------------------------------------\n                                   *youcompleteme-c-family-semantic-completion*\nC-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\n'.ycm_extra_conf.py' will need to stay on the old 'libclang' engine.\nInstructions on how to stay on the old engine are available on the wiki [52].\n\nSome of the features of clangd:\n\n- **Project wide indexing**: Clangd has both dynamic and static index\n  support. The dynamic index stores up-to-date symbols coming from any files\n  you are currently editing, whereas static index contains project-wide\n  symbol information. This symbol information is used for code completion and\n  code navigation. Whereas libclang is limited to the current translation\n  unit(TU).\n\n- **Code navigation**: Clangd provides all the GoTo requests libclang\n  provides and it improves those using the above-mentioned index information\n  to contain project-wide information rather than just the current TU.\n\n- **Rename**: Clangd can perform semantic rename operations on the current\n  file, whereas libclang doesn't support such functionality.\n\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\n- **Signature help**: Clangd provides signature help so that you can see the\n  names and types of arguments when calling functions.\n\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\n- **Performance**: Clangd has faster re-parse and code completion times\n  compared to libclang.\n\n-------------------------------------------------------------------------------\nInstallation ~\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\nwith '--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\ncan install a compatible 'clangd' and use |g:ycm_clangd_binary_path| to point\nto it.\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\nfor your 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  $ EXTRA_CMAKE_ARGS='-DPATH_TO_LLVM_ROOT=/path/to/your/llvm' ./install.py --clang-completer --system-libclang\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-------------------------------------------------------------------------------\n                                                  *youcompleteme-compile-flags*\nCompile flags ~\n\nIn order to perform semantic analysis such as code completion, |GoTo|, and\ndiagnostics, YouCompleteMe uses 'clangd', which makes use of clang compiler,\nsometimes also referred to as LLVM. Like any compiler, clang also requires a\nset of compile flags in order to parse your code. Simply put: If clang can't\nparse your code, YouCompleteMe can't provide semantic analysis.\n\nThere are 2 methods that can be used to provide compile flags to clang:\n\n-------------------------------------------------------------------------------\n                           *youcompleteme-option-1-use-compilation-database-53*\nOption 1: Use a compilation database [53] ~\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\nin your project.\n\nFor information on how to generate a compilation database, see the clang\ndocumentation [53]. In short:\n\n- If using CMake, add '-DCMAKE_EXPORT_COMPILE_COMMANDS=ON' when configuring\n  (or add 'set( CMAKE_EXPORT_COMPILE_COMMANDS ON )' to 'CMakeLists.txt') and\n  copy or symlink the generated database to the root of your project.\n- If using Ninja, check out the 'compdb' tool ('-t compdb') in its docs [54].\n- If using GNU make, check out compiledb [55] or Bear [56].\n- For other build systems, check out '.ycm_extra_conf.py' below.\n\nIf no '.ycm_extra_conf.py' is found, YouCompleteMe automatically tries to load\na compilation database if there is one.\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-------------------------------------------------------------------------------\n                                *youcompleteme-option-2-provide-flags-manually*\nOption 2: Provide the flags manually ~\n\nIf you don't have a compilation database or aren't able to generate one, you\nhave 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\nmechanism for you to generate the flags for a particular file with _arbitrary\ncomplexity_. This is achieved by requiring you to provide a Python module that\nimplements a trivial function that, given the file name as an argument, returns\na list of compiler flags to use to compile that file.\n\nYCM looks for a '.ycm_extra_conf.py' file in the directory of the opened file\nor in 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 |g:ycm_global_ycm_extra_conf| option, which will be used as a\nfallback. To prevent the execution of malicious code from a file you didn't\nwrite YCM will ask you once per '.ycm_extra_conf.py' if it is safe to load.\nThis can be disabled and you can white-/blacklist files. See the\n|g:ycm_confirm_extra_conf| and |g:ycm_extra_conf_globlist| 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 <language>' flag to libclang.\nThis is so that the correct language is detected, particularly for header\nfiles. Common values are '-x c' for C, '-x c++' for C++, '-x objc' for\nObjective-C, and '-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  def Settings( **kwargs ):\n    return {\n      'flags': [ '-x', 'c++', '-Wall', '-Wextra', '-Werror' ],\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\nof that 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\nthe full power of the Python language.\n\nFor a more elaborate example, see ycmd's own '.ycm_extra_conf.py' [57]. You\nshould be able to use it _as a starting point_. **Don't** just copy/paste that\nfile somewhere and expect things to magically work; **your project needs\ndifferent flags**. Hint: just replace the strings in the 'flags' variable with\ncompilation flags necessary for your project. That should be enough for 99% of\nprojects.\n\nYou could also consider using YCM-Generator [58] to generate the\n'ycm_extra_conf.py' file.\n\n-------------------------------------------------------------------------------\n                                      *youcompleteme-errors-during-compilation*\nErrors 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\nto getting fast completions.\n\nCall the |:YcmDiags| command to see if any errors or warnings were detected in\nyour file.\n\n-------------------------------------------------------------------------------\n                                       *youcompleteme-java-semantic-completion*\nJava Semantic Completion ~\n\n-------------------------------------------------------------------------------\n                                               *youcompleteme-java-quick-start*\nJava Quick Start ~\n\n1. Ensure that you have enabled the Java completer. See the installation\n   guide for details.\n\n2. Create a project file (gradle or maven) file in the root directory of\n   your Java project, by following the instructions below.\n\n3. (Optional) Configure the LSP server. The jdt.ls configuration options\n   [59] can be found in their codebase.\n\n4. If you previously used Eclim or Syntastic for Java, disable them for\n   Java.\n\n5. Edit a Java file from your project.\n\n-------------------------------------------------------------------------------\n                                             *youcompleteme-java-project-files*\nJava 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 [17] supports eclipse\nproject files [60], maven projects [61] and gradle projects [62].\n\n**NOTE:** Our recommendation is to use either Maven or Gradle projects.\n\n-------------------------------------------------------------------------------\n                                   *youcompleteme-diagnostic-display-syntastic*\nDiagnostic display - Syntastic ~\n\nThe native support for Java includes YCM's native real-time diagnostics\ndisplay. This can conflict with other diagnostics plugins like Syntastic, so\nwhen enabling Java support, please **manually disable Syntastic Java\ndiagnostics**.\n\nAdd the following to your 'vimrc':\n>\n  let g:syntastic_java_checkers = []\n<\n-------------------------------------------------------------------------------\n                                       *youcompleteme-diagnostic-display-eclim*\nDiagnostic display - Eclim ~\n\nThe native support for Java includes YCM's native real-time diagnostics\ndisplay. This can conflict with other diagnostics plugins like Eclim, so when\nenabling Java support, please **manually disable Eclim Java diagnostics**.\n\nAdd the following to your 'vimrc':\n>\n  let g:EclimFileTypeValidate = 0\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-------------------------------------------------------------------------------\n                                               *youcompleteme-eclipse-projects*\nEclipse Projects ~\n\nEclipse-style projects require two files: .project [60] and .classpath [63].\n\nIf your project already has these files due to previously being set up within\nEclipse, then no setup is required. jdt.ls [17] 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\nit is not recommended. You're better off using Gradle or Maven (see below).\n\nA simple eclipse style project example [64] can be found in the ycmd test\ndirectory. Normally all that is required is to copy these files to the root of\nyour project and to edit the '.classpath' to add additional libraries, such as:\n>\n  <classpathentry kind=\"lib\" path=\"/path/to/external/jar\" />\n  <classpathentry kind=\"lib\" path=\"/path/to/external/java/source\" />\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  <classpathentry kind=\"src\" output=\"target/classes\" path=\"path/to/src/\" />\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-------------------------------------------------------------------------------\n                                                 *youcompleteme-maven-projects*\nMaven Projects ~\n\nMaven needs a file named pom.xml [61] in the root of the project. Once again a\nsimple pom.xml [65] can be found in the ycmd source.\n\nThe format of pom.xml [61] files is way beyond the scope of this document, but\nwe do recommend using the various tools that can generate them for you, if\nyou're not familiar with them already.\n\n-------------------------------------------------------------------------------\n                                                *youcompleteme-gradle-projects*\nGradle Projects ~\n\nGradle projects require a build.gradle [62]. Again, there is a trivial example\nin ycmd's tests [66].\n\nThe format of build.gradle [62] files are way beyond the scope of this\ndocument, but we do recommend using the various tools that can generate them\nfor 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 Kotlin [67] instead.\n\n-------------------------------------------------------------------------------\n                                                *youcompleteme-troubleshooting*\nTroubleshooting ~\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\n  project. You should be able to see its progress in the command line, and\n  |:YcmDebugInfo|. Ensure that the following lines are present:\n>\n  --   jdt.ls Java Language Server running\n  --   jdt.ls Java Language Server Startup Status: Ready\n<\n- If the above lines don't appear after a few minutes, check the jdt.ls and\n  ycmd log files using |:YcmToggleLogs|. The jdt.ls log file is called '.log'\n  (for some reason).\n\nIf you get a message about \"classpath is incomplete\", then make sure you have\ncorrectly configured the project files.\n\nIf you get messages about unresolved imports, then make sure you have correctly\nconfigured the project files, in particular check that the classpath is set\ncorrectly.\n\n-------------------------------------------------------------------------------\n                                          *youcompleteme-c-semantic-completion*\nC# Semantic Completion ~\n\nYCM relies on OmniSharp-Roslyn [13] 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-------------------------------------------------------------------------------\n                        *youcompleteme-automatically-discovered-solution-files*\nAutomatically discovered solution files ~\n\nYCM will scan all parent directories of the file currently being edited and\nlook for a file with '.sln' extension.\n\n-------------------------------------------------------------------------------\n                              *youcompleteme-manually-specified-solution-files*\nManually 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\none wants to override the default behaviour and specify a solution file that is\nnot in any of the parent directories of the currently edited file. Example:\n>\n  def 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<\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-------------------------------------------------------------------------------\n                                    *youcompleteme-use-with-.net-6.0-.net-sdks*\nUse with .NET 6.0 and .NET SDKs ~\n\nYCM ships with older version of OmniSharp-Roslyn based on Mono runtime. It is\npossible 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 [68]\n\n2. Set |g:ycm_roslyn_binary_path| to the unpacked executable 'OmniSharp'\n\n3. Create a solution file if one doesn't already exist, it is currently\n   required by YCM for internal bookkeeping\n\n   1. Run 'dotnet new sln' at the root of your project\n   2. Run 'dotnet sln add <project1.csproj> <project2.csproj> ...' for\n      all of your projects\n\n4. Run |:YcmRestartServer|\n\n-------------------------------------------------------------------------------\n                                     *youcompleteme-python-semantic-completion*\nPython Semantic Completion ~\n\nYCM relies on the Jedi [12] engine to provide completion and code navigation.\nBy default, it will pick the version of Python running the ycmd server [44] 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-------------------------------------------------------------------------------\n                              *youcompleteme-working-with-virtual-environments*\nWorking 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  def Settings( **kwargs ):\n    return {\n      'interpreter_path': '/path/to/virtual/environment/python'\n    }\n<\nHere, '/path/to/virtual/environment/python' is the path to the Python used by\nthe 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\noption, read the Configuring through Vim options section.\n\n-------------------------------------------------------------------------------\n                              *youcompleteme-working-with-third-party-packages*\nWorking with third-party packages ~\n\nAnother common practice is to put the dependencies directly into the project\nand add their paths to 'sys.path' at runtime in order to import them. YCM needs\nto be told about this path manipulation to support those dependencies. This can\nbe done by creating a '.ycm_extra_conf.py' file at the root of the project.\nThis file must define a 'Settings( **kwargs )' function returning a dictionary\nwith the 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  def Settings( **kwargs ):\n    return {\n      'sys_path': [\n        '/path/to/some/third_party/package',\n        '/path/to/another/third_party/package'\n      ]\n    }\n<\nIf you would rather prepend paths to 'sys.path' with a Vim option, read the\nConfiguring through Vim options section.\n\nIf you need further control on how to add paths to 'sys.path', you should\ndefine the 'PythonSysPath( **kwargs )' function in the '.ycm_extra_conf.py'\nfile. Its keyword arguments are 'sys_path' which contains the default\n'sys.path', and 'interpreter_path' which is the path to the Python interpreter.\nHere's a trivial example that inserts the '/path/to/third_party/package' path\nat the second position of 'sys.path':\n>\n  def PythonSysPath( **kwargs ):\n    sys_path = kwargs[ 'sys_path' ]\n    sys_path.insert( 1, '/path/to/third_party/package' )\n    return sys_path\n<\nA more advanced example can be found in YCM's own '.ycm_extra_conf.py' [69].\n\n-------------------------------------------------------------------------------\n                                *youcompleteme-configuring-through-vim-options*\nConfiguring through Vim options ~\n\nYou may find it inconvenient to have to create a '.ycm_extra_conf.py' file at\nthe root 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| option and creating a global extra configuration\nfile. Let's take an example. Suppose that you want to set the interpreter path\nwith the 'g:ycm_python_interpreter_path' option and prepend paths to 'sys.path'\nwith the 'g:ycm_python_sys_path' option. Suppose also that you want to name the\nglobal extra configuration file 'global_extra_conf.py' and that you want to put\nit in your HOME folder. You should then add the following lines to your vimrc:\n>\n  let g:ycm_python_interpreter_path = ''\n  let g:ycm_python_sys_path = []\n  let g:ycm_extra_conf_vim_data = [\n    \\  'g:ycm_python_interpreter_path',\n    \\  'g:ycm_python_sys_path'\n    \\]\n  let g:ycm_global_ycm_extra_conf = '~/global_extra_conf.py'\n<\nThen, create the '~/global_extra_conf.py' file with the following contents:\n>\n  def 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<\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-------------------------------------------------------------------------------\n                                       *youcompleteme-rust-semantic-completion*\nRust Semantic Completion ~\n\nYCM uses rust-analyzer [16] for Rust semantic completion.\n\nNOTE: Previously, YCM used rls [70] for rust completion. This is no longer\nsupported, as the Rust community has decided on rust-analyzer [16] as the\nfuture of 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_ section for\ndetails). The install script takes care of installing the Rust source code\n[71], so no configuration is necessary.\n\n'rust-analyzer' supports a myriad of options. These are configured using LSP\nconfiguration, and are documented here [72].\n\n-------------------------------------------------------------------------------\n                                         *youcompleteme-go-semantic-completion*\nGo 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_ section for\ndetails). The server only works for projects with the \"canonical\" layout.\n\n'gopls' also has a load of documented options [73].\n\nYou can set these in your '.ycm_extra_conf.py'. For example, to set the build\ntags:\n>\n  def Settings( **kwargs ):\n    if kwargs[ 'language' ] == 'go':\n      return {\n         'ls': {\n           'build.buildFlags': [ '-tags=debug' ] }\n         }\n      }\n<\n-------------------------------------------------------------------------------\n                      *youcompleteme-javascript-typescript-semantic-completion*\nJavaScript and TypeScript Semantic Completion ~\n\n**NOTE:** YCM originally used the Tern [74] engine for JavaScript but due to\nTern [74] not being maintained anymore by its main author and the TSServer [15]\nengine offering more features, YCM is moving to TSServer [15]. This won't\naffect you if you were already using Tern [74] but you are encouraged to do the\nswitch by 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 [74],\nyou should pass the '--js-completer' option to the 'install.py' script during\ninstallation. Further instructions on how to set up YCM with Tern [74] are\navailable on the wiki [75].\n\nAll JavaScript and TypeScript features are provided by the TSServer [15]\nengine, which is included in the TypeScript SDK. To enable these features,\ninstall Node.js 18+ and npm [32] and call the 'install.py' script with the\n'--ts-completer' flag.\n\nTSServer [15] relies on the 'jsconfig.json' file [76] for JavaScript and the\n'tsconfig.json' file [77] for TypeScript to analyze your project. Ensure the\nfile 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  {\n      \"compilerOptions\": {\n          \"checkJs\": true\n      }\n  }\n<\n-------------------------------------------------------------------------------\n                        *youcompleteme-semantic-completion-for-other-languages*\nSemantic Completion for Other Languages ~\n\nC-family, C#, Go, Java, Python, Rust, and JavaScript/TypeScript languages are\nsupported natively by YouCompleteMe using the Clang [78], OmniSharp-Roslyn\n[13], Gopls [14], jdt.ls [17], Jedi [12], rust-analyzer [16], and TSServer [15]\nengines, respectively. Check the installation section for instructions to\nenable these features if desired.\n\n-------------------------------------------------------------------------------\n                               *youcompleteme-plugging-an-arbitrary-lsp-server*\nPlugging 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| option. An example of a value of this option would\nbe:\n>\n  let 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<\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 [79] repository.\n\nSee the LSP Examples [80] project for more examples of configuring the likes of\nPHP, Ruby, Kotlin, and D.\n\n-------------------------------------------------------------------------------\n                                              *youcompleteme-lsp-configuration*\nLSP 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  def Settings( **kwargs ):\n    if kwargs[ 'language' ] == 'java':\n      return {\n        'ls': {\n          'java.format.onType.enabled': True\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\nadditional 'config_sections' dictionary which maps section to a dictionary of\nconfig required by the server. For example:\n>\n  def 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<\nThe sections and options/values are completely server-specific and rarely well\ndocumented.\n\n-------------------------------------------------------------------------------\n                         *youcompleteme-using-omnifunc-for-semantic-completion*\nUsing 'omnifunc' for semantic completion ~\n\nYCM will use your 'omnifunc' (see ':h omnifunc' in Vim) as a source for\nsemantic completions if it does not have a native semantic completion engine\nfor your file's filetype. Vim comes with rudimentary omnifuncs for various\nlanguages like Ruby, PHP, etc. It depends on the language.\n\nYou can get a stellar omnifunc for Ruby with Eclim [81]. Just make sure you\nhave the _latest_ Eclim installed and configured (this means Eclim '>= 2.2.*'\nand Eclipse '>= 4.2.*').\n\nAfter installing Eclim remember to create a new Eclipse project within your\napplication by typing ':ProjectCreate <path-to-your-project> -n ruby' inside\nVim and 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\nas the data source for semantic completions and provide the auto-triggering and\nsubsequence-based matching (and other YCM features) on top of it.\n\n-------------------------------------------------------------------------------\n                                *youcompleteme-writing-new-semantic-completers*\nWriting 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\nYCM using the Completer API [82].\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\n- The Completer API is a _much_ more powerful way to integrate with YCM and\n  it provides a wider set of features. For instance, you can make your\n  Completer query your semantic back-end in an asynchronous fashion, thus not\n  blocking Vim's GUI thread while your completion system is processing stuff.\n  This is impossible with VimScript. All of YCM's completers use the\n  Completer API.\n\n- Performance with the Completer API is better since Python executes faster\n  than 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 [82].\n\nIf you want to upstream your completer into YCM's source, you should use the\nCompleter API.\n\n-------------------------------------------------------------------------------\n                                             *youcompleteme-diagnostic-display*\nDiagnostic 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\nupdate.\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\ncan update Vim's GUI after it has finished running. You _have to_ press a key.\nThis will 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 <F5> :YcmForceCompileAndDiagnostics<CR>' 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'<leader>d' 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 [83] (which also makes it\npossible to change the height of the 'locationlist' window), also written by\nyours truly.\n\n-------------------------------------------------------------------------------\n                                 *youcompleteme-diagnostic-highlighting-groups*\nDiagnostic 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\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| option is set. If you want highlighted lines\nbut no signs in the Vim gutter, set the 'signcolumn' option to 'no' in your\nvimrc:\n>\n  set signcolumn=no\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\nthen 'SpellBad' - 'YcmWarningSection', which falls back to group\n'SyntasticWarning' if it exists and then 'SpellCap'\n\nHere's how you'd change the style for a group:\n>\n  highlight YcmErrorLine guibg=#3f0000\n<\n-------------------------------------------------------------------------------\n                                                  *youcompleteme-symbol-search*\nSymbol 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  Image: asciicast [84]\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 <something> <Plug>(YCMFindSymbolInWorkspace)'\n- 'nmap <something> <Plug>(YCMFindSymbolInDocument)'\n\ne.g.\n\n- 'nmap <leader>yfw <Plug>(YCMFindSymbolInWorkspace)'\n- 'nmap <leader>yfd <Plug>(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 '<Esc>' 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 '<C-f>' 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- '<C-j>', '<Down>', '<C-n>', '<Tab>' - select the next item\n- '<C-k>', '<Up>', '<C-p>', '<S-Tab>' - select the previous item\n- '<PageUp>', '<kPageUp>' - jump up one screenful of items\n- '<PageDown>', '<kPageDown>' - jump down one screenful of items\n- '<Home>', '<kHome>' - jump to first item\n- '<End>', '<kEnd>' - jump to last item\n- '<CR>' - jump to the selected item\n- '<C-c>' cancel/dismiss the popup\n- '<C-f>' - 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 '<C-w>...' for example.\n\n-------------------------------------------------------------------------------\n                                                  *youcompleteme-closing-popup*\nClosing the popup ~\n\n**_NOTE_**: Pressing '<Esc>' does not close the popup - you must use 'Ctrl-c'\nfor that, or use a window command (e.g. '<Ctrl-w>j') or the mouse to leave the\nprompt buffer window.\n\n-------------------------------------------------------------------------------\n                                            *youcompleteme-type-call-hierarchy*\nType/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\nis useful. 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 '<Plug>(YCMTypeHierarchy)': Display subtypes and supertypes\n  of the symbol under cursor. Expand down to subtypes and up to supertypes.\n\n- Call hierarchy '<Plug>(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 Image: asciicast [86] for brief demo.\n\nHierarchy UI can be initiated by mapping something to the indicated plug\nmappings, for example:\n>\n  nmap <leader>yth <Plug>(YCMTypeHierarchy)\n  nmap <leader>ych <Plug>(YCMCallHierarchy)\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 '<Tab>' and \"up\" with\n'<S-Tab>'.\n\nThe \"root\" of the tree can be re-focused to the selected item with '<S-Tab>'\nand further '<S-Tab>' will show the parents of the selected item. This can take\na 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. '<S-Tab>' 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- '<Tab>': Drill into the hierarchy at the selected item: expand and show\n  children of the selected item.\n- '<S-Tab>': Show parents of the selected item. When applied to sub-types,\n  this will re-root the tree at that type, so that all parent types (are\n  displayed). Similar for callers.\n- '<CR>': Jump to the symbol currently selected.\n- '<Down>', '<C-n>', '<C-j>', 'j': Select the next item\n- '<Up>', '<C-p>', '<C-k>', '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\n-------------------------------------------------------------------------------\n                                                       *youcompleteme-commands*\nCommands ~\n\n-------------------------------------------------------------------------------\nThe *:YcmRestartServer* command\n\nIf the ycmd completion server [44] suddenly stops for some reason, you can\nrestart it with this command.\n\n-------------------------------------------------------------------------------\nThe *:YcmForceCompileAndDiagnostics* command\n\nCalling this command will force YCM to immediately recompile your file and\ndisplay any new diagnostics it encounters. Do note that recompilation with this\ncommand may take a while and during this time the Vim GUI _will_ be blocked.\n\nYou may want to map this command to a key; try putting 'nnoremap <F5>\n:YcmForceCompileAndDiagnostics<CR>' in your vimrc.\n\n-------------------------------------------------------------------------------\nThe *: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\ncan be 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\nlocation list from opening, but still have it filled with new diagnostic data.\nSee the _Options_ section for details.\n\n-------------------------------------------------------------------------------\nThe *: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 'let\ng:ycm_show_detailed_diag_in_popup=1'.\n\n-------------------------------------------------------------------------------\nThe *: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\nsemantic completion engine.\n\n-------------------------------------------------------------------------------\nThe *:YcmToggleLogs* command\n\nThis command presents the list of logfiles created by YCM, the ycmd server\n[44], and the semantic engine server for the current filetype, if any. One of\nthese 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'<TAB>' 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-------------------------------------------------------------------------------\nThe *:YcmCompleter* command\n\nThis command gives access to a number of additional IDE-like features in YCM,\nfor things like semantic GoTo, type information, FixIt, and refactoring.\n\nThis command accepts a range that can either be specified through a selection\nin one 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.\n\nCall 'YcmCompleter' without further arguments for a list of the commands you\ncan call for the current completer.\n\nSee the file type feature summary for an overview of the features available for\neach file type. See the _YcmCompleter subcommands_ section for more information\non 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\n-------------------------------------------------------------------------------\n                                       *youcompleteme-ycmcompleter-subcommands*\nYcmCompleter Subcommands ~\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\nC-family language one.\n\nYou may also want to map the subcommands to something less verbose; for\ninstance, 'nnoremap <leader>jd :YcmCompleter GoTo<CR>' maps the '<leader>jd'\nsequence to the longer subcommand invocation.\n\n-------------------------------------------------------------------------------\n                                                  *youcompleteme-goto-commands*\nGoTo 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 than\none destination, the quickfix list (see ':h quickfix') is populated with the\navailable locations and opened to the full width at the bottom of the screen.\nYou can change this behavior by using the |YcmQuickFixOpened| autocommand.\n\n-------------------------------------------------------------------------------\nThe *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-------------------------------------------------------------------------------\nThe *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-------------------------------------------------------------------------------\nThe *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-------------------------------------------------------------------------------\nThe *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-------------------------------------------------------------------------------\nThe *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 C-family\nlanguages, it first tries to look up the current line for a header and jump to\nit. 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-------------------------------------------------------------------------------\nThe *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\nyou're editing files that take time to compile but you know that you haven't\nmade any changes since the last parse that would lead to incorrect jumps. When\nyou're just browsing around your codebase, this command can spare you quite a\nbit of latency.\n\nSupported in filetypes: 'c, cpp, objc, objcpp, cuda'\n\n-------------------------------------------------------------------------------\n                                                      *GoToSymbol-symbol-query*\nThe 'GoToSymbol <symbol query>' 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 is also available.\n\nSupported in filetypes: 'c, cpp, objc, objcpp, cuda, cs, java, javascript,\npython, typescript'\n\n-------------------------------------------------------------------------------\nThe *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,\ntypescript, rust'\n\n-------------------------------------------------------------------------------\nThe *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-------------------------------------------------------------------------------\nThe *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-------------------------------------------------------------------------------\nThe *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-------------------------------------------------------------------------------\nThe *GoToDocumentOutline* subcommand\n\nProvides a list of symbols in the current document, in the quickfix list. See\nalso interactive symbol search.\n\nSupported in filetypes: 'c, cpp, objc, objcpp, cuda, go, java, rust'\n\n-------------------------------------------------------------------------------\nThe *GoToCallers* and 'GoToCallees' subcommands\n\nNote: A much more powerful call and type hierarchy can be viewd interactively.\nSee 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-------------------------------------------------------------------------------\n                                  *youcompleteme-semantic-information-commands*\nSemantic 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-------------------------------------------------------------------------------\nThe *GetType* subcommand\n\nEchos the type of the variable or method under the cursor, and where it\ndiffers, the derived type.\n\nFor example:\n>\n  std::string s;\n<\nInvoking this command on 's' returns 'std::string => std::basic_string<char>'\n\n**NOTE:** Causes re-parsing of the current translation unit.\n\nSupported in filetypes: 'c, cpp, objc, objcpp, cuda, java, javascript, go,\npython, typescript, rust'\n\n-------------------------------------------------------------------------------\nThe *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\nyou're editing files that take time to compile but you know that you haven't\nmade any changes since the last parse that would lead to incorrect type. When\nyou're just browsing around your codebase, this command can spare you quite a\nbit of latency.\n\nSupported in filetypes: 'c, cpp, objc, objcpp, cuda'\n\n-------------------------------------------------------------------------------\nThe *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  class C {\n      void f();\n  };\n  \n  void C::f() {\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-------------------------------------------------------------------------------\nThe *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  command -count ShowDocWithSize\n    \\ let g:ph=&previewheight \n    \\ <bar> set previewheight=<count>\n    \\ <bar> <mods> YcmCompleter GetDoc\n    \\ <bar> let &previewheight=g:ph\n<\nYou can then use something like ':botright vertical 80ShowDocWithSize'. Here's\nan example 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-------------------------------------------------------------------------------\nThe *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\nyou're editing files that take long to compile but you know that you haven't\nmade any changes since the last parse that would lead to incorrect docs. When\nyou're just browsing around your codebase, this command can spare you quite a\nbit of latency.\n\nSupported in filetypes: 'c, cpp, objc, objcpp, cuda'\n\n-------------------------------------------------------------------------------\n                                           *youcompleteme-refactoring-commands*\nRefactoring 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-------------------------------------------------------------------------------\nThe *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\nwhich the semantic engine can deterministically suggest corrections. A small\ndemo presenting how diagnostics can be fixed with clangd:\n\n  Image: YcmCompleter-FixIt-OnDiagnostic (see reference [88])\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\nclangd:\n\n  Image: YouCompleter-FixIt-Refactoring (see reference [89])\n\nIf no fix-it is available for the current line, or there is no diagnostic on\nthe current 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 completer\nis able to add this indication. The text '(FixIt available)' is also appended\nto the diagnostic text in the output of the |:YcmDiags| command for any\ndiagnostics 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-------------------------------------------------------------------------------\n                                                      *RefactorRename-new-name*\nThe 'RefactorRename <new name>' 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\nmay not be open in Vim buffers at the time. YouCompleteMe handles all of this\nfor you. The behavior is described in the following section.\n\nSupported in filetypes: 'c, cpp, objc, objcpp, cuda, java, javascript, python,\ntypescript, rust, cs'\n\n-------------------------------------------------------------------------------\n                                            *youcompleteme-python-refactorings*\nPython refactorings ~\n\nThe following additional commands are supported for Python:\n\n- 'RefactorInline'\n- 'RefactorExtractVariable'\n- 'RefactorExtractFunction'\n\nSee the jedi docs [90] for what they do.\n\nSupported in filetypes: 'python'\n\n-------------------------------------------------------------------------------\n                                            *youcompleteme-multi-file-refactor*\nMulti-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\ncurrent tab. If no such buffer can be found, YouCompleteMe opens the file in a\nnew small horizontal split at the top of the current window, applies the\nchange, and then _hides_ the window. **NOTE:** The buffer remains open, and\nmust be manually saved. A confirmation dialog is opened prior to doing this to\nremind you 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\nreview all automatic changes made by using ':copen'. Typically, use the 'CTRL-W\n<enter>' combination to open the selected file in a new split. It is possible\nto customize how the quickfix window is opened by using the |YcmQuickFixOpened|\nautocommand.\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 that\nVim's undo is per-buffer, so to undo all changes, the undo commands must be\napplied 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\nin any such prompts. This leaves the Refactor operation partially complete and\nmust be manually corrected using Vim's undo features. The quickfix list is\n_not_ populated in this case. Inspect ':buffers' or equivalent (see ':help\nbuffers') to see the buffers that were opened by the command.\n\n-------------------------------------------------------------------------------\nThe *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\nselect it in one of Vim's visual modes (see ':h visual-use') and run the\ncommand or directly enter the range on the command line, e.g. ':2,5YcmCompleter\nFormat' to format it from line 2 to line 5.\n\nSupported in filetypes: 'c, cpp, objc, objcpp, cuda, java, javascript, go,\ntypescript, rust, cs'\n\n-------------------------------------------------------------------------------\nThe *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-------------------------------------------------------------------------------\n                                         *youcompleteme-miscellaneous-commands*\nMiscellaneous 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-------------------------------------------------------------------------------\n                                                          *ExecuteCommand-args*\nThe 'ExecuteCommand <args>' subcommand ~\n\nSome LSP completers (currently only Java completers) support executing\nserver-specific commands. Consult the jdt.ls [17] documentation to find out\nwhat commands are supported and which arguments are expected.\n\nThe support for 'ExecuteCommand' was implemented to support plugins like\nVimspector [91] to debug java, but isn't limited to that specific use case.\n\n-------------------------------------------------------------------------------\nThe *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,\nrust, typescript'\n\n-------------------------------------------------------------------------------\nThe *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\n-------------------------------------------------------------------------------\n                                                      *youcompleteme-functions*\nFunctions ~\n\n-------------------------------------------------------------------------------\nThe *youcompleteme#GetErrorCount* function\n\nGet the number of YCM Diagnostic errors. If no errors are present, this\nfunction returns 0.\n\nFor example:\n>\n  call youcompleteme#GetErrorCount()\n<\nBoth this function and |youcompleteme#GetWarningCount| can be useful when\nintegrating YCM with other Vim plugins. For example, a lightline [92] user\ncould add a diagnostics section to their statusline which would display the\nnumber of errors and warnings.\n\n-------------------------------------------------------------------------------\nThe *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  call youcompleteme#GetWarningCount()\n<\n-------------------------------------------------------------------------------\n                                           *youcompleteme#GetCommandResponse()*\nThe 'youcompleteme#GetCommandResponse( ... )' function ~\n\nRun a completer subcommand and return the result as a string. This can be\nuseful for example to display the |GetDoc| output in a popup window, e.g.:\n>\n  let s:ycm_hover_popup = -1\n  function 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 ), {} )\n  endfunction\n  \n  \" CursorHold triggers in normal mode after a delay\n  autocmd CursorHold * call s:Hover()\n  \" Or, if you prefer, a mapping:\n  nnoremap <silent> <leader>D :call <SID>Hover()<CR>\n<\n**NOTE**: This is only an example, for real hover support, see\n|g:ycm_auto_hover|.\n\nIf the completer subcommand result is not a string (for example, it's a FixIt\nor a Location), or if the completer subcommand raises an error, an empty string\nis returned, 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=<filetype>' the request is targeted at the specified\nfiletype completer. This is an advanced usage and not necessary in most cases.\n\nNOTE: The request is run synchronously and blocks Vim until the response is\nreceived, so we do not recommend running this as part of an autocommand that\ntriggers frequently.\n\n-------------------------------------------------------------------------------\n                                      *youcompleteme#GetCommandResponseAsync()*\nThe 'youcompleteme#GetCommandResponseAsync( callback, ... )' function ~\n\nThis works exactly like 'youcompleteme#GetCommandResponse', except that instead\nof returning the result, you supply a 'callback' argument. This argument must\nbe a 'FuncRef' to a function taking a single argument 'response'. This callback\nwill be called with the command response at some point later, or immediately.\n\nAs with |youcompleteme#GetCommandResponse()|, this function will call the\ncallback with \"''\" (an empty string) if the request is not sent, or if there\nwas some sort of error.\n\nHere's an example that's similar to the one above:\n>\n  let s:ycm_hover_popup = -1\n  function! s:ShowDataPopup( response ) abort\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 ), {} )\n  endfunction\n  \n  function! s:GetData() abort\n    call youcompleteme#GetCommandResponseAsync(\n      \\ function( 's:ShowDataPopup' ),\n      \\ 'GetDoc' )\n  endfunction\n  \n  autocommand CursorHold * call s:GetData()\n<\nAgain, see |g:ycm_auto_hover| for proper hover support.\n\n**NOTE**: The callback may be called immediately, in the stack frame that\ncalled this function.\n\n**NOTE**: Only one command request can be outstanding at once. Attempting to\nrequest a second response while the first is outstanding will result in the\nsecond callback being immediately called with \"''\".\n\n-------------------------------------------------------------------------------\n                                                   *youcompleteme-autocommands*\nAutocommands ~\n\n-------------------------------------------------------------------------------\nThe *YcmLocationOpened* autocommand\n\nThis 'User' autocommand is fired when YCM opens the location list window in\nresponse to the 'YcmDiags' command. By default, the location list window is\nopened to the bottom of the current window and its height is set to fit all\nentries. This behavior can be overridden by using the |YcmLocationOpened|\nautocommand which is triggered while the cursor is in the location list window.\nFor instance:\n>\n  function! s:CustomizeYcmLocationWindow()\n    \" Move the window to the top of the screen.\n    wincmd K\n    \" Set the window height to 5.\n    5wincmd _\n    \" Switch back to the working window.\n    wincmd p\n  endfunction\n  \n  autocmd User YcmLocationOpened call s:CustomizeYcmLocationWindow()\n<\n-------------------------------------------------------------------------------\nThe *YcmQuickFixOpened* autocommand\n\nThis 'User' autocommand is fired when YCM opens the quickfix window in response\nto the 'GoTo*' and 'RefactorRename' subcommands. By default, the quickfix\nwindow is opened to full width at the bottom of the screen and its height is\nset to fit all entries. This behavior can be overridden by using the\n|YcmQuickFixOpened| autocommand which is triggered while the cursor is in the\nquickfix window. For instance:\n>\n  function! s:CustomizeYcmQuickFixWindow()\n    \" Move the window to the top of the screen.\n    wincmd K\n    \" Set the window height to 5.\n    5wincmd _\n  endfunction\n  \n  autocmd User YcmQuickFixOpened call s:CustomizeYcmQuickFixWindow()\n<\n-------------------------------------------------------------------------------\nOptions ~\n\nAll options have reasonable defaults so if the plug-in works after installation\nyou don't need to change any options. These options can be configured in your\nvimrc script [37] by including a line like this:\n>\n  let g:ycm_min_num_of_chars_for_completion = 1\n<\nNote that after changing an option in your vimrc script [37] you have to\nrestart ycmd [44] with the |:YcmRestartServer| command for the changes to take\neffect.\n\n-------------------------------------------------------------------------------\nThe *g:ycm_min_num_of_chars_for_completion* option\n\nThis option controls the number of characters the user needs to type before\nidentifier-based completion suggestions are triggered. For example, if the\noption is set to '2', then when the user types a second alphanumeric character\nafter a whitespace character, completion suggestions will be triggered. This\noption is NOT used for semantic completion.\n\nSetting this option to a high number like '99' effectively turns off the\nidentifier completion engine and just leaves the semantic engine.\n\nDefault: '2'\n>\n  let g:ycm_min_num_of_chars_for_completion = 2\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_min_num_identifier_candidate_chars* option\n\nThis option controls the minimum number of characters that a completion\ncandidate coming from the identifier completer must have to be shown in the\npopup menu.\n\nA special value of '0' means there is no limit.\n\n**NOTE:** This option only applies to the identifier completer; it has no\neffect on the various semantic completers.\n\nDefault: '0'\n>\n  let g:ycm_min_num_identifier_candidate_chars = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_max_num_candidates* option\n\nThis option controls the maximum number of semantic completion suggestions\nshown in the completion menu. This only applies to suggestions from semantic\ncompletion engines; see the 'g:ycm_max_identifier_candidates' option to limit\nthe number of suggestions from the identifier-based engine.\n\nA special value of '0' means there is no limit.\n\n**NOTE:** Setting this option to '0' or to a value greater than '100' is not\nrecommended as it will slow down completion when there is a very large number\nof suggestions.\n\nDefault: '50'\n>\n  let g:ycm_max_num_candidates = 50\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_max_num_candidates_to_detail* option\n\nSome completion engines require completion candidates to be 'resolved' in order\nto get detailed info such as inline documentation, method signatures, etc. This\ninformation is displayed by YCM in the preview window, or if 'completeopt'\ncontains 'popup', in the info popup next to the completion menu.\n\nBy default, if the info popup is in use, and there are more than 10 candidates,\nYCM will defer resolving candidates until they are selected in the completion\nmenu. Otherwise, YCM must resolve the details upfront, which can be costly.\n\nIf neither 'popup' nor 'preview' are in 'completeopt', YCM disables resolving\naltogether as the information would not be displayed.\n\nThis setting can be used to override these defaults and controls the number of\ncompletion candidates that should be resolved upfront. Typically users do not\nneed to change this, as YCM will work out an appropriate value based on your\n'completeopt' and |g:ycm_add_preview_to_completeopt| settings. However, you may\noverride this calculation by setting this value to a number:\n\n- '-1' - Resolve all candidates upfront\n- '0' - Never resolve any candidates upfront.\n- '> 0' - Resolve up to this many candidates upfront. If the number of\n  candidates is greater than this value, no candidates are resolved.\n\nIn the latter two cases, if 'completeopt' contains 'popup', then candidates are\nresolved on demand asynchronously.\n\nDefault:\n\n- '0' if neither 'popup' nor 'preview' are in 'completeopt'.\n- '10' if 'popup' is in completeopt.\n- '-1' if 'preview' is in completeopt.\n\nExample:\n>\n  let g:ycm_max_num_candidates_to_detail = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_max_num_identifier_candidates* option\n\nThis option controls the maximum number of completion suggestions from the\nidentifier-based engine shown in the completion menu.\n\nA special value of '0' means there is no limit.\n\n**NOTE:** Setting this option to '0' or to a value greater than '100' is not\nrecommended as it will slow down completion when there is a very large number\nof suggestions.\n\nDefault: '10'\n>\n  let g:ycm_max_num_identifier_candidates = 10\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_auto_trigger* option\n\nWhen set to '0', this option turns off YCM's identifier completer (the\nas-you-type popup) _and_ the semantic triggers (the popup you'd get after\ntyping '.' or '->' in say C++). You can still force semantic completion with\nthe '<C-Space>' shortcut.\n\nIf you want to just turn off the identifier completer but keep the semantic\ntriggers, you should set |g:ycm_min_num_of_chars_for_completion| to a high\nnumber like '99'.\n\nWhen |g:ycm_auto_trigger| is '0', YCM sets the 'completefunc', so that you can\nmanually trigger normal completion using 'C-x C-u'.\n\nIf you want to map something else to trigger completion, such as 'C-d', then\nyou can map it to '<plug>(YCMComplete)'. For example:\n>\n  let g:ycm_auto_trigger = 0\n  imap <c-d> <plug>(YCMComplete)\n<\nNOTE: It's not possible to map one of the keys in\n|g:ycm_key_list_select_completion| (or similar) to '<plug>(YCMComplete)'. In\npractice that means that you can't use '<Tab>' for this.\n\nDefault: '1'\n>\n  let g:ycm_auto_trigger = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_filetype_whitelist* option\n\nThis option controls for which Vim filetypes (see ':h filetype') should YCM be\nturned on. The option value should be a Vim dictionary with keys being filetype\nstrings (like 'python', 'cpp', etc.) and values being unimportant (the\ndictionary is used like a hash set, meaning that only the keys matter).\n\nThe '*' key is special and matches all filetypes. By default, the whitelist\ncontains only this '*' key.\n\nYCM also has a |g:ycm_filetype_blacklist| option that lists filetypes for which\nYCM shouldn't be turned on. YCM will work only in filetypes that both the\nwhitelist and the blacklist allow (the blacklist \"allows\" a filetype by _not_\nhaving it as a key).\n\nFor example, let's assume you want YCM to work in files with the 'cpp'\nfiletype. The filetype should then be present in the whitelist either directly\n('cpp' key in the whitelist) or indirectly through the special '*' key. It\nshould _not_ be present in the blacklist.\n\nFiletypes that are blocked by either of the lists will be completely ignored by\nYCM, meaning that neither the identifier-based completion engine nor the\nsemantic engine will operate in them.\n\nYou can get the filetype of the current file in Vim with ':set ft?'.\n\nDefault: \"{'*': 1}\"\n>\n  let g:ycm_filetype_whitelist = {'*': 1}\n<\n** Completion in buffers with no filetype **\n\nThere is one exception to the above rule. YCM supports completion in buffers\nwith no filetype set, but this must be _explicitly_ whitelisted. To identify\nbuffers with no filetype, we use the 'ycm_nofiletype' pseudo-filetype. To\nenable completion in buffers with no filetype, set:\n>\n  let g:ycm_filetype_whitelist = {\n    \\ '*': 1,\n    \\ 'ycm_nofiletype': 1\n    \\ }\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_filetype_blacklist* option\n\nThis option controls for which Vim filetypes (see ':h filetype') should YCM be\nturned off. The option value should be a Vim dictionary with keys being\nfiletype strings (like 'python', 'cpp', etc.) and values being unimportant (the\ndictionary is used like a hash set, meaning that only the keys matter).\n\nSee the |g:ycm_filetype_whitelist| option for more details on how this works.\n\nDefault: '[see next line]'\n>\n  let g:ycm_filetype_blacklist = {\n        \\ 'tagbar': 1,\n        \\ 'notes': 1,\n        \\ 'markdown': 1,\n        \\ 'netrw': 1,\n        \\ 'unite': 1,\n        \\ 'text': 1,\n        \\ 'vimwiki': 1,\n        \\ 'pandoc': 1,\n        \\ 'infolog': 1,\n        \\ 'leaderf': 1,\n        \\ 'mail': 1\n        \\}\n<\nIn addition, 'ycm_nofiletype' (representing buffers with no filetype set) is\nblacklisted if 'ycm_nofiletype' is not _explicitly_ whitelisted (using\n|g:ycm_filetype_whitelist|).\n\n-------------------------------------------------------------------------------\nThe *g:ycm_filetype_specific_completion_to_disable* option\n\nThis option controls for which Vim filetypes (see ':h filetype') should the YCM\nsemantic completion engine be turned off. The option value should be a Vim\ndictionary with keys being filetype strings (like 'python', 'cpp', etc.) and\nvalues being unimportant (the dictionary is used like a hash set, meaning that\nonly the keys matter). The listed filetypes will be ignored by the YCM semantic\ncompletion engine, but the identifier-based completion engine will still\ntrigger in files of those filetypes.\n\nNote that even if semantic completion is not turned off for a specific\nfiletype, you will not get semantic completion if the semantic engine does not\nsupport that filetype.\n\nYou can get the filetype of the current file in Vim with ':set ft?'.\n\nDefault: '[see next line]'\n>\n  let g:ycm_filetype_specific_completion_to_disable = {\n        \\ 'gitcommit': 1\n        \\}\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_filepath_blacklist* option\n\nThis option controls for which Vim filetypes (see ':h filetype') should\nfilepath completion be disabled. The option value should be a Vim dictionary\nwith keys being filetype strings (like 'python', 'cpp', etc.) and values being\nunimportant (the dictionary is used like a hash set, meaning that only the keys\nmatter).\n\nThe '*' key is special and matches all filetypes. Use this key if you want to\ncompletely disable filepath completion:\n>\n  let g:ycm_filepath_blacklist = {'*': 1}\n<\nYou can get the filetype of the current file in Vim with ':set ft?'.\n\nDefault: '[see next line]'\n>\n  let g:ycm_filepath_blacklist = {\n        \\ 'html': 1,\n        \\ 'jsx': 1,\n        \\ 'xml': 1,\n        \\}\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_show_diagnostics_ui* option\n\nWhen set, this option turns on YCM's diagnostic display features. See the\n_Diagnostic display_ section in the _User Manual_ for more details.\n\nSpecific parts of the diagnostics UI (like the gutter signs, text highlighting,\ndiagnostic echo, and auto location list population) can be individually turned\non or off. See the other options below for details.\n\nNote that YCM's diagnostics UI is only supported for C-family languages.\n\nWhen set, this option also makes YCM remove all Syntastic checkers set for the\n'c', 'cpp', 'objc', 'objcpp', and 'cuda' filetypes since this would conflict\nwith YCM's own diagnostics UI.\n\nIf you're using YCM's identifier completer in C-family languages but cannot use\nthe clang-based semantic completer for those languages _and_ want to use the\nGCC Syntastic checkers, unset this option.\n\nDefault: '1'\n>\n  let g:ycm_show_diagnostics_ui = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_error_symbol* option\n\nYCM will use the value of this option as the symbol for errors in the Vim\ngutter.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the 'g:syntastic_error_symbol' option\nbefore using this option's default.\n\nDefault: '>>'\n>\n  let g:ycm_error_symbol = '>>'\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_warning_symbol* option\n\nYCM will use the value of this option as the symbol for warnings in the Vim\ngutter.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the 'g:syntastic_warning_symbol' option\nbefore using this option's default.\n\nDefault: '>>'\n>\n  let g:ycm_warning_symbol = '>>'\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_enable_diagnostic_signs* option\n\nWhen this option is set, YCM will put icons in Vim's gutter on lines that have\na diagnostic set. Turning this off will also turn off the 'YcmErrorLine' and\n'YcmWarningLine' highlighting.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the 'g:syntastic_enable_signs' option\nbefore using this option's default.\n\nDefault: '1'\n>\n  let g:ycm_enable_diagnostic_signs = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_enable_diagnostic_highlighting* option\n\nWhen this option is set, YCM will highlight regions of text that are related to\nthe diagnostic that is present on a line, if any.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the 'g:syntastic_enable_highlighting'\noption before using this option's default.\n\nDefault: '1'\n>\n  let g:ycm_enable_diagnostic_highlighting = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_echo_current_diagnostic* option\n\nWhen this option is set to 1, YCM will echo the text of the diagnostic present\non the current line when you move your cursor to that line. If a |FixIt| is\navailable for the current diagnostic, then '(FixIt)' is appended.\n\nIf you have a Vim that supports virtual text, you can set this option to the\nstring 'virtual-text', and the diagnostic will be displayed inline with the\ntext, right aligned in the window and wrapping to the next line if there is not\nenough space, for example:\n\n  Image: Virtual text diagnostic demo (see reference [93])\n\n  Image: Virtual text diagnostic demo (see reference [94])\n\n**NOTE**: It's _strongly_ recommended to also set\n|g:ycm_update_diagnostics_in_insert_mode| to '0' when using 'virtual-text' for\ndiagnostics. This is due to the increased amount of distraction provided by\ndrawing diagnostics next to your input position.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the 'g:syntastic_echo_current_error'\noption before using this option's default.\n\nDefault: '1'\n\nValid values:\n\n- '0' - disabled\n- '1' - echo diagnostic to the command area\n- \"'virtual-text'\" - display the dignostic to the right of the line in the\n  window using virtual text\n>\n  let g:ycm_echo_current_diagnostic = 1\n  \" Or, when you have Vim supporting virtual text\n  let g:ycm_echo_current_diagnostic = 'virtual-text'\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_auto_hover* option\n\nThis option controls whether or not YCM shows documentation in a popup at the\ncursor location after a short delay. Only supported in Vim.\n\nWhen this option is set to \"'CursorHold'\", the popup is displayed on the\n'CursorHold' autocommand. See ':help CursorHold' for the details, but this\nmeans that it is displayed after 'updatetime' milliseconds. When set to an\nempty string, the popup is not automatically displayed.\n\nIn addition to this setting, there is the '<plug>(YCMHover)' mapping, which can\nbe used to manually trigger or hide the popup (it works like a toggle). For\nexample:\n>\n  nmap <leader>D <plug>(YCMHover)\n<\nAfter dismissing the popup with this mapping, it will not be automatically\ntriggered again until the cursor is moved (i.e. 'CursorMoved' autocommand).\n\nThe displayed documentation depends on what the completer for the current\nlanguage supports. It's selected heuristically in this order of preference:\n\n1. 'GetHover' with 'markdown' syntax\n2. |GetDoc| with no syntax\n3. |GetType| with the syntax of the current file.\n\nYou can customise this by manually setting up 'b:ycm_hover' to your liking.\nThis buffer-local variable can be set to a dictionary with the following keys:\n\n- 'command': The YCM completer subcommand which should be run on hover\n- 'syntax': The syntax to use (as in 'set syntax=') in the popup window for\n  highlighting.\n- 'popup_params': The params passed to a popup window which gets opened.\n\nFor example, to use C/C++ syntax highlighting in the popup for C-family\nlanguages, add something like this to your vimrc:\n>\n  augroup MyYCMCustom\n    autocmd!\n    autocmd FileType c,cpp let b:ycm_hover = {\n      \\ 'command': 'GetDoc',\n      \\ 'syntax': &filetype\n      \\ }\n  augroup END\n<\nYou can also modify the opened popup with 'popup_params' key. For example, you\ncan limit the popup's maximum width and add a border to it:\n\n\n>\n  augroup MyYCMCustom\n    autocmd!\n    autocmd FileType c,cpp let b:ycm_hover = {\n      \\ 'command': 'GetDoc',\n      \\ 'syntax': &filetype\n      \\ 'popup_params': {\n      \\     'maxwidth': 80,\n      \\     'border': [],\n      \\     'borderchars': ['─', '│', '─', '│', '┌', '┐', '┘', '└'],\n      \\   },\n      \\ }\n  augroup END\n<\nSee ':help popup_create-arguments' for the list of available popup window\noptions.\n\nDefault: \"'CursorHold'\"\n\n-------------------------------------------------------------------------------\nThe *g:ycm_filter_diagnostics* option\n\nThis option controls which diagnostics will be rendered by YCM. This option\nholds a dictionary of key-values, where the keys are Vim's filetype strings\ndelimited by commas and values are dictionaries describing the filter.\n\nA filter is a dictionary of key-values, where the keys are the type of filter,\nand the value is a list of arguments to that filter. In the case of just a\nsingle item in the list, you may omit the brackets and just provide the\nargument directly. If any filter matches a diagnostic, it will be dropped and\nYCM will not render it.\n\nThe following filter types are supported:\n\n- \"regex\": Accepts a string regular expression [95]. This type matches when\n  the regex (treated as case-insensitive) is found anywhere in the diagnostic\n  text ('re.search', not 're.match')\n\n- \"level\": Accepts a string level, either \"warning\" or \"error.\" This type\n  matches when the diagnostic has the same level, that is, specifying 'level:\n  \"error\"' will remove **all** errors from the diagnostics.\n\n**NOTE:** The regex syntax is **NOT** Vim's, it's Python's [95].\n\nDefault: '{}'\n\nThe following example will do, for Java filetype only: - Remove **all** error\nlevel diagnostics, and, - Also remove anything that contains 'ta<something>co'\n>\n  let g:ycm_filter_diagnostics = {\n    \\ \"java\": {\n    \\      \"regex\": [ \"ta.+co\", ... ],\n    \\      \"level\": \"error\",\n    \\      ...\n    \\    }\n    \\ }\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_always_populate_location_list* option\n\nWhen this option is set, YCM will populate the location list automatically\nevery time it gets new diagnostic data. This option is off by default so as not\nto interfere with other data you might have placed in the location list.\n\nSee ':help location-list' in Vim to learn more about the location list.\n\nThis option is part of the Syntastic compatibility layer; if the option is not\nset, YCM will fall back to the value of the\n'g:syntastic_always_populate_loc_list' option before using this option's\ndefault.\n\nNote: if YCM's errors aren't visible, it might be that YCM is updating an older\nlocation list. See ':help :lhistory' and ':lolder'.\n\nDefault: '0'\n>\n  let g:ycm_always_populate_location_list = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_open_loclist_on_ycm_diags* option\n\nWhen this option is set, |:YcmDiags| will automatically open the location list\nafter forcing a compilation and filling the list with diagnostic data.\n\nSee ':help location-list' in Vim to learn more about the location list.\n\nDefault: '1'\n>\n  let g:ycm_open_loclist_on_ycm_diags = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_complete_in_comments* option\n\nWhen this option is set to '1', YCM will show the completion menu even when\ntyping inside comments.\n\nDefault: '0'\n>\n  let g:ycm_complete_in_comments = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_complete_in_strings* option\n\nWhen this option is set to '1', YCM will show the completion menu even when\ntyping inside strings.\n\nNote that this is turned on by default so that you can use the filename\ncompletion inside strings. This is very useful for instance in C-family files\nwhere typing '#include \"' will trigger the start of filename completion. If you\nturn off this option, you will turn off filename completion in such situations\nas well.\n\nDefault: '1'\n>\n  let g:ycm_complete_in_strings = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_collect_identifiers_from_comments_and_strings* option\n\nWhen this option is set to '1', YCM's identifier completer will also collect\nidentifiers from strings and comments. Otherwise, the text in comments and\nstrings will be ignored.\n\nDefault: '0'\n>\n  let g:ycm_collect_identifiers_from_comments_and_strings = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_collect_identifiers_from_tags_files* option\n\nWhen this option is set to '1', YCM's identifier completer will also collect\nidentifiers from tags files. The list of tags files to examine is retrieved\nfrom the 'tagfiles()' Vim function which examines the 'tags' Vim option. See\n\":h 'tags'\" for details.\n\nYCM will re-index your tags files if it detects that they have been modified.\n\nThe only supported tag format is the Exuberant Ctags format [96]. The format\nfrom \"plain\" ctags is NOT supported. Ctags needs to be called with the\n'--fields=+l' option (that's a lowercase 'L', not a one) because YCM needs the\n'language:<lang>' field in the tags output.\n\nSee the _FAQ_ for pointers if YCM does not appear to read your tag files.\n\nThis option is off by default because it makes Vim slower if your tags are on a\nnetwork directory.\n\nDefault: '0'\n>\n  let g:ycm_collect_identifiers_from_tags_files = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_seed_identifiers_with_syntax* option\n\nWhen this option is set to '1', YCM's identifier completer will seed its\nidentifier database with the keywords of the programming language you're\nwriting.\n\nSince the keywords are extracted from the Vim syntax file for the filetype, all\nkeywords may not be collected, depending on how the syntax file was written.\nUsually at least 95% of the keywords are successfully extracted.\n\nDefault: '0'\n>\n  let g:ycm_seed_identifiers_with_syntax = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_extra_conf_vim_data* option\n\nIf you're using semantic completion for C-family files, this option might come\nhandy; it's a way of sending data from Vim to your 'Settings' function in your\n'.ycm_extra_conf.py' file.\n\nThis option is supposed to be a list of VimScript expression strings that are\nevaluated for every request to the ycmd server [44] and then passed to your\n'Settings' function as a 'client_data' keyword argument.\n\nFor instance, if you set this option to \"['v:version']\", your 'Settings'\nfunction will be called like this:\n>\n  # The '801' value is of course contingent on Vim 8.1; in 8.0 it would be '800'\n  Settings( ..., client_data = { 'v:version': 801 } )\n<\nSo the 'client_data' parameter is a dictionary mapping Vim expression strings\nto their values at the time of the request.\n\nThe correct way to define parameters for your 'Settings' function:\n>\n  def Settings( **kwargs ):\n<\nYou can then get to 'client_data' with \"kwargs['client_data']\".\n\nDefault: '[]'\n>\n  let g:ycm_extra_conf_vim_data = []\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_server_python_interpreter* option\n\nYCM will by default search for an appropriate Python interpreter on your\nsystem. You can use this option to override that behavior and force the use of\na specific interpreter of your choosing.\n\n**NOTE:** This interpreter is only used for the ycmd server [44]. The YCM\nclient running inside Vim always uses the Python interpreter that's embedded\ninside Vim.\n\nDefault: \"''\"\n>\n  let g:ycm_server_python_interpreter = ''\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_keep_logfiles* option\n\nWhen this option is set to '1', YCM and the ycmd completion server [44] will\nkeep the logfiles around after shutting down (they are deleted on shutdown by\ndefault).\n\nTo see where the log files are, call |:YcmDebugInfo|.\n\nDefault: '0'\n>\n  let g:ycm_keep_logfiles = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_log_level* option\n\nThe logging level that YCM and the ycmd completion server [44] use. Valid\nvalues are the following, from most verbose to least verbose: - 'debug' -\n'info' - 'warning' - 'error' - 'critical'\n\nNote that 'debug' is _very_ verbose.\n\nDefault: 'info'\n>\n  let g:ycm_log_level = 'info'\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_auto_start_csharp_server* option\n\nWhen set to '1', the OmniSharp-Roslyn server will be automatically started\n(once per Vim session) when you open a C# file.\n\nDefault: '1'\n>\n  let g:ycm_auto_start_csharp_server = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_auto_stop_csharp_server* option\n\nWhen set to '1', the OmniSharp-Roslyn server will be automatically stopped upon\nclosing Vim.\n\nDefault: '1'\n>\n  let g:ycm_auto_stop_csharp_server = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_csharp_server_port* option\n\nWhen g:ycm_auto_start_csharp_server is set to '1', specifies the port for the\nOmniSharp-Roslyn server to listen on. When set to '0' uses an unused port\nprovided by the OS.\n\nDefault: '0'\n>\n  let g:ycm_csharp_server_port = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_csharp_insert_namespace_expr* option\n\nBy default, when YCM inserts a namespace, it will insert the 'using' statement\nunder the nearest 'using' statement. You may prefer that the 'using' statement\nis inserted somewhere, for example, to preserve sorting. If so, you can set\nthis option to override this behavior.\n\nWhen this option is set, instead of inserting the 'using' statement itself, YCM\nwill set the global variable 'g:ycm_namespace_to_insert' to the namespace to\ninsert, and then evaluate this option's value as an expression. The option's\nexpression is responsible for inserting the namespace - the default insertion\nwill not occur.\n\nDefault: ''\n>\n  let g:ycm_csharp_insert_namespace_expr = ''\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_add_preview_to_completeopt* option\n\nWhen this option is set to '1', YCM will add the 'preview' string to Vim's\n'completeopt' option (see ':h completeopt'). If your 'completeopt' option\nalready has 'preview' set, there will be no effect. Alternatively, when set to\n'popup' and your version of Vim supports popup windows (see ':help popup'), the\n'popup' string will be used instead. You can see the current state of your\n'completeopt' setting with ':set completeopt?' (yes, the question mark is\nimportant).\n\nWhen 'preview' is present in 'completeopt', YCM will use the 'preview' window\nat the top of the file to store detailed information about the current\ncompletion candidate (but only if the candidate came from the semantic engine).\nFor instance, it would show the full function prototype and all the function\noverloads in the window if the current completion is a function name.\n\nWhen 'popup' is present in 'completeopt', YCM will instead use a 'popup' window\nto the side of the completion popup for storing detailed information about the\ncurrent completion candidate. In addition, YCM may truncate the detailed\ncompletion information in order to give the popup sufficient room to display\nthat detailed information.\n\nDefault: '0'\n>\n  let g:ycm_add_preview_to_completeopt = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_autoclose_preview_window_after_completion* option\n\nWhen this option is set to '1', YCM will auto-close the 'preview' window after\nthe user accepts the offered completion string. If there is no 'preview' window\ntriggered because there is no 'preview' string in 'completeopt', this option is\nirrelevant. See the |g:ycm_add_preview_to_completeopt| option for more details.\n\nDefault: '0'\n>\n  let g:ycm_autoclose_preview_window_after_completion = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_autoclose_preview_window_after_insertion* option\n\nWhen this option is set to '1', YCM will auto-close the 'preview' window after\nthe user leaves insert mode. This option is irrelevant if\n|g:ycm_autoclose_preview_window_after_completion| is set or if no 'preview'\nwindow is triggered. See the |g:ycm_add_preview_to_completeopt| option for more\ndetails.\n\nDefault: '0'\n>\n  let g:ycm_autoclose_preview_window_after_insertion = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_max_diagnostics_to_display* option\n\nThis option controls the maximum number of diagnostics shown to the user when\nerrors or warnings are detected in the file. This option is only relevant for\nthe C-family, C#, Java, JavaScript, and TypeScript languages.\n\nA special value of '0' means there is no limit.\n\nDefault: '30'\n>\n  let g:ycm_max_diagnostics_to_display = 30\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_key_list_select_completion* option\n\nThis option controls the key mappings used to select the first completion\nstring. Invoking any of them repeatedly cycles forward through the completion\nlist.\n\nSome users like adding '<Enter>' to this list.\n\nDefault: \"['<TAB>', '<Down>']\"\n>\n  let g:ycm_key_list_select_completion = ['<TAB>', '<Down>']\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_key_list_previous_completion* option\n\nThis option controls the key mappings used to select the previous completion\nstring. Invoking any of them repeatedly cycles backward through the completion\nlist.\n\nNote that one of the defaults is '<S-TAB>' which means Shift-TAB. That mapping\nwill probably only work in GUI Vim (Gvim or MacVim) and not in plain console\nVim because the terminal usually does not forward modifier key combinations to\nVim.\n\nDefault: \"['<S-TAB>', '<Up>']\"\n>\n  let g:ycm_key_list_previous_completion = ['<S-TAB>', '<Up>']\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_key_list_stop_completion* option\n\nThis option controls the key mappings used to close the completion menu. This\nis useful when the menu is blocking the view, when you need to insert the\n'<TAB>' character, or when you want to expand a snippet from UltiSnips [25] and\nnavigate through it.\n\nDefault: \"['<C-y>']\"\n>\n  let g:ycm_key_list_stop_completion = ['<C-y>']\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_key_invoke_completion* option\n\nThis option controls the key mapping used to invoke the completion menu for\nsemantic completion. By default, semantic completion is triggered automatically\nafter typing characters appropriate for the language, such as '.', '->', '::',\netc. in insert mode (if semantic completion support has been compiled in). This\nkey mapping can be used to trigger semantic completion anywhere. Useful for\nsearching for top-level functions and classes.\n\nConsole Vim (not Gvim or MacVim) passes '<Nul>' to Vim when the user types\n'<C-Space>' so YCM will make sure that '<Nul>' is used in the map command when\nyou're editing in console Vim, and '<C-Space>' in GUI Vim. This means that you\ncan just press '<C-Space>' in both the console and GUI Vim and YCM will do the\nright thing.\n\nSetting this option to an empty string will make sure no mapping is created.\n\nDefault: '<C-Space>'\n>\n  let g:ycm_key_invoke_completion = '<C-Space>'\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_key_detailed_diagnostics* option\n\nThis option controls the key mapping used to show the full diagnostic text when\nthe user's cursor is on the line with the diagnostic. It basically calls\n|:YcmShowDetailedDiagnostic|.\n\nSetting this option to an empty string will make sure no mapping is created.\n\nIf you prefer the detailed diagnostic to be shown in a popup, then 'let\ng:ycm_show_detailed_diag_in_popup=1'.\n\nDefault: '<leader>d'\n>\n  let g:ycm_key_detailed_diagnostics = '<leader>d'\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_show_detailed_diag_in_popup* option\n\nMakes |:YcmShowDetailedDiagnostic| always show in a popup rather than echoing\nto the command line.\n\nDefault: 0\n>\n  let g:ycm_show_detailed_diag_in_popup = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_global_ycm_extra_conf* option\n\nNormally, YCM searches for a '.ycm_extra_conf.py' file for compilation flags\n(see the User Guide for more details on how this works). This option specifies\na fallback path to a config file which is used if no '.ycm_extra_conf.py' is\nfound.\n\nYou can place such a global file anywhere in your filesystem.\n\nDefault: \"''\"\n>\n  let g:ycm_global_ycm_extra_conf = ''\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_confirm_extra_conf* option\n\nWhen this option is set to '1' YCM will ask once per '.ycm_extra_conf.py' file\nif it is safe to be loaded. This is to prevent the execution of malicious code\nfrom a '.ycm_extra_conf.py' file you didn't write.\n\nTo selectively get YCM to ask/not ask about loading certain\n'.ycm_extra_conf.py' files, see the |g:ycm_extra_conf_globlist| option.\n\nDefault: '1'\n>\n  let g:ycm_confirm_extra_conf = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_extra_conf_globlist* option\n\nThis option is a list that may contain several globbing patterns. If a pattern\nstarts with a '!' all '.ycm_extra_conf.py' files matching that pattern will be\nblacklisted, that is they won't be loaded and no confirmation dialog will be\nshown. If a pattern does not start with a '!' all files matching that pattern\nwill be whitelisted. Note that this option is not used when confirmation is\ndisabled using |g:ycm_confirm_extra_conf| and that items earlier in the list\nwill take precedence over the later ones.\n\nRules:\n\n- '*' matches everything\n- '?' matches any single character\n- '[seq]' matches any character in seq\n- '[!seq]' matches any char not in seq\n\nExample:\n>\n  let g:ycm_extra_conf_globlist = ['~/dev/*','!~/*']\n<\n- The first rule will match everything contained in the '~/dev' directory so\n  '.ycm_extra_conf.py' files from there will be loaded.\n\n- The second rule will match everything in the home directory so a\n  '.ycm_extra_conf.py' file from there won't be loaded.\n\n- As the first rule takes precedence everything in the home directory\n  excluding the '~/dev' directory will be blacklisted.\n\n**NOTE:** The glob pattern is first expanded with Python's\n'os.path.expanduser()' and then resolved with 'os.path.abspath()' before being\nmatched against the filename.\n\nDefault: '[]'\n>\n  let g:ycm_extra_conf_globlist = []\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_filepath_completion_use_working_dir* option\n\nBy default, YCM's filepath completion will interpret relative paths like '../'\nas being relative to the folder of the file of the currently active buffer.\nSetting this option will force YCM to always interpret relative paths as being\nrelative to Vim's current working directory.\n\nDefault: '0'\n>\n  let g:ycm_filepath_completion_use_working_dir = 0\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_semantic_triggers* option\n\nThis option controls the character-based triggers for the various semantic\ncompletion engines. The option holds a dictionary of key-values, where the keys\nare Vim's filetype strings delimited by commas and values are lists of strings,\nwhere the strings are the triggers.\n\nSetting key-value pairs on the dictionary _adds_ semantic triggers to the\ninternal default set (listed below). You cannot remove the default triggers,\nonly add new ones.\n\nA \"trigger\" is a sequence of one or more characters that trigger semantic\ncompletion when typed. For instance, C++ ('cpp' filetype) has '.' listed as a\ntrigger. So when the user types 'foo.', the semantic engine will trigger and\nserve 'foo''s list of member functions and variables. Since C++ also has '->'\nlisted as a trigger, the same thing would happen when the user typed 'foo->'.\n\nIt's also possible to use a regular expression as a trigger. You have to prefix\nyour trigger with 're!' to signify it's a regex trigger. For instance,\n're!\\w+\\.' would only trigger after the '\\w+\\.' regex matches.\n\n**NOTE:** The regex syntax is **NOT** Vim's, it's Python's [95].\n\nDefault: '[see next line]'\n>\n  let g:ycm_semantic_triggers =  {\n    \\   'c': ['->', '.'],\n    \\   'objc': ['->', '.', 're!\\[[_a-zA-Z]+\\w*\\s', 're!^\\s*[^\\W\\d]\\w*\\s',\n    \\            're!\\[.*\\]\\s'],\n    \\   'ocaml': ['.', '#'],\n    \\   'cpp,cuda,objcpp': ['->', '.', '::'],\n    \\   'perl': ['->'],\n    \\   'php': ['->', '::'],\n    \\   'cs,d,elixir,go,groovy,java,javascript,julia,perl6,python,scala,typescript,vb': ['.'],\n    \\   'ruby,rust': ['.', '::'],\n    \\   'lua': ['.', ':'],\n    \\   'erlang': [':'],\n    \\ }\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_cache_omnifunc* option\n\nSome omnicompletion engines do not work well with the YCM cache—in particular,\nthey might not produce all possible results for a given prefix. By unsetting\nthis option you can ensure that the omnicompletion engine is re-queried on\nevery keypress. That will ensure all completions will be presented but might\ncause stuttering and lag if the omnifunc is slow.\n\nDefault: '1'\n>\n  let g:ycm_cache_omnifunc = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_use_ultisnips_completer* option\n\nBy default, YCM will query the UltiSnips plugin for possible completions of\nsnippet triggers. This option can turn that behavior off.\n\nDefault: '1'\n>\n  let g:ycm_use_ultisnips_completer = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_goto_buffer_command* option\n\nDefines where 'GoTo*' commands result should be opened. Can take one of the\nfollowing values: \"'same-buffer'\", \"'split'\", or \"'split-or-existing-window'\".\nIf this option is set to the \"'same-buffer'\" but current buffer can not be\nswitched (when buffer is modified and 'nohidden' option is set), then result\nwill be opened in a split. When the option is set to\n\"'split-or-existing-window'\", if the result is already open in a window of the\ncurrent tab page (or any tab pages with the ':tab' modifier; see below), it\nwill jump to that window. Otherwise, the result will be opened in a split as if\nthe option was set to \"'split'\".\n\nTo customize the way a new window is split, prefix the 'GoTo*' command with one\nof the following modifiers: ':aboveleft', ':belowright', ':botright',\n':leftabove', ':rightbelow', ':topleft', and ':vertical'. For instance, to\nsplit vertically to the right of the current window, run the command:\n>\n  :rightbelow vertical YcmCompleter GoTo\n<\nTo open in a new tab page, use the ':tab' modifier with the \"'split'\" or\n\"'split-or-existing-window'\" options e.g.:\n>\n  :tab YcmCompleter GoTo\n<\nDefault: \"'same-buffer'\"\n>\n  let g:ycm_goto_buffer_command = 'same-buffer'\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_disable_for_files_larger_than_kb* option\n\nDefines the max size (in Kb) for a file to be considered for completion. If\nthis option is set to 0 then no check is made on the size of the file you're\nopening.\n\nDefault: 1000\n>\n  let g:ycm_disable_for_files_larger_than_kb = 1000\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_use_clangd* option\n\nThis option controls whether **clangd** should be used as a completion engine\nfor C-family languages. Can take one of the following values: '1', '0', with\nmeanings:\n\n- '1': YCM will use clangd if clangd binary exists in third party or it was\n  provided with 'ycm_clangd_binary_path' option.\n- '0': YCM will never use clangd completer.\n\nDefault: '1'\n>\n  let g:ycm_use_clangd = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_clangd_binary_path* option\n\nWhen 'ycm_use_clangd' option is set to '1', this option sets the path to\n**clangd** binary.\n\nDefault: \"''\"\n>\n  let g:ycm_clangd_binary_path = ''\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_clangd_args* option\n\nThis option controls the command line arguments passed to the clangd binary. It\nappends new options and overrides the existing ones.\n\nDefault: '[]'\n>\n  let g:ycm_clangd_args = []\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_clangd_uses_ycmd_caching* option\n\nThis option controls which ranking and filtering algorithm to use for\ncompletion items. It can take values:\n\n- '1': Uses ycmd's caching and filtering logic.\n- '0': Uses clangd's caching and filtering logic.\n\nDefault: '1'\n>\n  let g:ycm_clangd_uses_ycmd_caching = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_language_server* option\n\nThis option lets YCM use an arbitrary Language Server Protocol (LSP) server,\nnot unlike many other completion systems. The officially supported completers\nare favoured over custom LSP ones, so overriding an existing completer means\nfirst making sure YCM won't choose that existing completer in the first place.\n\nA simple working example of this option can be found in the section called\n\"Semantic Completion for Other Languages\".\n\nMany working examples can be found in the YCM lsp-examples [80] repository.\n\nDefault: '[]'\n>\n  let g:ycm_language_server = []\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_disable_signature_help* option\n\nThis option allows you to disable all signature help for all completion\nengines. There is no way to disable it per-completer.\n\nDefault: '0'\n>\n  \" Disable signature help\n  let g:ycm_disable_signature_help = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_signature_help_disable_syntax* option\n\nSet this to 1 to disable syntax highlighting in the signature help popup. Thiis\ncan help if your colourscheme doesn't work well with the default highliting and\ninverse video.\n\nDefault: '0'\n>\n  \" Disable signature help syntax highliting\n  let g:ycm_signature_help_disable_syntax = 1\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_gopls_binary_path* option\n\nIn case the system-wide 'gopls' binary is newer than the bundled one, setting\nthis option to the path of the system-wide 'gopls' would make YCM use that one\ninstead.\n\nIf the path is just 'gopls', YCM will search in '$PATH'.\n\n-------------------------------------------------------------------------------\nThe *g:ycm_gopls_args* option\n\nSimilar to the |g:ycm_clangd_args|, this option allows passing additional flags\nto the 'gopls' command line.\n\nDefault: '[]'\n>\n  let g:ycm_gopls_args = []\n<\n-------------------------------------------------------------------------------\nThe *g:ycm_rls_binary_path* and 'g:ycm_rustc_binary_path' options\n\nYCM no longer uses RLS for rust, and these options are therefore no longer\nsupported.\n\nTo use a custom rust-analyzer, see |g:ycm_rust_toolchain_root|.\n\n-------------------------------------------------------------------------------\nThe *g:ycm_rust_toolchain_root* option\n\nOptionally specify the path to a custom rust toolchain including at least a\nsupported version of 'rust-analyzer'.\n\n-------------------------------------------------------------------------------\nThe *g:ycm_tsserver_binary_path* option\n\nSimilar to the 'gopls' path, this option tells YCM where is the TSServer\nexecutable located.\n\n-------------------------------------------------------------------------------\nThe *g:ycm_roslyn_binary_path* option\n\nSimilar to the 'gopls' path, this option tells YCM where is the\nOmnisharp-Roslyn executable located.\n\n-------------------------------------------------------------------------------\nThe *g:ycm_update_diagnostics_in_insert_mode* option\n\nWith async diagnostics, LSP servers might send new diagnostics mid-typing. If\nseeing these new diagnostics while typing is not desired, this option can be\nset to 0.\n\nWhen this option is set to '0', diagnostic signs, virtual text, and highlights\nare cleared when entering insert mode and replaced when leaving insert mode.\nThis reduces visual noise while editing.\n\nIn addition, this option is recommended when |g:ycm_echo_current_diagnostic| is\nset to 'virtual-text' as it prevents updating the virtual text while you are\ntyping.\n\nDefault: '1'\n>\n  let g:ycm_update_diagnostics_in_insert_mode = 1\n<\n-------------------------------------------------------------------------------\n                                                            *youcompleteme-faq*\nFAQ ~\n\nThe FAQ section has been moved to the wiki [8].\n\n-------------------------------------------------------------------------------\n                                    *youcompleteme-contributor-code-of-conduct*\nContributor Code of Conduct ~\n\nPlease note that this project is released with a Contributor Code of Conduct\n[97]. By participating in this project you agree to abide by its terms.\n\n-------------------------------------------------------------------------------\n                                                        *youcompleteme-contact*\nContact ~\n\nIf you have questions about the plugin or need help, please join the Gitter\nroom [1] or use the ycm-users [98] mailing list.\n\nIf you have bug reports or feature suggestions, please use the issue tracker\n[99]. Before you do, please carefully read CONTRIBUTING.md [100] as this asks\nfor important diagnostics which the team will use to help get you going.\n\nThe latest version of the plugin is available at\nhttps://ycm-core.github.io/YouCompleteMe/.\n\nThe author's homepage is https://val.markovic.io.\n\nPlease do **NOT** go to #vim, Reddit, or Stack Overflow for support. Please\ncontact the YouCompleteMe maintainers directly using the contact details.\n\n-------------------------------------------------------------------------------\n                                                        *youcompleteme-license*\nLicense ~\n\nThis software is licensed under the GPL v3 license [101]. © 2015-2018\nYouCompleteMe contributors\n\n-------------------------------------------------------------------------------\n                                                    *youcompleteme-sponsorship*\nSponsorship ~\n\nIf you like YCM so much that you're willing to part with your hard-earned cash,\nplease consider donating to one of the following charities, which are\nmeaningful to the current maintainers (in no particular order):\n\n- Hector's Greyhound Rescue [102]\n- Be Humane [103]\n- Cancer Research UK [104]\n- ICCF Holland [105]\n- Any charity of your choosing.\n\nPlease note: The YCM maintainers do not specifically endorse nor necessarily\nhave any relationship with the above charities. Disclosure: It is noted that\none key maintainer is a family with Trustees of Greyhound Rescue Wales.\n\n===============================================================================\n                                                     *youcompleteme-references*\nReferences ~\n\n[1] https://gitter.im/Valloric/YouCompleteMe\n[2] https://img.shields.io/gitter/room/Valloric/YouCompleteMe.svg\n[3] https://dev.azure.com/YouCompleteMe/YCM/_build?definitionId=3&branchName=master\n[4] https://dev.azure.com/YouCompleteMe/YCM/_apis/build/status/ycm-core.YouCompleteMe?branchName=master\n[5] https://codecov.io/gh/ycm-core/YouCompleteMe\n[6] https://img.shields.io/codecov/c/github/ycm-core/YouCompleteMe/master.svg\n[7] https://github.com/ycm-core/YouCompleteMe/wiki/Troubleshooting-steps-for-ycmd-server-SHUT-DOWN\n[8] https://github.com/ycm-core/YouCompleteMe/wiki/FAQ\n[9] https://github.com/ycm-core/YouCompleteMe/issues/4134#issuecomment-1446235584\n[10] https://www.vim.org/\n[11] https://clang.llvm.org/extra/clangd.html\n[12] https://github.com/davidhalter/jedi\n[13] https://github.com/OmniSharp/omnisharp-roslyn\n[14] https://github.com/golang/go/wiki/gopls\n[15] https://github.com/Microsoft/TypeScript/tree/master/src/server\n[16] https://rust-analyzer.github.io\n[17] https://github.com/eclipse/eclipse.jdt.ls\n[18] https://i.imgur.com/0OP4ood.gif\n[19] https://en.wikipedia.org/wiki/Subsequence\n[20] https://github.com/scrooloose/syntastic\n[21] https://user-images.githubusercontent.com/10026824/34471853-af9cf32a-ef53-11e7-8229-de534058ddc4.gif\n[22] https://user-images.githubusercontent.com/10584846/58738348-5060da80-83fd-11e9-9537-d07fdbf4554c.gif\n[23] https://i.imgur.com/nmUUbdl.gif\n[24] https://user-images.githubusercontent.com/10584846/80312146-91af6500-87db-11ea-996b-7396f3134d1f.gif\n[25] https://github.com/SirVer/ultisnips/blob/master/doc/UltiSnips.txt\n[26] https://github.com/VundleVim/Vundle.vim#about\n[27] mono-install-macos\n[28] https://macvim-dev.github.io/macvim/\n[29] https://brew.sh\n[30] https://www.mono-project.com/download/stable/\n[31] https://golang.org/doc/install\n[32] https://docs.npmjs.com/getting-started/installing-node#1-install-nodejs--npm\n[33] https://adoptium.net/en-GB/temurin/releases\n[34] https://github.com/ycm-core/YouCompleteMe/wiki/Building-Vim-from-source\n[35] https://www.mono-project.com/download/stable/#download-lin\n[36] https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16\n[37] https://vimhelp.appspot.com/starting.txt.html#vimrc\n[38] https://github.com/vim/vim-win32-installer/releases\n[39] https://www.python.org/downloads/windows/\n[40] https://cmake.org/download/\n[41] https://stackoverflow.com/questions/6319274/how-do-i-run-msbuild-from-the-command-line-using-windows-sdk-7-1\n[42] https://github.com/ycm-core/YouCompleteMe/wiki/Full-Installation-Guide\n[43] https://www.unicode.org/glossary/#diacritic\n[44] https://github.com/ycm-core/ycmd\n[45] https://github.com/ycm-core/ycmd/pull/1255\n[46] https://user-images.githubusercontent.com/10584846/173137003-a265e8b0-84db-4993-98f0-03ee81b9de94.png\n[47] https://user-images.githubusercontent.com/10584846/173137012-7547de0b-145f-45fa-ace3-18943acd2141.png\n[48] https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_semanticTokens\n[49] https://user-images.githubusercontent.com/10584846/185708054-68074fc0-e50c-4a65-887c-da6f372b8982.png\n[50] https://user-images.githubusercontent.com/10584846/185708156-b52970ce-005f-4f0b-97e7-bdf8feeefedc.png\n[51] https://user-images.githubusercontent.com/10584846/185708242-e42dab6f-1847-46f1-8585-2d9f2c8a76dc.png\n[52] https://github.com/ycm-core/YouCompleteMe/wiki/C-family-Semantic-Completion-through-libclang\n[53] https://clang.llvm.org/docs/JSONCompilationDatabase.html\n[54] https://ninja-build.org/manual.html\n[55] https://pypi.org/project/compiledb/\n[56] https://github.com/rizsotto/Bear\n[57] https://raw.githubusercontent.com/ycm-core/ycmd/66030cd94299114ae316796f3cad181cac8a007c/.ycm_extra_conf.py\n[58] https://github.com/rdnetto/YCM-Generator\n[59] https://github.com/eclipse/eclipse.jdt.ls/blob/master/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/preferences/Preferences.java\n[60] https://help.eclipse.org/oxygen/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Fproject_description_file.html\n[61] https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html\n[62] https://docs.gradle.org/current/userguide/tutorial_java_projects.html\n[63] https://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fjdt%2Fcore%2FIClasspathEntry.html\n[64] https://github.com/ycm-core/ycmd/tree/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_eclipse_project\n[65] https://github.com/ycm-core/ycmd/blob/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_maven_project/pom.xml\n[66] https://github.com/ycm-core/ycmd/tree/3602f38ef7a762fc765afd75e562aec9a134711e/ycmd/tests/java/testdata/simple_gradle_project\n[67] https://github.com/ycm-core/lsp-examples#kotlin\n[68] https://github.com/OmniSharp/omnisharp-roslyn/releases/\n[69] https://github.com/ycm-core/YouCompleteMe/blob/master/.ycm_extra_conf.py\n[70] https://github.com/rust-lang/rls\n[71] https://www.rust-lang.org/downloads.html\n[72] https://rust-analyzer.github.io/manual.html#configuration]\n[73] https://github.com/golang/tools/blob/master/gopls/doc/settings.md\n[74] https://ternjs.net\n[75] https://github.com/ycm-core/YouCompleteMe/wiki/JavaScript-Semantic-Completion-through-Tern\n[76] https://code.visualstudio.com/docs/languages/jsconfig\n[77] https://www.typescriptlang.org/docs/handbook/tsconfig-json.html\n[78] https://clang.llvm.org/\n[79] https://github.com/ycm-core/ycmd#language_server-configuration\n[80] https://github.com/ycm-core/lsp-examples\n[81] http://eclim.org/\n[82] https://github.com/ycm-core/ycmd/blob/master/ycmd/completers/completer.py\n[83] https://github.com/Valloric/ListToggle\n[84] https://asciinema.org/a/4JmYLAaz5hOHbZDD0hbsQpY8C\n[85] https://asciinema.org/a/4JmYLAaz5hOHbZDD0hbsQpY8C.svg\n[86] https://asciinema.org/a/659925\n[87] https://asciinema.org/a/659925.svg\n[88] https://user-images.githubusercontent.com/17928698/206855014-9131a49b-87e8-4ed4-8d91-f2fe7808a0b9.gif\n[89] https://user-images.githubusercontent.com/17928698/206855713-3588c8de-d0f5-4725-b65e-bc51110252cc.gif\n[90] https://jedi.readthedocs.io/en/latest/docs/api.html#jedi.Script.extract_variable\n[91] https://github.com/puremourning/vimspector\n[92] https://github.com/itchyny/lightline.vim\n[93] https://user-images.githubusercontent.com/10584846/185707973-39703699-0263-47d3-82ac-639d52259bea.png\n[94] https://user-images.githubusercontent.com/10584846/185707993-14ff5fd7-c082-4e5a-b825-f1364e619b6a.png\n[95] https://docs.python.org/2/library/re.html#regular-expression-syntax\n[96] http://ctags.sourceforge.net/FORMAT\n[97] https://github.com/ycm-core/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md\n[98] https://groups.google.com/forum/?hl=en#!forum/ycm-users\n[99] https://github.com/ycm-core/YouCompleteMe/issues?state=open\n[100] https://github.com/ycm-core/YouCompleteMe/blob/master/CONTRIBUTING.md\n[101] https://www.gnu.org/copyleft/gpl.html\n[102] https://www.hectorsgreyhoundrescue.org\n[103] https://www.budihuman.rs/en\n[104] https://www.cancerresearchuk.org\n[105] https://iccf.nl\n\nvim: ft=help\n"
  },
  {
    "path": "install.py",
    "content": "#!/usr/bin/env python3\n\nfrom __future__ import print_function\nfrom __future__ import division\nfrom __future__ import unicode_literals\nfrom __future__ import absolute_import\n\nimport os\nimport subprocess\nimport sys\nimport os.path as p\nimport glob\n\nversion = sys.version_info[ 0 : 3 ]\nif version < ( 3, 12, 0 ):\n  sys.exit( 'YouCompleteMe requires Python >= 3.12.0; '\n            'your version of Python is ' + sys.version )\n\nDIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )\nDIR_OF_OLD_LIBS = p.join( DIR_OF_THIS_SCRIPT, 'python' )\n\n\ndef CheckCall( args, **kwargs ):\n  try:\n    subprocess.check_call( args, **kwargs )\n  except subprocess.CalledProcessError as error:\n    sys.exit( error.returncode )\n\n\ndef Main():\n  build_file = p.join( DIR_OF_THIS_SCRIPT, 'third_party', 'ycmd', 'build.py' )\n\n  if not p.isfile( build_file ):\n    sys.exit(\n      'File {0} does not exist; you probably forgot to run:\\n'\n      '\\tgit submodule update --init --recursive\\n'.format( build_file ) )\n\n  CheckCall( [ sys.executable, build_file ] + sys.argv[ 1: ] )\n\n  # Remove old YCM libs if present so that YCM can start.\n  old_libs = (\n    glob.glob( p.join( DIR_OF_OLD_LIBS, '*ycm_core.*' ) ) +\n    glob.glob( p.join( DIR_OF_OLD_LIBS, '*ycm_client_support.*' ) ) +\n    glob.glob( p.join( DIR_OF_OLD_LIBS, '*clang*.*' ) ) )\n  for lib in old_libs:\n    os.remove( lib )\n\n\nif __name__ == \"__main__\":\n  Main()\n"
  },
  {
    "path": "install.sh",
    "content": "#!/bin/sh\n\necho \"WARNING: this script is deprecated. Use the install.py script instead.\" 1>&2\n\n\nSCRIPT_DIR=$(dirname $0 || exit $?)\n\npython3 \"$SCRIPT_DIR/install.py\" \"$@\" || exit $?\n"
  },
  {
    "path": "plugin/youcompleteme.vim",
    "content": "\" Copyright (C) 2011, 2012  Google Inc.\n\"\n\" This file is part of YouCompleteMe.\n\"\n\" YouCompleteMe is free software: you can redistribute it and/or modify\n\" it under the terms of the GNU General Public License as published by\n\" the Free Software Foundation, either version 3 of the License, or\n\" (at your option) any later version.\n\"\n\" YouCompleteMe is distributed in the hope that it will be useful,\n\" but WITHOUT ANY WARRANTY; without even the implied warranty of\n\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n\" GNU General Public License for more details.\n\"\n\" You should have received a copy of the GNU General Public License\n\" along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\" This is basic vim plugin boilerplate\nlet s:save_cpo = &cpo\nset cpo&vim\n\nfunction! s:restore_cpo()\n  let &cpo = s:save_cpo\n  unlet s:save_cpo\nendfunction\n\n\" NOTE: The minimum supported version is 8.2.3995, but neovim always reports as\n\" v:version 800, but will largely work.\nlet s:is_neovim = has( 'nvim' )\n\nif exists( \"g:loaded_youcompleteme\" )\n  call s:restore_cpo()\n  finish\nelseif ( v:version < 901 || (v:version == 901 && !has( 'patch0016' )) ) &&\n      \\ !s:is_neovim\n  echohl WarningMsg |\n        \\ echomsg \"YouCompleteMe unavailable: requires Vim 9.1.0016+.\" |\n        \\ echohl None\n  call s:restore_cpo()\n  finish\nelseif !has( 'timers' )\n  echohl WarningMsg |\n        \\ echomsg \"YouCompleteMe unavailable: requires Vim compiled with \" .\n        \\ \"the timers feature.\" |\n        \\ echohl None\n  call s:restore_cpo()\n  finish\nelseif !has( 'python3_compiled' )\n  echohl WarningMsg |\n        \\ echomsg \"YouCompleteMe unavailable: requires Vim compiled with \" .\n        \\ \"Python (3.12.0+) support.\" |\n        \\ echohl None\n  call s:restore_cpo()\n  finish\n\" These calls try to load the Python 3 libraries when Vim is\n\" compiled dynamically against them. Since only one can be loaded at a time on\n\" some platforms, we first check if Python 3 is available.\nelseif !has( 'python3' )\n  echohl WarningMsg |\n        \\ echomsg \"YouCompleteMe unavailable: unable to load Python.\" |\n        \\ echohl None\n  call s:restore_cpo()\n  finish\nelseif &encoding !~? 'utf-\\?8'\n  echohl WarningMsg |\n        \\ echomsg \"YouCompleteMe unavailable: requires UTF-8 encoding. \" .\n        \\ \"Put the line 'set encoding=utf-8' in your vimrc.\" |\n        \\ echohl None\n  call s:restore_cpo()\n  finish\nendif\n\nlet g:loaded_youcompleteme = 1\n\n\"\n\" List of YCM options.\n\"\nlet g:ycm_filetype_whitelist =\n      \\ get( g:, 'ycm_filetype_whitelist', { \"*\": 1 } )\n\nlet g:ycm_filetype_blacklist =\n      \\ get( g:, 'ycm_filetype_blacklist', {\n      \\   'tagbar': 1,\n      \\   'notes': 1,\n      \\   'markdown': 1,\n      \\   'netrw': 1,\n      \\   'unite': 1,\n      \\   'text': 1,\n      \\   'vimwiki': 1,\n      \\   'pandoc': 1,\n      \\   'infolog': 1,\n      \\   'leaderf': 1,\n      \\   'mail': 1\n      \\ } )\n\n\" Blacklist empty buffers unless explicity whitelisted; workaround for\n\" https://github.com/ycm-core/YouCompleteMe/issues/3781\nif !has_key( g:ycm_filetype_whitelist, 'ycm_nofiletype' )\n  let g:ycm_filetype_blacklist.ycm_nofiletype = 1\nendif\n\nlet g:ycm_open_loclist_on_ycm_diags =\n      \\ get( g:, 'ycm_open_loclist_on_ycm_diags', 1 )\n\nlet g:ycm_add_preview_to_completeopt =\n      \\ get( g:, 'ycm_add_preview_to_completeopt', 0 )\n\nlet g:ycm_autoclose_preview_window_after_completion =\n      \\ get( g:, 'ycm_autoclose_preview_window_after_completion', 0 )\n\nlet g:ycm_autoclose_preview_window_after_insertion =\n      \\ get( g:, 'ycm_autoclose_preview_window_after_insertion', 0 )\n\nlet g:ycm_key_list_select_completion =\n      \\ get( g:, 'ycm_key_list_select_completion', ['<TAB>', '<Down>'] )\n\nlet g:ycm_key_list_previous_completion =\n      \\ get( g:, 'ycm_key_list_previous_completion', ['<S-TAB>', '<Up>'] )\n\nlet g:ycm_key_list_stop_completion =\n      \\ get( g:, 'ycm_key_list_stop_completion', ['<C-y>'] )\n\nlet g:ycm_key_invoke_completion =\n      \\ get( g:, 'ycm_key_invoke_completion', '<C-Space>' )\n\nlet g:ycm_key_detailed_diagnostics =\n      \\ get( g:, 'ycm_key_detailed_diagnostics', '<leader>d' )\n\nlet g:ycm_cache_omnifunc =\n      \\ get( g:, 'ycm_cache_omnifunc', 1 )\n\nlet g:ycm_log_level =\n      \\ get( g:, 'ycm_log_level',\n      \\ get( g:, 'ycm_server_log_level', 'info' ) )\n\nlet g:ycm_keep_logfiles =\n      \\ get( g:, 'ycm_keep_logfiles',\n      \\ get( g:, 'ycm_server_keep_logfiles', 0 ) )\n\nlet g:ycm_extra_conf_vim_data =\n      \\ get( g:, 'ycm_extra_conf_vim_data', [] )\n\nlet g:ycm_server_python_interpreter =\n      \\ get( g:, 'ycm_server_python_interpreter',\n      \\ get( g:, 'ycm_path_to_python_interpreter', '' ) )\n\nlet g:ycm_show_diagnostics_ui =\n      \\ get( g:, 'ycm_show_diagnostics_ui', 1 )\n\nlet g:ycm_enable_diagnostic_signs =\n      \\ get( g:, 'ycm_enable_diagnostic_signs',\n      \\ get( g:, 'syntastic_enable_signs', 1 ) )\n\nlet g:ycm_enable_diagnostic_highlighting =\n      \\ get( g:, 'ycm_enable_diagnostic_highlighting',\n      \\ get( g:, 'syntastic_enable_highlighting', 1 ) )\n\nlet g:ycm_echo_current_diagnostic =\n      \\ get( g:, 'ycm_echo_current_diagnostic',\n      \\ get( g:, 'syntastic_echo_current_error', 1 ) )\n\nlet g:ycm_filter_diagnostics =\n      \\ get( g:, 'ycm_filter_diagnostics', {} )\n\nlet g:ycm_always_populate_location_list =\n      \\ get( g:, 'ycm_always_populate_location_list',\n      \\ get( g:, 'syntastic_always_populate_loc_list', 0 ) )\n\nlet g:ycm_error_symbol =\n      \\ get( g:, 'ycm_error_symbol',\n      \\ get( g:, 'syntastic_error_symbol', '>>' ) )\n\nlet g:ycm_warning_symbol =\n      \\ get( g:, 'ycm_warning_symbol',\n      \\ get( g:, 'syntastic_warning_symbol', '>>' ) )\n\nlet g:ycm_complete_in_comments =\n      \\ get( g:, 'ycm_complete_in_comments', 0 )\n\nlet g:ycm_complete_in_strings =\n      \\ get( g:, 'ycm_complete_in_strings', 1 )\n\nlet g:ycm_collect_identifiers_from_tags_files =\n      \\ get( g:, 'ycm_collect_identifiers_from_tags_files', 0 )\n\nlet g:ycm_seed_identifiers_with_syntax =\n      \\ get( g:, 'ycm_seed_identifiers_with_syntax', 0 )\n\nlet g:ycm_goto_buffer_command =\n      \\ get( g:, 'ycm_goto_buffer_command', 'same-buffer' )\n\nlet g:ycm_disable_for_files_larger_than_kb =\n      \\ get( g:, 'ycm_disable_for_files_larger_than_kb', 1000 )\n\nlet g:ycm_auto_hover =\n      \\ get( g:, 'ycm_auto_hover', 'CursorHold' )\n\nlet g:ycm_update_diagnostics_in_insert_mode =\n      \\ get( g:, 'ycm_update_diagnostics_in_insert_mode', 1 )\n\n\"\n\" List of ycmd options.\n\"\nlet g:ycm_filepath_completion_use_working_dir =\n      \\ get( g:, 'ycm_filepath_completion_use_working_dir', 0 )\n\nlet g:ycm_auto_trigger =\n      \\ get( g:, 'ycm_auto_trigger', 1 )\n\nlet g:ycm_min_num_of_chars_for_completion =\n      \\ get( g:, 'ycm_min_num_of_chars_for_completion', 2 )\n\nlet g:ycm_min_identifier_candidate_chars =\n      \\ get( g:, 'ycm_min_num_identifier_candidate_chars', 0 )\n\nlet g:ycm_semantic_triggers =\n      \\ get( g:, 'ycm_semantic_triggers', {} )\n\nlet g:ycm_filetype_specific_completion_to_disable =\n      \\ get( g:, 'ycm_filetype_specific_completion_to_disable',\n      \\      { 'gitcommit': 1 } )\n\nlet g:ycm_collect_identifiers_from_comments_and_strings =\n      \\ get( g:, 'ycm_collect_identifiers_from_comments_and_strings', 0 )\n\nlet g:ycm_max_num_identifier_candidates =\n      \\ get( g:, 'ycm_max_num_identifier_candidates', 10 )\n\nlet g:ycm_max_num_candidates =\n      \\ get( g:, 'ycm_max_num_candidates', 50 )\n\nlet g:ycm_extra_conf_globlist =\n      \\ get( g:, 'ycm_extra_conf_globlist', [] )\n\nlet g:ycm_global_ycm_extra_conf =\n      \\ get( g:, 'ycm_global_ycm_extra_conf', '' )\n\nlet g:ycm_confirm_extra_conf =\n      \\ get( g:, 'ycm_confirm_extra_conf', 1 )\n\nlet g:ycm_max_diagnostics_to_display =\n      \\ get( g:, 'ycm_max_diagnostics_to_display', 30 )\n\nlet g:ycm_filepath_blacklist =\n      \\ get( g:, 'ycm_filepath_blacklist', {\n      \\   'html': 1,\n      \\   'jsx': 1,\n      \\   'xml': 1\n      \\ } )\n\nlet g:ycm_auto_start_csharp_server =\n      \\ get( g:, 'ycm_auto_start_csharp_server', 1 )\n\nlet g:ycm_auto_stop_csharp_server =\n      \\ get( g:, 'ycm_auto_stop_csharp_server', 1 )\n\nlet g:ycm_use_ultisnips_completer =\n      \\ get( g:, 'ycm_use_ultisnips_completer', 1 )\n\nlet g:ycm_csharp_server_port =\n      \\ get( g:, 'ycm_csharp_server_port', 0 )\n\nlet g:ycm_use_clangd =\n      \\ get( g:, 'ycm_use_clangd', 1 )\n\nlet g:ycm_clangd_binary_path =\n      \\ get( g:, 'ycm_clangd_binary_path', '' )\n\nlet g:ycm_clangd_args =\n      \\ get( g:, 'ycm_clangd_args', [] )\n\nlet g:ycm_clangd_uses_ycmd_caching =\n      \\ get( g:, 'ycm_clangd_uses_ycmd_caching', 1 )\n\n\" These options are not documented.\nlet g:ycm_java_jdtls_extension_path =\n      \\ get( g:, 'ycm_java_jdtls_extension_path', [] )\n\nlet g:ycm_java_jdtls_use_clean_workspace =\n      \\ get( g:, 'ycm_java_jdtls_use_clean_workspace', 1 )\n\nlet g:ycm_java_jdtls_workspace_root_path =\n      \\ get( g:, 'ycm_java_jdtls_workspace_root_path', '' )\n\n\" This option is deprecated.\nlet g:ycm_python_binary_path =\n      \\ get( g:, 'ycm_python_binary_path', '' )\n\nlet g:ycm_refilter_workspace_symbols =\n      \\ get( g:, 'ycm_refilter_workspace_symbols', 1 )\n\nif has( 'vim_starting' ) \" Loading at startup.\n  \" We defer loading until after VimEnter to allow the gui to fork (see\n  \" `:h gui-fork`) and avoid a deadlock situation, as explained here:\n  \" https://github.com/Valloric/YouCompleteMe/pull/2473#issuecomment-267716136\n  augroup youcompletemeStart\n    autocmd!\n    autocmd VimEnter * call youcompleteme#Enable()\n  augroup END\nelse \" Manual loading with :packadd.\n  call youcompleteme#Enable()\nendif\n\n\" This is basic vim plugin boilerplate\ncall s:restore_cpo()\n"
  },
  {
    "path": "print_todos.sh",
    "content": "#!/bin/bash\nag \\\n--ignore gmock \\\n--ignore jedi/ \\\n--ignore OmniSharpServer \\\n--ignore testdata \\\nTODO \\\nthird_party/ycmd/cpp/ycm python autoload plugin\n"
  },
  {
    "path": "python/test_requirements.txt",
    "content": "flake8                >= 3.0.0\nflake8-comprehensions >= 1.4.1\nflake8-ycm            >= 0.1.0\nPyHamcrest            >= 1.10.1\n# Use the updated fork\ngit+https://github.com/bstaletic/covimerage\n"
  },
  {
    "path": "python/ycm/__init__.py",
    "content": ""
  },
  {
    "path": "python/ycm/base.py",
    "content": "# Copyright (C) 2011, 2012  Google Inc.\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport os\nimport json\n\nfrom ycm import vimsupport, paths\nfrom ycmd import identifier_utils\n\nYCM_VAR_PREFIX = 'ycm_'\n\n\ndef GetUserOptions( default_options = {} ):\n  \"\"\"Builds a dictionary mapping YCM Vim user options to values. Option names\n  don't have the 'ycm_' prefix.\"\"\"\n\n  user_options = {}\n\n  # First load the default settings from ycmd. We do this to ensure that any\n  # client-side code that assumes all options are loaded (such as the\n  # omnicompleter) don't have to constantly check for values being present, and\n  # so that we don't jave to dulicate the list of server settings in\n  # youcomplete.vim\n  defaults_file =  os.path.join( paths.DIR_OF_YCMD,\n                                 'ycmd',\n                                 'default_settings.json' )\n  if os.path.exists( defaults_file ):\n    with open( defaults_file ) as defaults_file_handle:\n      user_options = json.load( defaults_file_handle )\n\n  # Override the server defaults with any client-generated defaults\n  user_options.update( default_options )\n\n  # Finally, override with any user-specified values in the g: dict\n\n  # We only evaluate the keys of the vim globals and not the whole dictionary\n  # to avoid unicode issues.\n  # See https://github.com/Valloric/YouCompleteMe/pull/2151 for details.\n  keys = vimsupport.GetVimGlobalsKeys()\n  for key in keys:\n    if not key.startswith( YCM_VAR_PREFIX ):\n      continue\n    new_key = key[ len( YCM_VAR_PREFIX ): ]\n    new_value = vimsupport.VimExpressionToPythonType( 'g:' + key )\n    user_options[ new_key ] = new_value\n\n  return user_options\n\n\ndef CurrentIdentifierFinished():\n  line, current_column = vimsupport.CurrentLineContentsAndCodepointColumn()\n  previous_char_index = current_column - 1\n  if previous_char_index < 0:\n    return True\n  filetype = vimsupport.CurrentFiletypes()[ 0 ]\n  regex = identifier_utils.IdentifierRegexForFiletype( filetype )\n\n  for match in regex.finditer( line ):\n    if match.end() == previous_char_index:\n      return True\n  # If the whole line is whitespace, that means the user probably finished an\n  # identifier on the previous line.\n  return line[ : current_column ].isspace()\n\n\ndef LastEnteredCharIsIdentifierChar():\n  line, current_column = vimsupport.CurrentLineContentsAndCodepointColumn()\n  if current_column - 1 < 0:\n    return False\n  filetype = vimsupport.CurrentFiletypes()[ 0 ]\n  return (\n    identifier_utils.StartOfLongestIdentifierEndingAtIndex(\n        line, current_column, filetype ) != current_column )\n\n\ndef AdjustCandidateInsertionText( candidates ):\n  \"\"\"This function adjusts the candidate insertion text to take into account the\n  text that's currently in front of the cursor.\n\n  For instance ('|' represents the cursor):\n    1. Buffer state: 'foo.|bar'\n    2. A completion candidate of 'zoobar' is shown and the user selects it.\n    3. Buffer state: 'foo.zoobar|bar' instead of 'foo.zoo|bar' which is what the\n    user wanted.\n\n  This function changes candidates to resolve that issue.\n\n  It could be argued that the user actually wants the final buffer state to be\n  'foo.zoobar|' (the cursor at the end), but that would be much more difficult\n  to implement and is probably not worth doing.\n  \"\"\"\n\n  def NewCandidateInsertionText( to_insert, text_after_cursor ):\n    overlap_len = OverlapLength( to_insert, text_after_cursor )\n    if overlap_len:\n      return to_insert[ :-overlap_len ]\n    return to_insert\n\n  text_after_cursor = vimsupport.TextAfterCursor()\n  if not text_after_cursor:\n    return candidates\n\n  new_candidates = []\n  for candidate in candidates:\n    new_candidate = candidate.copy()\n\n    if not new_candidate.get( 'abbr' ):\n      new_candidate[ 'abbr' ] = new_candidate[ 'word' ]\n\n    new_candidate[ 'word' ] = NewCandidateInsertionText(\n      new_candidate[ 'word' ],\n      text_after_cursor )\n\n    new_candidates.append( new_candidate )\n  return new_candidates\n\n\ndef OverlapLength( left_string, right_string ):\n  \"\"\"Returns the length of the overlap between two strings.\n  Example: \"foo baro\" and \"baro zoo\" -> 4\n  \"\"\"\n  left_string_length = len( left_string )\n  right_string_length = len( right_string )\n\n  if not left_string_length or not right_string_length:\n    return 0\n\n  # Truncate the longer string.\n  if left_string_length > right_string_length:\n    left_string = left_string[ -right_string_length: ]\n  elif left_string_length < right_string_length:\n    right_string = right_string[ :left_string_length ]\n\n  if left_string == right_string:\n    return min( left_string_length, right_string_length )\n\n  # Start by looking for a single character match\n  # and increase length until no match is found.\n  best = 0\n  length = 1\n  while True:\n    pattern = left_string[ -length: ]\n    found = right_string.find( pattern )\n    if found < 0:\n      return best\n    length += found\n    if left_string[ -length: ] == right_string[ :length ]:\n      best = length\n      length += 1\n"
  },
  {
    "path": "python/ycm/buffer.py",
    "content": "# Copyright (C) 2016, Davit Samvelyan\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm import vimsupport\nfrom ycm.client.event_notification import EventNotification\nfrom ycm.diagnostic_interface import DiagnosticInterface\nfrom ycm.semantic_highlighting import SemanticHighlighting\nfrom ycm.inlay_hints import InlayHints\n\n\n# Emulates Vim buffer\n# Used to store buffer related information like diagnostics, latest parse\n# request. Stores buffer change tick at the parse request moment, allowing\n# to effectively determine whether reparse is needed for the buffer.\nclass Buffer:\n\n  def __init__( self, bufnr, user_options, filetypes ):\n    self._number = bufnr\n    self._parse_tick = 0\n    self._handled_tick = 0\n    self._parse_request = None\n    self._should_resend = False\n    self._diag_interface = DiagnosticInterface( bufnr, user_options )\n    self._open_loclist_on_ycm_diags = user_options[\n                                        'open_loclist_on_ycm_diags' ]\n    self.semantic_highlighting = SemanticHighlighting( bufnr )\n    self.inlay_hints = InlayHints( bufnr )\n    self.UpdateFromFileTypes( filetypes )\n\n\n  def FileParseRequestReady( self, block = False ):\n    return ( bool( self._parse_request ) and\n             ( block or self._parse_request.Done() ) )\n\n\n  def SendParseRequest( self, extra_data ):\n    # Don't send a parse request if one is in progress\n    if self._parse_request is not None and not self._parse_request.Done():\n      self._should_resend = True\n      return\n\n    self._should_resend = False\n\n    self._parse_request = EventNotification( 'FileReadyToParse',\n                                             extra_data = extra_data )\n    self._parse_request.Start()\n    # Decrement handled tick to ensure correct handling when we are forcing\n    # reparse on buffer visit and changed tick remains the same.\n    self._handled_tick -= 1\n    self._parse_tick = self._ChangedTick()\n\n\n  def ParseRequestPending( self ):\n    return bool( self._parse_request ) and not self._parse_request.Done()\n\n\n  def NeedsReparse( self ):\n    return self._parse_tick != self._ChangedTick()\n\n\n  def ShouldResendParseRequest( self ):\n    return ( self._should_resend\n             or ( bool( self._parse_request )\n                  and self._parse_request.ShouldResend() ) )\n\n\n  def UpdateDiagnostics( self, force = False ):\n    if force or not self._async_diags:\n      self.UpdateWithNewDiagnostics( self._parse_request.Response(), False )\n    else:\n      # We need to call the response method, because it might throw an exception\n      # or require extra config confirmation, even if we don't actually use the\n      # diagnostics.\n      self._parse_request.Response()\n\n\n  def UpdateWithNewDiagnostics( self, diagnostics, async_message ):\n    self._async_diags = async_message\n    self._diag_interface.UpdateWithNewDiagnostics(\n        diagnostics,\n        not self._async_diags and self._open_loclist_on_ycm_diags )\n\n\n  def UpdateMatches( self ):\n    self._diag_interface.UpdateMatches()\n\n\n  def PopulateLocationList( self, open_on_edit = False ):\n    return self._diag_interface.PopulateLocationList( open_on_edit )\n\n\n  def GetResponse( self ):\n    return self._parse_request.Response()\n\n\n  def IsResponseHandled( self ):\n    return self._handled_tick == self._parse_tick\n\n\n  def MarkResponseHandled( self ):\n    self._handled_tick = self._parse_tick\n\n\n  def OnCursorMoved( self ):\n    self._diag_interface.OnCursorMoved()\n\n\n  def GetErrorCount( self ):\n    return self._diag_interface.GetErrorCount()\n\n\n  def GetWarningCount( self ):\n    return self._diag_interface.GetWarningCount()\n\n\n  def RefreshDiagnosticsUI( self ):\n    return self._diag_interface.RefreshDiagnosticsUI()\n\n\n  def ClearDiagnosticsUI( self ):\n    return self._diag_interface.ClearDiagnosticsUI()\n\n\n  def DiagnosticsForLine( self, line_number ):\n    return self._diag_interface.DiagnosticsForLine( line_number )\n\n\n  def UpdateFromFileTypes( self, filetypes ):\n    self._filetypes = filetypes\n    # We will set this to true if we ever receive any diagnostics asyncronously.\n    self._async_diags = False\n\n\n  def _ChangedTick( self ):\n    return vimsupport.GetBufferChangedTick( self._number )\n\n\nclass BufferDict( dict ):\n\n  def __init__( self, user_options ):\n    self._user_options = user_options\n\n\n  def __missing__( self, key ):\n    # Python does not allow to return assignment operation result directly\n    new_value = self[ key ] = Buffer(\n      key,\n      self._user_options,\n      vimsupport.GetBufferFiletypes( key ) )\n\n    return new_value\n"
  },
  {
    "path": "python/ycm/client/__init__.py",
    "content": ""
  },
  {
    "path": "python/ycm/client/base_request.py",
    "content": "# Copyright (C) 2013-2018 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport logging\nimport json\nimport vim\nfrom base64 import b64decode, b64encode\nfrom hmac import compare_digest\nfrom urllib.parse import urljoin, urlparse, urlencode\nfrom urllib.request import Request, urlopen\nfrom urllib.error import URLError, HTTPError\nfrom ycm import vimsupport\nfrom ycmd.utils import ToBytes, GetCurrentDirectory, ToUnicode\nfrom ycmd.hmac_utils import CreateRequestHmac, CreateHmac\nfrom ycmd.responses import ServerError, UnknownExtraConf\n\nHTTP_SERVER_ERROR = 500\n\n_HEADERS = { 'content-type': 'application/json' }\n_CONNECT_TIMEOUT_SEC = 0.01\n# Setting this to None seems to screw up the Requests/urllib3 libs.\n_READ_TIMEOUT_SEC = 30\n_HMAC_HEADER = 'x-ycm-hmac'\n_logger = logging.getLogger( __name__ )\n\n\nclass BaseRequest:\n\n  def __init__( self ):\n    self._should_resend = False\n\n\n  def Start( self ):\n    pass\n\n\n  def Done( self ):\n    return True\n\n\n  def Response( self ):\n    return {}\n\n\n  def ShouldResend( self ):\n    return self._should_resend\n\n\n  def HandleFuture( self,\n                    future,\n                    display_message = True,\n                    truncate_message = False ):\n    \"\"\"Get the server response from a |future| object and catch any exception\n    while doing so. If an exception is raised because of a unknown\n    .ycm_extra_conf.py file, load the file or ignore it after asking the user.\n    An identical request should be sent again to the server. For other\n    exceptions, log the exception and display its message to the user on the Vim\n    status line. Unset the |display_message| parameter to hide the message from\n    the user. Set the |truncate_message| parameter to avoid hit-enter prompts\n    from this message.\"\"\"\n    try:\n      try:\n        return _JsonFromFuture( future )\n      except UnknownExtraConf as e:\n        if vimsupport.Confirm( str( e ) ):\n          _LoadExtraConfFile( e.extra_conf_file )\n        else:\n          _IgnoreExtraConfFile( e.extra_conf_file )\n        self._should_resend = True\n    except URLError as e:\n      # We don't display this exception to the user since it is likely to happen\n      # for each subsequent request (typically if the server crashed) and we\n      # don't want to spam the user with it.\n      _logger.error( e )\n\n    except Exception as e:\n      _logger.exception( 'Error while handling server response' )\n      if display_message:\n        DisplayServerException( e, truncate_message )\n\n    return None\n\n\n  # This method blocks\n  # |timeout| is num seconds to tolerate no response from server before giving\n  # up; see Requests docs for details (we just pass the param along).\n  # See the HandleFuture method for the |display_message| and |truncate_message|\n  # parameters.\n  def GetDataFromHandler( self,\n                          handler,\n                          timeout = _READ_TIMEOUT_SEC,\n                          display_message = True,\n                          truncate_message = False,\n                          payload = None ):\n    return self.HandleFuture(\n        self.GetDataFromHandlerAsync( handler, timeout, payload ),\n        display_message,\n        truncate_message )\n\n\n  def GetDataFromHandlerAsync( self,\n                               handler,\n                               timeout = _READ_TIMEOUT_SEC,\n                               payload = None ):\n    return BaseRequest._TalkToHandlerAsync(\n        '', handler, 'GET', timeout, payload )\n\n\n  # This is the blocking version of the method. See below for async.\n  # |timeout| is num seconds to tolerate no response from server before giving\n  # up; see Requests docs for details (we just pass the param along).\n  # See the HandleFuture method for the |display_message| and |truncate_message|\n  # parameters.\n  def PostDataToHandler( self,\n                         data,\n                         handler,\n                         timeout = _READ_TIMEOUT_SEC,\n                         display_message = True,\n                         truncate_message = False ):\n    return self.HandleFuture(\n        BaseRequest.PostDataToHandlerAsync( data, handler, timeout ),\n        display_message,\n        truncate_message )\n\n\n  # This returns a future! Use HandleFuture to get the value.\n  # |timeout| is num seconds to tolerate no response from server before giving\n  # up; see Requests docs for details (we just pass the param along).\n  @staticmethod\n  def PostDataToHandlerAsync( data, handler, timeout = _READ_TIMEOUT_SEC ):\n    return BaseRequest._TalkToHandlerAsync( data, handler, 'POST', timeout )\n\n\n  # This returns a future! Use HandleFuture to get the value.\n  # |method| is either 'POST' or 'GET'.\n  # |timeout| is num seconds to tolerate no response from server before giving\n  # up; see Requests docs for details (we just pass the param along).\n  @staticmethod\n  def _TalkToHandlerAsync( data,\n                           handler,\n                           method,\n                           timeout = _READ_TIMEOUT_SEC,\n                           payload = None ):\n    def _MakeRequest( data, handler, method, timeout, payload ):\n      request_uri = _BuildUri( handler )\n\n      if method == 'POST':\n        sent_data = _ToUtf8Json( data )\n        headers = BaseRequest._ExtraHeaders( method,\n                                             request_uri,\n                                             sent_data )\n        _logger.debug( 'POST %s\\n%s\\n%s', request_uri, headers, sent_data )\n      else:\n        headers = BaseRequest._ExtraHeaders( method, request_uri )\n        if payload:\n          request_uri += ToBytes( f'?{ urlencode( payload ) }' )\n\n        _logger.debug( 'GET %s (%s)\\n%s', request_uri, payload, headers )\n      return urlopen(\n        Request(\n          ToUnicode( request_uri ),\n          data = sent_data if data else None,\n          headers = headers,\n          method = method ),\n        timeout = max( _CONNECT_TIMEOUT_SEC, timeout ) )\n\n\n    return BaseRequest.Executor().submit(\n      _MakeRequest,\n      data,\n      handler,\n      method,\n      timeout,\n      payload )\n\n\n  @staticmethod\n  def _ExtraHeaders( method, request_uri, request_body = None ):\n    if not request_body:\n      request_body = bytes( b'' )\n    headers = dict( _HEADERS )\n    headers[ _HMAC_HEADER ] = b64encode(\n        CreateRequestHmac( ToBytes( method ),\n                           ToBytes( urlparse( request_uri ).path ),\n                           request_body,\n                           BaseRequest.hmac_secret ) )\n    return headers\n\n\n  # This method exists to avoid importing the requests module at startup;\n  # reducing loading time since this module is slow to import.\n  @classmethod\n  def Executor( cls ):\n    try:\n      return cls.executor\n    except AttributeError:\n      from ycm.unsafe_thread_pool_executor import UnsafeThreadPoolExecutor\n      cls.executor = UnsafeThreadPoolExecutor( max_workers = 30 )\n      return cls.executor\n\n\n  server_location = ''\n  hmac_secret = ''\n\n\ndef BuildRequestData( buffer_number = None ):\n  \"\"\"Build request for the current buffer or the buffer with number\n  |buffer_number| if specified.\"\"\"\n  working_dir = GetCurrentDirectory()\n  current_buffer = vim.current.buffer\n\n  if buffer_number and current_buffer.number != buffer_number:\n    # Cursor position is irrelevant when filepath is not the current buffer.\n    buffer_object = vim.buffers[ buffer_number ]\n    filepath = vimsupport.GetBufferFilepath( buffer_object )\n    return {\n      'filepath': filepath,\n      'line_num': 1,\n      'column_num': 1,\n      'working_dir': working_dir,\n      'file_data': vimsupport.GetUnsavedAndSpecifiedBufferData( buffer_object,\n                                                                filepath )\n    }\n\n  current_filepath = vimsupport.GetBufferFilepath( current_buffer )\n  line, column = vimsupport.CurrentLineAndColumn()\n\n  return {\n    'filepath': current_filepath,\n    'line_num': line + 1,\n    'column_num': column + 1,\n    'working_dir': working_dir,\n    'file_data': vimsupport.GetUnsavedAndSpecifiedBufferData( current_buffer,\n                                                              current_filepath )\n  }\n\n\ndef BuildRequestDataForLocation( file : str, line : int, column : int ):\n  buffer_number = vimsupport.GetBufferNumberForFilename(\n      file,\n      create_buffer_if_needed = True )\n  try:\n    vim.eval( f'bufload( \"{ file }\" )' )\n  except vim.error as e:\n    if 'E325' not in str( e ):\n      raise\n  buffer = vim.buffers[ buffer_number ]\n  file_data = vimsupport.GetUnsavedAndSpecifiedBufferData( buffer, file )\n  return {\n    'filepath': file,\n    'line_num': line,\n    'column_num': column,\n    'working_dir': GetCurrentDirectory(),\n    'file_data': file_data\n  }\n\n\ndef _JsonFromFuture( future ):\n  try:\n    response = future.result()\n    response_text = response.read()\n    _ValidateResponseObject( response, response_text )\n    response.close()\n\n    if response_text:\n      return json.loads( response_text )\n    return None\n  except HTTPError as response:\n    if response.code == HTTP_SERVER_ERROR:\n      response_text = response.read()\n      response.close()\n      if response_text:\n        raise MakeServerException( json.loads( response_text ) )\n      else:\n        return None\n    raise\n\n\ndef _LoadExtraConfFile( filepath ):\n  BaseRequest().PostDataToHandler( { 'filepath': filepath },\n                                   'load_extra_conf_file' )\n\n\ndef _IgnoreExtraConfFile( filepath ):\n  BaseRequest().PostDataToHandler( { 'filepath': filepath },\n                                   'ignore_extra_conf_file' )\n\n\ndef DisplayServerException( exception, truncate_message = False ):\n  serialized_exception = str( exception )\n\n  # We ignore the exception about the file already being parsed since it comes\n  # up often and isn't something that's actionable by the user.\n  if 'already being parsed' in serialized_exception:\n    return\n  vimsupport.PostVimMessage( serialized_exception, truncate = truncate_message )\n\n\ndef _ToUtf8Json( data ):\n  return ToBytes( json.dumps( data ) if data else None )\n\n\ndef _ValidateResponseObject( response, response_text ):\n  if not response_text:\n    return\n  our_hmac = CreateHmac( response_text, BaseRequest.hmac_secret )\n  their_hmac = ToBytes( b64decode( response.headers[ _HMAC_HEADER ] ) )\n  if not compare_digest( our_hmac, their_hmac ):\n    raise RuntimeError( 'Received invalid HMAC for response!' )\n\n\ndef _BuildUri( handler ):\n  return ToBytes( urljoin( BaseRequest.server_location, handler ) )\n\n\ndef MakeServerException( data ):\n  _logger.debug( 'Server exception: %s', data )\n  if data[ 'exception' ][ 'TYPE' ] == UnknownExtraConf.__name__:\n    return UnknownExtraConf( data[ 'exception' ][ 'extra_conf_file' ] )\n\n  return ServerError( f'{ data[ \"exception\" ][ \"TYPE\" ] }: '\n                      f'{ data[ \"message\" ] }' )\n"
  },
  {
    "path": "python/ycm/client/command_request.py",
    "content": "# Copyright (C) 2013  Google Inc.\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.client.base_request import ( BaseRequest,\n                                      BuildRequestData,\n                                      BuildRequestDataForLocation )\nfrom ycm import vimsupport\n\nDEFAULT_BUFFER_COMMAND = 'same-buffer'\n\n\ndef _EnsureBackwardsCompatibility( arguments ):\n  if arguments and arguments[ 0 ] == 'GoToDefinitionElseDeclaration':\n    arguments[ 0 ] = 'GoTo'\n  return arguments\n\n\nclass CommandRequest( BaseRequest ):\n  def __init__( self,\n                arguments,\n                extra_data = None,\n                silent = False,\n                location = None ):\n    super( CommandRequest, self ).__init__()\n    self._arguments = _EnsureBackwardsCompatibility( arguments )\n    self._command = arguments and arguments[ 0 ]\n    self._extra_data = extra_data\n    self._response = None\n    self._request_data = None\n    self._response_future = None\n    self._silent = silent\n    self._bufnr = extra_data.pop( 'bufnr', None ) if extra_data else None\n    self._location = location\n\n\n  def Start( self ):\n    if self._location is not None:\n      self._request_data = BuildRequestDataForLocation( *self._location )\n    elif self._bufnr is not None:\n      self._request_data = BuildRequestData( self._bufnr )\n    else:\n      self._request_data = BuildRequestData()\n\n    if self._extra_data:\n      self._request_data.update( self._extra_data )\n    self._request_data.update( {\n      'command_arguments': self._arguments\n    } )\n    self._response_future = self.PostDataToHandlerAsync(\n      self._request_data,\n      'run_completer_command' )\n\n\n  def Done( self ):\n    return bool( self._response_future ) and self._response_future.done()\n\n\n  def Response( self ):\n    if self._response is None and self._response_future is not None:\n      # Block\n      self._response = self.HandleFuture( self._response_future,\n                                          display_message = not self._silent )\n\n    return self._response\n\n\n  def RunPostCommandActionsIfNeeded( self,\n                                     modifiers,\n                                     buffer_command = DEFAULT_BUFFER_COMMAND ):\n\n    # This is a blocking call if not Done()\n    self.Response()\n\n    if self._response is None:\n      # An exception was raised and handled.\n      return\n\n    # If not a dictionary or a list, the response is necessarily a\n    # scalar: boolean, number, string, etc. In this case, we print\n    # it to the user.\n    if not isinstance( self._response, ( dict, list ) ):\n      return self._HandleBasicResponse()\n\n    if 'fixits' in self._response:\n      return self._HandleFixitResponse()\n\n    if 'message' in self._response:\n      return self._HandleMessageResponse()\n\n    if 'detailed_info' in self._response:\n      return self._HandleDetailedInfoResponse( modifiers )\n\n    # The only other type of response we understand is GoTo, and that is the\n    # only one that we can't detect just by inspecting the response (it should\n    # either be a single location or a list)\n    return self._HandleGotoResponse( buffer_command, modifiers )\n\n\n  def StringResponse( self ):\n    # Retuns a supporable public API version of the response. The reason this\n    # exists is that the ycmd API here is wonky as it originally only supported\n    # text-responses and now has things like fixits and such.\n    #\n    # The supportable public API is basically any text-only response. All other\n    # response types are returned as empty strings\n\n    # This is a blocking call if not Done()\n    self.Response()\n\n    # Completer threw an error ?\n    if self._response is None:\n      return \"\"\n\n    # If not a dictionary or a list, the response is necessarily a\n    # scalar: boolean, number, string, etc. In this case, we print\n    # it to the user.\n    if not isinstance( self._response, ( dict, list ) ):\n      return str( self._response )\n\n    if 'message' in self._response:\n      return self._response[ 'message' ]\n\n    if 'detailed_info' in self._response:\n      return self._response[ 'detailed_info' ]\n\n    # The only other type of response we understand is 'fixits' and GoTo. We\n    # don't provide string versions of them.\n    return \"\"\n\n\n  def _HandleGotoResponse( self, buffer_command, modifiers ):\n    if isinstance( self._response, list ):\n      vimsupport.SetQuickFixList(\n        [ vimsupport.BuildQfListItem( x ) for x in self._response ] )\n      vimsupport.OpenQuickFixList( focus = True, autoclose = True )\n    elif self._response.get( 'file_only' ):\n      vimsupport.JumpToLocation( self._response[ 'filepath' ],\n                                 None,\n                                 None,\n                                 modifiers,\n                                 buffer_command )\n    else:\n      vimsupport.JumpToLocation( self._response[ 'filepath' ],\n                                 self._response[ 'line_num' ],\n                                 self._response[ 'column_num' ],\n                                 modifiers,\n                                 buffer_command )\n\n\n  def _HandleFixitResponse( self ):\n    if not len( self._response[ 'fixits' ] ):\n      vimsupport.PostVimMessage( 'No fixits found for current line',\n                                 warning = False )\n    else:\n      try:\n        fixit_index = 0\n\n        # If there is more than one fixit, we need to ask the user which one\n        # should be applied.\n        #\n        # If there's only one, triggered by the FixIt subcommand (as opposed to\n        # `RefactorRename`, for example) and whose `kind` is not `quicfix`, we\n        # still need to as the user for confirmation.\n        fixits = self._response[ 'fixits' ]\n        if ( len( fixits ) > 1 or\n             ( len( fixits ) == 1 and\n               self._command == 'FixIt' and\n               fixits[ 0 ].get( 'kind' ) != 'quickfix' ) ):\n          fixit_index = vimsupport.SelectFromList(\n            \"FixIt suggestion(s) available at this location. \"\n            \"Which one would you like to apply?\",\n            [ fixit[ 'text' ] for fixit in fixits ] )\n        chosen_fixit = fixits[ fixit_index ]\n        if chosen_fixit[ 'resolve' ]:\n          self._request_data.update( { 'fixit': chosen_fixit } )\n          response = self.PostDataToHandler( self._request_data,\n                                             'resolve_fixit' )\n          if response is None:\n            return\n          fixits = response[ 'fixits' ]\n          assert len( fixits ) == 1\n          chosen_fixit = fixits[ 0 ]\n\n        vimsupport.ReplaceChunks(\n          chosen_fixit[ 'chunks' ],\n          silent = self._command == 'Format' )\n      except RuntimeError as e:\n        vimsupport.PostVimMessage( str( e ) )\n\n\n  def _HandleBasicResponse( self ):\n    vimsupport.PostVimMessage( self._response, warning = False )\n\n\n  def _HandleMessageResponse( self ):\n    vimsupport.PostVimMessage( self._response[ 'message' ], warning = False )\n\n\n  def _HandleDetailedInfoResponse( self, modifiers ):\n    vimsupport.WriteToPreviewWindow( self._response[ 'detailed_info' ],\n                                     modifiers )\n\n\ndef SendCommandRequestAsync( arguments,\n                             extra_data = None,\n                             silent = True,\n                             location = None ):\n  request = CommandRequest( arguments,\n                            extra_data = extra_data,\n                            silent = silent,\n                            location = location )\n  request.Start()\n  # Don't block\n  return request\n\n\ndef SendCommandRequest( arguments,\n                        modifiers,\n                        buffer_command = DEFAULT_BUFFER_COMMAND,\n                        extra_data = None,\n                        skip_post_command_action = False ):\n  request = SendCommandRequestAsync( arguments,\n                                     extra_data = extra_data,\n                                     silent = False )\n  # Block here to get the response\n  if not skip_post_command_action:\n    request.RunPostCommandActionsIfNeeded( modifiers, buffer_command )\n  return request.Response()\n\n\ndef GetCommandResponse( arguments, extra_data = None ):\n  request = SendCommandRequestAsync( arguments,\n                                     extra_data = extra_data,\n                                     silent = True )\n  # Block here to get the response\n  return request.StringResponse()\n\n\ndef GetRawCommandResponse( arguments, silent, location = None ):\n  request = SendCommandRequestAsync( arguments,\n                                     extra_data = None,\n                                     silent = silent,\n                                     location = location )\n  return request.Response()\n"
  },
  {
    "path": "python/ycm/client/completer_available_request.py",
    "content": "# Copyright (C) 2013  Google Inc.\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.client.base_request import BaseRequest, BuildRequestData\n\n\nclass CompleterAvailableRequest( BaseRequest ):\n  def __init__( self, filetypes ):\n    super( CompleterAvailableRequest, self ).__init__()\n    self.filetypes = filetypes\n    self._response = None\n\n\n  def Start( self ):\n    request_data = BuildRequestData()\n    request_data.update( { 'filetypes': self.filetypes } )\n    self._response = self.PostDataToHandler( request_data,\n                                             'semantic_completion_available' )\n\n\n  def Response( self ):\n    return self._response\n\n\ndef SendCompleterAvailableRequest( filetypes ):\n  request = CompleterAvailableRequest( filetypes )\n  # This is a blocking call.\n  request.Start()\n  return request.Response()\n"
  },
  {
    "path": "python/ycm/client/completion_request.py",
    "content": "# Copyright (C) 2013-2019 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport json\nimport logging\nfrom ycmd.utils import ToUnicode\nfrom ycm.client.base_request import ( BaseRequest,\n                                      DisplayServerException,\n                                      MakeServerException )\nfrom ycm import vimsupport, base\nfrom ycm.vimsupport import NO_COMPLETIONS\n\n_logger = logging.getLogger( __name__ )\n\n\nclass CompletionRequest( BaseRequest ):\n  def __init__( self, request_data ):\n    super().__init__()\n    self.request_data = request_data\n    self._response_future = None\n\n\n  def Start( self ):\n    self._response_future = self.PostDataToHandlerAsync( self.request_data,\n                                                         'completions' )\n\n\n  def Done( self ):\n    return bool( self._response_future ) and self._response_future.done()\n\n\n  def _RawResponse( self ):\n    if not self._response_future:\n      return NO_COMPLETIONS\n\n    response = self.HandleFuture( self._response_future,\n                                  truncate_message = True )\n    if not response:\n      return NO_COMPLETIONS\n\n    # Vim may not be able to convert the 'errors' entry to its internal format\n    # so we remove it from the response.\n    errors = response.pop( 'errors', [] )\n    for e in errors:\n      exception = MakeServerException( e )\n      _logger.error( exception )\n      DisplayServerException( exception, truncate_message = True )\n\n    response[ 'line' ] = self.request_data[ 'line_num' ]\n    response[ 'column' ] = self.request_data[ 'column_num' ]\n    return response\n\n\n  def Response( self ):\n    response = self._RawResponse()\n    response[ 'completions' ] = _ConvertCompletionDatasToVimDatas(\n        response[ 'completions' ] )\n    # FIXME: Do we really need to do this AdjustCandidateInsertionText ? I feel\n    # like Vim should do that for us\n    response[ 'completions' ] = base.AdjustCandidateInsertionText(\n        response[ 'completions' ] )\n    return response\n\n\n  def OnCompleteDone( self ):\n    if not self.Done():\n      return\n\n    if 'cs' in vimsupport.CurrentFiletypes():\n      self._OnCompleteDone_Csharp()\n    else:\n      self._OnCompleteDone_FixIt()\n\n\n  def _GetExtraDataUserMayHaveCompleted( self ):\n    completed_item = vimsupport.GetVariableValue( 'v:completed_item' )\n\n    # If Vim supports user_data (8.0.1493 or later), we actually know the\n    # _exact_ element that was selected, having put its extra_data in the\n    # user_data field. Otherwise, we have to guess by matching the values in the\n    # completed item and the list of completions. Sometimes this returns\n    # multiple possibilities, which is essentially unresolvable.\n    if 'user_data' not in completed_item:\n      completions = self._RawResponse()[ 'completions' ]\n      return _FilterToMatchingCompletions( completed_item, completions )\n\n    if completed_item[ 'user_data' ]:\n      return [ json.loads( completed_item[ 'user_data' ] ) ]\n\n    return []\n\n\n  def _OnCompleteDone_Csharp( self ):\n    extra_datas = self._GetExtraDataUserMayHaveCompleted()\n    namespaces = [ _GetRequiredNamespaceImport( c ) for c in extra_datas ]\n    namespaces = [ n for n in namespaces if n ]\n    if not namespaces:\n      return\n\n    if len( namespaces ) > 1:\n      choices = [ f\"{ i + 1 } { n }\" for i, n in enumerate( namespaces ) ]\n      choice = vimsupport.PresentDialog( \"Insert which namespace:\", choices )\n      if choice < 0:\n        return\n      namespace = namespaces[ choice ]\n    else:\n      namespace = namespaces[ 0 ]\n\n    vimsupport.InsertNamespace( namespace )\n\n\n  def _OnCompleteDone_FixIt( self ):\n    extra_datas = self._GetExtraDataUserMayHaveCompleted()\n    fixit_completions = [ _GetFixItCompletion( c ) for c in extra_datas ]\n    fixit_completions = [ f for f in fixit_completions if f ]\n    if not fixit_completions:\n      return\n\n    # If we have user_data in completions (8.0.1493 or later), then we would\n    # only ever return max. 1 completion here. However, if we had to guess, it\n    # is possible that we matched multiple completion items (e.g. for overloads,\n    # or similar classes in multiple packages). In any case, rather than\n    # prompting the user and disturbing her workflow, we just apply the first\n    # one. This might be wrong, but the solution is to use a (very) new version\n    # of Vim which supports user_data on completion items\n    fixit_completion = fixit_completions[ 0 ]\n\n    for fixit in fixit_completion:\n      vimsupport.ReplaceChunks( fixit[ 'chunks' ], silent=True )\n\n\ndef _GetRequiredNamespaceImport( extra_data ):\n  return extra_data.get( 'required_namespace_import' )\n\n\ndef _GetFixItCompletion( extra_data ):\n  return extra_data.get( 'fixits' )\n\n\ndef _FilterToMatchingCompletions( completed_item, completions ):\n  \"\"\"Filter to completions matching the item Vim said was completed\"\"\"\n  match_keys = [ 'word', 'abbr', 'menu', 'info' ]\n  matched_completions = []\n  for completion in completions:\n    item = ConvertCompletionDataToVimData( completion )\n\n    def matcher( key ):\n      return ( ToUnicode( completed_item.get( key, \"\" ) ) ==\n               ToUnicode( item.get( key, \"\" ) ) )\n\n    if all( matcher( i ) for i in match_keys ):\n      matched_completions.append( completion.get( 'extra_data', {} ) )\n  return matched_completions\n\n\ndef _GetCompletionInfoField( completion_data ):\n  info = completion_data.get( 'detailed_info', '' )\n\n  if 'extra_data' in completion_data:\n    docstring = completion_data[ 'extra_data' ].get( 'doc_string', '' )\n    if docstring:\n      if info:\n        info += '\\n' + docstring\n      else:\n        info = docstring\n\n  # This field may contain null characters e.g. \\x00 in Python docstrings. Vim\n  # cannot evaluate such characters so they are removed.\n  return info.replace( '\\x00', '' )\n\n\ndef ConvertCompletionDataToVimData( completion_data ):\n  # See :h complete-items for a description of the dictionary fields.\n  extra_menu_info = completion_data.get( 'extra_menu_info', '' )\n  preview_info = _GetCompletionInfoField( completion_data )\n\n  # When we are using a popup for the preview_info, it needs to fit on the\n  # screen alongside the extra_menu_info. Let's use some heuristics.  If the\n  # length of the extra_menu_info is more than, say, 1/3 of screen, truncate it\n  # and stick it in the preview_info.\n  if vimsupport.UsingPreviewPopup():\n    max_width = max( int( vimsupport.DisplayWidth() / 3 ), 3 )\n    extra_menu_info_width = vimsupport.DisplayWidthOfString( extra_menu_info )\n    if extra_menu_info_width > max_width:\n      if not preview_info.startswith( extra_menu_info ):\n        preview_info = extra_menu_info + '\\n\\n' + preview_info\n      extra_menu_info = extra_menu_info[ : ( max_width - 3 ) ] + '...'\n\n  return {\n    'word'     : completion_data[ 'insertion_text' ],\n    'abbr'     : completion_data.get( 'menu_text', '' ),\n    'menu'     : extra_menu_info,\n    'info'     : preview_info,\n    'kind'     : ToUnicode( completion_data.get( 'kind', '' ) )[ :1 ].lower(),\n    # Disable Vim filtering.\n    'equal'    : 1,\n    'dup'      : 1,\n    'empty'    : 1,\n    # We store the completion item extra_data as a string in the completion\n    # user_data. This allows us to identify the _exact_ item that was completed\n    # in the CompleteDone handler, by inspecting this item from v:completed_item\n    #\n    # We convert to string because completion user data items must be strings.\n    #\n    # Note: Not all versions of Vim support this (added in 8.0.1483), but adding\n    # the item to the dictionary is harmless in earlier Vims.\n    # Note: Since 8.2.0084 we don't need to use json.dumps() here.\n    'user_data': json.dumps( completion_data.get( 'extra_data', {} ) )\n  }\n\n\ndef _ConvertCompletionDatasToVimDatas( response_data ):\n  return [ ConvertCompletionDataToVimData( x ) for x in response_data ]\n"
  },
  {
    "path": "python/ycm/client/debug_info_request.py",
    "content": "# Copyright (C) 2016-2017 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.client.base_request import BaseRequest, BuildRequestData\n\n\nclass DebugInfoRequest( BaseRequest ):\n  def __init__( self, extra_data = None ):\n    super( DebugInfoRequest, self ).__init__()\n    self._extra_data = extra_data\n    self._response = None\n\n\n  def Start( self ):\n    request_data = BuildRequestData()\n    if self._extra_data:\n      request_data.update( self._extra_data )\n    self._response = self.PostDataToHandler( request_data,\n                                             'debug_info',\n                                             display_message = False )\n\n\n  def Response( self ):\n    return self._response\n\n\ndef FormatDebugInfoResponse( response ):\n  if not response:\n    return 'Server errored, no debug info from server\\n'\n  message = _FormatYcmdDebugInfo( response )\n  completer = response[ 'completer' ]\n  if completer:\n    message += _FormatCompleterDebugInfo( completer )\n  return message\n\n\ndef _FormatYcmdDebugInfo( ycmd ):\n  python = ycmd[ 'python' ]\n  clang = ycmd[ 'clang' ]\n  message = (\n    f'Server Python interpreter: { python[ \"executable\" ] }\\n'\n    f'Server Python version: { python[ \"version\" ] }\\n'\n    f'Server has Clang support compiled in: { clang[ \"has_support\" ] }\\n'\n    f'Clang version: { clang[ \"version\" ] }\\n' )\n  extra_conf = ycmd[ 'extra_conf' ]\n  extra_conf_path = extra_conf[ 'path' ]\n  if not extra_conf_path:\n    message += 'No extra configuration file found\\n'\n  elif not extra_conf[ 'is_loaded' ]:\n    message += ( 'Extra configuration file found but not loaded\\n'\n                 f'Extra configuration path: { extra_conf_path }\\n' )\n  else:\n    message += ( 'Extra configuration file found and loaded\\n'\n                 f'Extra configuration path: { extra_conf_path }\\n' )\n  return message\n\n\ndef _FormatCompleterDebugInfo( completer ):\n  message = f'{ completer[ \"name\" ] } completer debug information:\\n'\n  for server in completer[ 'servers' ]:\n    name = server[ 'name' ]\n    if server[ 'is_running' ]:\n      address = server[ 'address' ]\n      port = server[ 'port' ]\n      if address and port:\n        message += f'  { name } running at: http://{ address }:{ port }\\n'\n      else:\n        message += f'  { name } running\\n'\n      message += f'  { name } process ID: { server[ \"pid\" ] }\\n'\n    else:\n      message += f'  { name } not running\\n'\n    message += f'  { name } executable: { server[ \"executable\" ] }\\n'\n    logfiles = server[ 'logfiles' ]\n    if logfiles:\n      message += f'  { name } logfiles:\\n'\n      for logfile in logfiles:\n        message += f'    { logfile }\\n'\n    else:\n      message += '  No logfiles available\\n'\n    if 'extras' in server:\n      for extra in server[ 'extras' ]:\n        message += f'  { name } { extra[ \"key\" ] }: { extra[ \"value\" ] }\\n'\n  for item in completer[ 'items' ]:\n    message += f'  { item[ \"key\" ].capitalize() }: { item[ \"value\" ] }\\n'\n  return message\n\n\ndef SendDebugInfoRequest( extra_data = None ):\n  request = DebugInfoRequest( extra_data )\n  # This is a blocking call.\n  request.Start()\n  return request.Response()\n"
  },
  {
    "path": "python/ycm/client/event_notification.py",
    "content": "# Copyright (C) 2013-2018 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.client.base_request import BaseRequest, BuildRequestData\n\n\nclass EventNotification( BaseRequest ):\n  def __init__( self, event_name, buffer_number = None, extra_data = None ):\n    super( EventNotification, self ).__init__()\n    self._event_name = event_name\n    self._buffer_number = buffer_number\n    self._extra_data = extra_data\n    self._response_future = None\n    self._cached_response = None\n\n\n  def Start( self ):\n    request_data = BuildRequestData( self._buffer_number )\n    if self._extra_data:\n      request_data.update( self._extra_data )\n    request_data[ 'event_name' ] = self._event_name\n\n    self._response_future = self.PostDataToHandlerAsync( request_data,\n                                                         'event_notification' )\n\n\n  def Done( self ):\n    return bool( self._response_future ) and self._response_future.done()\n\n\n  def Response( self ):\n    if self._cached_response:\n      return self._cached_response\n\n    if not self._response_future or self._event_name != 'FileReadyToParse':\n      return []\n\n    self._cached_response = self.HandleFuture( self._response_future,\n                                               truncate_message = True )\n\n    return self._cached_response if self._cached_response else []\n\n\ndef SendEventNotificationAsync( event_name,\n                                buffer_number = None,\n                                extra_data = None ):\n  event = EventNotification( event_name, buffer_number, extra_data )\n  event.Start()\n"
  },
  {
    "path": "python/ycm/client/inlay_hints_request.py",
    "content": "# Copyright (C) 2022, YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\nimport logging\nfrom ycm.client.base_request import ( BaseRequest, DisplayServerException,\n                                      MakeServerException )\n\n_logger = logging.getLogger( __name__ )\n\n\n# FIXME: This is copy/pasta from SemanticTokensRequest - abstract a\n# SimpleAsyncRequest base that does all of this generically\nclass InlayHintsRequest( BaseRequest ):\n  def __init__( self, request_data ):\n    super().__init__()\n    self.request_data = request_data\n    self._response_future = None\n\n\n  def Start( self ):\n    self._response_future = self.PostDataToHandlerAsync( self.request_data,\n                                                         'inlay_hints' )\n\n  def Done( self ):\n    return bool( self._response_future ) and self._response_future.done()\n\n\n  def Reset( self ):\n    self._response_future = None\n\n  def Response( self ):\n    if not self._response_future:\n      return []\n\n    response = self.HandleFuture( self._response_future,\n                                  truncate_message = True )\n\n    if not response:\n      return []\n\n    # Vim may not be able to convert the 'errors' entry to its internal format\n    # so we remove it from the response.\n    errors = response.pop( 'errors', [] )\n    for e in errors:\n      exception = MakeServerException( e )\n      _logger.error( exception )\n      DisplayServerException( exception, truncate_message = True )\n\n    return response.get( 'inlay_hints' ) or []\n"
  },
  {
    "path": "python/ycm/client/messages_request.py",
    "content": "# Copyright (C) 2017 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.client.base_request import BaseRequest, BuildRequestData\nfrom ycm.vimsupport import PostVimMessage\n\nimport logging\n\n_logger = logging.getLogger( __name__ )\n\n# Looooong poll\nTIMEOUT_SECONDS = 60\n\n\nclass MessagesPoll( BaseRequest ):\n  def __init__( self, buff ):\n    super( MessagesPoll, self ).__init__()\n    self._request_data = BuildRequestData( buff.number )\n    self._response_future = None\n\n\n  def _SendRequest( self ):\n    self._response_future = self.PostDataToHandlerAsync(\n      self._request_data,\n      'receive_messages',\n      timeout = TIMEOUT_SECONDS )\n    return\n\n\n  def Poll( self, diagnostics_handler ):\n    \"\"\"This should be called regularly to check for new messages in this buffer.\n    Returns True if Poll should be called again in a while. Returns False when\n    the completer or server indicated that further polling should not be done\n    for the requested file.\"\"\"\n\n    if self._response_future is None:\n      # First poll\n      self._SendRequest()\n      return True\n\n    if not self._response_future.done():\n      # Nothing yet...\n      return True\n\n    response = self.HandleFuture( self._response_future,\n                                  display_message = False )\n    if response is None:\n      # Server returned an exception.\n      return False\n\n    poll_again = _HandlePollResponse( response, diagnostics_handler )\n    if poll_again:\n      self._SendRequest()\n      return True\n\n    return False\n\n\ndef _HandlePollResponse( response, diagnostics_handler ):\n  if isinstance( response, list ):\n    for notification in response:\n      if 'message' in notification:\n        PostVimMessage( notification[ 'message' ],\n                        warning = False,\n                        truncate = True )\n      elif 'diagnostics' in notification:\n        diagnostics_handler.UpdateWithNewDiagnosticsForFile(\n          notification[ 'filepath' ],\n          notification[ 'diagnostics' ] )\n  elif response is False:\n    # Don't keep polling for this file\n    return False\n  # else any truthy response means \"nothing to see here; poll again in a\n  # while\"\n\n  # Start the next poll (only if the last poll didn't raise an exception)\n  return True\n"
  },
  {
    "path": "python/ycm/client/omni_completion_request.py",
    "content": "# Copyright (C) 2013  Google Inc.\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.client.completion_request import CompletionRequest\n\n\nclass OmniCompletionRequest( CompletionRequest ):\n  def __init__( self, omni_completer, request_data ):\n    super( OmniCompletionRequest, self ).__init__( request_data )\n    self._omni_completer = omni_completer\n\n\n  def Start( self ):\n    self._results = self._omni_completer.ComputeCandidates( self.request_data )\n\n\n  def Done( self ):\n    return True\n\n\n  def Response( self ):\n    return {\n      'line': self.request_data[ 'line_num' ],\n      'column': self.request_data[ 'column_num' ],\n      'completion_start_column': self.request_data[ 'start_column' ],\n      'completions': self._results\n    }\n\n\n  def OnCompleteDone( self ):\n    pass\n"
  },
  {
    "path": "python/ycm/client/resolve_completion_request.py",
    "content": "# Copyright (C) 2020 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.client.base_request import ( BaseRequest,\n                                      DisplayServerException,\n                                      MakeServerException )\nfrom ycm.client.completion_request import ( CompletionRequest,\n                                            ConvertCompletionDataToVimData )\n\nimport logging\nimport json\n_logger = logging.getLogger( __name__ )\n\n\nclass ResolveCompletionRequest( BaseRequest ):\n  def __init__( self,\n                completion_request: CompletionRequest,\n                request_data ):\n    super().__init__()\n    self.request_data = request_data\n    self.completion_request = completion_request\n\n  def Start( self ):\n    self._response_future = self.PostDataToHandlerAsync( self.request_data,\n                                                         'resolve_completion' )\n\n  def Done( self ):\n    return bool( self._response_future ) and self._response_future.done()\n\n\n  def OnCompleteDone( self ):\n    # This is required to be compatible with the \"CompletionRequest\" API. We're\n    # not really a CompletionRequest, but we are mutually exclusive with\n    # completion requests, so we implement this API by delegating to the\n    # original completion request, which contains all of the code for actually\n    # handling things like automatic imports etc.\n    self.completion_request.OnCompleteDone()\n\n\n  def Response( self ):\n    response = self.HandleFuture( self._response_future,\n                                  truncate_message = True,\n                                  display_message = True )\n\n    if not response or not response[ 'completion' ]:\n      return { 'completion': [] }\n\n    # Vim may not be able to convert the 'errors' entry to its internal format\n    # so we remove it from the response.\n    errors = response.pop( 'errors', [] )\n    for e in errors:\n      exception = MakeServerException( e )\n      _logger.error( exception )\n      DisplayServerException( exception, truncate_message = True )\n\n    response[ 'completion' ] = ConvertCompletionDataToVimData(\n        response[ 'completion' ] )\n    return response\n\n\ndef ResolveCompletionItem( completion_request, item ):\n  if not completion_request.Done():\n    return None\n  try:\n    completion_extra_data = json.loads( item[ 'user_data' ] )\n  except KeyError:\n    return None\n  except ( TypeError, json.JSONDecodeError ):\n    # Can happen with the omni completer\n    return None\n\n  request_data = completion_request.request_data\n  try:\n    # Note: We mutate the request_data inside the original completion request\n    # and pass it into the new request object. this is just a big efficiency\n    # saving. The request_data for a Done() request is almost certainly no\n    # longer needed.\n    request_data[ 'resolve' ] = completion_extra_data[ 'resolve' ]\n  except KeyError:\n    return None\n\n  resolve_request = ResolveCompletionRequest( completion_request, request_data )\n  resolve_request.Start()\n  return resolve_request\n"
  },
  {
    "path": "python/ycm/client/semantic_tokens_request.py",
    "content": "# Copyright (C) 2020, YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\nimport logging\nfrom ycm.client.base_request import ( BaseRequest, DisplayServerException,\n                                      MakeServerException )\n\n_logger = logging.getLogger( __name__ )\n\n\n# FIXME: This is copy/pasta from SignatureHelpRequest - abstract a\n# SimpleAsyncRequest base that does all of this generically\nclass SemanticTokensRequest( BaseRequest ):\n  def __init__( self, request_data ):\n    super().__init__()\n    self.request_data = request_data\n    self._response_future = None\n\n\n  def Start( self ):\n    self._response_future = self.PostDataToHandlerAsync( self.request_data,\n                                                         'semantic_tokens' )\n\n  def Done( self ):\n    return bool( self._response_future ) and self._response_future.done()\n\n\n  def Reset( self ):\n    self._response_future = None\n\n  def Response( self ):\n    if not self._response_future:\n      return {}\n\n    response = self.HandleFuture( self._response_future,\n                                  truncate_message = True )\n\n    if not response:\n      return {}\n\n    # Vim may not be able to convert the 'errors' entry to its internal format\n    # so we remove it from the response.\n    errors = response.pop( 'errors', [] )\n    for e in errors:\n      exception = MakeServerException( e )\n      _logger.error( exception )\n      DisplayServerException( exception, truncate_message = True )\n\n    return response.get( 'semantic_tokens' ) or {}\n"
  },
  {
    "path": "python/ycm/client/shutdown_request.py",
    "content": "# Copyright (C) 2016 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.client.base_request import BaseRequest\n\nTIMEOUT_SECONDS = 0.1\n\n\nclass ShutdownRequest( BaseRequest ):\n  def __init__( self ):\n    super( ShutdownRequest, self ).__init__()\n\n\n  def Start( self ):\n    self.PostDataToHandler( {},\n                            'shutdown',\n                            TIMEOUT_SECONDS,\n                            display_message = False )\n\n\ndef SendShutdownRequest():\n  request = ShutdownRequest()\n  # This is a blocking call.\n  request.Start()\n"
  },
  {
    "path": "python/ycm/client/signature_help_request.py",
    "content": "# Copyright (C) 2019 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport logging\nfrom ycm.client.base_request import ( BaseRequest, DisplayServerException,\n                                      MakeServerException )\n\n_logger = logging.getLogger( __name__ )\n\n\nclass SigHelpAvailableByFileType( dict ):\n  def __missing__( self, filetype ):\n    request = SignatureHelpAvailableRequest( filetype )\n    self[ filetype ] = request\n    return request\n\n\nclass SignatureHelpRequest( BaseRequest ):\n  def __init__( self, request_data ):\n    super( SignatureHelpRequest, self ).__init__()\n    self.request_data = request_data\n    self._response_future = None\n    self._response = None\n\n\n  def Start( self ):\n    self._response_future = self.PostDataToHandlerAsync( self.request_data,\n                                                         'signature_help' )\n\n\n  def Done( self ):\n    return bool( self._response_future ) and self._response_future.done()\n\n\n  def Reset( self ):\n    self._response_future = None\n\n\n  def Response( self ):\n    if self._response is None:\n      self._response = self._Response()\n    return self._response\n\n\n  def _Response( self ):\n    if not self._response_future:\n      return {}\n\n    response = self.HandleFuture( self._response_future,\n                                  truncate_message = True )\n    if not response:\n      return {}\n\n    # Vim may not be able to convert the 'errors' entry to its internal format\n    # so we remove it from the response.\n    errors = response.pop( 'errors', [] )\n    for e in errors:\n      exception = MakeServerException( e )\n      _logger.error( exception )\n      DisplayServerException( exception, truncate_message = True )\n\n    return response.get( 'signature_help' ) or {}\n\n\nclass SignatureHelpAvailableRequest( BaseRequest ):\n  def __init__( self, filetype ):\n    super( SignatureHelpAvailableRequest, self ).__init__()\n    self._response_future = None\n    self.Start( filetype )\n\n\n  def Done( self ):\n    return bool( self._response_future ) and self._response_future.done()\n\n\n  def Response( self ):\n    if not self._response_future:\n      return None\n\n    response = self.HandleFuture( self._response_future,\n                                  truncate_message = True )\n\n    if not response:\n      return None\n\n    return response[ 'available' ]\n\n\n  def Start( self, filetype ):\n    self._response_future = self.GetDataFromHandlerAsync(\n      'signature_help_available',\n      payload = { 'subserver': filetype } )\n"
  },
  {
    "path": "python/ycm/client/ycmd_keepalive.py",
    "content": "# Copyright (C) 2013  Google Inc.\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport time\nfrom threading import Thread\nfrom ycm.client.base_request import BaseRequest\n\n\n# This class can be used to keep the ycmd server alive for the duration of the\n# life of the client. By default, ycmd shuts down if it doesn't see a request in\n# a while.\nclass YcmdKeepalive:\n  def __init__( self, ping_interval_seconds = 60 * 10 ):\n    self._keepalive_thread = Thread( target = self._ThreadMain )\n    self._keepalive_thread.daemon = True\n    self._ping_interval_seconds = ping_interval_seconds\n\n\n  def Start( self ):\n    self._keepalive_thread.start()\n\n\n  def _ThreadMain( self ):\n    while True:\n      time.sleep( self._ping_interval_seconds )\n\n      BaseRequest().GetDataFromHandler( 'healthy', display_message = False )\n"
  },
  {
    "path": "python/ycm/diagnostic_filter.py",
    "content": "# Copyright (C) 2016  YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport re\n\n\nclass DiagnosticFilter:\n  def __init__( self, config_or_filters ):\n    self._filters : list = config_or_filters\n\n\n  def IsAllowed( self, diagnostic ):\n    return not any( filterMatches( diagnostic )\n                    for filterMatches in self._filters )\n\n\n  @staticmethod\n  def CreateFromOptions( user_options ):\n    all_filters = user_options[ 'filter_diagnostics' ]\n    compiled_by_type = {}\n    for type_spec, filter_value in all_filters.items():\n      filetypes = type_spec.split( ',' )\n      for filetype in filetypes:\n        compiled_by_type[ filetype ] = _CompileFilters( filter_value )\n\n    return _MasterDiagnosticFilter( compiled_by_type )\n\n\nclass _MasterDiagnosticFilter:\n\n  def __init__( self, all_filters ):\n    self._all_filters = all_filters\n    self._cache = {}\n\n\n  def SubsetForTypes( self, filetypes ):\n    # check cache\n    cache_key = ','.join( filetypes )\n    cached = self._cache.get( cache_key )\n    if cached is not None:\n      return cached\n\n    # build a new DiagnosticFilter merging all filters\n    #  for the provided filetypes\n    spec = []\n    for filetype in filetypes:\n      type_specific = self._all_filters.get( filetype, [] )\n      spec.extend( type_specific )\n\n    new_filter = DiagnosticFilter( spec )\n    self._cache[ cache_key ] = new_filter\n    return new_filter\n\n\ndef _ListOf( config_entry ):\n  if isinstance( config_entry, list ):\n    return config_entry\n\n  return [ config_entry ]\n\n\ndef CompileRegex( raw_regex ):\n  pattern = re.compile( raw_regex, re.IGNORECASE )\n\n  def FilterRegex( diagnostic ):\n    return pattern.search( diagnostic[ 'text' ] ) is not None\n\n  return FilterRegex\n\n\ndef CompileLevel( level ):\n  # valid kinds are WARNING and ERROR;\n  #  expected input levels are `warning` and `error`\n  # NOTE: we don't validate the input...\n  expected_kind = level.upper()\n\n  def FilterLevel( diagnostic ):\n    return diagnostic[ 'kind' ] == expected_kind\n\n  return FilterLevel\n\n\nFILTER_COMPILERS = { 'regex' : CompileRegex,\n                     'level' : CompileLevel }\n\n\ndef _CompileFilters( config ):\n  \"\"\"Given a filter config dictionary, return a list of compiled filters\"\"\"\n  filters = []\n\n  for filter_type, filter_pattern in config.items():\n    compiler = FILTER_COMPILERS.get( filter_type )\n\n    if compiler is not None:\n      for filter_config in _ListOf( filter_pattern ):\n        compiledFilter = compiler( filter_config )\n        filters.append( compiledFilter )\n\n  return filters\n"
  },
  {
    "path": "python/ycm/diagnostic_interface.py",
    "content": "# Copyright (C) 2013-2018 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom collections import defaultdict\nfrom ycm import vimsupport\nfrom ycm.diagnostic_filter import DiagnosticFilter, CompileLevel\nfrom ycm import text_properties as tp\nimport vim\nYCM_VIM_PROPERTY_ID = 1\n\n\nclass DiagnosticInterface:\n  def __init__( self, bufnr, user_options ):\n    self._bufnr = bufnr\n    self._user_options = user_options\n    self._diagnostics = []\n    self._diag_filter = DiagnosticFilter.CreateFromOptions( user_options )\n    # Line and column numbers are 1-based\n    self._line_to_diags = defaultdict( list )\n    self._previous_diag_line_number = -1\n    self._diag_message_needs_clearing = False\n\n\n  def ShouldUpdateDiagnosticsUINow( self ):\n    return ( self._user_options[ 'update_diagnostics_in_insert_mode' ] or\n             'i' not in vim.eval( 'mode()' ) )\n\n\n  def OnCursorMoved( self ):\n    if self._user_options[ 'echo_current_diagnostic' ]:\n      line, _ = vimsupport.CurrentLineAndColumn()\n      line += 1  # Convert to 1-based\n      if not self.ShouldUpdateDiagnosticsUINow():\n        # Clear any previously echo'd diagnostic in insert mode\n        self._EchoDiagnosticText( line, None, None )\n      elif line != self._previous_diag_line_number:\n        self._EchoDiagnosticForLine( line )\n\n\n  def GetErrorCount( self ):\n    return self._DiagnosticsCount( _DiagnosticIsError )\n\n\n  def GetWarningCount( self ):\n    return self._DiagnosticsCount( _DiagnosticIsWarning )\n\n\n  def PopulateLocationList( self, open_on_edit = False ):\n    # Do nothing if loc list is already populated by diag_interface\n    if not self._user_options[ 'always_populate_location_list' ]:\n      self._UpdateLocationLists( open_on_edit )\n    return bool( self._diagnostics )\n\n\n  def UpdateWithNewDiagnostics( self, diags, open_on_edit = False ):\n    self._diagnostics = [ _NormalizeDiagnostic( x ) for x in\n                            self._ApplyDiagnosticFilter( diags ) ]\n    self._ConvertDiagListToDict()\n\n    if self.ShouldUpdateDiagnosticsUINow():\n      self.RefreshDiagnosticsUI( open_on_edit )\n\n\n  def RefreshDiagnosticsUI( self, open_on_edit = False ):\n    if self._user_options[ 'echo_current_diagnostic' ]:\n      self._EchoDiagnostic()\n\n    if self._user_options[ 'enable_diagnostic_signs' ]:\n      self._UpdateSigns()\n\n    self.UpdateMatches()\n\n    if self._user_options[ 'always_populate_location_list' ]:\n      self._UpdateLocationLists( open_on_edit )\n\n\n  def ClearDiagnosticsUI( self ):\n    if self._user_options[ 'echo_current_diagnostic' ]:\n      self._ClearCurrentDiagnostic()\n\n    if self._user_options[ 'enable_diagnostic_signs' ]:\n      self._ClearSigns()\n\n    self._ClearMatches()\n\n\n  def DiagnosticsForLine( self, line_number ):\n    return self._line_to_diags[ line_number ]\n\n\n  def _ApplyDiagnosticFilter( self, diags ):\n    filetypes = vimsupport.GetBufferFiletypes( self._bufnr )\n    diag_filter = self._diag_filter.SubsetForTypes( filetypes )\n    return filter( diag_filter.IsAllowed, diags )\n\n\n  def _EchoDiagnostic( self ):\n    line, _ = vimsupport.CurrentLineAndColumn()\n    line += 1  # Convert to 1-based\n    self._EchoDiagnosticForLine( line )\n\n\n  def _EchoDiagnosticForLine( self, line_num ):\n    self._previous_diag_line_number = line_num\n\n    diags = self._line_to_diags[ line_num ]\n    text = None\n    first_diag = None\n    if diags:\n      first_diag = diags[ 0 ]\n      text = first_diag[ 'text' ]\n      if first_diag.get( 'fixit_available', False ):\n        text += ' (FixIt)'\n\n    self._EchoDiagnosticText( line_num, first_diag, text )\n\n\n  def _ClearCurrentDiagnostic( self, will_be_replaced=False ):\n    if not self._diag_message_needs_clearing:\n      return\n\n    if ( not vimsupport.VimIsNeovim() and\n         self._user_options[ 'echo_current_diagnostic' ] == 'virtual-text' ):\n      tp.ClearTextProperties( self._bufnr,\n                              prop_types = [ 'YcmVirtDiagPadding',\n                                             'YcmVirtDiagError',\n                                             'YcmVirtDiagWarning' ] )\n    else:\n      if not will_be_replaced:\n        vimsupport.PostVimMessage( '', warning = False )\n\n    self._diag_message_needs_clearing = False\n\n\n  def _EchoDiagnosticText( self, line_num, first_diag, text ):\n    self._ClearCurrentDiagnostic( bool( text ) )\n\n    if ( not vimsupport.VimIsNeovim() and\n         self._user_options[ 'echo_current_diagnostic' ] == 'virtual-text' ):\n      if not text:\n        return\n\n      def MakeVritualTextProperty( prop_type, text, position='after' ):\n        vimsupport.AddTextProperty( self._bufnr,\n                                    line_num,\n                                    0,\n                                    prop_type,\n                                    {\n                                      'text': text,\n                                      'text_align': position,\n                                      'text_wrap': 'wrap'\n                                    } )\n\n      if vim.options[ 'ambiwidth' ] != 'double':\n        marker = '⚠'\n      else:\n        marker = '>'\n\n      MakeVritualTextProperty(\n        'YcmVirtDiagPadding',\n        ' ' * vim.buffers[ self._bufnr ].options[ 'shiftwidth' ] ),\n      MakeVritualTextProperty(\n        'YcmVirtDiagError' if _DiagnosticIsError( first_diag )\n                       else 'YcmVirtDiagWarning',\n        marker + ' ' + [ line for line in text.splitlines() if line ][ 0 ] )\n    else:\n      if not text:\n        # We already cleared it\n        return\n\n      vimsupport.PostVimMessage( text, warning = False, truncate = True )\n\n    self._diag_message_needs_clearing = True\n\n\n  def _DiagnosticsCount( self, predicate ):\n    count = 0\n    for diags in self._line_to_diags.values():\n      count += sum( 1 for d in diags if predicate( d ) )\n    return count\n\n\n  def _UpdateLocationLists( self, open_on_edit = False ):\n    vimsupport.SetLocationListsForBuffer(\n      self._bufnr,\n      vimsupport.ConvertDiagnosticsToQfList( self._diagnostics ),\n      open_on_edit )\n\n\n  def _ClearMatches( self ):\n    props_to_remove = vimsupport.GetTextProperties( self._bufnr )\n    for prop in props_to_remove:\n      vimsupport.RemoveDiagnosticProperty( self._bufnr, prop )\n\n\n  def UpdateMatches( self ):\n    if not self._user_options[ 'enable_diagnostic_highlighting' ]:\n      return\n\n    props_to_remove = vimsupport.GetTextProperties( self._bufnr )\n    for diags in self._line_to_diags.values():\n      # Insert squiggles in reverse order so that errors overlap warnings.\n      for diag in reversed( diags ):\n        for line, column, name, extras in _ConvertDiagnosticToTextProperties(\n            self._bufnr,\n            diag ):\n          global YCM_VIM_PROPERTY_ID\n\n          # Note the following .remove() works because the __eq__ on\n          # DiagnosticProperty does not actually check the IDs match...\n          diag_prop = vimsupport.DiagnosticProperty(\n              YCM_VIM_PROPERTY_ID,\n              name,\n              line,\n              column,\n              extras[ 'end_col' ] - column if 'end_col' in extras else column )\n          try:\n            props_to_remove.remove( diag_prop )\n          except ValueError:\n            extras.update( {\n              'id': YCM_VIM_PROPERTY_ID\n            } )\n            vimsupport.AddTextProperty( self._bufnr,\n                                        line,\n                                        column,\n                                        name,\n                                        extras )\n          YCM_VIM_PROPERTY_ID += 1\n    for prop in props_to_remove:\n      vimsupport.RemoveDiagnosticProperty( self._bufnr, prop )\n\n\n  def _ClearSigns( self ):\n    signs_to_unplace = vimsupport.GetSignsInBuffer( self._bufnr )\n    vim.eval( f'sign_unplacelist( { signs_to_unplace } )' )\n\n\n  def _UpdateSigns( self ):\n    signs_to_unplace = vimsupport.GetSignsInBuffer( self._bufnr )\n    signs_to_place = []\n    for line, diags in self._line_to_diags.items():\n      if not diags:\n        continue\n\n      # We always go for the first diagnostic on the line because diagnostics\n      # are sorted by errors in priority and Vim can only display one sign by\n      # line.\n      name = 'YcmError' if _DiagnosticIsError( diags[ 0 ] ) else 'YcmWarning'\n      sign = {\n          'lnum': line,\n          'name': name,\n          'buffer': self._bufnr,\n          'group': 'ycm_signs'\n      }\n      try:\n        signs_to_unplace.remove( sign )\n      except ValueError:\n        signs_to_place.append( sign )\n    vim.eval( f'sign_placelist( { signs_to_place } )' )\n    vim.eval( f'sign_unplacelist( { signs_to_unplace } )' )\n\n\n  def _ConvertDiagListToDict( self ):\n    self._line_to_diags = defaultdict( list )\n    for diag in self._diagnostics:\n      location_extent = diag[ 'location_extent' ]\n      start = location_extent[ 'start' ]\n      end = location_extent[ 'end' ]\n      bufnr = vimsupport.GetBufferNumberForFilename( start[ 'filepath' ] )\n      if bufnr == self._bufnr:\n        for line_number in range( start[ 'line_num' ], end[ 'line_num' ] + 1 ):\n          self._line_to_diags[ line_number ].append( diag )\n\n    for diags in self._line_to_diags.values():\n      # We also want errors to be listed before warnings so that errors aren't\n      # hidden by the warnings; Vim won't place a sign over an existing one.\n      diags.sort( key = lambda diag: ( diag[ 'kind' ],\n                                       diag[ 'location' ][ 'column_num' ] ) )\n\n\n_DiagnosticIsError = CompileLevel( 'error' )\n_DiagnosticIsWarning = CompileLevel( 'warning' )\n\n\ndef _NormalizeDiagnostic( diag ):\n  def ClampToOne( value ):\n    return value if value > 0 else 1\n\n  location = diag[ 'location' ]\n  location[ 'column_num' ] = ClampToOne( location[ 'column_num' ] )\n  location[ 'line_num' ] = ClampToOne( location[ 'line_num' ] )\n  return diag\n\n\ndef _ConvertDiagnosticToTextProperties( bufnr, diagnostic ):\n  properties = []\n\n  name = ( 'YcmErrorProperty' if _DiagnosticIsError( diagnostic ) else\n            'YcmWarningProperty' )\n  if vimsupport.VimIsNeovim():\n    name = name.replace( 'Property', 'Section' )\n\n  location_extent = diagnostic[ 'location_extent' ]\n  if location_extent[ 'start' ][ 'line_num' ] <= 0:\n    location = diagnostic[ 'location' ]\n    line, column = vimsupport.LineAndColumnNumbersClamped(\n      bufnr,\n      location[ 'line_num' ],\n      location[ 'column_num' ]\n    )\n    properties.append( ( line, column, name, {} ) )\n  else:\n    start_line, start_column = vimsupport.LineAndColumnNumbersClamped(\n      bufnr,\n      location_extent[ 'start' ][ 'line_num' ],\n      location_extent[ 'start' ][ 'column_num' ]\n    )\n    end_line, end_column = vimsupport.LineAndColumnNumbersClamped(\n      bufnr,\n      location_extent[ 'end' ][ 'line_num' ],\n      location_extent[ 'end' ][ 'column_num' ]\n    )\n    properties.append( (\n      start_line,\n      start_column,\n      name,\n      { 'end_lnum': end_line,\n        'end_col': end_column } ) )\n\n  for diagnostic_range in diagnostic[ 'ranges' ]:\n    if ( diagnostic_range[ 'start' ][ 'line_num' ] == 0 or\n         diagnostic_range[ 'end' ][ 'line_num' ] == 0 ):\n      continue\n    start_line, start_column = vimsupport.LineAndColumnNumbersClamped(\n      bufnr,\n      diagnostic_range[ 'start' ][ 'line_num' ],\n      diagnostic_range[ 'start' ][ 'column_num' ]\n    )\n    end_line, end_column = vimsupport.LineAndColumnNumbersClamped(\n      bufnr,\n      diagnostic_range[ 'end' ][ 'line_num' ],\n      diagnostic_range[ 'end' ][ 'column_num' ]\n    )\n\n    if not _IsValidRange( start_line, start_column, end_line, end_column ):\n      continue\n\n    properties.append( (\n      start_line,\n      start_column,\n      name,\n      { 'end_lnum': end_line,\n        'end_col': end_column } ) )\n\n  return properties\n\n\ndef _IsValidRange( start_line, start_column, end_line, end_column ):\n  # End line before start line - invalid\n  if start_line > end_line:\n    return False\n\n  # End line after start line - valid\n  if start_line < end_line:\n    return True\n\n  # Same line, start colum after end column - invalid\n  if start_column > end_column:\n    return False\n\n  # Same line, start column before or equal to end column - valid\n  return True\n"
  },
  {
    "path": "python/ycm/hierarchy_tree.py",
    "content": "# Copyright (C) 2024 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom typing import Optional, List\nfrom ycm import vimsupport\nimport os\n\n\nclass HierarchyNode:\n  def __init__( self, data, distance : int ):\n    self._references : Optional[ List[ int ] ] = None\n    self._data = data\n    self._distance_from_root = distance\n\n\n  def ToRootLocation( self, subindex : int ):\n    location = self._data.get( 'root_location' )\n    if location:\n      file = location[ 'filepath' ]\n      line = location[ 'line_num' ]\n      column = location[ 'column_num' ]\n      return file, line, column\n    else:\n      return self.ToLocation( subindex )\n\n\n  def ToLocation( self, subindex : int ):\n    location = self._data[ 'locations' ][ subindex ]\n    line = location[ 'line_num' ]\n    column = location[ 'column_num' ]\n    file = location[ 'filepath' ]\n    return file, line, column\n\n\nMAX_HANDLES_PER_INDEX = 1000000\n\n\ndef handle_to_index( handle : int ):\n  return abs( handle ) // MAX_HANDLES_PER_INDEX\n\n\ndef handle_to_location_index( handle : int ):\n  return abs( handle ) % MAX_HANDLES_PER_INDEX\n\n\ndef make_handle( index : int, location_index : int ):\n  return index * MAX_HANDLES_PER_INDEX + location_index\n\n\nclass HierarchyTree:\n  def __init__( self ):\n    self._up_nodes : List[ HierarchyNode ] = []\n    self._down_nodes : List[ HierarchyNode ] = []\n    self._kind : str = ''\n\n  def SetRootNode( self, items, kind : str ):\n    if items:\n      assert len( items ) == 1\n      self._root_node_indices = [ 0 ]\n      self._down_nodes.append( HierarchyNode( items[ 0 ], 0 ) )\n      self._up_nodes.append( HierarchyNode( items[ 0 ], 0 ) )\n      self._kind = kind\n      return self.HierarchyToLines()\n    return []\n\n\n  def UpdateHierarchy( self, handle : int, items, direction : str ):\n    current_index = handle_to_index( handle )\n    nodes = self._down_nodes if direction == 'down' else self._up_nodes\n    if items:\n      nodes.extend( [\n        HierarchyNode( item,\n                       nodes[ current_index ]._distance_from_root + 1 )\n        for item in items ] )\n      nodes[ current_index ]._references = list(\n          range( len( nodes ) - len( items ), len( nodes ) ) )\n    else:\n      nodes[ current_index ]._references = []\n\n\n  def Reset( self ):\n    self._down_nodes = []\n    self._up_nodes = []\n    self._kind = ''\n\n\n  def _HierarchyToLinesHelper( self, refs, use_down_nodes ):\n    partial_result = []\n    nodes = self._down_nodes if use_down_nodes else self._up_nodes\n    for index in refs:\n      next_node = nodes[ index ]\n      indent = 2 * next_node._distance_from_root\n      if index == 0:\n        can_expand = ( self._down_nodes[ 0 ]._references is None or\n                       self._up_nodes[ 0 ]._references is None )\n      else:\n        can_expand = next_node._references is None\n      symbol = '+' if can_expand else '-'\n      name = next_node._data[ 'name' ]\n      kind = next_node._data[ 'kind' ]\n      if use_down_nodes:\n        partial_result.extend( [\n          (\n            {\n              'indent': indent,\n              'icon': symbol,\n              'symbol': name,\n              'kind': kind,\n              'filepath': os.path.split( l[ 'filepath' ] )[ 1 ],\n              'line_num': str( l[ 'line_num' ] ),\n              'description': l.get( 'description', '' ).strip(),\n            },\n            make_handle( index, location_index )\n          )\n          for location_index, l in enumerate( next_node._data[ 'locations' ] )\n        ] )\n      else:\n        partial_result.extend( [\n          (\n            {\n              'indent': indent,\n              'icon': symbol,\n              'symbol': name,\n              'kind': kind,\n              'filepath': os.path.split( l[ 'filepath' ] )[ 1 ],\n              'line_num': str( l[ 'line_num' ] ),\n              'description': l.get( 'description', '' ).strip(),\n            },\n            make_handle( index, location_index ) * -1\n          )\n          for location_index, l in enumerate( next_node._data[ 'locations' ] )\n        ] )\n      if next_node._references:\n        partial_result.extend(\n          self._HierarchyToLinesHelper(\n            next_node._references, use_down_nodes ) )\n    return partial_result\n\n  def HierarchyToLines( self ):\n    down_lines = self._HierarchyToLinesHelper( [ 0 ], True )\n    up_lines = self._HierarchyToLinesHelper( [ 0 ], False )\n    up_lines.reverse()\n    return up_lines + down_lines[ 1: ]\n\n\n  def JumpToItem( self, handle : int, command ):\n    node_index = handle_to_index( handle )\n    location_index = handle_to_location_index( handle )\n    if handle >= 0:\n      node = self._down_nodes[ node_index ]\n    else:\n      node = self._up_nodes[ node_index ]\n    file, line, column = node.ToLocation( location_index )\n    vimsupport.JumpToLocation( file, line, column, '', command )\n\n\n  def ShouldResolveItem( self, handle : int, direction : str ):\n    node_index = handle_to_index( handle )\n    if ( ( handle >= 0 and direction == 'down' ) or\n         ( handle <= 0 and direction == 'up' ) ):\n      if direction == 'down':\n        node = self._down_nodes[ node_index ]\n      else:\n        node = self._up_nodes[ node_index ]\n      return node._references is None\n    return True\n\n\n  def ResolveArguments( self, handle : int, direction : str ):\n    node_index = handle_to_index( handle )\n    if self._kind == 'call':\n      direction = 'outgoing' if direction == 'up' else 'incoming'\n    else:\n      direction = 'supertypes' if direction == 'up' else 'subtypes'\n    if handle >= 0:\n      node = self._down_nodes[ node_index ]\n    else:\n      node = self._up_nodes[ node_index ]\n    return [\n      f'Resolve{ self._kind.title() }HierarchyItem',\n      node._data,\n      direction\n    ]\n\n\n  def HandleToRootLocation( self, handle : int ):\n    node_index = handle_to_index( handle )\n\n    if handle >= 0:\n      node = self._down_nodes[ node_index ]\n    else:\n      node = self._up_nodes[ node_index ]\n\n    location_index = handle_to_location_index( handle )\n    return node.ToRootLocation( location_index )\n\n\n  def UpdateChangesRoot( self, handle : int, direction : str ):\n    return ( ( handle < 0 and direction == 'down' ) or\n             ( handle > 0 and direction == 'up' ) )\n"
  },
  {
    "path": "python/ycm/inlay_hints.py",
    "content": "# Copyright (C) 2022, YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\nfrom ycm.client.inlay_hints_request import InlayHintsRequest\nfrom ycm.client.base_request import BuildRequestData\nfrom ycm import vimsupport\nfrom ycm import text_properties as tp\nfrom ycm import scrolling_range as sr\n\n\nHIGHLIGHT_GROUP = {\n  'Type':      'YcmInlayHint',\n  'Parameter': 'YcmInlayHint',\n  'Enum':      'YcmInlayHint',\n}\nREPORTED_MISSING_TYPES = set()\n\n\ndef Initialise():\n  if vimsupport.VimIsNeovim():\n    return False\n\n  props = tp.GetTextPropertyTypes()\n  if 'YCM_INLAY_UNKNOWN' not in props:\n    tp.AddTextPropertyType( 'YCM_INLAY_UNKNOWN',\n                            highlight = 'YcmInlayHint',\n                            start_incl = 1 )\n  if 'YCM_INLAY_PADDING' not in props:\n    tp.AddTextPropertyType( 'YCM_INLAY_PADDING',\n                            highlight = 'YcmInvisible',\n                            start_incl = 1 )\n\n  for token_type, group in HIGHLIGHT_GROUP.items():\n    prop = f'YCM_INLAY_{ token_type }'\n    if prop not in props and vimsupport.GetIntValue(\n        f\"hlexists( '{ vimsupport.EscapeForVim( group ) }' )\" ):\n      tp.AddTextPropertyType( prop,\n                              highlight = group,\n                              start_incl = 1 )\n\n  return True\n\n\nclass InlayHints( sr.ScrollingBufferRange ):\n  \"\"\"Stores the inlay hints state for a Vim buffer\"\"\"\n\n\n  def _NewRequest( self, request_range ):\n    request_data = BuildRequestData( self._bufnr )\n    request_data[ 'range' ] = request_range\n    return InlayHintsRequest( request_data )\n\n\n  def Clear( self ):\n    types = [ 'YCM_INLAY_UNKNOWN', 'YCM_INLAY_PADDING' ] + [\n      f'YCM_INLAY_{ prop_type }' for prop_type in HIGHLIGHT_GROUP.keys()\n    ]\n\n    tp.ClearTextProperties( self._bufnr, prop_types = types )\n\n\n  def _Draw( self ):\n    self.Clear()\n\n    for inlay_hint in self._latest_response:\n      if 'kind' not in inlay_hint:\n        prop_type = 'YCM_INLAY_UNKNOWN'\n      elif inlay_hint[ 'kind' ] not in HIGHLIGHT_GROUP:\n        prop_type = 'YCM_INLAY_UNKNOWN'\n      else:\n        prop_type = 'YCM_INLAY_' + inlay_hint[ 'kind' ]\n\n      self.GrowRangeIfNeeded( {\n        'start': inlay_hint[ 'position' ],\n        'end': {\n          'line_num': inlay_hint[ 'position' ][ 'line_num' ],\n          'column_num': inlay_hint[ 'position' ][ 'column_num' ] + len(\n            inlay_hint[ 'label' ] )\n        }\n      } )\n\n      if inlay_hint.get( 'paddingLeft', False ):\n        tp.AddTextProperty( self._bufnr,\n                            None,\n                            'YCM_INLAY_PADDING',\n                            {\n                              'start': inlay_hint[ 'position' ],\n                            },\n                            {\n                              'text': ' '\n                            } )\n\n      tp.AddTextProperty( self._bufnr,\n                          None,\n                          prop_type,\n                          {\n                            'start': inlay_hint[ 'position' ],\n                          },\n                          {\n                            'text': inlay_hint[ 'label' ]\n                          } )\n\n      if inlay_hint.get( 'paddingRight', False ):\n        tp.AddTextProperty( self._bufnr,\n                            None,\n                            'YCM_INLAY_PADDING',\n                            {\n                              'start': inlay_hint[ 'position' ],\n                            },\n                            {\n                              'text': ' '\n                            } )\n"
  },
  {
    "path": "python/ycm/omni_completer.py",
    "content": "# Copyright (C) 2011-2019 ycmd contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport vim\nfrom ycm import vimsupport\nfrom ycmd import utils\nfrom ycmd.completers.completer import Completer\nfrom ycm.client.base_request import BaseRequest\n\nOMNIFUNC_RETURNED_BAD_VALUE = 'Omnifunc returned bad value to YCM!'\nOMNIFUNC_NOT_LIST = ( 'Omnifunc did not return a list or a dict with a \"words\" '\n                     ' list when expected.' )\n\n\nclass OmniCompleter( Completer ):\n  def __init__( self, user_options ):\n    super( OmniCompleter, self ).__init__( user_options )\n    self._omnifunc = None\n\n\n  def SupportedFiletypes( self ):\n    return []\n\n\n  def ShouldUseCache( self ):\n    return bool( self.user_options[ 'cache_omnifunc' ] )\n\n\n  def ShouldUseNow( self, request_data ):\n    self._omnifunc = utils.ToUnicode( vim.eval( '&omnifunc' ) )\n    if not self._omnifunc:\n      return False\n    if self.ShouldUseCache():\n      return super( OmniCompleter, self ).ShouldUseNow( request_data )\n    return self.ShouldUseNowInner( request_data )\n\n\n  def ShouldUseNowInner( self, request_data ):\n    if request_data[ 'force_semantic' ]:\n      return True\n    disabled_filetypes = self.user_options[\n      'filetype_specific_completion_to_disable' ]\n    if not vimsupport.CurrentFiletypesEnabled( disabled_filetypes ):\n      return False\n    return super( OmniCompleter, self ).ShouldUseNowInner( request_data )\n\n\n  def ComputeCandidates( self, request_data ):\n    if self.ShouldUseCache():\n      return super( OmniCompleter, self ).ComputeCandidates( request_data )\n    if self.ShouldUseNowInner( request_data ):\n      return self.ComputeCandidatesInner( request_data )\n    return []\n\n\n  def ComputeCandidatesInner( self, request_data ):\n    if not self._omnifunc:\n      return []\n\n    # Calling directly the omnifunc may move the cursor position. This is the\n    # case with the default Vim omnifunc for C-family languages\n    # (ccomplete#Complete) which calls searchdecl to find a declaration. This\n    # function is supposed to move the cursor to the found declaration but it\n    # doesn't when called through the omni completion mapping (CTRL-X CTRL-O).\n    # So, we restore the cursor position after the omnifunc calls.\n    line, column = vimsupport.CurrentLineAndColumn()\n\n    try:\n      start_column = vimsupport.GetIntValue( self._omnifunc + '(1,\"\")' )\n\n      # Vim only stops completion if the value returned by the omnifunc is -3 or\n      # -2. In other cases, if the value is negative or greater than the current\n      # column, the start column is set to the current column; otherwise, the\n      # value is used as the start column.\n      if start_column in ( -3, -2 ):\n        return []\n      if start_column < 0 or start_column > column:\n        start_column = column\n\n      # Use the start column calculated by the omnifunc, rather than our own\n      # interpretation. This is important for certain languages where our\n      # identifier detection is either incorrect or not compatible with the\n      # behaviour of the omnifunc. Note: do this before calling the omnifunc\n      # because it affects the value returned by 'query'.\n      request_data[ 'start_column' ] = start_column + 1\n\n      # Vim internally moves the cursor to the start column before calling again\n      # the omnifunc. Some omnifuncs like the one defined by the\n      # LanguageClient-neovim plugin depend on this behavior to compute the list\n      # of candidates.\n      vimsupport.SetCurrentLineAndColumn( line, start_column )\n\n      omnifunc_call = [ self._omnifunc,\n                        \"(0,'\",\n                        vimsupport.EscapeForVim( request_data[ 'query' ] ),\n                        \"')\" ]\n      items = vim.eval( ''.join( omnifunc_call ) )\n\n      if isinstance( items, dict ) and 'words' in items:\n        items = items[ 'words' ]\n\n      if not hasattr( items, '__iter__' ):\n        raise TypeError( OMNIFUNC_NOT_LIST )\n\n      # Vim allows each item of the list to be either a string or a dictionary\n      # but ycmd only supports lists where items are all strings or all\n      # dictionaries. Convert all strings into dictionaries.\n      for index, item in enumerate( items ):\n        # Set the 'equal' field to 1 to disable Vim filtering.\n        if not isinstance( item, dict ):\n          items[ index ] = {\n            'word': item,\n            'equal': 1\n          }\n        else:\n          item[ 'equal' ] = 1\n\n      return items\n\n    except ( TypeError, ValueError, vim.error ) as error:\n      vimsupport.PostVimMessage(\n        OMNIFUNC_RETURNED_BAD_VALUE + ' ' + str( error ) )\n      return []\n\n    finally:\n      vimsupport.SetCurrentLineAndColumn( line, column )\n\n\n  def FilterAndSortCandidatesInner( self, candidates, sort_property, query ):\n    request_data = {\n      'candidates': candidates,\n      'sort_property': sort_property,\n      'query': query\n    }\n\n    response = BaseRequest().PostDataToHandler( request_data,\n                                                'filter_and_sort_candidates' )\n    return response if response is not None else []\n"
  },
  {
    "path": "python/ycm/paths.py",
    "content": "# Copyright (C) 2015-2017 YouCompleteMe contributors.\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport os\nimport sys\nimport vim\nimport re\n\n# Can't import these from setup.py because it makes nosetests go crazy.\nDIR_OF_CURRENT_SCRIPT = os.path.dirname( os.path.abspath( __file__ ) )\nDIR_OF_YCMD = os.path.join( DIR_OF_CURRENT_SCRIPT, '..', '..', 'third_party',\n                            'ycmd' )\nWIN_PYTHON_PATH = os.path.join( sys.exec_prefix, 'python.exe' )\nPYTHON_BINARY_REGEX = re.compile(\n  r'python(3(\\.[6-9])?)?(.exe)?$', re.IGNORECASE )\n\n\n# Not caching the result of this function; users shouldn't have to restart Vim\n# after running the install script or setting the\n# `g:ycm_server_python_interpreter` option.\ndef PathToPythonInterpreter():\n  # Not calling the Python interpreter to check its version as it significantly\n  # impacts startup time.\n  from ycmd import utils\n\n  python_interpreter = vim.eval( 'g:ycm_server_python_interpreter' )\n  if python_interpreter:\n    python_interpreter = utils.FindExecutable( python_interpreter )\n    if python_interpreter:\n      return python_interpreter\n\n    raise RuntimeError( \"Path in 'g:ycm_server_python_interpreter' option \"\n                        \"does not point to a valid Python 3.6+.\" )\n\n  python_interpreter = _PathToPythonUsedDuringBuild()\n  if python_interpreter and utils.GetExecutable( python_interpreter ):\n    return python_interpreter\n\n  # On UNIX platforms, we use sys.executable as the Python interpreter path.\n  # We cannot use sys.executable on Windows because for unknown reasons, it\n  # returns the Vim executable. Instead, we use sys.exec_prefix to deduce the\n  # interpreter path.\n  python_interpreter = ( WIN_PYTHON_PATH if utils.OnWindows() else\n                         sys.executable )\n  if _EndsWithPython( python_interpreter ):\n    return python_interpreter\n\n  python_interpreter = utils.PathToFirstExistingExecutable( [ 'python3',\n                                                              'python' ] )\n  if python_interpreter:\n    return python_interpreter\n\n  raise RuntimeError( \"Cannot find Python 3.6+. \"\n                      \"Set the 'g:ycm_server_python_interpreter' option \"\n                      \"to a Python interpreter path.\" )\n\n\ndef _PathToPythonUsedDuringBuild():\n  from ycmd import utils\n\n  try:\n    filepath = os.path.join( DIR_OF_YCMD, 'PYTHON_USED_DURING_BUILDING' )\n    return utils.ReadFile( filepath ).strip()\n  except OSError:\n    return None\n\n\ndef _EndsWithPython( path ):\n  \"\"\"Check if given path ends with a python 3.6+ name.\"\"\"\n  return path and PYTHON_BINARY_REGEX.search( path ) is not None\n\n\ndef PathToServerScript():\n  return os.path.join( DIR_OF_YCMD, 'ycmd' )\n"
  },
  {
    "path": "python/ycm/scrolling_range.py",
    "content": "# Copyright (C) 2023, YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport abc\n\nfrom ycm import vimsupport\n\n\nclass ScrollingBufferRange( object ):\n  \"\"\"Abstraction used by inlay hints and semantic tokens to only request visible\n  ranges\"\"\"\n\n  # FIXME: Send a request per-disjoint range for this buffer rather than the\n  # maximal range. then collaate the results when all responses are returned\n  def __init__( self, bufnr ):\n    self._bufnr = bufnr\n    self._tick = -1\n    self._request = None\n    self._last_requested_range = None\n\n\n  def Ready( self ):\n    return self._request is not None and self._request.Done()\n\n\n  def Request( self, force=False ):\n    if self._request and not self.Ready():\n      return True\n\n    # Check to see if the buffer ranges would actually change anything visible.\n    # This avoids a round-trip for every single line scroll event\n    if ( not force and\n         self._tick == vimsupport.GetBufferChangedTick( self._bufnr ) and\n         vimsupport.VisibleRangeOfBufferOverlaps(\n           self._bufnr,\n           self._last_requested_range ) ):\n      return False # don't poll\n\n    # FIXME: This call is duplicated in the call to VisibleRangeOfBufferOverlaps\n    #  - remove the expansion param\n    #  - look up the actual visible range, then call this function\n    #  - if not overlapping, do the factor expansion and request\n    self._last_requested_range = vimsupport.RangeVisibleInBuffer( self._bufnr )\n    # If this is false, either the self._bufnr is not a valid buffer number or\n    # the buffer is not visible in any window.\n    # Since this is called asynchronously, a user may bwipeout a buffer with\n    # self._bufnr number between polls.\n    if self._last_requested_range is None:\n      return False\n\n    self._tick = vimsupport.GetBufferChangedTick( self._bufnr )\n\n    # We'll never use the last response again, so clear it\n    self._latest_response = None\n    self._request = self._NewRequest( self._last_requested_range )\n    self._request.Start()\n    return True\n\n\n  def Update( self ):\n    if not self._request:\n      # Nothing to update\n      return True\n\n    assert self.Ready()\n\n    # We're ready to use this response. Clear the request (to avoid repeatedly\n    # re-polling).\n    self._latest_response = self._request.Response()\n    self._request = None\n\n    if self._tick != vimsupport.GetBufferChangedTick( self._bufnr ):\n      # Buffer has changed, we should ignore the data and retry\n      self.Request( force=True )\n      return False # poll again\n\n    self._Draw()\n\n    # No need to re-poll\n    return True\n\n\n  def Refresh( self ):\n    if self._tick != vimsupport.GetBufferChangedTick( self._bufnr ):\n      # stale data\n      return\n\n    if self._request is not None:\n      # request in progress; we''l handle refreshing when it's done.\n      return\n\n    self._Draw()\n\n\n  def GrowRangeIfNeeded( self, rng ):\n    \"\"\"When processing results, we may receive a wider range than requested. In\n    that case, grow our 'last requested' range to minimise requesting more\n    frequently than we need to.\"\"\"\n    # Note: references (pointers) so no need to re-assign\n    rmin = self._last_requested_range[ 'start' ]\n    rmax = self._last_requested_range[ 'end' ]\n\n    start = rng[ 'start' ]\n    end = rng[ 'end' ]\n\n    if rmin[ 'line_num' ] is None or start[ 'line_num' ] < rmin[ 'line_num' ]:\n      rmin[ 'line_num' ] = start[ 'line_num' ]\n      rmin[ 'column_num' ] = start[ 'column_num' ]\n    elif start[ 'line_num' ] == rmin[ 'line_num' ]:\n      rmin[ 'column_num' ] = min( start[ 'column_num' ],\n                                  rmin[ 'column_num' ] )\n\n    if rmax[ 'line_num' ] is None or end[ 'line_num' ] > rmax[ 'line_num' ]:\n      rmax[ 'line_num' ] = end[ 'line_num' ]\n      rmax[ 'column_num' ] = end[ 'column_num' ]\n    elif end[ 'line_num' ] == rmax[ 'line_num' ]:\n      rmax[ 'column_num' ] = max( end[ 'column_num' ], rmax[ 'column_num' ] )\n\n\n  # API; just implement the following, using self._bufnr and\n  # self._latest_response as required\n\n  @abc.abstractmethod\n  def _NewRequest( self, request_range ):\n    # prepare a new request_data and return it\n    pass\n\n\n  @abc.abstractmethod\n  def _Draw( self ):\n    # actuall paint the properties\n    pass\n"
  },
  {
    "path": "python/ycm/semantic_highlighting.py",
    "content": "# Copyright (C) 2020, YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\nfrom ycm.client.semantic_tokens_request import SemanticTokensRequest\nfrom ycm.client.base_request import BuildRequestData\nfrom ycm import vimsupport\nfrom ycm import text_properties as tp\nfrom ycm import scrolling_range as sr\n\nimport vim\n\n\nHIGHLIGHT_GROUP = {\n  'namespace': 'Type',\n  'type': 'Type',\n  'class': 'Structure',\n  'enum': 'Structure',\n  'interface': 'Structure',\n  'struct': 'Structure',\n  'typeParameter': 'Identifier',\n  'parameter': 'Identifier',\n  'variable': 'Identifier',\n  'property': 'Identifier',\n  'enumMember': 'Identifier',\n  'enumConstant': 'Constant',\n  'event': 'Identifier',\n  'function': 'Function',\n  'member': 'Identifier',\n  'macro': 'Macro',\n  'method': 'Function',\n  'keyword': 'Keyword',\n  'modifier': 'Keyword',\n  'comment': 'Comment',\n  'string': 'String',\n  'number': 'Number',\n  'regexp': 'String',\n  'operator': 'Operator',\n  'decorator': 'Special',\n  'unknown': 'Normal',\n\n  # These are not part of the spec, but are used by clangd\n  'bracket': 'Normal',\n  'concept': 'Type',\n  # These are not part of the spec, but are used by jdt.ls\n  'annotation': 'Macro',\n}\nREPORTED_MISSING_TYPES = set()\n\n\ndef Initialise():\n  if vimsupport.VimIsNeovim():\n    return\n\n  props = tp.GetTextPropertyTypes()\n  if 'YCM_HL_UNKNOWN' not in props:\n    tp.AddTextPropertyType( 'YCM_HL_UNKNOWN',\n                            highlight = 'WarningMsg',\n                            priority = 0 )\n\n  for token_type, group in HIGHLIGHT_GROUP.items():\n    prop = f'YCM_HL_{ token_type }'\n    if prop not in props and vimsupport.GetIntValue(\n        f\"hlexists( '{ vimsupport.EscapeForVim( group ) }' )\" ):\n      tp.AddTextPropertyType( prop,\n                              highlight = group,\n                              priority = 0 )\n\n\n# \"arbitrary\" base id\nNEXT_TEXT_PROP_ID = 70784\n\n\ndef NextPropID():\n  global NEXT_TEXT_PROP_ID\n  try:\n    return NEXT_TEXT_PROP_ID\n  finally:\n    NEXT_TEXT_PROP_ID += 1\n\n\n\nclass SemanticHighlighting( sr.ScrollingBufferRange ):\n  \"\"\"Stores the semantic highlighting state for a Vim buffer\"\"\"\n\n  def __init__( self, bufnr ):\n    self._prop_id = NextPropID()\n    super().__init__( bufnr )\n\n\n  def _NewRequest( self, request_range ):\n    request: dict = BuildRequestData( self._bufnr )\n    request[ 'range' ] = request_range\n    return SemanticTokensRequest( request )\n\n\n  def _Draw( self ):\n    # We requested a snapshot\n    tokens = self._latest_response.get( 'tokens', [] )\n\n    prev_prop_id = self._prop_id\n    self._prop_id = NextPropID()\n\n    for token in tokens:\n      prop_type = f\"YCM_HL_{ token[ 'type' ] }\"\n      rng = token[ 'range' ]\n      self.GrowRangeIfNeeded( rng )\n\n      try:\n        tp.AddTextProperty( self._bufnr, self._prop_id, prop_type, rng )\n      except vim.error as e:\n        if 'E971:' in str( e ): # Text property doesn't exist\n          if token[ 'type' ] not in REPORTED_MISSING_TYPES:\n            REPORTED_MISSING_TYPES.add( token[ 'type' ] )\n            vimsupport.PostVimMessage(\n              f\"Token type { token[ 'type' ] } not supported. \"\n              f\"Define property type { prop_type }. \"\n              f\"See :help youcompleteme-customising-highlight-groups\" )\n        else:\n          raise e\n\n    tp.ClearTextProperties( self._bufnr, prop_id = prev_prop_id )\n"
  },
  {
    "path": "python/ycm/signature_help.py",
    "content": "# Copyright (C) 2011-2018 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport vim\nimport json\nfrom ycm import vimsupport\nfrom ycmd import utils\nfrom ycm.vimsupport import memoize, GetIntValue\n\n\nclass SignatureHelpState:\n  ACTIVE = 'ACTIVE'\n  INACTIVE = 'INACTIVE'\n  ACTIVE_SUPPRESSED = 'ACTIVE_SUPPRESSED'\n\n  def __init__( self,\n                popup_win_id = None,\n                state = INACTIVE ):\n    self.popup_win_id = popup_win_id\n    self.state = state\n    self.anchor = None\n\n\n  def ToggleVisibility( self ):\n    if self.state == 'ACTIVE':\n      self.state = 'ACTIVE_SUPPRESSED'\n      vim.eval( f'popup_hide( { self.popup_win_id } )' )\n    elif self.state == 'ACTIVE_SUPPRESSED':\n      self.state = 'ACTIVE'\n      vim.eval( f'popup_show( { self.popup_win_id } )' )\n\n\n  def IsActive( self ):\n    if self.state in ( 'ACTIVE', 'ACTIVE_SUPPRESSED' ):\n      return 'ACTIVE'\n    return 'INACTIVE'\n\n\ndef _MakeSignatureHelpBuffer( signature_info ):\n  active_parameter = int( signature_info.get( 'activeParameter', 0 ) )\n\n  lines = []\n  signatures = ( signature_info.get( 'signatures' ) or [] )\n\n  for sig_index, signature in enumerate( signatures ):\n    props = []\n\n    sig_label = signature[ 'label' ]\n    parameters = ( signature.get( 'parameters' ) or [] )\n    for param_index, parameter in enumerate( parameters ):\n      param_label = parameter[ 'label' ]\n      begin = int( param_label[ 0 ] )\n      end = int( param_label[ 1 ] )\n      if param_index == active_parameter:\n        props.append( {\n          'col': begin + 1, # 1-based\n          'length': end - begin,\n          'type': 'YCM-signature-help-current-argument'\n        } )\n\n    lines.append( {\n      'text': sig_label,\n      'props': props\n    } )\n\n  return lines\n\n\n@memoize()\ndef ShouldUseSignatureHelp():\n  return ( vimsupport.VimHasFunctions( 'screenpos', 'pum_getpos' ) and\n           vimsupport.VimSupportsPopupWindows() )\n\n\ndef UpdateSignatureHelp( state, signature_info ): # noqa\n  if not ShouldUseSignatureHelp():\n    return state\n\n  signatures = signature_info.get( 'signatures' ) or []\n\n  if not signatures:\n    if state.popup_win_id:\n      # TODO/FIXME: Should we use popup_hide() instead ?\n      vim.eval( f\"popup_close( { state.popup_win_id } )\" )\n    return SignatureHelpState( None, SignatureHelpState.INACTIVE )\n\n  if state.state == SignatureHelpState.INACTIVE:\n    state.anchor = vimsupport.CurrentLineAndColumn()\n\n    state.state = SignatureHelpState.ACTIVE\n\n  # Generate the buffer as a list of lines\n  buf_lines = _MakeSignatureHelpBuffer( signature_info )\n  screen_pos = vimsupport.ScreenPositionForLineColumnInWindow(\n    vim.current.window,\n    state.anchor[ 0 ] + 1,  # anchor 0-based\n    state.anchor[ 1 ] + 1 ) # anchor 0-based\n\n  # Simulate 'flip' at the screen boundaries by using screenpos and hiding the\n  # signature help menu if it overlaps the completion popup (pum).\n  #\n  # FIXME: revert to cursor-relative positioning and the 'flip' option when that\n  # is implemented (if that is indeed better).\n\n  # By default display above the anchor\n  line = int( screen_pos[ 'row' ] ) - 1 # -1 to display above the cur line\n  pos = \"botleft\"\n\n  cursor_line = vimsupport.CurrentLineAndColumn()[ 0 ] + 1\n  if int( screen_pos[ 'row' ] ) <= len( buf_lines ):\n    # No room at the top, display below\n    line = int( screen_pos[ 'row' ] ) + 1\n    pos = \"topleft\"\n\n  # Don't allow the popup to overlap the cursor\n  if ( pos == 'topleft' and\n       line < cursor_line and\n       line + len( buf_lines ) >= cursor_line ):\n    line = 0\n\n  # Don't allow the popup to overlap the pum\n  if line > 0 and GetIntValue( 'pumvisible()' ):\n    pum_line = GetIntValue( 'pum_getpos().row' ) + 1\n    if pos == 'botleft' and pum_line <= line:\n      line = 0\n    elif ( pos == 'topleft' and\n           pum_line >= line and\n           pum_line < ( line + len( buf_lines ) ) ):\n      line = 0\n\n  if line <= 0:\n    # Nowhere to put it so hide it\n    if state.popup_win_id:\n      # TODO/FIXME: Should we use popup_hide() instead ?\n      vim.eval( f\"popup_close( { state.popup_win_id } )\" )\n    return SignatureHelpState( None, SignatureHelpState.INACTIVE )\n\n  if int( screen_pos[ 'curscol' ] ) <= 1:\n    col = 1\n  else:\n    # -1 for padding,\n    # -1 for the trigger character inserted (the anchor is set _after_ the\n    # character is inserted, so we remove it).\n    # FIXME: multi-byte characters would be wrong. Need to set anchor before\n    # inserting the char ?\n    col = int( screen_pos[ 'curscol' ] ) - 2\n\n  # Vim stops shifting the popup to the left if we turn on soft-wrapping.\n  # Instead, we want to first shift the popup to the left and then\n  # and then turn on wrapping.\n  max_line_length = max( len( item[ 'text' ] ) for item in buf_lines )\n  vim_width = vimsupport.GetIntValue( '&columns' )\n  line_available = vim_width - max( col, 1 )\n  if max_line_length > line_available:\n    col = vim_width - max_line_length\n\n  if col <= 0:\n    col = 1\n\n  options = {\n    \"line\": line,\n    \"col\": col,\n    \"pos\": pos,\n    \"wrap\": 0,\n    # NOTE: We *dont'* use \"cursorline\" here - that actually uses PMenuSel,\n    # which is just too invasive for us (it's more selected item than actual\n    # cursorline. So instead, we manually set 'cursorline' in the popup window\n    # and enable syntax based on the current file syntax)\n    \"flip\": 1,\n    \"fixed\": 1,\n    \"padding\": [ 0, 1, 0, 1 ], # Pad 1 char in X axis to match completion menu\n    \"hidden\": int( state.state == SignatureHelpState.ACTIVE_SUPPRESSED )\n  }\n\n  if not state.popup_win_id:\n    state.popup_win_id = GetIntValue(\n      f'popup_create( { json.dumps( buf_lines ) }, '\n                    f'{ json.dumps( options ) } )' )\n  else:\n    vim.eval( f'popup_settext( { state.popup_win_id }, '\n                             f'{ json.dumps( buf_lines ) } )' )\n\n  # Should do nothing if already visible\n  vim.eval( f'popup_move( { state.popup_win_id }, { json.dumps( options ) } )' )\n  if state.state == SignatureHelpState.ACTIVE:\n    vim.eval( f'popup_show( { state.popup_win_id } )' )\n\n  if vim.vars.get( 'ycm_signature_help_disable_syntax', False ):\n    syntax = ''\n  else:\n    syntax = utils.ToUnicode( vim.current.buffer.options[ 'syntax' ] )\n\n  active_signature = int( signature_info.get( 'activeSignature', 0 ) )\n  vim.eval( f\"win_execute( { state.popup_win_id }, \"\n            f\"'set syntax={ syntax } cursorline wrap | \"\n            f\"call cursor( [ { active_signature + 1 }, 1 ] )' )\" )\n\n  return state\n"
  },
  {
    "path": "python/ycm/syntax_parse.py",
    "content": "# Copyright (C) 2013  Google Inc.\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport re\nfrom ycm import vimsupport\n\nSYNTAX_GROUP_REGEX = re.compile(\n  r\"\"\"^\n      (?P<group_name>\\w+)\n      \\s+\n      xxx\n      \\s+\n      (?P<content>.+?)\n      $\"\"\",\n  re.VERBOSE )\n\nKEYWORD_REGEX = re.compile( r'^(\\w+),?$' )\n\nSYNTAX_ARGUMENT_REGEX = re.compile(\n  r\"^\\w+=.*$\" )\n\nSYNTAX_REGION_ARGUMENT_REGEX = re.compile(\n  r\"^(?:matchgroup|start)=.*$\" )\n\n# See \":h syn-nextgroup\".\nSYNTAX_NEXTGROUP_ARGUMENTS = {\n  'skipwhite',\n  'skipnl',\n  'skipempty'\n}\n\n# These are the parent groups from which we want to extract keywords.\nROOT_GROUPS = {\n  'Boolean',\n  'Identifier',\n  'Statement',\n  'PreProc',\n  'Type'\n}\n\n\nclass SyntaxGroup:\n  def __init__( self, name, lines = None ):\n    self.name     = name\n    self.lines    = lines if lines else []\n    self.children = []\n\n\ndef SyntaxKeywordsForCurrentBuffer():\n  syntax_output = vimsupport.CaptureVimCommand( 'syntax list' )\n  return _KeywordsFromSyntaxListOutput( syntax_output )\n\n\ndef _KeywordsFromSyntaxListOutput( syntax_output ):\n  group_name_to_group = _SyntaxGroupsFromOutput( syntax_output )\n  _ConnectGroupChildren( group_name_to_group )\n\n  groups_with_keywords = []\n  for root_group in ROOT_GROUPS:\n    groups_with_keywords.extend(\n      _GetAllDescendentats( group_name_to_group[ root_group ] ) )\n\n  keywords = []\n  for group in groups_with_keywords:\n    keywords.extend( _ExtractKeywordsFromGroup( group ) )\n  return set( keywords )\n\n\ndef _SyntaxGroupsFromOutput( syntax_output ):\n  group_name_to_group = _CreateInitialGroupMap()\n  lines               = syntax_output.split( '\\n' )\n  looking_for_group   = True\n\n  current_group = None\n  for line in lines:\n    if not line:\n      continue\n\n    match = SYNTAX_GROUP_REGEX.search( line )\n    if match:\n      if looking_for_group:\n        looking_for_group = False\n      else:\n        group_name_to_group[ current_group.name ] = current_group\n\n      current_group = SyntaxGroup( match.group( 'group_name' ),\n                                   [ match.group( 'content' ).strip() ] )\n    else:\n      if looking_for_group:\n        continue\n\n      if line[ 0 ] == ' ' or line[ 0 ] == '\\t':\n        current_group.lines.append( line.strip() )\n\n  if current_group:\n    group_name_to_group[ current_group.name ] = current_group\n  return group_name_to_group\n\n\ndef _CreateInitialGroupMap():\n  def AddToGroupMap( name, parent ):\n    new_group = SyntaxGroup( name )\n    group_name_to_group[ name ] = new_group\n    parent.children.append( new_group )\n\n  identifier_group = SyntaxGroup( 'Identifier' )\n  statement_group  = SyntaxGroup( 'Statement' )\n  type_group       = SyntaxGroup( 'Type' )\n  preproc_group    = SyntaxGroup( 'PreProc' )\n\n  # See \":h group-name\" for details on how the initial group hierarchy is built.\n  group_name_to_group = {\n    'Boolean': SyntaxGroup( 'Boolean' ),\n    'Identifier': identifier_group,\n    'Statement': statement_group,\n    'PreProc': preproc_group,\n    'Type': type_group\n  }\n\n  AddToGroupMap( 'Function', identifier_group )\n\n  AddToGroupMap( 'Conditional', statement_group )\n  AddToGroupMap( 'Repeat'     , statement_group )\n  AddToGroupMap( 'Label'      , statement_group )\n  AddToGroupMap( 'Operator'   , statement_group )\n  AddToGroupMap( 'Keyword'    , statement_group )\n  AddToGroupMap( 'Exception'  , statement_group )\n\n  AddToGroupMap( 'StorageClass', type_group )\n  AddToGroupMap( 'Structure'   , type_group )\n  AddToGroupMap( 'Typedef'     , type_group )\n\n  AddToGroupMap( 'Include'  , preproc_group )\n  AddToGroupMap( 'Define'   , preproc_group )\n  AddToGroupMap( 'Macro'    , preproc_group )\n  AddToGroupMap( 'PreCondit', preproc_group )\n\n  return group_name_to_group\n\n\ndef _ConnectGroupChildren( group_name_to_group ):\n  def GetParentNames( group ):\n    links_to     = 'links to '\n    parent_names = []\n    for line in group.lines:\n      if line.startswith( links_to ):\n        parent_names.append( line[ len( links_to ): ] )\n    return parent_names\n\n  for group in group_name_to_group.values():\n    parent_names = GetParentNames( group )\n\n    for parent_name in parent_names:\n      try:\n        parent_group = group_name_to_group[ parent_name ]\n      except KeyError:\n        continue\n      parent_group.children.append( group )\n\n\ndef _GetAllDescendentats( root_group ):\n  descendants = []\n  for child in root_group.children:\n    descendants.append( child )\n    descendants.extend( _GetAllDescendentats( child ) )\n  return descendants\n\n\ndef _ExtractKeywordsFromLine( line ):\n  if line.startswith( 'links to ' ):\n    return []\n\n  # Ignore \"syntax match\" lines (see \":h syn-match\").\n  if line.startswith( 'match ' ):\n    return []\n\n  words = line.split()\n  if not words:\n    return []\n\n  # Ignore \"syntax region\" lines (see \":h syn-region\"). They always start\n  # with matchgroup= or start= in the syntax list.\n  if SYNTAX_REGION_ARGUMENT_REGEX.match( words[ 0 ] ):\n    return []\n\n  # Ignore \"nextgroup=\" argument in first position and the arguments\n  # \"skipwhite\", \"skipnl\", and \"skipempty\" that immediately come after.\n  nextgroup_at_start = False\n  if words[ 0 ].startswith( 'nextgroup=' ):\n    nextgroup_at_start = True\n    words = words[ 1: ]\n\n  # Ignore \"contained\" argument in first position.\n  if words[ 0 ] == 'contained':\n    words = words[ 1: ]\n\n  keywords = []\n  for word in words:\n    if nextgroup_at_start and word in SYNTAX_NEXTGROUP_ARGUMENTS:\n      continue\n\n    nextgroup_at_start = False\n\n    keyword_matched = KEYWORD_REGEX.match( word )\n    if keyword_matched:\n      keywords.append( keyword_matched.group( 1 ) )\n  return keywords\n\n\ndef _ExtractKeywordsFromGroup( group ):\n  keywords = []\n  for line in group.lines:\n    keywords.extend( _ExtractKeywordsFromLine( line ) )\n  return keywords\n"
  },
  {
    "path": "python/ycm/tests/__init__.py",
    "content": "# Copyright (C) 2016-2020 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport os\nfrom ycm.tests.test_utils import MockVimModule\nMockVimModule()\n\nimport contextlib\nimport functools\nimport time\nfrom urllib.error import HTTPError, URLError\n\nfrom ycm.client.base_request import BaseRequest\nfrom ycm.tests import test_utils\nfrom ycm.youcompleteme import YouCompleteMe\nfrom ycmd.utils import CloseStandardStreams, WaitUntilProcessIsTerminated\n\n\ndef PathToTestFile( *args ):\n  dir_of_current_script = os.path.dirname( os.path.abspath( __file__ ) )\n  return os.path.join( dir_of_current_script, 'testdata', *args )\n\n\n# The default options which are required for a working YouCompleteMe object.\nDEFAULT_CLIENT_OPTIONS = {\n  # YCM options\n  'g:ycm_log_level': 'info',\n  'g:ycm_keep_logfiles': 0,\n  'g:ycm_extra_conf_vim_data': [],\n  'g:ycm_server_python_interpreter': '',\n  'g:ycm_show_diagnostics_ui': 1,\n  'g:ycm_enable_diagnostic_signs': 1,\n  'g:ycm_enable_diagnostic_highlighting': 0,\n  'g:ycm_echo_current_diagnostic': 1,\n  'g:ycm_filter_diagnostics': {},\n  'g:ycm_always_populate_location_list': 0,\n  'g:ycm_open_loclist_on_ycm_diags': 1,\n  'g:ycm_collect_identifiers_from_tags_files': 0,\n  'g:ycm_seed_identifiers_with_syntax': 0,\n  'g:ycm_goto_buffer_command': 'same-buffer',\n  'g:ycm_update_diagnostics_in_insert_mode': 1,\n  # ycmd options\n  'g:ycm_auto_trigger': 1,\n  'g:ycm_min_num_of_chars_for_completion': 2,\n  'g:ycm_semantic_triggers': {},\n  'g:ycm_filetype_specific_completion_to_disable': { 'gitcommit': 1 },\n  'g:ycm_max_num_candidates': 50,\n  'g:ycm_max_diagnostics_to_display': 30,\n  'g:ycm_disable_signature_help': 0,\n}\n\n\n@contextlib.contextmanager\ndef UserOptions( options ):\n  old_vim_options = test_utils.VIM_OPTIONS.copy()\n  test_utils.VIM_OPTIONS.update( DEFAULT_CLIENT_OPTIONS )\n  test_utils.VIM_OPTIONS.update( options )\n  try:\n    yield\n  finally:\n    test_utils.VIM_OPTIONS = old_vim_options\n\n\ndef _IsReady():\n  return BaseRequest().GetDataFromHandler( 'ready' )\n\n\ndef WaitUntilReady( timeout = 5 ):\n  expiration = time.time() + timeout\n  while True:\n    try:\n      if time.time() > expiration:\n        raise RuntimeError( 'Waited for the server to be ready '\n                            f'for { timeout } seconds, aborting.' )\n      if _IsReady():\n        return\n    except ( URLError, HTTPError ):\n      pass\n    finally:\n      time.sleep( 0.1 )\n\n\ndef StopServer( ycm ):\n  try:\n    ycm.OnVimLeave()\n    WaitUntilProcessIsTerminated( ycm._server_popen )\n    CloseStandardStreams( ycm._server_popen )\n  except Exception:\n    pass\n\n\ndef YouCompleteMeInstance( custom_options = {} ):\n  \"\"\"Defines a decorator function for tests that passes a unique YouCompleteMe\n  instance as a parameter. This instance is initialized with the default options\n  `DEFAULT_CLIENT_OPTIONS`. Use the optional parameter |custom_options| to give\n  additional options and/or override the already existing ones.\n\n  Example usage:\n\n    from ycm.tests import YouCompleteMeInstance\n\n    @YouCompleteMeInstance( { 'log_level': 'debug',\n                              'keep_logfiles': 1 } )\n    def Debug_test( ycm ):\n        ...\n  \"\"\"\n  def Decorator( test ):\n    @functools.wraps( test )\n    def Wrapper( test_case_instance, *args, **kwargs ):\n      with UserOptions( custom_options ):\n        ycm = YouCompleteMe()\n        WaitUntilReady()\n        ycm.CheckIfServerIsReady()\n        try:\n          test_utils.VIM_PROPS_FOR_BUFFER.clear()\n          return test( test_case_instance, ycm, *args, **kwargs )\n        finally:\n          StopServer( ycm )\n    return Wrapper\n  return Decorator\n\n\n@contextlib.contextmanager\ndef youcompleteme_instance( custom_options = {} ):\n  \"\"\"Defines a context manager to be used in case a shared YCM state\n  between subtests is to be avoided, as could be the case with completion\n  caching.\"\"\"\n  with UserOptions( custom_options ):\n    ycm = YouCompleteMe()\n    WaitUntilReady()\n    try:\n      test_utils.VIM_PROPS_FOR_BUFFER.clear()\n      yield ycm\n    finally:\n      StopServer( ycm )\n"
  },
  {
    "path": "python/ycm/tests/base_test.py",
    "content": "# Copyright (C) 2013 Google Inc.\n#               2020 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport contextlib\nfrom hamcrest import assert_that, equal_to\nfrom unittest import TestCase\nfrom unittest.mock import patch\n\nfrom ycm.tests.test_utils import MockVimModule\nvim_mock = MockVimModule()\nfrom ycm import base\n\n\n@contextlib.contextmanager\ndef MockCurrentFiletypes( filetypes = [ '' ] ):\n  with patch( 'ycm.vimsupport.CurrentFiletypes', return_value = filetypes ):\n    yield\n\n\n@contextlib.contextmanager\ndef MockCurrentColumnAndLineContents( column, line_contents ):\n  with patch( 'ycm.vimsupport.CurrentColumn', return_value = column ):\n    with patch( 'ycm.vimsupport.CurrentLineContents',\n                return_value = line_contents ):\n      yield\n\n\n@contextlib.contextmanager\ndef MockTextAfterCursor( text ):\n  with patch( 'ycm.vimsupport.TextAfterCursor', return_value = text ):\n    yield\n\n\nclass BaseTest( TestCase ):\n  def test_AdjustCandidateInsertionText_Basic( self ):\n    with MockTextAfterCursor( 'bar' ):\n      assert_that( [ { 'word': 'foo',    'abbr': 'foobar' } ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                               { 'word': 'foobar', 'abbr': '' } ] ) ) )\n\n\n  def test_AdjustCandidateInsertionText_ParenInTextAfterCursor( self ):\n    with MockTextAfterCursor( 'bar(zoo' ):\n      assert_that( [ { 'word': 'foo',    'abbr': 'foobar' } ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                               { 'word': 'foobar', 'abbr': '' } ] ) ) )\n\n\n  def test_AdjustCandidateInsertionText_PlusInTextAfterCursor( self ):\n    with MockTextAfterCursor( 'bar+zoo' ):\n      assert_that( [ { 'word': 'foo',    'abbr': 'foobar' } ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                               { 'word': 'foobar', 'abbr': '' } ] ) ) )\n\n\n  def test_AdjustCandidateInsertionText_WhitespaceInTextAfterCursor( self ):\n    with MockTextAfterCursor( 'bar zoo' ):\n      assert_that( [ { 'word': 'foo',    'abbr': 'foobar' } ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                               { 'word': 'foobar', 'abbr': '' } ] ) ) )\n\n\n  def test_AdjustCandidateInsertionText_MoreThanWordMatchingAfterCursor( self ):\n    with MockTextAfterCursor( 'bar.h' ):\n      assert_that( [ { 'word': 'foo', 'abbr': 'foobar.h' } ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                               { 'word': 'foobar.h', 'abbr': '' } ] ) ) )\n\n    with MockTextAfterCursor( 'bar(zoo' ):\n      assert_that( [ { 'word': 'foo', 'abbr': 'foobar(zoo' } ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                               { 'word': 'foobar(zoo', 'abbr': '' } ] ) ) )\n\n\n  def test_AdjustCandidateInsertionText_NotSuffix( self ):\n    with MockTextAfterCursor( 'bar' ):\n      assert_that( [ { 'word': 'foofoo', 'abbr': 'foofoo' } ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                     { 'word': 'foofoo', 'abbr': '' } ] ) ) )\n\n\n  def test_AdjustCandidateInsertionText_NothingAfterCursor( self ):\n    with MockTextAfterCursor( '' ):\n      assert_that( [ { 'word': 'foofoo', 'abbr': '' },\n                     { 'word': 'zobar',  'abbr': '' } ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                     { 'word': 'foofoo', 'abbr': '' },\n                     { 'word': 'zobar',  'abbr': '' } ] ) ) )\n\n\n  def test_AdjustCandidateInsertionText_MultipleStrings( self ):\n    with MockTextAfterCursor( 'bar' ):\n      assert_that( [ { 'word': 'foo',    'abbr': 'foobar' },\n                     { 'word': 'zo',     'abbr': 'zobar' },\n                     { 'word': 'q',      'abbr': 'qbar' },\n                     { 'word': '',       'abbr': 'bar' }, ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                     { 'word': 'foobar', 'abbr': '' },\n                     { 'word': 'zobar',  'abbr': '' },\n                     { 'word': 'qbar',   'abbr': '' },\n                     { 'word': 'bar',    'abbr': '' } ] ) ) )\n\n\n  def test_AdjustCandidateInsertionText_DontTouchAbbr( self ):\n    with MockTextAfterCursor( 'bar' ):\n      assert_that( [ { 'word': 'foo',    'abbr': '1234' } ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                     { 'word': 'foobar', 'abbr': '1234' } ] ) ) )\n\n\n  def test_AdjustCandidateInsertionText_NoAbbr( self ):\n    with MockTextAfterCursor( 'bar' ):\n      assert_that( [ { 'word': 'foo', 'abbr': 'foobar' } ],\n                   equal_to( base.AdjustCandidateInsertionText( [\n                     { 'word': 'foobar' } ] ) ) )\n\n\n  def test_OverlapLength_Basic( self ):\n    assert_that( 3, equal_to( base.OverlapLength( 'foo bar', 'bar zoo' ) ) )\n    assert_that( 3, equal_to( base.OverlapLength( 'foobar', 'barzoo' ) ) )\n\n\n  def test_OverlapLength_BasicWithUnicode( self ):\n    assert_that( 3, equal_to( base.OverlapLength( 'bar fäö', 'fäö bar' ) ) )\n    assert_that( 3, equal_to( base.OverlapLength( 'zoofäö', 'fäözoo' ) ) )\n\n\n  def test_OverlapLength_OneCharOverlap( self ):\n    assert_that( 1, equal_to( base.OverlapLength( 'foo b', 'b zoo' ) ) )\n\n\n  def test_OverlapLength_SameStrings( self ):\n    assert_that( 6, equal_to( base.OverlapLength( 'foobar', 'foobar' ) ) )\n\n\n  def test_OverlapLength_Substring( self ):\n    assert_that( 6, equal_to( base.OverlapLength( 'foobar', 'foobarzoo' ) ) )\n    assert_that( 6, equal_to( base.OverlapLength( 'zoofoobar', 'foobar' ) ) )\n\n\n  def test_OverlapLength_LongestOverlap( self ):\n    assert_that( 7, equal_to( base.OverlapLength( 'bar foo foo',\n                                                  'foo foo bar' ) ) )\n\n\n  def test_OverlapLength_EmptyInput( self ):\n    assert_that( 0, equal_to( base.OverlapLength( '', 'goobar' ) ) )\n    assert_that( 0, equal_to( base.OverlapLength( 'foobar', '' ) ) )\n    assert_that( 0, equal_to( base.OverlapLength( '', '' ) ) )\n\n\n  def test_OverlapLength_NoOverlap( self ):\n    assert_that( 0, equal_to( base.OverlapLength( 'foobar', 'goobar' ) ) )\n    assert_that( 0, equal_to( base.OverlapLength( 'foobar', '(^($@#$#@' ) ) )\n    assert_that( 0, equal_to( base.OverlapLength( 'foo bar zoo',\n                                                  'foo zoo bar' ) ) )\n\n\n  def test_LastEnteredCharIsIdentifierChar_Basic( self ):\n    with MockCurrentFiletypes():\n      with MockCurrentColumnAndLineContents( 3, 'abc' ):\n        assert_that( base.LastEnteredCharIsIdentifierChar() )\n\n      with MockCurrentColumnAndLineContents( 2, 'abc' ):\n        assert_that( base.LastEnteredCharIsIdentifierChar() )\n\n      with MockCurrentColumnAndLineContents( 1, 'abc' ):\n        assert_that( base.LastEnteredCharIsIdentifierChar() )\n\n\n  def test_LastEnteredCharIsIdentifierChar_FiletypeHtml( self ):\n    with MockCurrentFiletypes( [ 'html' ] ):\n      with MockCurrentColumnAndLineContents( 3, 'ab-' ):\n        assert_that( base.LastEnteredCharIsIdentifierChar() )\n\n\n  def test_LastEnteredCharIsIdentifierChar_ColumnIsZero( self ):\n    with MockCurrentColumnAndLineContents( 0, 'abc' ):\n      assert_that( not base.LastEnteredCharIsIdentifierChar() )\n\n\n  def test_LastEnteredCharIsIdentifierChar_LineEmpty( self ):\n    with MockCurrentFiletypes():\n      with MockCurrentColumnAndLineContents( 3, '' ):\n        assert_that( not base.LastEnteredCharIsIdentifierChar() )\n\n      with MockCurrentColumnAndLineContents( 0, '' ):\n        assert_that( not base.LastEnteredCharIsIdentifierChar() )\n\n\n  def test_LastEnteredCharIsIdentifierChar_NotIdentChar( self ):\n    with MockCurrentFiletypes():\n      with MockCurrentColumnAndLineContents( 3, 'ab;' ):\n        assert_that( not base.LastEnteredCharIsIdentifierChar() )\n\n      with MockCurrentColumnAndLineContents( 1, ';' ):\n        assert_that( not base.LastEnteredCharIsIdentifierChar() )\n\n      with MockCurrentColumnAndLineContents( 3, 'ab-' ):\n        assert_that( not base.LastEnteredCharIsIdentifierChar() )\n\n\n  def test_LastEnteredCharIsIdentifierChar_Unicode( self ):\n    with MockCurrentFiletypes():\n      # CurrentColumn returns a byte offset and character ø is 2 bytes length.\n      with MockCurrentColumnAndLineContents( 5, 'føo(' ):\n        assert_that( not base.LastEnteredCharIsIdentifierChar() )\n\n      with MockCurrentColumnAndLineContents( 4, 'føo(' ):\n        assert_that( base.LastEnteredCharIsIdentifierChar() )\n\n      with MockCurrentColumnAndLineContents( 3, 'føo(' ):\n        assert_that( base.LastEnteredCharIsIdentifierChar() )\n\n      with MockCurrentColumnAndLineContents( 1, 'føo(' ):\n        assert_that( base.LastEnteredCharIsIdentifierChar() )\n\n\n  def test_CurrentIdentifierFinished_Basic( self ):\n    with MockCurrentFiletypes():\n      with MockCurrentColumnAndLineContents( 3, 'ab;' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 2, 'ab;' ):\n        assert_that( not base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 1, 'ab;' ):\n        assert_that( not base.CurrentIdentifierFinished() )\n\n\n  def test_CurrentIdentifierFinished_NothingBeforeColumn( self ):\n    with MockCurrentColumnAndLineContents( 0, 'ab;' ):\n      assert_that( base.CurrentIdentifierFinished() )\n\n    with MockCurrentColumnAndLineContents( 0, '' ):\n      assert_that( base.CurrentIdentifierFinished() )\n\n\n  def test_CurrentIdentifierFinished_InvalidColumn( self ):\n    with MockCurrentFiletypes():\n      with MockCurrentColumnAndLineContents( 5, '' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 5, 'abc' ):\n        assert_that( not base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 4, 'ab;' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n\n  def test_CurrentIdentifierFinished_InMiddleOfLine( self ):\n    with MockCurrentFiletypes():\n      with MockCurrentColumnAndLineContents( 4, 'bar.zoo' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 4, 'bar(zoo' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 4, 'bar-zoo' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n\n  def test_CurrentIdentifierFinished_Html( self ):\n    with MockCurrentFiletypes( [ 'html' ] ):\n      with MockCurrentColumnAndLineContents( 4, 'bar-zoo' ):\n        assert_that( not base.CurrentIdentifierFinished() )\n\n\n  def test_CurrentIdentifierFinished_WhitespaceOnly( self ):\n    with MockCurrentFiletypes():\n      with MockCurrentColumnAndLineContents( 1, '\\n' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 3, '\\n    ' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 3, '\\t\\t\\t\\t' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n\n  def test_CurrentIdentifierFinished_Unicode( self ):\n    with MockCurrentFiletypes():\n      # CurrentColumn returns a byte offset and character ø is 2 bytes length.\n      with MockCurrentColumnAndLineContents( 6, 'føo ' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 5, 'føo ' ):\n        assert_that( base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 4, 'føo ' ):\n        assert_that( not base.CurrentIdentifierFinished() )\n\n      with MockCurrentColumnAndLineContents( 3, 'føo ' ):\n        assert_that( not base.CurrentIdentifierFinished() )\n"
  },
  {
    "path": "python/ycm/tests/client/__init__.py",
    "content": ""
  },
  {
    "path": "python/ycm/tests/client/base_request_test.py",
    "content": "# Copyright (C) 2017-2018 YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.tests.test_utils import MockVimBuffers, MockVimModule, VimBuffer\nMockVimModule()\n\nfrom hamcrest import assert_that, has_entry\nfrom unittest import TestCase\nfrom unittest.mock import patch\nfrom ycm.client.base_request import BuildRequestData\n\n\nclass BaseRequestTest( TestCase ):\n  @patch( 'ycm.client.base_request.GetCurrentDirectory',\n          return_value = '/some/dir' )\n  def test_BuildRequestData_AddWorkingDir( self, *args ):\n    current_buffer = VimBuffer( 'foo' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      assert_that( BuildRequestData(), has_entry( 'working_dir', '/some/dir' ) )\n\n\n  @patch( 'ycm.client.base_request.GetCurrentDirectory',\n          return_value = '/some/dir' )\n  def test_BuildRequestData_AddWorkingDirWithFileName( self, *args ):\n    current_buffer = VimBuffer( 'foo' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      assert_that( BuildRequestData( current_buffer.number ),\n                   has_entry( 'working_dir', '/some/dir' ) )\n"
  },
  {
    "path": "python/ycm/tests/client/command_request_test.py",
    "content": "# Copyright (C) 2016 YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.tests.test_utils import ExtendedMock, MockVimModule\nMockVimModule()\n\nimport json\nfrom hamcrest import assert_that\nfrom unittest import TestCase\nfrom unittest.mock import patch, call\nfrom ycm.client.command_request import CommandRequest\n\n\ndef GoToTest( command, response ):\n  with patch( 'ycm.vimsupport.JumpToLocation' ) as jump_to_location:\n    request = CommandRequest( [ command ] )\n    request._response = response\n    request.RunPostCommandActionsIfNeeded( 'rightbelow' )\n    jump_to_location.assert_called_with(\n        response[ 'filepath' ],\n        response[ 'line_num' ],\n        response[ 'column_num' ],\n        'rightbelow',\n        'same-buffer' )\n\n\ndef GoToListTest( command, response ):\n  # Note: the detail of these called are tested by\n  # GoToResponse_QuickFix_test, so here we just check that the right call is\n  # made\n  with patch( 'ycm.vimsupport.SetQuickFixList' ) as set_qf_list:\n    with patch( 'ycm.vimsupport.OpenQuickFixList' ) as open_qf_list:\n      request = CommandRequest( [ command ] )\n      request._response = response\n      request.RunPostCommandActionsIfNeeded( 'tab' )\n      assert_that( set_qf_list.called )\n      assert_that( open_qf_list.called )\n\n\nBASIC_GOTO = {\n  'filepath': 'test',\n  'line_num': 10,\n  'column_num': 100,\n}\n\n\nBASIC_FIXIT = {\n  'fixits': [ {\n    'resolve': False,\n    'chunks': [ {\n      'dummy chunk contents': True\n    } ]\n  } ]\n}\nBASIC_FIXIT_CHUNKS = BASIC_FIXIT[ 'fixits' ][ 0 ][ 'chunks' ]\n\nMULTI_FIXIT = {\n  'fixits': [ {\n    'text': 'first',\n    'resolve': False,\n    'chunks': [ {\n      'dummy chunk contents': True\n    } ]\n  }, {\n    'text': 'second',\n    'resolve': False,\n    'chunks': [ {\n      'dummy chunk contents': False\n    } ]\n  } ]\n}\nMULTI_FIXIT_FIRST_CHUNKS = MULTI_FIXIT[ 'fixits' ][ 0 ][ 'chunks' ]\nMULTI_FIXIT_SECOND_CHUNKS = MULTI_FIXIT[ 'fixits' ][ 1 ][ 'chunks' ]\n\n\nclass GoToResponse_QuickFixTest( TestCase ):\n  \"\"\"This class tests the generation of QuickFix lists for GoTo responses which\n  return multiple locations, such as the Python completer and JavaScript\n  completer. It mostly proves that we use 1-based indexing for the column\n  number.\"\"\"\n\n  def setUp( self ):\n    self._request = CommandRequest( [ 'GoToTest' ] )\n\n\n  def tearDown( self ):\n    self._request = None\n\n\n  def test_GoTo_EmptyList( self ):\n    self._CheckGoToList( [], [] )\n\n\n  def test_GoTo_SingleItem_List( self ):\n    self._CheckGoToList( [ {\n      'filepath':     'dummy_file',\n      'line_num':     10,\n      'column_num':   1,\n      'description': 'this is some text',\n    } ], [ {\n      'filename':    'dummy_file',\n      'text':        'this is some text',\n      'lnum':        10,\n      'col':         1\n    } ] )\n\n\n  def test_GoTo_MultiItem_List( self ):\n    self._CheckGoToList( [ {\n      'filepath':     'dummy_file',\n      'line_num':     10,\n      'column_num':   1,\n      'description': 'this is some other text',\n    }, {\n      'filepath':     'dummy_file2',\n      'line_num':     1,\n      'column_num':   21,\n      'description': 'this is some text',\n    } ], [ {\n      'filename':    'dummy_file',\n      'text':        'this is some other text',\n      'lnum':        10,\n      'col':         1\n    }, {\n      'filename':    'dummy_file2',\n      'text':        'this is some text',\n      'lnum':        1,\n      'col':         21\n    } ] )\n\n\n  @patch( 'ycm.vimsupport.VariableExists', return_value = True )\n  @patch( 'ycm.vimsupport.SetFittingHeightForCurrentWindow' )\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  @patch( 'vim.eval', new_callable = ExtendedMock )\n  def _CheckGoToList( self,\n                      completer_response,\n                      expected_qf_list,\n                      vim_eval,\n                      vim_command,\n                      set_fitting_height,\n                      variable_exists ):\n    self._request._response = completer_response\n\n    self._request.RunPostCommandActionsIfNeeded( 'aboveleft' )\n\n    vim_eval.assert_has_exact_calls( [\n      call( f'setqflist( { json.dumps( expected_qf_list ) } )' )\n    ] )\n    vim_command.assert_has_exact_calls( [\n      call( 'botright copen' ),\n      call( 'augroup ycmquickfix' ),\n      call( 'autocmd! * <buffer>' ),\n      call( 'autocmd WinLeave <buffer> '\n            'if bufnr( \"%\" ) == expand( \"<abuf>\" ) | q | endif '\n            '| autocmd! ycmquickfix' ),\n      call( 'augroup END' ),\n      call( 'doautocmd User YcmQuickFixOpened' )\n    ] )\n    set_fitting_height.assert_called_once_with()\n\n\nclass Response_Detection_Test( TestCase ):\n\n  def test_BasicResponse( self ):\n    def _BasicResponseTest( command, response ):\n      with patch( 'vim.command' ) as vim_command:\n        request = CommandRequest( [ command ] )\n        request._response = response\n        request.RunPostCommandActionsIfNeeded( 'belowright' )\n        vim_command.assert_called_with( f\"echo '{ response }'\" )\n\n    for command, response in [\n        [ 'AnythingYouLike',        True ],\n        [ 'GoToEvenWorks',          10 ],\n        [ 'FixItWorks',             'String!' ],\n        [ 'and8434fd andy garbag!', 10.3 ],\n      ]:\n      with self.subTest( command = command, response = response ):\n        _BasicResponseTest( command, response )\n\n  def test_FixIt_Response_Empty( self ):\n    # Ensures we recognise and handle fixit responses which indicate that there\n    # are no fixits available\n    def EmptyFixItTest( command ):\n      with patch( 'ycm.vimsupport.ReplaceChunks' ) as replace_chunks:\n        with patch( 'ycm.vimsupport.PostVimMessage' ) as post_vim_message:\n          request = CommandRequest( [ command ] )\n          request._response = {\n            'fixits': []\n          }\n          request.RunPostCommandActionsIfNeeded( 'botright' )\n\n          post_vim_message.assert_called_with(\n            'No fixits found for current line', warning = False )\n          replace_chunks.assert_not_called()\n\n    for command in [ 'FixIt', 'Refactor', 'GoToHell', 'any_old_garbade!!!21' ]:\n      with self.subTest( command = command ):\n        EmptyFixItTest( command )\n\n\n\n  def test_FixIt_Response( self ):\n    # Ensures we recognise and handle fixit responses with some dummy chunk data\n    def FixItTest( command, response, chunks, selection, silent ):\n      with patch( 'ycm.vimsupport.ReplaceChunks' ) as replace_chunks:\n        with patch( 'ycm.vimsupport.PostVimMessage' ) as post_vim_message:\n          with patch( 'ycm.vimsupport.SelectFromList',\n                      return_value = selection ):\n            request = CommandRequest( [ command ] )\n            request._response = response\n            request.RunPostCommandActionsIfNeeded( 'leftabove' )\n\n            replace_chunks.assert_called_with( chunks, silent = silent )\n            post_vim_message.assert_not_called()\n\n\n    for command, response, chunks, selection, silent in [\n      [ 'AnythingYouLike',\n        BASIC_FIXIT,  BASIC_FIXIT_CHUNKS,        0, False ],\n      [ 'GoToEvenWorks',\n        BASIC_FIXIT,  BASIC_FIXIT_CHUNKS,        0, False ],\n      [ 'FixItWorks',\n        BASIC_FIXIT,  BASIC_FIXIT_CHUNKS,        0, False ],\n      [ 'and8434fd andy garbag!',\n        BASIC_FIXIT,  BASIC_FIXIT_CHUNKS,        0, False ],\n      [ 'Format',\n        BASIC_FIXIT,  BASIC_FIXIT_CHUNKS,        0, True ],\n      [ 'select from multiple 1',\n        MULTI_FIXIT,  MULTI_FIXIT_FIRST_CHUNKS,  0, False ],\n      [ 'select from multiple 2',\n        MULTI_FIXIT,  MULTI_FIXIT_SECOND_CHUNKS, 1, False ],\n    ]:\n      with self.subTest( command = command,\n                                   response = response,\n                                   chunks = chunks,\n                                   selection = selection,\n                                   silent = silent ):\n        FixItTest( command, response, chunks, selection, silent )\n\n\n  def test_Message_Response( self ):\n    # Ensures we correctly recognise and handle responses with a message to show\n    # to the user\n\n    def MessageTest( command, message ):\n      with patch( 'ycm.vimsupport.PostVimMessage' ) as post_vim_message:\n        request = CommandRequest( [ command ] )\n        request._response = { 'message': message }\n        request.RunPostCommandActionsIfNeeded( 'rightbelow' )\n        post_vim_message.assert_called_with( message, warning = False )\n\n    for command, message in [\n      [ '___________', 'This is a message' ],\n      [ '',            'this is also a message' ],\n      [ 'GetType',     'std::string' ],\n    ]:\n      with self.subTest( command = command, message = message ):\n        MessageTest( command, message )\n\n\n  def test_Detailed_Info( self ):\n    # Ensures we correctly detect and handle detailed_info responses which are\n    # used to display information in the preview window\n\n    def DetailedInfoTest( command, info ):\n      with patch( 'ycm.vimsupport.WriteToPreviewWindow' ) as write_to_preview:\n        request = CommandRequest( [ command ] )\n        request._response = { 'detailed_info': info }\n        request.RunPostCommandActionsIfNeeded( 'topleft' )\n        write_to_preview.assert_called_with( info, 'topleft' )\n\n    for command, info in [\n      [ '___________', 'This is a message' ],\n      [ '',            'this is also a message' ],\n      [ 'GetDoc',      'std::string\\netc\\netc' ],\n    ]:\n      with self.subTest( command = command, info = info ):\n        DetailedInfoTest( command, info )\n\n\n  def test_GoTo_Single( self ):\n    for test, command, response in [\n      [ GoToTest,     'AnythingYouLike', BASIC_GOTO ],\n      [ GoToTest,     'GoTo',            BASIC_GOTO ],\n      [ GoToTest,     'FindAThing',      BASIC_GOTO ],\n      [ GoToTest,     'FixItGoto',       BASIC_GOTO ],\n      [ GoToListTest, 'AnythingYouLike', [ BASIC_GOTO ] ],\n      [ GoToListTest, 'GoTo',            [] ],\n      [ GoToListTest, 'FixItGoto',       [ BASIC_GOTO, BASIC_GOTO ] ],\n    ]:\n      with self.subTest( test = test, command = command, response = response ):\n        test( command, response )\n"
  },
  {
    "path": "python/ycm/tests/client/completion_request_test.py",
    "content": "# Copyright (C) 2015-2019 YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport json\nfrom hamcrest import assert_that, equal_to\nfrom unittest import TestCase\nfrom ycm.tests import UserOptions\nfrom ycm.tests.test_utils import MockVimModule\nvim_mock = MockVimModule()\n\nfrom ycm.client import completion_request\n\n\nclass ConvertCompletionResponseToVimDatasTest( TestCase ):\n  \"\"\" This class tests the\n      completion_request.ConvertCompletionResponseToVimDatas method \"\"\"\n\n  def _Check( self, completion_data, expected_vim_data ):\n    vim_data = completion_request.ConvertCompletionDataToVimData(\n        completion_data )\n\n    try:\n      assert_that( vim_data, equal_to( expected_vim_data ) )\n    except Exception:\n      print( \"Expected:\\n\"\n               f\"'{ expected_vim_data }'\\n\"\n             \"when parsing:\\n'\"\n               f\"{ completion_data }'\\n\"\n             \"But found:\\n\"\n               f\"'{ vim_data }'\" )\n      raise\n\n\n  def test_AllFields( self ):\n    extra_data = {\n        'doc_string':    'DOC STRING',\n    }\n    self._Check( {\n      'insertion_text':  'INSERTION TEXT',\n      'menu_text':       'MENU TEXT',\n      'extra_menu_info': 'EXTRA MENU INFO',\n      'kind':            'K',\n      'detailed_info':   'DETAILED INFO',\n      'extra_data': extra_data,\n    }, {\n      'word'     : 'INSERTION TEXT',\n      'abbr'     : 'MENU TEXT',\n      'menu'     : 'EXTRA MENU INFO',\n      'kind'     : 'k',\n      'info'     : 'DETAILED INFO\\nDOC STRING',\n      'equal'    : 1,\n      'dup'      : 1,\n      'empty'    : 1,\n      'user_data': json.dumps( extra_data ),\n    } )\n\n\n  def test_OnlyInsertionTextField( self ):\n    self._Check( {\n      'insertion_text':  'INSERTION TEXT'\n    }, {\n      'word'     : 'INSERTION TEXT',\n      'abbr'     : '',\n      'menu'     : '',\n      'kind'     : '',\n      'info'     : '',\n      'equal'    : 1,\n      'dup'      : 1,\n      'empty'    : 1,\n      'user_data': '{}',\n    } )\n\n\n  def test_JustDetailedInfo( self ):\n    self._Check( {\n      'insertion_text':  'INSERTION TEXT',\n      'menu_text':       'MENU TEXT',\n      'extra_menu_info': 'EXTRA MENU INFO',\n      'kind':            'K',\n      'detailed_info':   'DETAILED INFO',\n    }, {\n      'word'     : 'INSERTION TEXT',\n      'abbr'     : 'MENU TEXT',\n      'menu'     : 'EXTRA MENU INFO',\n      'kind'     : 'k',\n      'info'     : 'DETAILED INFO',\n      'equal'    : 1,\n      'dup'      : 1,\n      'empty'    : 1,\n      'user_data': '{}',\n    } )\n\n\n  def test_JustDocString( self ):\n    extra_data = {\n      'doc_string':    'DOC STRING',\n    }\n    self._Check( {\n      'insertion_text':  'INSERTION TEXT',\n      'menu_text':       'MENU TEXT',\n      'extra_menu_info': 'EXTRA MENU INFO',\n      'kind':            'K',\n      'extra_data': extra_data,\n    }, {\n      'word'     : 'INSERTION TEXT',\n      'abbr'     : 'MENU TEXT',\n      'menu'     : 'EXTRA MENU INFO',\n      'kind'     : 'k',\n      'info'     : 'DOC STRING',\n      'equal'    : 1,\n      'dup'      : 1,\n      'empty'    : 1,\n      'user_data': json.dumps( extra_data ),\n    } )\n\n\n  def test_ExtraInfoNoDocString( self ):\n    self._Check( {\n      'insertion_text':  'INSERTION TEXT',\n      'menu_text':       'MENU TEXT',\n      'extra_menu_info': 'EXTRA MENU INFO',\n      'kind':            'K',\n      'extra_data': {\n      },\n    }, {\n      'word'     : 'INSERTION TEXT',\n      'abbr'     : 'MENU TEXT',\n      'menu'     : 'EXTRA MENU INFO',\n      'kind'     : 'k',\n      'info'     : '',\n      'equal'    : 1,\n      'dup'      : 1,\n      'empty'    : 1,\n      'user_data': '{}',\n    } )\n\n\n  def test_NullCharactersInExtraInfoAndDocString( self ):\n    extra_data = {\n      'doc_string': 'DOC\\x00STRING'\n    }\n    self._Check( {\n      'insertion_text':  'INSERTION TEXT',\n      'menu_text':       'MENU TEXT',\n      'extra_menu_info': 'EXTRA MENU INFO',\n      'kind':            'K',\n      'detailed_info':   'DETAILED\\x00INFO',\n      'extra_data': extra_data,\n    }, {\n      'word'     : 'INSERTION TEXT',\n      'abbr'     : 'MENU TEXT',\n      'menu'     : 'EXTRA MENU INFO',\n      'kind'     : 'k',\n      'info'     : 'DETAILEDINFO\\nDOCSTRING',\n      'equal'    : 1,\n      'dup'      : 1,\n      'empty'    : 1,\n      'user_data': json.dumps( extra_data ),\n    } )\n\n\n  def test_ExtraInfoNoDocStringWithDetailedInfo( self ):\n    self._Check( {\n      'insertion_text':  'INSERTION TEXT',\n      'menu_text':       'MENU TEXT',\n      'extra_menu_info': 'EXTRA MENU INFO',\n      'kind':            'K',\n      'detailed_info':   'DETAILED INFO',\n      'extra_data': {\n      },\n    }, {\n      'word'     : 'INSERTION TEXT',\n      'abbr'     : 'MENU TEXT',\n      'menu'     : 'EXTRA MENU INFO',\n      'kind'     : 'k',\n      'info'     : 'DETAILED INFO',\n      'equal'    : 1,\n      'dup'      : 1,\n      'empty'    : 1,\n      'user_data': '{}',\n    } )\n\n\n  def test_EmptyInsertionText( self ):\n    extra_data = {\n      'doc_string':    'DOC STRING',\n    }\n    self._Check( {\n      'insertion_text':  '',\n      'menu_text':       'MENU TEXT',\n      'extra_menu_info': 'EXTRA MENU INFO',\n      'kind':            'K',\n      'detailed_info':   'DETAILED INFO',\n      'extra_data': extra_data,\n    }, {\n      'word'     : '',\n      'abbr'     : 'MENU TEXT',\n      'menu'     : 'EXTRA MENU INFO',\n      'kind'     : 'k',\n      'info'     : 'DETAILED INFO\\nDOC STRING',\n      'equal'    : 1,\n      'dup'      : 1,\n      'empty'    : 1,\n      'user_data': json.dumps( extra_data ),\n    } )\n\n\n  def test_TruncateForPopup( self, *args ):\n    with UserOptions( { '&columns': 60, '&completeopt': b'popup,menuone' } ):\n      extra_data = {\n        'doc_string':    'DOC STRING',\n      }\n      self._Check( {\n        'insertion_text':  '',\n        'menu_text':       'MENU TEXT',\n        'extra_menu_info': 'ESPECIALLY LONG EXTRA MENU INFO LOREM IPSUM DOLOR',\n        'kind':            'K',\n        'detailed_info':   'DETAILED INFO',\n        'extra_data': extra_data,\n      }, {\n        'word'     : '',\n        'abbr'     : 'MENU TEXT',\n        'menu'     : 'ESPECIALLY LONG E...',\n        'kind'     : 'k',\n        'info'     : 'ESPECIALLY LONG EXTRA MENU INFO LOREM IPSUM DOLOR\\n\\n' +\n                     'DETAILED INFO\\nDOC STRING',\n        'equal'    : 1,\n        'dup'      : 1,\n        'empty'    : 1,\n        'user_data': json.dumps( extra_data ),\n      } )\n\n\n  def test_OnlyTruncateForPopupIfNecessary( self, *args ):\n    with UserOptions( { '&columns': 60, '&completeopt': b'popup,menuone' } ):\n      extra_data = {\n        'doc_string':    'DOC STRING',\n      }\n      self._Check( {\n        'insertion_text':  '',\n        'menu_text':       'MENU TEXT',\n        'extra_menu_info': 'EXTRA MENU INFO',\n        'kind':            'K',\n        'detailed_info':   'DETAILED INFO',\n        'extra_data': extra_data,\n      }, {\n        'word'     : '',\n        'abbr'     : 'MENU TEXT',\n        'menu'     : 'EXTRA MENU INFO',\n        'kind'     : 'k',\n        'info'     : 'DETAILED INFO\\nDOC STRING',\n        'equal'    : 1,\n        'dup'      : 1,\n        'empty'    : 1,\n        'user_data': json.dumps( extra_data ),\n      } )\n\n\n  def test_DontTruncateIfNotPopup( self, *args ):\n    with UserOptions( { '&columns': 60, '&completeopt': b'preview,menuone' } ):\n      extra_data = {\n        'doc_string':    'DOC STRING',\n      }\n      self._Check( {\n        'insertion_text':  '',\n        'menu_text':       'MENU TEXT',\n        'extra_menu_info': 'ESPECIALLY LONG EXTRA MENU INFO LOREM IPSUM DOLOR',\n        'kind':            'K',\n        'detailed_info':   'DETAILED INFO',\n        'extra_data': extra_data,\n      }, {\n        'word'     : '',\n        'abbr'     : 'MENU TEXT',\n        'menu'     : 'ESPECIALLY LONG EXTRA MENU INFO LOREM IPSUM DOLOR',\n        'kind'     : 'k',\n        'info'     : 'DETAILED INFO\\nDOC STRING',\n        'equal'    : 1,\n        'dup'      : 1,\n        'empty'    : 1,\n        'user_data': json.dumps( extra_data ),\n      } )\n\n\n  def test_TruncateForPopupWithoutDuplication( self, *args ):\n    with UserOptions( { '&columns': 60, '&completeopt': b'popup,menuone' } ):\n      extra_data = {\n        'doc_string':    'DOC STRING',\n      }\n      self._Check( {\n        'insertion_text':  '',\n        'menu_text':       'MENU TEXT',\n        'extra_menu_info': 'ESPECIALLY LONG METHOD SIGNATURE LOREM IPSUM',\n        'kind':            'K',\n        'detailed_info':   'ESPECIALLY LONG METHOD SIGNATURE LOREM IPSUM',\n        'extra_data': extra_data,\n      }, {\n        'word'     : '',\n        'abbr'     : 'MENU TEXT',\n        'menu'     : 'ESPECIALLY LONG M...',\n        'kind'     : 'k',\n        'info'     : 'ESPECIALLY LONG METHOD SIGNATURE LOREM IPSUM\\n' +\n                     'DOC STRING',\n        'equal'    : 1,\n        'dup'      : 1,\n        'empty'    : 1,\n        'user_data': json.dumps( extra_data ),\n      } )\n"
  },
  {
    "path": "python/ycm/tests/client/debug_info_request_test.py",
    "content": "# Copyright (C) 2017 YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom copy import deepcopy\nfrom hamcrest import assert_that, contains_string, equal_to\nfrom unittest import TestCase\n\nfrom ycm.client.debug_info_request import FormatDebugInfoResponse\n\n\nGENERIC_RESPONSE = {\n  'clang': {\n    'has_support': True,\n    'version': 'Clang version'\n  },\n  'completer': {\n    'items': [\n      {\n        'key': 'key',\n        'value': 'value'\n      }\n    ],\n    'name': 'Completer name',\n    'servers': [\n      {\n        'address': '127.0.0.1',\n        'executable': '/path/to/executable',\n        'extras': [\n          {\n            'key': 'key',\n            'value': 'value'\n          }\n        ],\n        'is_running': True,\n        'logfiles': [\n          '/path/to/stdout/logfile',\n          '/path/to/stderr/logfile'\n        ],\n        'name': 'Server name',\n        'pid': 12345,\n        'port': 1234\n      }\n    ]\n  },\n  'extra_conf': {\n    'is_loaded': False,\n    'path': '/path/to/extra/conf'\n  },\n  'python': {\n    'executable': '/path/to/python/interpreter',\n    'version': 'Python version'\n  }\n}\n\n\nclass DebugInfoRequestTest( TestCase ):\n  def test_FormatDebugInfoResponse_NoResponse( self ):\n    assert_that(\n      FormatDebugInfoResponse( None ),\n      equal_to( 'Server errored, no debug info from server\\n' )\n    )\n\n\n  def test_FormatDebugInfoResponse_NoExtraConf( self ):\n    response = deepcopy( GENERIC_RESPONSE )\n    response[ 'extra_conf' ].update( {\n      'is_loaded': False,\n      'path': None\n    } )\n    assert_that(\n      FormatDebugInfoResponse( response ),\n      contains_string(\n        'No extra configuration file found\\n'\n      )\n    )\n\n\n  def test_FormatDebugInfoResponse_ExtraConfFoundButNotLoaded( self ):\n    response = deepcopy( GENERIC_RESPONSE )\n    response[ 'extra_conf' ].update( {\n      'is_loaded': False,\n      'path': '/path/to/extra/conf'\n    } )\n    assert_that(\n      FormatDebugInfoResponse( response ),\n      contains_string(\n        'Extra configuration file found but not loaded\\n'\n        'Extra configuration path: /path/to/extra/conf\\n'\n      )\n    )\n\n\n  def test_FormatDebugInfoResponse_ExtraConfFoundAndLoaded( self ):\n    response = deepcopy( GENERIC_RESPONSE )\n    response[ 'extra_conf' ].update( {\n      'is_loaded': True,\n      'path': '/path/to/extra/conf'\n    } )\n    assert_that(\n      FormatDebugInfoResponse( response ),\n      contains_string(\n        'Extra configuration file found and loaded\\n'\n        'Extra configuration path: /path/to/extra/conf\\n'\n      )\n    )\n\n\n  def test_FormatDebugInfoResponse_Completer_ServerRunningWithHost( self ):\n    response = deepcopy( GENERIC_RESPONSE )\n    assert_that(\n      FormatDebugInfoResponse( response ),\n      contains_string(\n        'Completer name completer debug information:\\n'\n        '  Server name running at: http://127.0.0.1:1234\\n'\n        '  Server name process ID: 12345\\n'\n        '  Server name executable: /path/to/executable\\n'\n        '  Server name logfiles:\\n'\n        '    /path/to/stdout/logfile\\n'\n        '    /path/to/stderr/logfile\\n'\n        '  Server name key: value\\n'\n        '  Key: value\\n'\n      )\n    )\n\n\n  def test_FormatDebugInfoResponse_Completer_ServerRunningWithoutHost( self ):\n    response = deepcopy( GENERIC_RESPONSE )\n    response[ 'completer' ][ 'servers' ][ 0 ].update( {\n      'address': None,\n      'port': None\n    } )\n    assert_that(\n      FormatDebugInfoResponse( response ),\n      contains_string(\n        'Completer name completer debug information:\\n'\n        '  Server name running\\n'\n        '  Server name process ID: 12345\\n'\n        '  Server name executable: /path/to/executable\\n'\n        '  Server name logfiles:\\n'\n        '    /path/to/stdout/logfile\\n'\n        '    /path/to/stderr/logfile\\n'\n        '  Server name key: value\\n'\n        '  Key: value\\n'\n      )\n    )\n\n\n  def test_FormatDebugInfoResponse_Completer_ServerNotRunningWithNoLogfiles(\n      self ):\n    response = deepcopy( GENERIC_RESPONSE )\n    response[ 'completer' ][ 'servers' ][ 0 ].update( {\n      'is_running': False,\n      'logfiles': []\n    } )\n    assert_that(\n      FormatDebugInfoResponse( response ),\n      contains_string(\n        'Completer name completer debug information:\\n'\n        '  Server name not running\\n'\n        '  Server name executable: /path/to/executable\\n'\n        '  No logfiles available\\n'\n        '  Server name key: value\\n'\n        '  Key: value\\n'\n      )\n    )\n"
  },
  {
    "path": "python/ycm/tests/client/messages_request_test.py",
    "content": "# Copyright (C) 2017 YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.tests.test_utils import MockVimModule\nMockVimModule()\n\nfrom hamcrest import assert_that, equal_to\nfrom unittest import TestCase\nfrom unittest.mock import patch, call\n\nfrom ycm.client.messages_request import _HandlePollResponse\nfrom ycm.tests.test_utils import ExtendedMock\n\n\nclass MessagesRequestTest( TestCase ):\n  def test_HandlePollResponse_NoMessages( self ):\n    assert_that( _HandlePollResponse( True, None ), equal_to( True ) )\n\n    # Other non-False responses mean the same thing\n    assert_that( _HandlePollResponse( '', None ), equal_to( True ) )\n    assert_that( _HandlePollResponse( 1, None ), equal_to( True ) )\n    assert_that( _HandlePollResponse( {}, None ), equal_to( True ) )\n\n\n  def test_HandlePollResponse_PollingNotSupported( self ):\n    assert_that( _HandlePollResponse( False, None ), equal_to( False ) )\n\n    # 0 is not False\n    assert_that( _HandlePollResponse( 0, None ), equal_to( True ) )\n\n\n  @patch( 'ycm.client.messages_request.PostVimMessage',\n          new_callable = ExtendedMock )\n  def test_HandlePollResponse_SingleMessage( self, post_vim_message ):\n    assert_that( _HandlePollResponse( [ { 'message': 'this is a message' } ] ,\n                                      None ),\n                 equal_to( True ) )\n\n    post_vim_message.assert_has_exact_calls( [\n      call( 'this is a message', warning=False, truncate=True )\n    ] )\n\n\n  @patch( 'ycm.client.messages_request.PostVimMessage',\n          new_callable = ExtendedMock )\n  def test_HandlePollResponse_MultipleMessages( self, post_vim_message ):\n    assert_that( _HandlePollResponse( [ { 'message': 'this is a message' },\n                                        { 'message': 'this is another one' } ] ,\n                                      None ),\n                 equal_to( True ) )\n\n    post_vim_message.assert_has_exact_calls( [\n      call( 'this is a message', warning=False, truncate=True ),\n      call( 'this is another one', warning=False, truncate=True )\n    ] )\n\n\n  def test_HandlePollResponse_SingleDiagnostic( self ):\n    diagnostics_handler = ExtendedMock()\n    messages = [\n      { 'filepath': 'foo', 'diagnostics': [ 'PLACEHOLDER' ] },\n    ]\n    assert_that( _HandlePollResponse( messages, diagnostics_handler ),\n                 equal_to( True ) )\n    diagnostics_handler.UpdateWithNewDiagnosticsForFile.assert_has_exact_calls(\n      [\n        call( 'foo', [ 'PLACEHOLDER' ] )\n      ] )\n\n\n  def test_HandlePollResponse_MultipleDiagnostics( self ):\n    diagnostics_handler = ExtendedMock()\n    messages = [\n      { 'filepath': 'foo', 'diagnostics': [ 'PLACEHOLDER1' ] },\n      { 'filepath': 'bar', 'diagnostics': [ 'PLACEHOLDER2' ] },\n      { 'filepath': 'baz', 'diagnostics': [ 'PLACEHOLDER3' ] },\n      { 'filepath': 'foo', 'diagnostics': [ 'PLACEHOLDER4' ] },\n    ]\n    assert_that( _HandlePollResponse( messages, diagnostics_handler ),\n                 equal_to( True ) )\n    diagnostics_handler.UpdateWithNewDiagnosticsForFile.assert_has_exact_calls(\n      [\n        call( 'foo', [ 'PLACEHOLDER1' ] ),\n        call( 'bar', [ 'PLACEHOLDER2' ] ),\n        call( 'baz', [ 'PLACEHOLDER3' ] ),\n        call( 'foo', [ 'PLACEHOLDER4' ] )\n      ] )\n\n\n  @patch( 'ycm.client.messages_request.PostVimMessage',\n          new_callable = ExtendedMock )\n  def test_HandlePollResponse_MultipleMessagesAndDiagnostics(\n      self, post_vim_message ):\n    diagnostics_handler = ExtendedMock()\n    messages = [\n      { 'filepath': 'foo', 'diagnostics': [ 'PLACEHOLDER1' ] },\n      { 'message': 'On the first day of Christmas, my VimScript gave to me' },\n      { 'filepath': 'bar', 'diagnostics': [ 'PLACEHOLDER2' ] },\n      { 'message': 'A test file in a Command-T' },\n      { 'filepath': 'baz', 'diagnostics': [ 'PLACEHOLDER3' ] },\n      { 'message': 'On the second day of Christmas, my VimScript gave to me' },\n      { 'filepath': 'foo', 'diagnostics': [ 'PLACEHOLDER4' ] },\n      { 'message': 'Two popup menus, and a test file in a Command-T' },\n    ]\n    assert_that( _HandlePollResponse( messages, diagnostics_handler ),\n                 equal_to( True ) )\n    diagnostics_handler.UpdateWithNewDiagnosticsForFile.assert_has_exact_calls(\n      [\n        call( 'foo', [ 'PLACEHOLDER1' ] ),\n        call( 'bar', [ 'PLACEHOLDER2' ] ),\n        call( 'baz', [ 'PLACEHOLDER3' ] ),\n        call( 'foo', [ 'PLACEHOLDER4' ] )\n      ] )\n\n    post_vim_message.assert_has_exact_calls( [\n      call( 'On the first day of Christmas, my VimScript gave to me',\n            warning=False,\n            truncate=True ),\n      call( 'A test file in a Command-T', warning=False, truncate=True ),\n      call( 'On the second day of Christmas, my VimScript gave to me',\n            warning=False,\n            truncate=True ),\n      call( 'Two popup menus, and a test file in a Command-T',\n            warning=False,\n            truncate=True ),\n    ] )\n"
  },
  {
    "path": "python/ycm/tests/client/omni_completion_request_test.py",
    "content": "# Copyright (C) 2020 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom unittest import TestCase\nfrom unittest.mock import MagicMock\nfrom hamcrest import assert_that, has_entries\n\nfrom ycm.client.omni_completion_request import OmniCompletionRequest\n\n\ndef BuildOmnicompletionRequest( results, start_column = 1 ):\n  omni_completer = MagicMock()\n  omni_completer.ComputeCandidates = MagicMock( return_value = results )\n\n  request_data = {\n    'line_num': 1,\n    'column_num': 1,\n    'start_column': start_column\n  }\n  request = OmniCompletionRequest( omni_completer, request_data )\n  request.Start()\n\n  return request\n\n\nclass OmniCompletionRequestTest( TestCase ):\n  def test_Done_AlwaysTrue( self ):\n    request = BuildOmnicompletionRequest( [] )\n\n    assert_that( request.Done() )\n\n\n  def test_Response_FromOmniCompleter( self ):\n    results = [ { \"word\": \"test\" } ]\n    request = BuildOmnicompletionRequest( results )\n\n    assert_that( request.Response(), has_entries( {\n      'line': 1,\n      'column': 1,\n      'completion_start_column': 1,\n      'completions': results\n    } ) )\n"
  },
  {
    "path": "python/ycm/tests/command_test.py",
    "content": "# Copyright (C) 2016-2018 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.tests.test_utils import MockVimModule, MockVimBuffers, VimBuffer\nMockVimModule()\n\nfrom hamcrest import assert_that, contains_exactly, has_entries\nfrom unittest.mock import patch\nfrom unittest import TestCase\n\nfrom ycm.tests import YouCompleteMeInstance\n\n\nclass CommandTest( TestCase ):\n  @YouCompleteMeInstance( { 'g:ycm_extra_conf_vim_data': [ 'tempname()' ] } )\n  def test_SendCommandRequest_ExtraConfVimData_Works( self, ycm ):\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.youcompleteme.SendCommandRequest' ) as send_request:\n        ycm.SendCommandRequest( [ 'GoTo' ], 'aboveleft', False, 1, 1 )\n        assert_that(\n          # Positional arguments passed to SendCommandRequest.\n          send_request.call_args[ 0 ],\n          contains_exactly(\n            contains_exactly( 'GoTo' ),\n            'aboveleft',\n            'same-buffer',\n            has_entries( {\n              'options': has_entries( {\n                'tab_size': 2,\n                'insert_spaces': True,\n              } ),\n              'extra_conf_data': has_entries( {\n                'tempname()': '_TEMP_FILE_'\n              } ),\n            } ),\n          )\n        )\n\n\n  @YouCompleteMeInstance( {\n    'g:ycm_extra_conf_vim_data': [ 'undefined_value' ] } )\n  def test_SendCommandRequest_ExtraConfData_UndefinedValue( self, ycm ):\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.youcompleteme.SendCommandRequest' ) as send_request:\n        ycm.SendCommandRequest( [ 'GoTo' ], 'belowright', False, 1, 1 )\n        assert_that(\n          # Positional arguments passed to SendCommandRequest.\n          send_request.call_args[ 0 ],\n          contains_exactly(\n            contains_exactly( 'GoTo' ),\n            'belowright',\n            'same-buffer',\n            has_entries( {\n              'options': has_entries( {\n                'tab_size': 2,\n                'insert_spaces': True,\n              } )\n            } ),\n          )\n        )\n\n\n  @YouCompleteMeInstance()\n  def test_SendCommandRequest_BuildRange_NoVisualMarks( self, ycm, *args ):\n    current_buffer = VimBuffer( 'buffer', contents = [ 'first line',\n                                                       'second line' ] )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.youcompleteme.SendCommandRequest' ) as send_request:\n        ycm.SendCommandRequest( [ 'GoTo' ], '', True, 1, 2 )\n        send_request.assert_called_once_with(\n          [ 'GoTo' ],\n          '',\n          'same-buffer',\n          {\n            'options': {\n              'tab_size': 2,\n              'insert_spaces': True\n            },\n            'range': {\n              'start': {\n                'line_num': 1,\n                'column_num': 1\n              },\n              'end': {\n                'line_num': 2,\n                'column_num': 12\n              }\n            }\n          },\n        )\n\n\n  @YouCompleteMeInstance()\n  def test_SendCommandRequest_BuildRange_VisualMarks( self, ycm, *args ):\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'first line',\n                                             'second line' ],\n                                visual_start = [ 1, 4 ],\n                                visual_end = [ 2, 8 ] )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.youcompleteme.SendCommandRequest' ) as send_request:\n        ycm.SendCommandRequest( [ 'GoTo' ], 'tab', True, 1, 2 )\n        send_request.assert_called_once_with(\n          [ 'GoTo' ],\n          'tab',\n          'same-buffer',\n          {\n            'options': {\n              'tab_size': 2,\n              'insert_spaces': True\n            },\n            'range': {\n              'start': {\n                'line_num': 1,\n                'column_num': 5\n              },\n              'end': {\n                'line_num': 2,\n                'column_num': 9\n              }\n            }\n          },\n        )\n\n\n  @YouCompleteMeInstance()\n  def test_SendCommandRequest_IgnoreFileTypeOption( self, ycm, *args ):\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      expected_args = (\n        [ 'GoTo' ],\n        '',\n        'same-buffer',\n        {\n          'completer_target': 'python',\n          'options': {\n            'tab_size': 2,\n            'insert_spaces': True\n          },\n        },\n      )\n\n      with patch( 'ycm.youcompleteme.SendCommandRequest' ) as send_request:\n        ycm.SendCommandRequest( [ 'ft=python', 'GoTo' ], '', False, 1, 1 )\n        send_request.assert_called_once_with( *expected_args )\n\n      with patch( 'ycm.youcompleteme.SendCommandRequest' ) as send_request:\n        ycm.SendCommandRequest( [ 'GoTo', 'ft=python' ], '', False, 1, 1 )\n        send_request.assert_called_once_with( *expected_args )\n"
  },
  {
    "path": "python/ycm/tests/completion_test.py",
    "content": "# Copyright (C) 2016 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.tests.test_utils import ( CurrentWorkingDirectory, ExtendedMock,\n                                   MockVimModule, MockVimBuffers, VimBuffer )\nMockVimModule()\n\nimport contextlib\nfrom hamcrest import ( assert_that,\n                       contains_exactly,\n                       empty,\n                       equal_to,\n                       has_entries )\nfrom unittest import TestCase\nfrom unittest.mock import call, MagicMock, patch\n\nfrom ycm.tests import PathToTestFile, YouCompleteMeInstance\nfrom ycmd.responses import ServerError\n\nimport json\n\n\n@contextlib.contextmanager\ndef MockCompletionRequest( response_method ):\n  \"\"\"Mock out the CompletionRequest, replacing the response handler\n  JsonFromFuture with the |response_method| parameter.\"\"\"\n\n  # We don't want the requests to actually be sent to the server, just have it\n  # return success.\n  with patch( 'ycm.client.completer_available_request.'\n              'CompleterAvailableRequest.PostDataToHandler',\n              return_value = True ):\n    with patch( 'ycm.client.completion_request.CompletionRequest.'\n                'PostDataToHandlerAsync',\n                return_value = MagicMock( return_value=True ) ):\n\n      # We set up a fake response.\n      with patch( 'ycm.client.base_request._JsonFromFuture',\n                  side_effect = response_method ):\n        yield\n\n\n@contextlib.contextmanager\ndef MockResolveRequest( response_method ):\n  \"\"\"Mock out the CompletionRequest, replacing the response handler\n  JsonFromFuture with the |response_method| parameter.\"\"\"\n\n  with patch( 'ycm.client.resolve_completion_request.ResolveCompletionRequest.'\n              'PostDataToHandlerAsync',\n              return_value = MagicMock( return_value=True ) ):\n\n    # We set up a fake response.\n    with patch( 'ycm.client.base_request._JsonFromFuture',\n                side_effect = response_method ):\n      yield\n\n\nclass CompletionTest( TestCase ):\n  @YouCompleteMeInstance()\n  def test_SendCompletionRequest_UnicodeWorkingDirectory( self, ycm ):\n    unicode_dir = PathToTestFile( 'uni¢od€' )\n    current_buffer = VimBuffer( PathToTestFile( 'uni¢𐍈d€', 'current_buffer' ) )\n\n    def ServerResponse( *args ):\n      return { 'completions': [], 'completion_start_column': 1 }\n\n    with CurrentWorkingDirectory( unicode_dir ):\n      with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n        with MockCompletionRequest( ServerResponse ):\n          ycm.SendCompletionRequest()\n          assert_that( ycm.CompletionRequestReady() )\n          assert_that(\n            ycm.GetCompletionResponse(),\n            has_entries( {\n              'completions': empty(),\n              'completion_start_column': 1\n            } )\n          )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_SendCompletionRequest_ResponseContainingError(\n      self, ycm, post_vim_message ):\n    current_buffer = VimBuffer( 'buffer' )\n\n    def ServerResponse( *args ):\n      return {\n        'completions': [ {\n          'insertion_text': 'insertion_text',\n          'menu_text': 'menu_text',\n          'extra_menu_info': 'extra_menu_info',\n          'detailed_info': 'detailed_info',\n          'kind': 'kind',\n          'extra_data': {\n             'doc_string': 'doc_string'\n          }\n        } ],\n        'completion_start_column': 3,\n        'errors': [ {\n          'exception': {\n             'TYPE': 'Exception'\n          },\n          'message': 'message',\n          'traceback': 'traceback'\n        } ]\n      }\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with MockCompletionRequest( ServerResponse ):\n        ycm.SendCompletionRequest()\n        assert_that( ycm.CompletionRequestReady() )\n        response = ycm.GetCompletionResponse()\n        post_vim_message.assert_has_exact_calls( [\n          call( 'Exception: message', truncate = True )\n        ] )\n        assert_that(\n          response,\n          has_entries( {\n            'completions': contains_exactly( has_entries( {\n              'word': 'insertion_text',\n              'abbr': 'menu_text',\n              'menu': 'extra_menu_info',\n              'info': 'detailed_info\\ndoc_string',\n              'kind': 'k',\n              'dup': 1,\n              'empty': 1\n            } ) ),\n            'completion_start_column': 3\n          } )\n        )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.client.base_request._logger', autospec = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_SendCompletionRequest_ErrorFromServer( self,\n                                                  ycm,\n                                                  post_vim_message,\n                                                  logger ):\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with MockCompletionRequest( ServerError( 'Server error' ) ):\n        ycm.SendCompletionRequest()\n        assert_that( ycm.CompletionRequestReady() )\n        response = ycm.GetCompletionResponse()\n        logger.exception.assert_called_with( 'Error while handling server '\n                                             'response' )\n        post_vim_message.assert_has_exact_calls( [\n          call( 'Server error', truncate = True )\n        ] )\n        assert_that(\n          response,\n          has_entries( {\n            'completions': empty(),\n            'completion_start_column': -1\n          } )\n        )\n\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.client.base_request._logger', autospec = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_ResolveCompletionRequest_Resolves( self,\n                                              ycm,\n                                              post_vim_message,\n                                              logger ):\n\n    def CompletionResponse( *args ):\n      return {\n        'completions': [ {\n          'insertion_text': 'insertion_text',\n          'menu_text': 'menu_text',\n          'extra_menu_info': 'extra_menu_info',\n          'detailed_info': 'detailed_info',\n          'kind': 'kind',\n          'extra_data': {\n            'doc_string': 'doc_string',\n            'resolve': 10\n          }\n        } ],\n        'completion_start_column': 3,\n        'errors': []\n      }\n\n    def ResolveResponse( *args ):\n      return {\n        'completion': {\n          'insertion_text': 'insertion_text',\n          'menu_text': 'menu_text',\n          'extra_menu_info': 'extra_menu_info',\n          'detailed_info': 'detailed_info',\n          'kind': 'kind',\n          'extra_data': {\n            'doc_string': 'doc_string with more info'\n          }\n        },\n        'errors': []\n      }\n\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with MockCompletionRequest( CompletionResponse ):\n        ycm.SendCompletionRequest()\n        assert_that( ycm.CompletionRequestReady() )\n        response = ycm.GetCompletionResponse()\n\n        post_vim_message.assert_not_called()\n        assert_that(\n          response,\n          has_entries( {\n            'completions': contains_exactly( has_entries( {\n              'word': 'insertion_text',\n              'abbr': 'menu_text',\n              'menu': 'extra_menu_info',\n              'info': 'detailed_info\\ndoc_string',\n              'kind': 'k',\n              'dup': 1,\n              'empty': 1\n            } ) ),\n            'completion_start_column': 3\n          } )\n        )\n\n        item = response[ 'completions' ][ 0 ]\n        assert_that( json.loads( item[ 'user_data' ] ),\n                     has_entries( { 'resolve': 10 } ) )\n\n      with MockResolveRequest( ResolveResponse ):\n        assert_that( ycm.ResolveCompletionItem( item ), equal_to( True ) )\n        assert_that( ycm.CompletionRequestReady() )\n        response = ycm.GetCompletionResponse()\n        post_vim_message.assert_not_called()\n\n        assert_that(\n          response,\n          has_entries( {\n            'completion': has_entries( {\n              'word': 'insertion_text',\n              'abbr': 'menu_text',\n              'menu': 'extra_menu_info',\n              'info': 'detailed_info\\ndoc_string with more info',\n              'kind': 'k',\n              'dup': 1,\n              'empty': 1\n            } )\n          } )\n        )\n\n        item = response[ 'completion' ]\n\n      with MockResolveRequest( ServerError( 'must not be called' ) ):\n        assert_that( ycm.ResolveCompletionItem( item ), equal_to( False ) )\n        post_vim_message.assert_not_called()\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.client.base_request._logger', autospec = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_ResolveCompletionRequest_ResponseContainsErrors( self,\n                                                            ycm,\n                                                            post_vim_message,\n                                                            logger ):\n\n    def CompletionResponse( *args ):\n      return {\n        'completions': [ {\n          'insertion_text': 'insertion_text',\n          'menu_text': 'menu_text',\n          'extra_menu_info': 'extra_menu_info',\n          'detailed_info': 'detailed_info',\n          'kind': 'kind',\n          'extra_data': {\n            'doc_string': 'doc_string',\n            'resolve': 10\n          }\n        } ],\n        'completion_start_column': 3,\n        'errors': []\n      }\n\n    def ResolveResponse( *args ):\n      return {\n        'completion': {\n          'insertion_text': 'insertion_text',\n          'menu_text': 'menu_text',\n          'extra_menu_info': 'extra_menu_info',\n          'detailed_info': 'detailed_info',\n          'kind': 'kind',\n          'extra_data': {\n            'doc_string': 'doc_string with more info'\n          }\n        },\n        'errors': [ {\n          'exception': {\n             'TYPE': 'Exception'\n          },\n          'message': 'message',\n          'traceback': 'traceback'\n        } ]\n      }\n\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with MockCompletionRequest( CompletionResponse ):\n        ycm.SendCompletionRequest()\n        assert_that( ycm.CompletionRequestReady() )\n        response = ycm.GetCompletionResponse()\n\n        post_vim_message.assert_not_called()\n        assert_that(\n          response,\n          has_entries( {\n            'completions': contains_exactly( has_entries( {\n              'word': 'insertion_text',\n              'abbr': 'menu_text',\n              'menu': 'extra_menu_info',\n              'info': 'detailed_info\\ndoc_string',\n              'kind': 'k',\n              'dup': 1,\n              'empty': 1\n            } ) ),\n            'completion_start_column': 3\n          } )\n        )\n\n        item = response[ 'completions' ][ 0 ]\n        assert_that( json.loads( item[ 'user_data' ] ),\n                     has_entries( { 'resolve': 10 } ) )\n\n      with MockResolveRequest( ResolveResponse ):\n        assert_that( ycm.ResolveCompletionItem( item ), equal_to( True ) )\n        assert_that( ycm.CompletionRequestReady() )\n        response = ycm.GetCompletionResponse()\n\n        post_vim_message.assert_has_exact_calls( [\n          call( 'Exception: message', truncate = True )\n        ] )\n        assert_that(\n          response,\n          has_entries( {\n            'completion': has_entries( {\n              'word': 'insertion_text',\n              'abbr': 'menu_text',\n              'menu': 'extra_menu_info',\n              'info': 'detailed_info\\ndoc_string with more info',\n              'kind': 'k',\n              'dup': 1,\n              'empty': 1\n            } )\n          } )\n        )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_ResolveCompletionItem_NoUserData( self, ycm, post_vim_message ):\n    def CompletionResponse( *args ):\n      return {\n        'completions': [ {\n          'insertion_text': 'insertion_text',\n          'menu_text': 'menu_text',\n          'extra_menu_info': 'extra_menu_info',\n          'detailed_info': 'detailed_info',\n          'kind': 'kind'\n        } ],\n        'completion_start_column': 3,\n        'errors': []\n      }\n\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with MockCompletionRequest( CompletionResponse ):\n        ycm.SendCompletionRequest()\n        assert_that( ycm.CompletionRequestReady() )\n        response = ycm.GetCompletionResponse()\n\n        post_vim_message.assert_not_called()\n        assert_that(\n          response,\n          has_entries( {\n            'completions': contains_exactly( has_entries( {\n              'word': 'insertion_text',\n              'abbr': 'menu_text',\n              'menu': 'extra_menu_info',\n              'info': 'detailed_info',\n              'kind': 'k',\n              'dup': 1,\n              'empty': 1\n            } ) ),\n            'completion_start_column': 3\n          } )\n        )\n\n        item = response[ 'completions' ][ 0 ]\n        item.pop( 'user_data' )\n\n      with MockResolveRequest( ServerError( 'must not be called' ) ):\n        assert_that( ycm.ResolveCompletionItem( item ), equal_to( False ) )\n        post_vim_message.assert_not_called()\n\n\n  @YouCompleteMeInstance()\n  def test_ResolveCompletionItem_NoRequest( self, ycm ):\n    assert_that( ycm.GetCurrentCompletionRequest(), equal_to( None ) )\n    assert_that( ycm.ResolveCompletionItem( {} ), equal_to( False ) )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.client.base_request._logger', autospec = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_ResolveCompletionRequest_ServerError(\n      self, ycm, post_vim_message, logger ):\n\n    def ServerResponse( *args ):\n      return {\n        'completions': [ {\n          'insertion_text': 'insertion_text',\n          'menu_text': 'menu_text',\n          'extra_menu_info': 'extra_menu_info',\n          'detailed_info': 'detailed_info',\n          'kind': 'kind',\n          'extra_data': {\n            'doc_string': 'doc_string',\n            'resolve': 10\n          }\n        } ],\n        'completion_start_column': 3,\n        'errors': []\n      }\n\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with MockCompletionRequest( ServerResponse ):\n        ycm.SendCompletionRequest()\n        assert_that( ycm.CompletionRequestReady() )\n        response = ycm.GetCompletionResponse()\n\n        post_vim_message.assert_not_called()\n        assert_that(\n          response,\n          has_entries( {\n            'completions': contains_exactly( has_entries( {\n              'word': 'insertion_text',\n              'abbr': 'menu_text',\n              'menu': 'extra_menu_info',\n              'info': 'detailed_info\\ndoc_string',\n              'kind': 'k',\n              'dup': 1,\n              'empty': 1\n            } ) ),\n            'completion_start_column': 3\n          } )\n        )\n\n        item = response[ 'completions' ][ 0 ]\n        assert_that( json.loads( item[ 'user_data' ] ),\n                     has_entries( { 'resolve': 10 } ) )\n\n      with MockResolveRequest( ServerError( 'Server error' ) ):\n        ycm.ResolveCompletionItem( item )\n        assert_that( ycm.CompletionRequestReady() )\n        response = ycm.GetCompletionResponse()\n\n        logger.exception.assert_called_with( 'Error while handling server '\n                                             'response' )\n        post_vim_message.assert_has_exact_calls( [\n          call( 'Server error', truncate = True )\n        ] )\n"
  },
  {
    "path": "python/ycm/tests/diagnostic_filter_test.py",
    "content": "# Copyright (C) 2016  YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.tests.test_utils import MockVimModule\nMockVimModule()\n\nfrom hamcrest import assert_that, equal_to\nfrom unittest import TestCase\nfrom ycm.diagnostic_filter import DiagnosticFilter\n\n\ndef _assert_accept_equals( filter, text_or_obj, expected ):\n  if not isinstance( text_or_obj, dict ):\n    text_or_obj = { 'text': text_or_obj }\n\n  assert_that( filter.IsAllowed( text_or_obj ), equal_to( expected ) )\n\n\ndef _assert_accepts( filter, text ):\n  _assert_accept_equals( filter, text, True )\n\n\ndef _assert_rejects( filter, text ):\n  _assert_accept_equals( filter, text, False )\n\n\ndef _JavaFilter( config ):\n  return { 'filter_diagnostics' : { 'java': config } }\n\n\ndef _CreateFilterForTypes( opts, types ):\n  return DiagnosticFilter.CreateFromOptions( opts ).SubsetForTypes( types )\n\n\nclass DiagnosticFilterTest( TestCase ):\n  def test_RegexFilter( self ):\n    opts = _JavaFilter( { 'regex' : 'taco' } )\n    f = _CreateFilterForTypes( opts, [ 'java' ] )\n\n    _assert_rejects( f, 'This is a Taco' )\n    _assert_accepts( f, 'This is a Burrito' )\n\n\n  def test_RegexSingleList( self ):\n    opts = _JavaFilter( { 'regex' : [ 'taco' ] } )\n    f = _CreateFilterForTypes( opts, [ 'java' ] )\n\n    _assert_rejects( f, 'This is a Taco' )\n    _assert_accepts( f, 'This is a Burrito' )\n\n\n  def test_RegexMultiList( self ):\n    opts = _JavaFilter( { 'regex' : [ 'taco', 'burrito' ] } )\n    f = _CreateFilterForTypes( opts, [ 'java' ] )\n\n    _assert_rejects( f, 'This is a Taco' )\n    _assert_rejects( f, 'This is a Burrito' )\n\n\n  def test_RegexNotFiltered( self ):\n    opts = _JavaFilter( { 'regex' : 'taco' } )\n    f = _CreateFilterForTypes( opts, [ 'cs' ] )\n\n    _assert_accepts( f, 'This is a Taco' )\n    _assert_accepts( f, 'This is a Burrito' )\n\n\n  def test_LevelWarnings( self ):\n    opts = _JavaFilter( { 'level' : 'warning' } )\n    f = _CreateFilterForTypes( opts, [ 'java' ] )\n\n    _assert_rejects( f, { 'text' : 'This is an unimportant taco',\n                          'kind' : 'WARNING' } )\n    _assert_accepts( f, { 'text' : 'This taco will be shown',\n                          'kind' : 'ERROR' } )\n\n\n  def test_LevelErrors( self ):\n    opts = _JavaFilter( { 'level' : 'error' } )\n    f = _CreateFilterForTypes( opts, [ 'java' ] )\n\n    _assert_accepts( f, { 'text' : 'This is an IMPORTANT taco',\n                          'kind' : 'WARNING' } )\n    _assert_rejects( f, { 'text' : 'This taco will NOT be shown',\n                          'kind' : 'ERROR' } )\n\n\n  def test_MultipleFilterTypesTypeTest( self ):\n\n    opts = _JavaFilter( { 'regex' : '.*taco.*',\n                          'level' : 'warning' } )\n    f = _CreateFilterForTypes( opts, [ 'java' ] )\n\n    _assert_rejects( f, { 'text' : 'This is an unimportant taco',\n                          'kind' : 'WARNING' } )\n    _assert_rejects( f, { 'text' : 'This taco will NOT be shown',\n                          'kind' : 'ERROR' } )\n    _assert_accepts( f, { 'text' : 'This burrito WILL be shown',\n                          'kind' : 'ERROR' } )\n\n\n  def test_MergeMultipleFiletypes( self ):\n\n    opts = { 'filter_diagnostics' : {\n      'java' : { 'regex' : '.*taco.*' },\n      'xml'  : { 'regex' : '.*burrito.*' } } }\n\n    f = _CreateFilterForTypes( opts, [ 'java', 'xml' ] )\n\n    _assert_rejects( f, 'This is a Taco' )\n    _assert_rejects( f, 'This is a Burrito' )\n    _assert_accepts( f, 'This is some Nachos' )\n\n\n  def test_CommaSeparatedFiletypes( self ):\n\n    opts = { 'filter_diagnostics' : {\n      'java,c,cs' : { 'regex' : '.*taco.*' } } }\n\n    f = _CreateFilterForTypes( opts, [ 'cs' ] )\n\n    _assert_rejects( f, 'This is a Taco' )\n    _assert_accepts( f, 'This is a Burrito' )\n"
  },
  {
    "path": "python/ycm/tests/diagnostic_interface_test.py",
    "content": "# Copyright (C) 2015-2018 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\nfrom ycm import diagnostic_interface\nfrom ycm.tests.test_utils import VimBuffer, MockVimModule, MockVimBuffers\nfrom hamcrest import ( assert_that,\n                       contains_exactly,\n                       equal_to,\n                       has_entries,\n                       has_item )\nfrom unittest import TestCase\nMockVimModule()\n\n\ndef SimpleDiagnosticToJson( start_line, start_col, end_line, end_col ):\n  return {\n    'kind': 'ERROR',\n    'location': { 'line_num': start_line, 'column_num': start_col },\n    'location_extent': {\n      'start': {\n        'line_num': start_line,\n        'column_num': start_col\n      },\n      'end': {\n        'line_num': end_line,\n        'column_num': end_col\n      }\n    },\n    'ranges': [\n      {\n        'start': {\n          'line_num': start_line,\n          'column_num': start_col\n        },\n        'end': {\n          'line_num': end_line,\n          'column_num': end_col\n        }\n      }\n    ]\n  }\n\n\ndef SimpleDiagnosticToJsonWithInvalidLineNum( start_line, start_col,\n                                              end_line, end_col ):\n  return {\n    'kind': 'ERROR',\n    'location': { 'line_num': start_line, 'column_num': start_col },\n    'location_extent': {\n      'start': {\n        'line_num': start_line,\n        'column_num': start_col\n      },\n      'end': {\n        'line_num': end_line,\n        'column_num': end_col\n      }\n    },\n    'ranges': [\n      {\n        'start': {\n          'line_num': 0,\n          'column_num': 0\n        },\n        'end': {\n          'line_num': 0,\n          'column_num': 0\n        }\n      },\n      {\n        'start': {\n          'line_num': start_line,\n          'column_num': start_col\n        },\n        'end': {\n          'line_num': end_line,\n          'column_num': end_col\n        }\n      }\n    ]\n  }\n\n\ndef YcmTextPropertyTupleMatcher( start_line, start_col, end_line, end_col ):\n  return has_item( contains_exactly(\n    start_line,\n    start_col,\n    'YcmErrorProperty',\n    has_entries( { 'end_col': end_col, 'end_lnum': end_line } ) ) )\n\n\nclass DiagnosticInterfaceTest( TestCase ):\n  def test_ConvertDiagnosticToTextProperties( self ):\n    for diag, contents, result in [\n      # Error in middle of the line\n      [\n        SimpleDiagnosticToJson( 1, 16, 1, 23 ),\n        [ 'Highlight this error please' ],\n        YcmTextPropertyTupleMatcher( 1, 16, 1, 23 )\n      ],\n      # Error at the end of the line\n      [\n        SimpleDiagnosticToJson( 1, 16, 1, 21 ),\n        [ 'Highlight this warning' ],\n        YcmTextPropertyTupleMatcher( 1, 16, 1, 21 )\n      ],\n      [\n        SimpleDiagnosticToJson( 1, 16, 1, 19 ),\n        [ 'Highlight unicøde' ],\n        YcmTextPropertyTupleMatcher( 1, 16, 1, 19 )\n      ],\n      # Non-positive position\n      [\n        SimpleDiagnosticToJson( 0, 0, 0, 0 ),\n        [ 'Some contents' ],\n        {}\n      ],\n      [\n        SimpleDiagnosticToJson( -1, -2, -3, -4 ),\n        [ 'Some contents' ],\n        YcmTextPropertyTupleMatcher( 1, 1, 1, 1 )\n      ],\n    ]:\n      with self.subTest( diag = diag, contents = contents, result = result ):\n        current_buffer = VimBuffer( 'foo', number = 1, contents = [ '' ] )\n        target_buffer = VimBuffer( 'bar', number = 2, contents = contents )\n\n        with MockVimBuffers( [ current_buffer, target_buffer ],\n                             [ current_buffer, target_buffer ] ):\n          actual = diagnostic_interface._ConvertDiagnosticToTextProperties(\n              target_buffer.number,\n              diag )\n          print( actual )\n          assert_that( actual, result )\n\n  def test_ConvertDiagnosticWithInvalidLineNum( self ):\n    for diag, contents, result in [\n      # Error in middle of the line\n      [\n        SimpleDiagnosticToJsonWithInvalidLineNum( 1, 16, 1, 23 ),\n        [ 'Highlight this error please' ],\n        YcmTextPropertyTupleMatcher( 1, 16, 1, 23 )\n      ],\n      # Error at the end of the line\n      [\n        SimpleDiagnosticToJsonWithInvalidLineNum( 1, 16, 1, 21 ),\n        [ 'Highlight this warning' ],\n        YcmTextPropertyTupleMatcher( 1, 16, 1, 21 )\n      ],\n      [\n        SimpleDiagnosticToJsonWithInvalidLineNum( 1, 16, 1, 19 ),\n        [ 'Highlight unicøde' ],\n        YcmTextPropertyTupleMatcher( 1, 16, 1, 19 )\n      ],\n    ]:\n      with self.subTest( diag = diag, contents = contents, result = result ):\n        current_buffer = VimBuffer( 'foo', number = 1, contents = [ '' ] )\n        target_buffer = VimBuffer( 'bar', number = 2, contents = contents )\n\n        with MockVimBuffers( [ current_buffer, target_buffer ],\n                             [ current_buffer, target_buffer ] ):\n          actual = diagnostic_interface._ConvertDiagnosticToTextProperties(\n              target_buffer.number,\n              diag )\n          print( actual )\n          assert_that( actual, result )\n\n\n  def test_IsValidRange( self ):\n    for start_line, start_col, end_line, end_col, expect in (\n      ( 1, 1, 1, 1, True ),\n      ( 1, 1, 0, 0, False ),\n      ( 1, 1, 2, 1, True ),\n      ( 1, 2, 2, 1, True ),\n      ( 2, 1, 1, 1, False ),\n      ( 2, 2, 2, 1, False ),\n    ):\n      with self.subTest( start=( start_line, start_col ),\n                         end=( end_line, end_col ),\n                         expect = expect ):\n        assert_that( diagnostic_interface._IsValidRange( start_line,\n                                                         start_col,\n                                                         end_line,\n                                                         end_col ),\n                     equal_to( expect ) )\n"
  },
  {
    "path": "python/ycm/tests/event_notification_test.py",
    "content": "# Copyright (C) 2015-2018 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.tests.test_utils import ( CurrentWorkingDirectory, ExtendedMock,\n                                   MockVimBuffers, MockVimModule, VimBuffer,\n                                   VimSign )\nMockVimModule()\n\nimport contextlib\nimport os\n\nfrom ycm.tests import ( PathToTestFile, test_utils, YouCompleteMeInstance,\n                        WaitUntilReady )\nfrom ycmd.responses import ( BuildDiagnosticData, Diagnostic, Location, Range,\n                             UnknownExtraConf, ServerError )\n\nfrom hamcrest import ( assert_that, contains_exactly, empty, equal_to,\n                       has_entries, has_entry, has_item, has_items, has_key,\n                       is_not )\nfrom unittest import TestCase\nfrom unittest.mock import call, MagicMock, patch\n\n\ndef PresentDialog_Confirm_Call( message ):\n  \"\"\"Return a mock.call object for a call to vimsupport.PresentDialog, as called\n  why vimsupport.Confirm with the supplied confirmation message\"\"\"\n  return call( message, [ 'Ok', 'Cancel' ] )\n\n\n@contextlib.contextmanager\ndef MockArbitraryBuffer( filetype ):\n  \"\"\"Used via the with statement, set up a single buffer with an arbitrary name\n  and no contents. Its filetype is set to the supplied filetype.\"\"\"\n\n  # Arbitrary, but valid, single buffer open.\n  current_buffer = VimBuffer( os.path.realpath( 'TEST_BUFFER' ),\n                              filetype = filetype )\n\n  with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n    yield\n\n\n@contextlib.contextmanager\ndef MockEventNotification( response_method, native_filetype_completer = True ):\n  \"\"\"Mock out the EventNotification client request object, replacing the\n  Response handler's JsonFromFuture with the supplied |response_method|.\n  Additionally mock out YouCompleteMe's FiletypeCompleterExistsForFiletype\n  method to return the supplied |native_filetype_completer| parameter, rather\n  than querying the server\"\"\"\n\n  # We don't want the event to actually be sent to the server, just have it\n  # return success\n  with patch( 'ycm.client.event_notification.EventNotification.'\n              'PostDataToHandlerAsync',\n              return_value = MagicMock( return_value=True ) ):\n\n    # We set up a fake a Response (as called by EventNotification.Response)\n    # which calls the supplied callback method. Generally this callback just\n    # raises an apropriate exception, otherwise it would have to return a mock\n    # future object.\n    with patch( 'ycm.client.base_request._JsonFromFuture',\n                side_effect = response_method ):\n\n      # Filetype available information comes from the server, so rather than\n      # relying on that request, we mock out the check. The caller decides if\n      # filetype completion is available\n      with patch(\n        'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n        return_value = native_filetype_completer ):\n\n        yield\n\n\ndef _Check_FileReadyToParse_Diagnostic_Error( ycm ):\n  # Tests Vim sign placement and error/warning count python API\n  # when one error is returned.\n  def DiagnosticResponse( *args ):\n    start = Location( 1, 2, 'TEST_BUFFER' )\n    end = Location( 1, 4, 'TEST_BUFFER' )\n    extent = Range( start, end )\n    diagnostic = Diagnostic( [], start, extent, 'expected ;', 'ERROR' )\n    return [ BuildDiagnosticData( diagnostic ) ]\n\n  with MockArbitraryBuffer( 'cpp' ):\n    with MockEventNotification( DiagnosticResponse ):\n      ycm.OnFileReadyToParse()\n      assert_that( ycm.FileParseRequestReady() )\n      ycm.HandleFileParseRequest()\n      assert_that(\n        test_utils.VIM_SIGNS,\n        contains_exactly(\n          VimSign( 1, 'YcmError', 1 )\n        )\n      )\n      assert_that( ycm.GetErrorCount(), equal_to( 1 ) )\n      assert_that( ycm.GetWarningCount(), equal_to( 0 ) )\n\n      # Consequent calls to HandleFileParseRequest shouldn't mess with\n      # existing diagnostics, when there is no new parse request.\n      ycm.HandleFileParseRequest()\n      assert_that(\n        test_utils.VIM_SIGNS,\n        contains_exactly(\n          VimSign( 1, 'YcmError', 1 )\n        )\n      )\n      assert_that( ycm.GetErrorCount(), equal_to( 1 ) )\n      assert_that( ycm.GetWarningCount(), equal_to( 0 ) )\n\n      assert_that( not ycm.ShouldResendFileParseRequest() )\n\n      # New identical requests should result in the same diagnostics.\n      ycm.OnFileReadyToParse()\n      assert_that( ycm.FileParseRequestReady() )\n      ycm.HandleFileParseRequest()\n      assert_that(\n        test_utils.VIM_SIGNS,\n        contains_exactly(\n          VimSign( 1, 'YcmError', 1 )\n        )\n      )\n      assert_that( ycm.GetErrorCount(), equal_to( 1 ) )\n      assert_that( ycm.GetWarningCount(), equal_to( 0 ) )\n\n      assert_that( not ycm.ShouldResendFileParseRequest() )\n\n\ndef _Check_FileReadyToParse_Diagnostic_Warning( ycm ):\n  # Tests Vim sign placement/unplacement and error/warning count python API\n  # when one warning is returned.\n  # Should be called after _Check_FileReadyToParse_Diagnostic_Error\n  def DiagnosticResponse( *args ):\n    start = Location( 2, 2, 'TEST_BUFFER' )\n    end = Location( 2, 4, 'TEST_BUFFER' )\n    extent = Range( start, end )\n    diagnostic = Diagnostic( [], start, extent, 'cast', 'WARNING' )\n    return [ BuildDiagnosticData( diagnostic ) ]\n\n  with MockArbitraryBuffer( 'cpp' ):\n    with MockEventNotification( DiagnosticResponse ):\n      ycm.OnFileReadyToParse()\n      assert_that( ycm.FileParseRequestReady() )\n      ycm.HandleFileParseRequest()\n      assert_that(\n        test_utils.VIM_SIGNS,\n        contains_exactly(\n          VimSign( 2, 'YcmWarning', 1 )\n        )\n      )\n      assert_that( ycm.GetErrorCount(), equal_to( 0 ) )\n      assert_that( ycm.GetWarningCount(), equal_to( 1 ) )\n\n      # Consequent calls to HandleFileParseRequest shouldn't mess with\n      # existing diagnostics, when there is no new parse request.\n      ycm.HandleFileParseRequest()\n      assert_that(\n        test_utils.VIM_SIGNS,\n        contains_exactly(\n          VimSign( 2, 'YcmWarning', 1 )\n        )\n      )\n      assert_that( ycm.GetErrorCount(), equal_to( 0 ) )\n      assert_that( ycm.GetWarningCount(), equal_to( 1 ) )\n\n      assert_that( not ycm.ShouldResendFileParseRequest() )\n\n\ndef _Check_FileReadyToParse_Diagnostic_Clean( ycm ):\n  # Tests Vim sign unplacement and error/warning count python API\n  # when there are no errors/warnings left.\n  # Should be called after _Check_FileReadyToParse_Diagnostic_Warning\n  with MockArbitraryBuffer( 'cpp' ):\n    with MockEventNotification( MagicMock( return_value = [] ) ):\n      ycm.OnFileReadyToParse()\n      ycm.HandleFileParseRequest()\n      assert_that(\n        test_utils.VIM_SIGNS,\n        empty()\n      )\n      assert_that( ycm.GetErrorCount(), equal_to( 0 ) )\n      assert_that( ycm.GetWarningCount(), equal_to( 0 ) )\n      assert_that( not ycm.ShouldResendFileParseRequest() )\n\n\nclass EventNotificationTest( TestCase ):\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  @YouCompleteMeInstance()\n  def test_EventNotification_FileReadyToParse_NonDiagnostic_Error(\n      self, ycm, post_vim_message ):\n\n    # This test validates the behaviour of YouCompleteMe.HandleFileParseRequest\n    # in combination with YouCompleteMe.OnFileReadyToParse when the completer\n    # raises an exception handling FileReadyToParse event notification\n    ERROR_TEXT = 'Some completer response text'\n\n    def ErrorResponse( *args ):\n      raise ServerError( ERROR_TEXT )\n\n    with MockArbitraryBuffer( 'some_filetype' ):\n      with MockEventNotification( ErrorResponse ):\n        ycm.OnFileReadyToParse()\n        assert_that( ycm.FileParseRequestReady() )\n        ycm.HandleFileParseRequest()\n\n        # The first call raises a warning\n        post_vim_message.assert_has_exact_calls( [\n          call( ERROR_TEXT, truncate = True )\n        ] )\n\n        # Subsequent calls don't re-raise the warning\n        ycm.HandleFileParseRequest()\n        post_vim_message.assert_has_exact_calls( [\n          call( ERROR_TEXT, truncate = True )\n        ] )\n\n        assert_that( not ycm.ShouldResendFileParseRequest() )\n\n        # But it does if a subsequent event raises again\n        ycm.OnFileReadyToParse()\n        assert_that( ycm.FileParseRequestReady() )\n        ycm.HandleFileParseRequest()\n        post_vim_message.assert_has_exact_calls( [\n          call( ERROR_TEXT, truncate = True ),\n          call( ERROR_TEXT, truncate = True )\n        ] )\n\n        assert_that( not ycm.ShouldResendFileParseRequest() )\n\n\n  @YouCompleteMeInstance()\n  def test_EventNotification_FileReadyToParse_NonDiagnostic_Error_NonNative(\n    self, ycm ):\n\n    test_utils.VIM_MATCHES = []\n    test_utils.VIM_SIGNS = []\n\n    with MockArbitraryBuffer( 'some_filetype' ):\n      with MockEventNotification( None, False ):\n        ycm.OnFileReadyToParse()\n        ycm.HandleFileParseRequest()\n        assert_that( test_utils.VIM_MATCHES, empty() )\n        assert_that( test_utils.VIM_SIGNS, empty() )\n        assert_that( not ycm.ShouldResendFileParseRequest() )\n\n\n  @YouCompleteMeInstance()\n  def test_EventNotification_FileReadyToParse_NonDiagnostic_ConfirmExtraConf(\n      self, ycm ):\n\n    # This test validates the behaviour of YouCompleteMe.HandleFileParseRequest\n    # in combination with YouCompleteMe.OnFileReadyToParse when the completer\n    # raises the (special) UnknownExtraConf exception\n    FILE_NAME = 'a_file'\n    MESSAGE = ( 'Found ' + FILE_NAME + '. Load? \\n\\n(Question can be '\n                'turned off with options, see YCM docs)' )\n\n    def UnknownExtraConfResponse( *args ):\n      raise UnknownExtraConf( FILE_NAME )\n\n    with patch( 'ycm.client.base_request.BaseRequest.PostDataToHandler',\n                new_callable = ExtendedMock ) as post_data_to_handler:\n      with MockArbitraryBuffer( 'some_filetype' ):\n        with MockEventNotification( UnknownExtraConfResponse ):\n\n          # When the user accepts the extra conf, we load it\n          with patch( 'ycm.vimsupport.PresentDialog',\n                      return_value = 0,\n                      new_callable = ExtendedMock ) as present_dialog:\n            ycm.OnFileReadyToParse()\n            assert_that( ycm.FileParseRequestReady() )\n            ycm.HandleFileParseRequest()\n\n            present_dialog.assert_has_exact_calls( [\n              PresentDialog_Confirm_Call( MESSAGE ),\n            ] )\n            post_data_to_handler.assert_has_exact_calls( [\n              call( { 'filepath': FILE_NAME }, 'load_extra_conf_file' )\n            ] )\n\n            # Subsequent calls don't re-raise the warning\n            ycm.HandleFileParseRequest()\n\n            present_dialog.assert_has_exact_calls( [\n              PresentDialog_Confirm_Call( MESSAGE )\n            ] )\n            post_data_to_handler.assert_has_exact_calls( [\n              call( { 'filepath': FILE_NAME }, 'load_extra_conf_file' )\n            ] )\n\n            assert_that( ycm.ShouldResendFileParseRequest() )\n\n            # But it does if a subsequent event raises again\n            ycm.OnFileReadyToParse()\n            assert_that( ycm.FileParseRequestReady() )\n            ycm.HandleFileParseRequest()\n\n            present_dialog.assert_has_exact_calls( [\n              PresentDialog_Confirm_Call( MESSAGE ),\n              PresentDialog_Confirm_Call( MESSAGE ),\n            ] )\n            post_data_to_handler.assert_has_exact_calls( [\n              call( { 'filepath': FILE_NAME }, 'load_extra_conf_file' ),\n              call( { 'filepath': FILE_NAME }, 'load_extra_conf_file' )\n            ] )\n\n            assert_that( ycm.ShouldResendFileParseRequest() )\n\n          post_data_to_handler.reset_mock()\n\n          # When the user rejects the extra conf, we reject it\n          with patch( 'ycm.vimsupport.PresentDialog',\n                      return_value = 1,\n                      new_callable = ExtendedMock ) as present_dialog:\n            ycm.OnFileReadyToParse()\n            assert_that( ycm.FileParseRequestReady() )\n            ycm.HandleFileParseRequest()\n\n            present_dialog.assert_has_exact_calls( [\n              PresentDialog_Confirm_Call( MESSAGE ),\n            ] )\n            post_data_to_handler.assert_has_exact_calls( [\n              call( { 'filepath': FILE_NAME }, 'ignore_extra_conf_file' )\n            ] )\n\n            # Subsequent calls don't re-raise the warning\n            ycm.HandleFileParseRequest()\n\n            present_dialog.assert_has_exact_calls( [\n              PresentDialog_Confirm_Call( MESSAGE )\n            ] )\n            post_data_to_handler.assert_has_exact_calls( [\n              call( { 'filepath': FILE_NAME }, 'ignore_extra_conf_file' )\n            ] )\n\n            assert_that( ycm.ShouldResendFileParseRequest() )\n\n            # But it does if a subsequent event raises again\n            ycm.OnFileReadyToParse()\n            assert_that( ycm.FileParseRequestReady() )\n            ycm.HandleFileParseRequest()\n\n            present_dialog.assert_has_exact_calls( [\n              PresentDialog_Confirm_Call( MESSAGE ),\n              PresentDialog_Confirm_Call( MESSAGE ),\n            ] )\n            post_data_to_handler.assert_has_exact_calls( [\n              call( { 'filepath': FILE_NAME }, 'ignore_extra_conf_file' ),\n              call( { 'filepath': FILE_NAME }, 'ignore_extra_conf_file' )\n            ] )\n\n            assert_that( ycm.ShouldResendFileParseRequest() )\n\n\n  @YouCompleteMeInstance()\n  def test_EventNotification_FileReadyToParse_Diagnostic_Error_Native(\n      self, ycm ):\n    test_utils.VIM_SIGNS = []\n\n    _Check_FileReadyToParse_Diagnostic_Error( ycm )\n    _Check_FileReadyToParse_Diagnostic_Warning( ycm )\n    _Check_FileReadyToParse_Diagnostic_Clean( ycm )\n\n\n  @patch( 'ycm.youcompleteme.YouCompleteMe._AddUltiSnipsDataIfNeeded' )\n  @YouCompleteMeInstance( { 'g:ycm_collect_identifiers_from_tags_files': 1 } )\n  def test_EventNotification_FileReadyToParse_TagFiles_UnicodeWorkingDirectory(\n      self, ycm, *args ):\n    unicode_dir = PathToTestFile( 'uni¢od€' )\n    current_buffer_file = PathToTestFile( 'uni¢𐍈d€', 'current_buffer' )\n    current_buffer = VimBuffer( name = current_buffer_file,\n                                contents = [ 'current_buffer_contents' ],\n                                filetype = 'some_filetype' )\n\n    with patch( 'ycm.client.event_notification.EventNotification.'\n                'PostDataToHandlerAsync' ) as post_data_to_handler_async:\n      with CurrentWorkingDirectory( unicode_dir ):\n        with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 5 ) ):\n          ycm.OnFileReadyToParse()\n\n      assert_that(\n        # Positional arguments passed to PostDataToHandlerAsync.\n        post_data_to_handler_async.call_args[ 0 ],\n        contains_exactly(\n          has_entries( {\n            'filepath': current_buffer_file,\n            'line_num': 1,\n            'column_num': 6,\n            'file_data': has_entries( {\n              current_buffer_file: has_entries( {\n                'contents': 'current_buffer_contents\\n',\n                'filetypes': [ 'some_filetype' ]\n              } )\n            } ),\n            'event_name': 'FileReadyToParse',\n            'tag_files': has_item( PathToTestFile( 'uni¢od€', 'tags' ) )\n          } ),\n          'event_notification'\n        )\n      )\n\n\n  @patch( 'ycm.youcompleteme.YouCompleteMe._AddUltiSnipsDataIfNeeded' )\n  @YouCompleteMeInstance()\n  def test_EventNotification_BufferVisit_BuildRequestForCurrentAndUnsavedBuffers( # noqa\n      self, ycm, *args ):\n\n    current_buffer_file = os.path.realpath( 'current_buffer' )\n    current_buffer = VimBuffer( name = current_buffer_file,\n                                number = 1,\n                                contents = [ 'current_buffer_contents' ],\n                                filetype = 'some_filetype',\n                                modified = False )\n    modified_buffer_file = os.path.realpath( 'modified_buffer' )\n    modified_buffer = VimBuffer( name = modified_buffer_file,\n                                 number = 2,\n                                 contents = [ 'modified_buffer_contents' ],\n                                 filetype = 'some_filetype',\n                                 modified = True )\n\n    unmodified_buffer_file = os.path.realpath( 'unmodified_buffer' )\n    unmodified_buffer = VimBuffer( name = unmodified_buffer_file,\n                                   number = 3,\n                                   contents = [ 'unmodified_buffer_contents' ],\n                                   filetype = 'some_filetype',\n                                   modified = False )\n\n    with patch( 'ycm.client.event_notification.EventNotification.'\n                'PostDataToHandlerAsync' ) as post_data_to_handler_async:\n      with MockVimBuffers( [ current_buffer,\n                             modified_buffer,\n                             unmodified_buffer ],\n                           [ current_buffer ],\n                           ( 1, 5 ) ):\n        ycm.OnBufferVisit()\n\n      assert_that(\n        # Positional arguments passed to PostDataToHandlerAsync.\n        post_data_to_handler_async.call_args[ 0 ],\n        contains_exactly(\n          has_entries( {\n            'filepath': current_buffer_file,\n            'line_num': 1,\n            'column_num': 6,\n            'file_data': has_entries( {\n              current_buffer_file: has_entries( {\n                'contents': 'current_buffer_contents\\n',\n                'filetypes': [ 'some_filetype' ]\n              } ),\n              modified_buffer_file: has_entries( {\n                'contents': 'modified_buffer_contents\\n',\n                'filetypes': [ 'some_filetype' ]\n              } )\n            } ),\n            'event_name': 'BufferVisit'\n          } ),\n          'event_notification'\n        )\n      )\n\n\n  @YouCompleteMeInstance()\n  def test_EventNotification_BufferUnload_BuildRequestForDeletedAndUnsavedBuffers( # noqa\n      self, ycm ):\n    current_buffer_file = os.path.realpath( 'current_βuffer' )\n    current_buffer = VimBuffer( name = current_buffer_file,\n                                number = 1,\n                                contents = [ 'current_buffer_contents' ],\n                                filetype = 'some_filetype',\n                                modified = True )\n\n    deleted_buffer_file = os.path.realpath( 'deleted_βuffer' )\n    deleted_buffer = VimBuffer( name = deleted_buffer_file,\n                                number = 2,\n                                contents = [ 'deleted_buffer_contents' ],\n                                filetype = 'some_filetype',\n                                modified = False )\n\n    with patch( 'ycm.client.event_notification.EventNotification.'\n                'PostDataToHandlerAsync' ) as post_data_to_handler_async:\n      with MockVimBuffers( [ current_buffer, deleted_buffer ],\n                           [ current_buffer ] ):\n        ycm.OnBufferUnload( deleted_buffer.number )\n\n    assert_that(\n      # Positional arguments passed to PostDataToHandlerAsync.\n      post_data_to_handler_async.call_args[ 0 ],\n      contains_exactly(\n        has_entries( {\n          'filepath': deleted_buffer_file,\n          'line_num': 1,\n          'column_num': 1,\n          'file_data': has_entries( {\n            current_buffer_file: has_entries( {\n              'contents': 'current_buffer_contents\\n',\n              'filetypes': [ 'some_filetype' ]\n            } ),\n            deleted_buffer_file: has_entries( {\n              'contents': 'deleted_buffer_contents\\n',\n              'filetypes': [ 'some_filetype' ]\n            } )\n          } ),\n          'event_name': 'BufferUnload'\n        } ),\n        'event_notification'\n      )\n    )\n\n\n  @patch( 'ycm.vimsupport.CaptureVimCommand', return_value = \"\"\"\nfooGroup xxx foo bar\n             links to Statement\"\"\" )\n  @YouCompleteMeInstance( { 'g:ycm_seed_identifiers_with_syntax': 1 } )\n  def test_EventNotification_FileReadyToParse_SyntaxKeywords_SeedWithCache(\n      self, ycm, *args ):\n\n    current_buffer = VimBuffer( name = 'current_buffer',\n                                filetype = 'some_filetype' )\n\n    with patch( 'ycm.client.event_notification.EventNotification.'\n                'PostDataToHandlerAsync' ) as post_data_to_handler_async:\n      with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n        ycm.OnFileReadyToParse()\n        assert_that(\n          # Positional arguments passed to PostDataToHandlerAsync.\n          post_data_to_handler_async.call_args[ 0 ],\n          contains_exactly(\n            has_entry( 'syntax_keywords', has_items( 'foo', 'bar' ) ),\n            'event_notification'\n          )\n        )\n\n        # Do not send again syntax keywords in subsequent requests.\n        ycm.OnFileReadyToParse()\n        assert_that(\n          # Positional arguments passed to PostDataToHandlerAsync.\n          post_data_to_handler_async.call_args[ 0 ],\n          contains_exactly(\n            is_not( has_key( 'syntax_keywords' ) ),\n            'event_notification'\n          )\n        )\n\n\n  @patch( 'ycm.vimsupport.CaptureVimCommand', return_value = \"\"\"\nfooGroup xxx foo bar\n             links to Statement\"\"\" )\n  @YouCompleteMeInstance( { 'g:ycm_seed_identifiers_with_syntax': 1 } )\n  def test_EventNotification_FileReadyToParse_SyntaxKeywords_ClearCacheIfRestart( # noqa\n      self, ycm, *args ):\n\n    current_buffer = VimBuffer( name = 'current_buffer',\n                                filetype = 'some_filetype' )\n\n    with patch( 'ycm.client.event_notification.EventNotification.'\n                'PostDataToHandlerAsync' ) as post_data_to_handler_async:\n      with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n        ycm.OnFileReadyToParse()\n        assert_that(\n          # Positional arguments passed to PostDataToHandlerAsync.\n          post_data_to_handler_async.call_args[ 0 ],\n          contains_exactly(\n            has_entry( 'syntax_keywords', has_items( 'foo', 'bar' ) ),\n            'event_notification'\n          )\n        )\n\n        # Send again the syntax keywords after restarting the server.\n        ycm.RestartServer()\n        WaitUntilReady()\n        ycm.OnFileReadyToParse()\n        assert_that(\n          # Positional arguments passed to PostDataToHandlerAsync.\n          post_data_to_handler_async.call_args[ 0 ],\n          contains_exactly(\n            has_entry( 'syntax_keywords', has_items( 'foo', 'bar' ) ),\n            'event_notification'\n          )\n        )\n"
  },
  {
    "path": "python/ycm/tests/mock_utils.py",
    "content": "# Copyright (C) 2017 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\nimport json\nfrom unittest import mock\nHTTP_OK = 200\n\n\nclass FakeResponse:\n  \"\"\"A fake version of a requests response object, just about suitable for\n  mocking a server response. Not usually used directly. See\n  MockServerResponse* methods\"\"\"\n  def __init__( self, response, exception ):\n    self._json = response\n    self._exception = exception\n    self.code = HTTP_OK\n\n\n  def read( self ):\n    if self._exception:\n      raise self._exception\n    return json.dumps( self._json ).encode( 'utf-8' )\n\n\n  def close( self ):\n    pass\n\n\nclass FakeFuture:\n  \"\"\"A fake version of a future response object, just about suitable for\n  mocking a server response as generated by PostDataToHandlerAsync.\n  Not usually used directly. See MockAsyncServerResponse* methods\"\"\"\n  def __init__( self, done, response = None, exception = None ):\n    self._done = done\n\n    if not done:\n      self._result = None\n    else:\n      self._result = FakeResponse( response, exception )\n\n\n  def done( self ):\n    return self._done\n\n\n  def result( self ):\n    return self._result\n\n\ndef MockAsyncServerResponseDone( response ):\n  \"\"\"Return a MessagePoll containing a fake future object that is complete with\n  the supplied response message. Suitable for mocking a response future within\n  a client request. For example:\n\n  with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 1 ) ) as v:\n    mock_response = MockAsyncServerResponseDone( response )\n    with patch.dict( ycm._message_poll_requests, {} ):\n      ycm._message_poll_requests[ filetype ] = MessagesPoll( v.current.buffer )\n      ycm._message_poll_requests[ filetype ]._response_future = mock_response\n      # Needed to keep a reference to the mocked dictionary\n      mock_future = ycm._message_poll_requests[ filetype ]._response_future\n      ycm.OnPeriodicTick() # Uses ycm._message_poll_requests[ filetype ] ...\n  \"\"\"\n  return mock.MagicMock( wraps = FakeFuture( True, response ) )\n\n\ndef MockAsyncServerResponseInProgress():\n  \"\"\"Return a fake future object that is incomplete. Suitable for mocking a\n  response future within a client request. For example:\n\n  with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 1 ) ) as v:\n    mock_response = MockAsyncServerResponseInProgress()\n    with patch.dict( ycm._message_poll_requests, {} ):\n      ycm._message_poll_requests[ filetype ] = MessagesPoll( v.current.buffer )\n      ycm._message_poll_requests[ filetype ]._response_future = mock_response\n      # Needed to keep a reference to the mocked dictionary\n      mock_future = ycm._message_poll_requests[ filetype ]._response_future\n      ycm.OnPeriodicTick() # Uses ycm._message_poll_requests[ filetype ] ...\n  \"\"\"\n  return mock.MagicMock( wraps = FakeFuture( False ) )\n\n\ndef MockAsyncServerResponseException( exception ):\n  \"\"\"Return a fake future object that is complete, but raises an exception.\n  Suitable for mocking a response future within a client request. For example:\n\n  with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 1 ) ) as v:\n    mock_response = MockAsyncServerResponseException( exception )\n    with patch.dict( ycm._message_poll_requests, {} ):\n      ycm._message_poll_requests[ filetype ] = MessagesPoll( v.current.buffer )\n      ycm._message_poll_requests[ filetype ]._response_future = mock_response\n      # Needed to keep a reference to the mocked dictionary\n      mock_future = ycm._message_poll_requests[ filetype ]._response_future\n      ycm.OnPeriodicTick() # Uses ycm._message_poll_requests[ filetype ] ...\n  \"\"\"\n  return mock.MagicMock( wraps = FakeFuture( True, None, exception ) )\n\n\n# TODO: In future, implement MockServerResponse and MockServerResponseException\n# for synchronous cases when such test cases are needed.\n"
  },
  {
    "path": "python/ycm/tests/omni_completer_test.py",
    "content": "# encoding: utf-8\n#\n# Copyright (C) 2016-2019 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom hamcrest import assert_that, contains_exactly, empty, has_entries\nfrom unittest import TestCase\n\nfrom ycm.tests.test_utils import MockVimBuffers, MockVimModule, VimBuffer\nMockVimModule()\n\nfrom ycm import vimsupport\nfrom ycm.tests import YouCompleteMeInstance, youcompleteme_instance\n\nFILETYPE = 'ycmtest'\nTRIGGERS = {\n  'ycmtest': [ '.' ]\n}\n\n\ndef StartColumnCompliance( ycm,\n                           omnifunc_start_column,\n                           ycm_completions,\n                           ycm_start_column ):\n  def Omnifunc( findstart, base ):\n    if findstart:\n      return omnifunc_start_column\n    return [ 'foo' ]\n\n  current_buffer = VimBuffer( 'buffer',\n                              contents = [ 'fo' ],\n                              filetype = FILETYPE,\n                              omnifunc = Omnifunc )\n\n  with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 2 ) ):\n    ycm.SendCompletionRequest( force_semantic = True )\n    r = ycm.GetCompletionResponse()\n    assert_that(\n      r,\n      has_entries( {\n        'completions': ycm_completions,\n        'completion_start_column': ycm_start_column\n      } )\n    )\n\n\nclass OmniCompleterTest( TestCase ):\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_Cache_List( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [ 'a', 'b', 'cdef' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 5 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [\n            { 'word': 'a',    'equal': 1 },\n            { 'word': 'b',    'equal': 1 },\n            { 'word': 'cdef', 'equal': 1 }\n          ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_Cache_ListFilter( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [ 'a', 'b', 'cdef' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.t' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 6 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': empty(),\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 0,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_NoCache_List( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [ 'a', 'b', 'cdef' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 5 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [\n            { 'word': 'a',    'equal': 1 },\n            { 'word': 'b',    'equal': 1 },\n            { 'word': 'cdef', 'equal': 1 }\n          ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 0,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_NoCache_ListFilter( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [ 'a', 'b', 'cdef' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.t' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 6 ) ):\n      ycm.SendCompletionRequest()\n      # Actual result is that the results are not filtered, as we expect the\n      # omnifunc or vim itself to do this filtering.\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [\n            { 'word': 'a',    'equal': 1 },\n            { 'word': 'b',    'equal': 1 },\n            { 'word': 'cdef', 'equal': 1 }\n          ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 0,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_NoCache_UseFindStart( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 0\n      return [ 'a', 'b', 'cdef' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.t' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 6 ) ):\n      ycm.SendCompletionRequest()\n      # Actual result is that the results are not filtered, as we expect the\n      # omnifunc or vim itself to do this filtering.\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [\n            { 'word': 'a',    'equal': 1 },\n            { 'word': 'b',    'equal': 1 },\n            { 'word': 'cdef', 'equal': 1 }\n          ],\n          'completion_start_column': 1\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_Cache_UseFindStart( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 0\n      return [ 'a', 'b', 'cdef' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.t' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 6 ) ):\n      ycm.SendCompletionRequest()\n      # There are no results because the query 'test.t' doesn't match any\n      # candidate (and cache_omnifunc=1, so we FilterAndSortCandidates).\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': empty(),\n          'completion_start_column': 1\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_Cache_Object( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return { 'words': [ 'a', 'b', 'CDtEF' ] }\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.t' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 6 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [ { 'word': 'CDtEF', 'equal': 1 } ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_Cache_ObjectList( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [\n        {\n          'word': 'a',\n          'abbr': 'ABBR',\n          'menu': 'MENU',\n          'info': 'INFO',\n          'kind': 'K'\n        },\n        {\n          'word': 'test',\n          'abbr': 'ABBRTEST',\n          'menu': 'MENUTEST',\n          'info': 'INFOTEST',\n          'kind': 'T'\n        }\n      ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.tt' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 7 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': contains_exactly( {\n            'word' : 'test',\n            'abbr' : 'ABBRTEST',\n            'menu' : 'MENUTEST',\n            'info' : 'INFOTEST',\n            'kind' : 'T',\n            'equal': 1\n          } ),\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 0,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_NoCache_ObjectList( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [\n        {\n          'word': 'a',\n          'abbr': 'ABBR',\n          'menu': 'MENU',\n          'info': 'INFO',\n          'kind': 'K'\n        },\n        {\n          'word': 'test',\n          'abbr': 'ABBRTEST',\n          'menu': 'MENUTEST',\n          'info': 'INFOTEST',\n          'kind': 'T'\n        }\n      ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.tt' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 7 ) ):\n      ycm.SendCompletionRequest()\n      # We don't filter the result - we expect the omnifunc to do that\n      # based on the query we supplied (Note: that means no fuzzy matching!).\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [ {\n            'word' : 'a',\n            'abbr' : 'ABBR',\n            'menu' : 'MENU',\n            'info' : 'INFO',\n            'kind' : 'K',\n            'equal': 1\n          }, {\n            'word' : 'test',\n            'abbr' : 'ABBRTEST',\n            'menu' : 'MENUTEST',\n            'info' : 'INFOTEST',\n            'kind' : 'T',\n            'equal': 1\n          } ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_Cache_ObjectListObject( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return { 'words': [\n        {\n          'word': 'a',\n          'abbr': 'ABBR',\n          'menu': 'MENU',\n          'info': 'INFO',\n          'kind': 'K'\n        },\n        {\n          'word': 'test',\n          'abbr': 'ABBRTEST',\n          'menu': 'MENUTEST',\n          'info': 'INFOTEST',\n          'kind': 'T'\n        }\n      ] }\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.tt' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 7 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [ {\n            'word' : 'test',\n            'abbr' : 'ABBRTEST',\n            'menu' : 'MENUTEST',\n            'info' : 'INFOTEST',\n            'kind' : 'T',\n            'equal': 1\n          } ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 0,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_NoCache_ObjectListObject( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return { 'words': [\n        {\n          'word': 'a',\n          'abbr': 'ABBR',\n          'menu': 'MENU',\n          'info': 'INFO',\n          'kind': 'K'\n        },\n        {\n          'word': 'test',\n          'abbr': 'ABBRTEST',\n          'menu': 'MENUTEST',\n          'info': 'INFOTEST',\n          'kind': 'T'\n        }\n      ] }\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.tt' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 7 ) ):\n      ycm.SendCompletionRequest()\n      # No FilterAndSortCandidates for cache_omnifunc=0 (we expect the omnifunc\n      # to do the filtering?)\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [ {\n            'word' : 'a',\n            'abbr' : 'ABBR',\n            'menu' : 'MENU',\n            'info' : 'INFO',\n            'kind' : 'K',\n            'equal': 1\n          }, {\n            'word' : 'test',\n            'abbr' : 'ABBRTEST',\n            'menu' : 'MENUTEST',\n            'info' : 'INFOTEST',\n            'kind' : 'T',\n            'equal': 1\n          } ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_Cache_List_Unicode( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 12\n      return [ '†est', 'å_unicode_identifier', 'πππππππ yummy πie' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ '†åsty_π.' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 12 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [\n            { 'word': 'å_unicode_identifier', 'equal': 1 },\n            { 'word': 'πππππππ yummy πie',    'equal': 1 },\n            { 'word': '†est',                 'equal': 1 }\n          ],\n          'completion_start_column': 13\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 0,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_NoCache_List_Unicode( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 12\n      return [ '†est', 'å_unicode_identifier', 'πππππππ yummy πie' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ '†åsty_π.' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 12 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [\n            { 'word': '†est',                 'equal': 1 },\n            { 'word': 'å_unicode_identifier', 'equal': 1 },\n            { 'word': 'πππππππ yummy πie',    'equal': 1 }\n          ],\n          'completion_start_column': 13\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_Cache_List_Filter_Unicode( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 12\n      return [ '†est', 'å_unicode_identifier', 'πππππππ yummy πie' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ '†åsty_π.ππ' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 17 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [ { 'word': 'πππππππ yummy πie', 'equal': 1 } ],\n          'completion_start_column': 13\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 0,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_NoCache_List_Filter_Unicode(\n      self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 12\n      return [ 'πππππππ yummy πie' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ '†åsty_π.ππ' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 17 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [ { 'word': 'πππππππ yummy πie', 'equal': 1 } ],\n          'completion_start_column': 13\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_Cache_ObjectList_Unicode( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 12\n      return [\n        {\n          'word': 'ålpha∫et',\n          'abbr': 'å∫∫®',\n          'menu': 'µ´~¨á',\n          'info': '^~fo',\n          'kind': '˚'\n        },\n        {\n          'word': 'π†´ß†π',\n          'abbr': 'ÅııÂÊ‰ÍÊ',\n          'menu': '˜‰ˆËÊ‰ÍÊ',\n          'info': 'ÈˆÏØÊ‰ÍÊ',\n          'kind': 'Ê'\n        }\n      ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ '†åsty_π.ππ' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 17 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [ {\n            'word' : 'π†´ß†π',\n            'abbr' : 'ÅııÂÊ‰ÍÊ',\n            'menu' : '˜‰ˆËÊ‰ÍÊ',\n            'info' : 'ÈˆÏØÊ‰ÍÊ',\n            'kind' : 'Ê',\n            'equal': 1\n          } ],\n          'completion_start_column': 13\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_Cache_ObjectListObject_Unicode(\n      self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 12\n      return {\n        'words': [\n          {\n            'word': 'ålpha∫et',\n            'abbr': 'å∫∫®',\n            'menu': 'µ´~¨á',\n            'info': '^~fo',\n            'kind': '˚'\n          },\n          {\n            'word': 'π†´ß†π',\n            'abbr': 'ÅııÂÊ‰ÍÊ',\n            'menu': '˜‰ˆËÊ‰ÍÊ',\n            'info': 'ÈˆÏØÊ‰ÍÊ',\n            'kind': 'Ê'\n          },\n          {\n            'word': 'test',\n            'abbr': 'ÅııÂÊ‰ÍÊ',\n            'menu': '˜‰ˆËÊ‰ÍÊ',\n            'info': 'ÈˆÏØÊ‰ÍÊ',\n            'kind': 'Ê'\n          }\n        ]\n      }\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ '†åsty_π.t' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 13 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': contains_exactly( {\n            'word' : 'test',\n            'abbr' : 'ÅııÂÊ‰ÍÊ',\n            'menu' : '˜‰ˆËÊ‰ÍÊ',\n            'info' : 'ÈˆÏØÊ‰ÍÊ',\n            'kind' : 'Ê',\n            'equal': 1\n          }, {\n            'word' : 'ålpha∫et',\n            'abbr' : 'å∫∫®',\n            'menu' : 'µ´~¨á',\n            'info' : '^~fo',\n            'kind' : '˚',\n            'equal': 1\n          } ),\n          'completion_start_column': 13\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_RestoreCursorPositionAfterOmnifuncCall(\n    self, ycm ):\n\n    # This omnifunc moves the cursor to the test definition like\n    # ccomplete#Complete would.\n    def Omnifunc( findstart, base ):\n      vimsupport.SetCurrentLineAndColumn( 0, 0 )\n      if findstart:\n        return 5\n      return [ 'length' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'String test',\n                                             '',\n                                             'test.' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 3, 5 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        vimsupport.CurrentLineAndColumn(),\n        contains_exactly( 2, 5 )\n      )\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [ { 'word': 'length', 'equal': 1 } ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_MoveCursorPositionAtStartColumn(\n      self, ycm ):\n    # This omnifunc relies on the cursor being moved at the start column when\n    # called the second time like LanguageClient#complete from the\n    # LanguageClient-neovim plugin.\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      if vimsupport.CurrentColumn() == 5:\n        return [ 'length' ]\n      return []\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'String test',\n                                             '',\n                                             'test.le' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 3, 7 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        vimsupport.CurrentLineAndColumn(),\n        contains_exactly( 2, 7 )\n      )\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [ { 'word': 'length', 'equal': 1 } ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  def test_OmniCompleter_GetCompletions_StartColumnCompliance( self ):\n    for omnifunc_start_column, ycm_completions, ycm_start_column in [\n     [ -4, [ { 'word': 'foo', 'equal': 1 } ], 3 ],\n     [ -3, [],                                1 ],\n     [ -2, [],                                1 ],\n     [ -1, [ { 'word': 'foo', 'equal': 1 } ], 3 ],\n     [ 0, [ { 'word': 'foo', 'equal': 1 } ], 1 ],\n     [ 1, [ { 'word': 'foo', 'equal': 1 } ], 2 ],\n     [ 2, [ { 'word': 'foo', 'equal': 1 } ], 3 ],\n     [ 3, [ { 'word': 'foo', 'equal': 1 } ], 3 ]\n      ]:\n      with youcompleteme_instance( { 'g:ycm_cache_omnifunc': 1 } ) as ycm:\n        with self.subTest( omnifunc_start_column = omnifunc_start_column,\n                           ycm_completions = ycm_completions,\n                           ycm_start_column = ycm_start_column ):\n          StartColumnCompliance( ycm,\n                                 omnifunc_start_column,\n                                 ycm_completions,\n                                 ycm_start_column )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 0,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_NoCache_NoSemanticTrigger( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 0\n      return [ 'test' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'te' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 3 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': empty(),\n          'completion_start_column': 1\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 0,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_NoCache_ForceSemantic( self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 0\n      return [ 'test' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'te' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 3 ) ):\n      ycm.SendCompletionRequest( force_semantic = True )\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [ { 'word': 'test', 'equal': 1 } ],\n          'completion_start_column': 1\n        } )\n      )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_cache_omnifunc': 1,\n                            'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_ConvertStringsToDictionaries(\n      self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [\n        { 'word': 'a' },\n        'b'\n      ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 7 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [\n            { 'word': 'a', 'equal': 1 },\n            { 'word': 'b', 'equal': 1 }\n          ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( {\n    'g:ycm_cache_omnifunc': 0,\n    'g:ycm_filetype_specific_completion_to_disable': { FILETYPE: 1 },\n    'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_FiletypeDisabled_SemanticTrigger(\n      self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [ 'a', 'b', 'cdef' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 6 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': empty(),\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( {\n    'g:ycm_cache_omnifunc': 0,\n    'g:ycm_filetype_specific_completion_to_disable': { '*': 1 },\n    'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_AllFiletypesDisabled_SemanticTrigger(\n    self, ycm ):\n\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [ 'a', 'b', 'cdef' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 6 ) ):\n      ycm.SendCompletionRequest()\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': empty(),\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( {\n    'g:ycm_cache_omnifunc': 0,\n    'g:ycm_filetype_specific_completion_to_disable': { FILETYPE: 1 },\n    'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_FiletypeDisabled_ForceSemantic(\n      self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [ 'a', 'b', 'cdef' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 6 ) ):\n      ycm.SendCompletionRequest( force_semantic = True )\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [\n            { 'word': 'a',    'equal': 1 },\n            { 'word': 'b',    'equal': 1 },\n            { 'word': 'cdef', 'equal': 1 }\n          ],\n          'completion_start_column': 6\n        } )\n      )\n\n\n  @YouCompleteMeInstance( {\n    'g:ycm_cache_omnifunc': 0,\n    'g:ycm_filetype_specific_completion_to_disable': { '*': 1 },\n    'g:ycm_semantic_triggers': TRIGGERS } )\n  def test_OmniCompleter_GetCompletions_AllFiletypesDisabled_ForceSemantic(\n      self, ycm ):\n    def Omnifunc( findstart, base ):\n      if findstart:\n        return 5\n      return [ 'a', 'b', 'cdef' ]\n\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'test.' ],\n                                filetype = FILETYPE,\n                                omnifunc = Omnifunc )\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 6 ) ):\n      ycm.SendCompletionRequest( force_semantic = True )\n      assert_that(\n        ycm.GetCompletionResponse(),\n        has_entries( {\n          'completions': [\n            { 'word': 'a',    'equal': 1 },\n            { 'word': 'b',    'equal': 1 },\n            { 'word': 'cdef', 'equal': 1 }\n          ],\n          'completion_start_column': 6\n        } )\n      )\n"
  },
  {
    "path": "python/ycm/tests/paths_test.py",
    "content": "# Copyright (C) 2016-2017 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.tests.test_utils import MockVimModule\nMockVimModule()\n\nfrom hamcrest import assert_that\nfrom unittest import TestCase\nfrom ycm.paths import _EndsWithPython\n\n\ndef EndsWithPython_Good( path ):\n  assert_that( _EndsWithPython( path ),\n              f'Path { path } does not end with a Python name.' )\n\n\ndef EndsWithPython_Bad( path ):\n  assert_that( not _EndsWithPython( path ),\n              f'Path { path } does end with a Python name.' )\n\n\nclass PathTest( TestCase ):\n  def test_EndsWithPython_Python3Paths( self ):\n    for path in [\n      'python3',\n      '/usr/bin/python3.6',\n      '/home/user/.pyenv/shims/python3.6',\n      r'C:\\Python36\\python.exe'\n    ]:\n      with self.subTest( path = path ):\n        EndsWithPython_Good( path )\n\n\n  def test_EndsWithPython_BadPaths( self ):\n    for path in [\n      None,\n      '',\n      '/opt/local/bin/vim',\n      r'C:\\Program Files\\Vim\\vim74\\gvim.exe',\n      '/usr/bin/python2.7',\n      '/home/user/.pyenv/shims/python3.2',\n    ]:\n      with self.subTest( path = path ):\n        EndsWithPython_Bad( path )\n"
  },
  {
    "path": "python/ycm/tests/postcomplete_test.py",
    "content": "# encoding: utf-8\n#\n# Copyright (C) 2015-2016 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.tests.test_utils import MockVimModule\nMockVimModule()\n\nimport contextlib\nimport json\nfrom hamcrest import assert_that, contains_exactly, empty, equal_to, none\nfrom unittest import TestCase\nfrom unittest.mock import MagicMock, DEFAULT, patch\n\nfrom ycm import vimsupport\nfrom ycmd.utils import ToBytes\nfrom ycm.client.completion_request import ( CompletionRequest,\n                                            _FilterToMatchingCompletions,\n                                            _GetRequiredNamespaceImport )\nfrom ycm.client.omni_completion_request import OmniCompletionRequest\n\n\ndef CompleteItemIs( word, abbr = None, menu = None,\n                    info = None, kind = None, **kwargs ):\n  item = {\n    'word': ToBytes( word ),\n    'abbr': ToBytes( abbr ),\n    'menu': ToBytes( menu ),\n    'info': ToBytes( info ),\n    'kind': ToBytes( kind ),\n  }\n  item.update( **kwargs )\n  return item\n\n\ndef GetVariableValue_CompleteItemIs( word, abbr = None, menu = None,\n                                     info = None, kind = None, **kwargs ):\n  def Result( variable ):\n    if variable == 'v:completed_item':\n      return CompleteItemIs( word, abbr, menu, info, kind, **kwargs )\n    return DEFAULT\n  return MagicMock( side_effect = Result )\n\n\ndef BuildCompletion( insertion_text = 'Test',\n                     menu_text = None,\n                     extra_menu_info = None,\n                     detailed_info = None,\n                     kind = None,\n                     extra_data = None ):\n  completion = {\n    'insertion_text': insertion_text\n  }\n\n  if extra_menu_info:\n    completion[ 'extra_menu_info' ] = extra_menu_info\n  if menu_text:\n    completion[ 'menu_text' ] = menu_text\n  if detailed_info:\n    completion[ 'detailed_info' ] = detailed_info\n  if kind:\n    completion[ 'kind' ] = kind\n  if extra_data:\n    completion[ 'extra_data' ] = extra_data\n  return completion\n\n\ndef BuildCompletionNamespace( namespace = None,\n                              insertion_text = 'Test',\n                              menu_text = None,\n                              extra_menu_info = None,\n                              detailed_info = None,\n                              kind = None ):\n  return BuildCompletion( insertion_text = insertion_text,\n                          menu_text = menu_text,\n                          extra_menu_info = extra_menu_info,\n                          detailed_info = detailed_info,\n                          kind = kind,\n                          extra_data = {\n                            'required_namespace_import': namespace\n                          } )\n\n\ndef BuildCompletionFixIt( fixits,\n                          insertion_text = 'Test',\n                          menu_text = None,\n                          extra_menu_info = None,\n                          detailed_info = None,\n                          kind = None ):\n  return BuildCompletion( insertion_text = insertion_text,\n                          menu_text = menu_text,\n                          extra_menu_info = extra_menu_info,\n                          detailed_info = detailed_info,\n                          kind = kind,\n                          extra_data = {\n                            'fixits': fixits,\n                          } )\n\n\n@contextlib.contextmanager\ndef _SetupForCsharpCompletionDone( completions ):\n  with patch( 'ycm.vimsupport.InsertNamespace' ):\n    with _SetUpCompleteDone( completions ) as request:\n      yield request\n\n\n@contextlib.contextmanager\ndef _SetUpCompleteDone( completions ):\n  with patch( 'ycm.vimsupport.TextBeforeCursor', return_value = '   Test' ):\n    request = CompletionRequest( None )\n    request.Done = MagicMock( return_value = True )\n    request._RawResponse = MagicMock( return_value = {\n      'completions': completions\n    } )\n    yield request\n\n\nclass PostcompleteTest( TestCase ):\n  @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'ycmtest' ] )\n  def test_OnCompleteDone_DefaultFixIt( self, *args ):\n    request = CompletionRequest( None )\n    request.Done = MagicMock( return_value = True )\n    request._OnCompleteDone_Csharp = MagicMock()\n    request._OnCompleteDone_FixIt = MagicMock()\n    request.OnCompleteDone()\n    request._OnCompleteDone_Csharp.assert_not_called()\n    request._OnCompleteDone_FixIt.assert_called_once_with()\n\n\n  @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'cs' ] )\n  def test_OnCompleteDone_CsharpFixIt( self, *args ):\n    request = CompletionRequest( None )\n    request.Done = MagicMock( return_value = True )\n    request._OnCompleteDone_Csharp = MagicMock()\n    request._OnCompleteDone_FixIt = MagicMock()\n    request.OnCompleteDone()\n    request._OnCompleteDone_Csharp.assert_called_once_with()\n    request._OnCompleteDone_FixIt.assert_not_called()\n\n\n  @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'ycmtest' ] )\n  def test_OnCompleteDone_NoFixItIfNotDone( self, *args ):\n    request = CompletionRequest( None )\n    request.Done = MagicMock( return_value = False )\n    request._OnCompleteDone_Csharp = MagicMock()\n    request._OnCompleteDone_FixIt = MagicMock()\n    request.OnCompleteDone()\n    request._OnCompleteDone_Csharp.assert_not_called()\n    request._OnCompleteDone_FixIt.assert_not_called()\n\n\n  @patch( 'ycm.vimsupport.CurrentFiletypes', return_value = [ 'ycmtest' ] )\n  def test_OnCompleteDone_NoFixItForOmnifunc( self, *args ):\n    request = OmniCompletionRequest( 'omnifunc', None )\n    request.Done = MagicMock( return_value = True )\n    request._OnCompleteDone_Csharp = MagicMock()\n    request._OnCompleteDone_FixIt = MagicMock()\n    request.OnCompleteDone()\n    request._OnCompleteDone_Csharp.assert_not_called()\n    request._OnCompleteDone_FixIt.assert_not_called()\n\n\n  def test_FilterToCompletedCompletions_MatchIsReturned( self ):\n    completions = [ BuildCompletion( insertion_text = 'Test' ) ]\n    result = _FilterToMatchingCompletions( CompleteItemIs( 'Test' ),\n                                           completions )\n    assert_that( list( result ), contains_exactly( {} ) )\n\n\n  def test_FilterToCompletedCompletions_ShortTextDoesntRaise( self ):\n    completions = [ BuildCompletion( insertion_text = 'AAA' ) ]\n    result = _FilterToMatchingCompletions( CompleteItemIs( 'A' ), completions )\n    assert_that( list( result ), empty() )\n\n\n  def test_FilterToCompletedCompletions_ExactMatchIsReturned( self ):\n    completions = [ BuildCompletion( insertion_text = 'Test' ) ]\n    result = _FilterToMatchingCompletions( CompleteItemIs( 'Test' ),\n                                           completions )\n    assert_that( list( result ), contains_exactly( {} ) )\n\n\n  def test_FilterToCompletedCompletions_NonMatchIsntReturned( self ):\n    completions = [ BuildCompletion( insertion_text = 'A' ) ]\n    result = _FilterToMatchingCompletions( CompleteItemIs( '   Quote' ),\n                                           completions )\n    assert_that( list( result ), empty() )\n\n\n  def test_FilterToCompletedCompletions_Unicode( self ):\n    completions = [ BuildCompletion( insertion_text = '†es†' ) ]\n    result = _FilterToMatchingCompletions( CompleteItemIs( '†es†' ),\n                                           completions )\n    assert_that( list( result ), contains_exactly( {} ) )\n\n\n  def test_GetRequiredNamespaceImport_ReturnNoneForNoExtraData( self ):\n    assert_that( _GetRequiredNamespaceImport( {} ), none() )\n\n\n  def test_GetRequiredNamespaceImport_ReturnNamespaceFromExtraData( self ):\n    namespace = 'A_NAMESPACE'\n    assert_that( _GetRequiredNamespaceImport(\n                     BuildCompletionNamespace( namespace )[ 'extra_data' ] ),\n                 equal_to( namespace ) )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Te' ) )\n  def test_GetExtraDataUserMayHaveCompleted_ReturnEmptyIfPendingMatches(\n      *args ):\n    completions = [ BuildCompletionNamespace( None ) ]\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      assert_that( request._GetExtraDataUserMayHaveCompleted(), empty() )\n\n\n  def test_GetExtraDataUserMayHaveCompleted_ReturnMatchIfExactMatches(\n      self, *args ):\n    info = [ 'NS', 'Test', 'Abbr', 'Menu', 'Info', 'Kind' ]\n    completions = [ BuildCompletionNamespace( *info ) ]\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      with patch( 'ycm.vimsupport.GetVariableValue',\n                  GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):\n        assert_that( request._GetExtraDataUserMayHaveCompleted(),\n                     contains_exactly( completions[ 0 ][ 'extra_data' ] ) )\n\n\n  def test_GetExtraDataUserMayHaveCompleted_ReturnMatchIfExactMatchesEvenIfPartial( self ): # noqa\n    info = [ 'NS', 'Test', 'Abbr', 'Menu', 'Info', 'Kind' ]\n    completions = [ BuildCompletionNamespace( *info ),\n                    BuildCompletion( insertion_text = 'TestTest' ) ]\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      with patch( 'ycm.vimsupport.GetVariableValue',\n                  GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):\n        assert_that( request._GetExtraDataUserMayHaveCompleted(),\n                     contains_exactly( completions[ 0 ][ 'extra_data' ] ) )\n\n\n  def test_GetExtraDataUserMayHaveCompleted_DontReturnMatchIfNoExactMatchesAndPartial( self ): # noqa\n    info = [ 'NS', 'Test', 'Abbr', 'Menu', 'Info', 'Kind' ]\n    completions = [ BuildCompletion( insertion_text = info[ 0 ] ),\n                    BuildCompletion( insertion_text = 'TestTest' ) ]\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      with patch( 'ycm.vimsupport.GetVariableValue',\n                  GetVariableValue_CompleteItemIs( *info[ 1: ] ) ):\n        assert_that( request._GetExtraDataUserMayHaveCompleted(), empty() )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Test' ) )\n  def test_GetExtraDataUserMayHaveCompleted_ReturnMatchIfMatches( self, *args ):\n    completions = [ BuildCompletionNamespace( None ) ]\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      assert_that( request._GetExtraDataUserMayHaveCompleted(),\n                   contains_exactly( completions[ 0 ][ 'extra_data' ] ) )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs(\n            'Test',\n            user_data=json.dumps( {\n              'required_namespace_import': 'namespace1' } ) ) )\n  def test_GetExtraDataUserMayHaveCompleted_UseUserData0( self, *args ):\n    # Identical completions but we specify the first one via user_data.\n    completions = [\n      BuildCompletionNamespace( 'namespace1' ),\n      BuildCompletionNamespace( 'namespace2' )\n    ]\n\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      assert_that(\n          request._GetExtraDataUserMayHaveCompleted(),\n          contains_exactly(\n            BuildCompletionNamespace( 'namespace1' )[ 'extra_data' ] ) )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs(\n            'Test',\n            user_data=json.dumps( {\n              'required_namespace_import': 'namespace2' } ) ) )\n  def test_GetExtraDataUserMayHaveCompleted_UseUserData1( self, *args ):\n    # Identical completions but we specify the second one via user_data.\n    completions = [\n      BuildCompletionNamespace( 'namespace1' ),\n      BuildCompletionNamespace( 'namespace2' )\n    ]\n\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      assert_that(\n          request._GetExtraDataUserMayHaveCompleted(),\n          contains_exactly(\n            BuildCompletionNamespace( 'namespace2' )[ 'extra_data' ] ) )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Test', user_data='' ) )\n  def test_GetExtraDataUserMayHaveCompleted_EmptyUserData( self, *args ):\n    # Identical completions but none is selected.\n    completions = [\n      BuildCompletionNamespace( 'namespace1' ),\n      BuildCompletionNamespace( 'namespace2' )\n    ]\n\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      assert_that( request._GetExtraDataUserMayHaveCompleted(), empty() )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Test' ) )\n  def test_PostCompleteCsharp_EmptyDoesntInsertNamespace( self, *args ):\n    with _SetupForCsharpCompletionDone( [] ) as request:\n      request._OnCompleteDone_Csharp()\n      assert_that( not vimsupport.InsertNamespace.called )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Test' ) )\n  def test_PostCompleteCsharp_ExistingWithoutNamespaceDoesntInsertNamespace(\n      self, *args ):\n    completions = [ BuildCompletionNamespace( None ) ]\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      request._OnCompleteDone_Csharp()\n      assert_that( not vimsupport.InsertNamespace.called )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Test' ) )\n  def test_PostCompleteCsharp_ValueDoesInsertNamespace( self, *args ):\n    namespace = 'A_NAMESPACE'\n    completions = [ BuildCompletionNamespace( namespace ) ]\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      request._OnCompleteDone_Csharp()\n      vimsupport.InsertNamespace.assert_called_once_with( namespace )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Test' ) )\n  @patch( 'ycm.vimsupport.PresentDialog', return_value = 1 )\n  def test_PostCompleteCsharp_InsertSecondNamespaceIfSelected( self, *args ):\n    namespace = 'A_NAMESPACE'\n    namespace2 = 'ANOTHER_NAMESPACE'\n    completions = [\n      BuildCompletionNamespace( namespace ),\n      BuildCompletionNamespace( namespace2 ),\n    ]\n    with _SetupForCsharpCompletionDone( completions ) as request:\n      request._OnCompleteDone_Csharp()\n      vimsupport.InsertNamespace.assert_called_once_with( namespace2 )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Test' ) )\n  @patch( 'ycm.vimsupport.ReplaceChunks' )\n  def test_PostCompleteFixIt_ApplyFixIt_NoFixIts( self, replace_chunks, *args ):\n    completions = [\n      BuildCompletionFixIt( [] )\n    ]\n    with _SetUpCompleteDone( completions ) as request:\n      request._OnCompleteDone_FixIt()\n      replace_chunks.assert_not_called()\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Test' ) )\n  @patch( 'ycm.vimsupport.ReplaceChunks' )\n  def test_PostCompleteFixIt_ApplyFixIt_EmptyFixIt(\n      self, replace_chunks, *args ):\n    completions = [\n      BuildCompletionFixIt( [ { 'chunks': [] } ] )\n    ]\n    with _SetUpCompleteDone( completions ) as request:\n      request._OnCompleteDone_FixIt()\n      replace_chunks.assert_called_once_with( [], silent = True )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Test' ) )\n  @patch( 'ycm.vimsupport.ReplaceChunks' )\n  def test_PostCompleteFixIt_ApplyFixIt_NoFixIt( self, replace_chunks, *args ):\n    completions = [\n      BuildCompletion()\n    ]\n    with _SetUpCompleteDone( completions ) as request:\n      request._OnCompleteDone_FixIt()\n      replace_chunks.assert_not_called()\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs( 'Test' ) )\n  @patch( 'ycm.vimsupport.ReplaceChunks' )\n  def test_PostCompleteFixIt_ApplyFixIt_PickFirst(\n      self, replace_chunks, *args ):\n    completions = [\n      BuildCompletionFixIt( [ { 'chunks': 'one' } ] ),\n      BuildCompletionFixIt( [ { 'chunks': 'two' } ] ),\n    ]\n    with _SetUpCompleteDone( completions ) as request:\n      request._OnCompleteDone_FixIt()\n      replace_chunks.assert_called_once_with( 'one', silent = True )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs(\n            'Test',\n            user_data=json.dumps( { 'fixits': [ { 'chunks': 'one' } ] } ) ) )\n  @patch( 'ycm.vimsupport.ReplaceChunks' )\n  def test_PostCompleteFixIt_ApplyFixIt_PickFirstUserData( self,\n                                                           replace_chunks,\n                                                           *args ):\n    completions = [\n      BuildCompletionFixIt( [ { 'chunks': 'one' } ] ),\n      BuildCompletionFixIt( [ { 'chunks': 'two' } ] ),\n    ]\n    with _SetUpCompleteDone( completions ) as request:\n      request._OnCompleteDone_FixIt()\n      replace_chunks.assert_called_once_with( 'one', silent = True )\n\n\n  @patch( 'ycm.vimsupport.GetVariableValue',\n          GetVariableValue_CompleteItemIs(\n            'Test',\n            user_data=json.dumps( { 'fixits': [ { 'chunks': 'two' } ] } ) ) )\n  @patch( 'ycm.vimsupport.ReplaceChunks' )\n  def test_PostCompleteFixIt_ApplyFixIt_PickSecond(\n      self, replace_chunks, *args ):\n    completions = [\n      BuildCompletionFixIt( [ { 'chunks': 'one' } ] ),\n      BuildCompletionFixIt( [ { 'chunks': 'two' } ] ),\n    ]\n    with _SetUpCompleteDone( completions ) as request:\n      request._OnCompleteDone_FixIt()\n      replace_chunks.assert_called_once_with( 'two', silent = True )\n"
  },
  {
    "path": "python/ycm/tests/signature_help_test.py",
    "content": "# Copyright (C) 2019 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom hamcrest import ( assert_that,\n                       empty )\nfrom unittest import TestCase\nfrom ycm import signature_help as sh\n\n\nclass SignatureHelpTest( TestCase ):\n  def test_MakeSignatureHelpBuffer_Empty( self ):\n    assert_that( sh._MakeSignatureHelpBuffer( {} ), empty() )\n    assert_that( sh._MakeSignatureHelpBuffer( {\n      'activeSignature': 0,\n      'activeParameter': 0,\n      'signatures': []\n    } ), empty() )\n    assert_that( sh._MakeSignatureHelpBuffer( {\n      'activeSignature': 0,\n      'activeParameter': 0,\n    } ), empty() )\n    assert_that( sh._MakeSignatureHelpBuffer( {\n      'signatures': []\n    } ), empty() )\n"
  },
  {
    "path": "python/ycm/tests/syntax_parse_test.py",
    "content": "# Copyright (C) 2013 Google Inc.\n#               2016 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.tests.test_utils import MockVimModule\nMockVimModule()\n\nimport os\nfrom hamcrest import assert_that, contains_inanyorder, has_item, has_items\nfrom unittest import TestCase\nfrom ycm import syntax_parse\nfrom ycmd.utils import ReadFile\n\n\ndef ContentsOfTestFile( test_file ):\n  dir_of_script = os.path.dirname( os.path.abspath( __file__ ) )\n  full_path_to_test_file = os.path.join( dir_of_script, 'testdata', test_file )\n  return ReadFile( full_path_to_test_file )\n\n\nclass SyntaxTest( TestCase ):\n  def test_KeywordsFromSyntaxListOutput_PythonSyntax( self ):\n    expected_keywords = ( 'bytearray', 'IndexError', 'all', 'help', 'vars',\n        'SyntaxError', 'global', 'elif', 'unicode', 'sorted', 'memoryview',\n        'isinstance', 'except', 'nonlocal', 'NameError', 'finally',\n        'BytesWarning', 'dict', 'IOError', 'pass', 'oct', 'bin', 'SystemExit',\n        'return', 'StandardError', 'format', 'TabError', 'break', 'next',\n        'not', 'UnicodeDecodeError', 'False', 'RuntimeWarning', 'list', 'iter',\n        'try', 'reload', 'Warning', 'round', 'dir', 'cmp', 'set', 'bytes',\n        'UnicodeTranslateError', 'intern', 'issubclass', 'yield', 'Ellipsis',\n        'hash', 'locals', 'BufferError', 'slice', 'for', 'FloatingPointError',\n        'sum', 'VMSError', 'getattr', 'abs', 'print', 'import', 'True',\n        'FutureWarning', 'ImportWarning', 'None', 'EOFError', 'len',\n        'frozenset', 'ord', 'super', 'raise', 'TypeError', 'KeyboardInterrupt',\n        'UserWarning', 'filter', 'range', 'staticmethod', 'SystemError', 'or',\n        'BaseException', 'pow', 'RuntimeError', 'float', 'MemoryError',\n        'StopIteration', 'globals', 'divmod', 'enumerate', 'apply',\n        'LookupError', 'open', 'basestring', 'from', 'UnicodeError', 'zip',\n        'hex', 'long', 'IndentationError', 'int', 'chr', '__import__', 'type',\n        'Exception', 'continue', 'tuple', 'reduce', 'reversed', 'else',\n        'assert', 'UnicodeEncodeError', 'input', 'with', 'hasattr', 'delattr',\n        'setattr', 'raw_input', 'PendingDeprecationWarning', 'compile',\n        'ArithmeticError', 'while', 'del', 'str', 'property', 'def', 'and',\n        'GeneratorExit', 'ImportError', 'xrange', 'is', 'EnvironmentError',\n        'KeyError', 'coerce', 'SyntaxWarning', 'file', 'in', 'unichr', 'ascii',\n        'any', 'as', 'if', 'OSError', 'DeprecationWarning', 'min',\n        'UnicodeWarning', 'execfile', 'id', 'complex', 'bool', 'ValueError',\n        'NotImplemented', 'map', 'exec', 'buffer', 'max', 'class', 'object',\n        'repr', 'callable', 'ZeroDivisionError', 'eval', '__debug__',\n        'ReferenceError', 'AssertionError', 'classmethod', 'UnboundLocalError',\n        'NotImplementedError', 'lambda', 'AttributeError', 'OverflowError',\n        'WindowsError' )\n\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput(\n                     ContentsOfTestFile( 'python_syntax' ) ),\n                 contains_inanyorder( *expected_keywords ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_CppSyntax( self ):\n    expected_keywords = (\n      'int_fast32_t', 'FILE', 'size_t', 'bitor', 'typedef', 'const', 'struct',\n      'uint8_t', 'fpos_t', 'thread_local', 'unsigned', 'uint_least16_t', 'do',\n      'intptr_t', 'uint_least64_t', 'return', 'auto', 'void', '_Complex',\n      'break', '_Alignof', 'not', 'using', '_Static_assert', '_Thread_local',\n      'public', 'uint_fast16_t', 'this', 'continue', 'char32_t', 'int16_t',\n      'intmax_t', 'static', 'clock_t', 'sizeof', 'int_fast64_t', 'mbstate_t',\n      'try', 'xor', 'uint_fast32_t', 'int_least8_t', 'div_t', 'volatile',\n      'template', 'char16_t', 'new', 'ldiv_t', 'int_least16_t', 'va_list',\n      'uint_least8_t', 'goto', 'noreturn', 'enum', 'static_assert', 'bitand',\n      'compl', 'imaginary', 'jmp_buf', 'throw', 'asm', 'ptrdiff_t', 'uint16_t',\n      'or', 'uint_fast8_t', '_Bool', 'int32_t', 'float', 'private', 'restrict',\n      'wint_t', 'operator', 'not_eq', '_Imaginary', 'alignas', 'union', 'long',\n      'uint_least32_t', 'int_least64_t', 'friend', 'uintptr_t', 'int8_t',\n      'else', 'export', 'int_fast8_t', 'catch', 'true', 'case', 'default',\n      'double', '_Noreturn', 'signed', 'typename', 'while', 'protected',\n      'wchar_t', 'wctrans_t', 'uint64_t', 'delete', 'and', 'register', 'false',\n      'int', 'uintmax_t', 'off_t', 'char', 'int64_t', 'int_fast16_t', 'DIR',\n      '_Atomic', 'time_t', 'xor_eq', 'namespace', 'virtual', 'complex', 'bool',\n      'mutable', 'if', 'int_least32_t', 'sig_atomic_t', 'and_eq', 'ssize_t',\n      'alignof', '_Alignas', '_Generic', 'extern', 'class', 'typeid', 'short',\n      'for', 'uint_fast64_t', 'wctype_t', 'explicit', 'or_eq', 'switch',\n      'uint32_t', 'inline' )\n\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput(\n                     ContentsOfTestFile( 'cpp_syntax' ) ),\n                 contains_inanyorder( *expected_keywords ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_JavaSyntax( self ):\n    expected_keywords = (\n      'code', 'text', 'cols', 'datetime', 'disabled', 'shape', 'codetype',\n      'alt', 'compact', 'style', 'valuetype', 'short', 'finally', 'continue',\n      'extends', 'valign', 'bordercolor', 'do', 'return', 'rel', 'rules',\n      'void', 'nohref', 'abbr', 'background', 'scrolling', 'instanceof',\n      'name', 'summary', 'try', 'default', 'noshade', 'coords', 'dir', 'frame',\n      'usemap', 'ismap', 'static', 'hspace', 'vlink', 'for', 'selected', 'rev',\n      'vspace', 'content', 'method', 'version', 'volatile', 'above', 'new',\n      'charoff', 'public', 'alink', 'enum', 'codebase', 'if', 'noresize',\n      'interface', 'checked', 'byte', 'super', 'throw', 'src', 'language',\n      'package', 'standby', 'script', 'longdesc', 'maxlength', 'cellpadding',\n      'throws', 'tabindex', 'color', 'colspan', 'accesskey', 'float', 'while',\n      'private', 'height', 'boolean', 'wrap', 'prompt', 'nowrap', 'size',\n      'rows', 'span', 'clip', 'bgcolor', 'top', 'long', 'start', 'scope',\n      'scheme', 'type', 'final', 'lang', 'visibility', 'else', 'assert',\n      'transient', 'link', 'catch', 'true', 'serializable', 'target', 'lowsrc',\n      'this', 'double', 'align', 'value', 'cite', 'headers', 'below',\n      'protected', 'declare', 'classid', 'defer', 'false', 'synchronized',\n      'int', 'abstract', 'accept', 'hreflang', 'char', 'border', 'id',\n      'native', 'rowspan', 'charset', 'archive', 'strictfp', 'readonly',\n      'axis', 'cellspacing', 'profile', 'multiple', 'object', 'action',\n      'pagex', 'pagey', 'marginheight', 'data', 'class', 'frameborder',\n      'enctype', 'implements', 'break', 'gutter', 'url', 'clear', 'face',\n      'switch', 'marginwidth', 'width', 'left' )\n\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput(\n                     ContentsOfTestFile( 'java_syntax' ) ),\n                 contains_inanyorder( *expected_keywords ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_PhpSyntax_ContainsFunctions( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput(\n                     ContentsOfTestFile( 'php_syntax' ) ),\n                 has_items( 'array_change_key_case' ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_PhpSyntax_ContainsPreProc( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput(\n                     ContentsOfTestFile( 'php_syntax' ) ),\n                 has_items( 'skip', 'function' ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_Basic( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput( \"\"\"\nfoogroup xxx foo bar\n             zoo goo\n             links to Statement\"\"\" ),\n                contains_inanyorder( 'foo', 'bar', 'zoo', 'goo' ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_Function( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput( \"\"\"\nfoogroup xxx foo bar\n             zoo goo\n             links to Function\"\"\" ),\n                 contains_inanyorder( 'foo', 'bar', 'zoo', 'goo' ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_ContainedArgAllowed( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput( \"\"\"\nphpFunctions   xxx contained gzclose yaz_syntax html_entity_decode fbsql_read_blob png2wbmp mssql_init cpdf_set_title gztell fbsql_insert_id empty cpdf_restore mysql_field_type closelog swftext ldap_search curl_errno gmp_div_r mssql_data_seek getmyinode printer_draw_pie mcve_initconn ncurses_getmaxyx defined\n                   contained replace_child has_attributes specified insertdocument assign node_name hwstat addshape get_attribute_node html_dump_mem userlist\n                   links to Function\"\"\" ), # noqa\n                has_items( 'gzclose', 'userlist', 'ldap_search' ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_JunkIgnored( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput( \"\"\"\n--- Syntax items ---\nfoogroup xxx foo bar\n             zoo goo\n             links to Statement\nSpell        cluster=NONE\nNoSpell      cluster=NONE\"\"\" ),\n                 contains_inanyorder( 'foo', 'bar', 'zoo', 'goo' ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_MultipleStatementGroups( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput( \"\"\"\nfoogroup xxx foo bar\n             links to Statement\nbargroup xxx zoo goo\n             links to Statement\"\"\" ),\n                 contains_inanyorder( 'foo', 'bar', 'zoo', 'goo' ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_StatementAndTypeGroups( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput( \"\"\"\nfoogroup xxx foo bar\n             links to Statement\nbargroup xxx zoo goo\n             links to Type\"\"\" ),\n                 contains_inanyorder( 'foo', 'bar', 'zoo', 'goo' ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_StatementHierarchy( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput( \"\"\"\nbaa xxx foo bar\n        links to Foo\nFoo xxx zoo goo\n        links to Bar\nBar xxx qux moo\n        links to Statement\"\"\" ),\n                 contains_inanyorder( 'foo', 'bar', 'zoo',\n                                      'goo', 'qux', 'moo' ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_TypeHierarchy( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput( \"\"\"\nbaa xxx foo bar\n        links to Foo\nFoo xxx zoo goo\n        links to Bar\nBar xxx qux moo\n        links to Type\"\"\" ),\n                contains_inanyorder( 'foo', 'bar', 'zoo',\n                                     'goo', 'qux', 'moo' ) )\n\n\n  def test_KeywordsFromSyntaxListOutput_StatementAndTypeHierarchy( self ):\n    assert_that( syntax_parse._KeywordsFromSyntaxListOutput( \"\"\"\ntBaa xxx foo bar\n         links to tFoo\ntFoo xxx zoo goo\n         links to tBar\ntBar xxx qux moo\n         links to Type\nsBaa xxx na bar\n         links to sFoo\nsFoo xxx zoo nb\n         links to sBar\nsBar xxx qux nc\n         links to Statement\"\"\" ),\n                contains_inanyorder( 'foo', 'bar', 'zoo', 'goo', 'qux', 'moo',\n                                     'na', 'nb', 'nc' ) )\n\n\n  def test_SyntaxGroupsFromOutput_Basic( self ):\n    assert_that( syntax_parse._SyntaxGroupsFromOutput( \"\"\"\nfoogroup xxx foo bar\n             zoo goo\n             links to Statement\"\"\" ),\n                 has_item( 'foogroup' ) )\n\n\n  def test_ExtractKeywordsFromGroup_Basic( self ):\n    assert_that( syntax_parse._ExtractKeywordsFromGroup(\n                   syntax_parse.SyntaxGroup( '', [\n                     'foo bar',\n                     'zoo goo',\n                   ] ) ),\n                 contains_inanyorder( 'foo', 'bar', 'zoo', 'goo' ) )\n\n\n  def test_ExtractKeywordsFromGroup_Commas( self ):\n    assert_that( syntax_parse._ExtractKeywordsFromGroup(\n                   syntax_parse.SyntaxGroup( '', [\n                     'foo, bar,',\n                     'zoo goo',\n                   ] ) ),\n                 contains_inanyorder( 'foo', 'bar', 'zoo', 'goo' ) )\n\n\n  def test_ExtractKeywordsFromGroup_WithLinksTo( self ):\n    assert_that( syntax_parse._ExtractKeywordsFromGroup(\n                   syntax_parse.SyntaxGroup( '', [\n                     'foo bar',\n                     'zoo goo',\n                     'links to Statement'\n                   ] ) ),\n                 contains_inanyorder( 'foo', 'bar', 'zoo', 'goo' ) )\n\n\n  def test_ExtractKeywordsFromGroup_KeywordStarts( self ):\n    assert_that( syntax_parse._ExtractKeywordsFromGroup(\n                   syntax_parse.SyntaxGroup( '', [\n                     'foo bar',\n                     'contained boo baa',\n                     'zoo goo',\n                   ] ) ),\n                 contains_inanyorder( 'foo', 'bar', 'boo',\n                                      'baa', 'zoo', 'goo' ) )\n\n\n  def test_ExtractKeywordsFromGroup_KeywordMiddle( self ):\n    assert_that( syntax_parse._ExtractKeywordsFromGroup(\n                   syntax_parse.SyntaxGroup( '', [\n                     'foo contained bar',\n                     'zoo goo'\n                   ] ) ),\n                 contains_inanyorder( 'foo', 'contained',\n                                      'bar', 'zoo', 'goo' ) )\n\n\n  def test_ExtractKeywordsFromGroup_KeywordAssign( self ):\n    assert_that( syntax_parse._ExtractKeywordsFromGroup(\n                   syntax_parse.SyntaxGroup( '', [\n                     'nextgroup=zoo skipwhite foo bar',\n                     'zoo goo',\n                   ] ) ),\n                 contains_inanyorder( 'foo', 'bar', 'zoo', 'goo' ) )\n\n\n  def test_ExtractKeywordsFromGroup_KeywordAssignAndMiddle( self ):\n    assert_that( syntax_parse._ExtractKeywordsFromGroup(\n                   syntax_parse.SyntaxGroup( '', [\n                     'nextgroup=zoo foo skipnl bar',\n                     'zoo goo',\n                   ] ) ),\n                 contains_inanyorder( 'foo', 'skipnl', 'bar', 'zoo', 'goo' ) )\n\n\n  def test_ExtractKeywordsFromGroup_KeywordWithoutNextgroup( self ):\n    assert_that( syntax_parse._ExtractKeywordsFromGroup(\n                   syntax_parse.SyntaxGroup( '', [\n                     'skipempty foo bar',\n                     'zoo goo',\n                   ] ) ),\n                 contains_inanyorder( 'skipempty', 'foo',\n                                      'bar', 'zoo', 'goo' ) )\n\n\n  def test_ExtractKeywordsFromGroup_ContainedSyntaxArgAllowed( self ):\n    assert_that( syntax_parse._ExtractKeywordsFromGroup(\n                   syntax_parse.SyntaxGroup( '', [\n                     'contained foo zoq',\n                     'contained bar goo',\n                     'far'\n                   ] ) ),\n                 contains_inanyorder( 'foo', 'zoq', 'bar', 'goo', 'far' ) )\n"
  },
  {
    "path": "python/ycm/tests/test_utils.py",
    "content": "# Copyright (C) 2011-2019 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom collections import defaultdict, namedtuple\nfrom unittest.mock import DEFAULT, MagicMock, patch\nfrom unittest import skip\nfrom hamcrest import ( assert_that,\n                       contains_exactly,\n                       contains_inanyorder,\n                       equal_to )\nimport contextlib\nimport functools\nimport json\nimport os\nimport re\nimport sys\n\nfrom unittest import skipIf\n\nfrom ycmd.utils import GetCurrentDirectory, OnMac, OnWindows, ToUnicode\n\n\nBUFNR_REGEX = re.compile(\n  '^bufnr\\\\( \\'(?P<buffer_filename>.+)\\'(, ([01]))? \\\\)$' )\nBUFWINNR_REGEX = re.compile( '^bufwinnr\\\\( (?P<buffer_number>[0-9]+) \\\\)$' )\nBWIPEOUT_REGEX = re.compile(\n  '^(?:silent! )bwipeout!? (?P<buffer_number>[0-9]+)$' )\nGETBUFVAR_REGEX = re.compile(\n  '^getbufvar\\\\((?P<buffer_number>[0-9]+), \"(?P<option>.+)\"\\\\)( \\\\?\\\\? 0)?$' )\nPROP_LIST_REGEX = re.compile(\n        '^prop_list\\\\( '                       # A literal at the start\n        '(?P<lnum>\\\\d+), '                     # Start line\n        '{ \"bufnr\": (?P<bufnr>\\\\d+), '         # Corresponding buffer number\n        '\"end_lnum\": (?P<end_lnum>[0-9-]+), '  # End line, can be negative.\n        '\"types\": (?P<prop_types>\\\\[.+\\\\]) } ' # Property types\n        '\\\\)$' )\nPROP_ADD_REGEX = re.compile(\n        '^prop_add\\\\( '            # A literal at the start\n        '(?P<start_line>\\\\d+), '   # First argument - number\n        '(?P<start_column>\\\\d+), ' # Second argument - number\n        '{(?P<opts>.+)} '          # Third argument is a complex dict, which\n                                   # we parse separately\n        '\\\\)$' )\nPROP_REMOVE_REGEX = re.compile( '^prop_remove\\\\( (?P<prop>.+) \\\\)$' )\nOMNIFUNC_REGEX_FORMAT = (\n  '^{omnifunc_name}\\\\((?P<findstart>[01]),[\\'\"](?P<base>.*)[\\'\"]\\\\)$' )\nFNAMEESCAPE_REGEX = re.compile( '^fnameescape\\\\(\\'(?P<filepath>.+)\\'\\\\)$' )\nSTRDISPLAYWIDTH_REGEX = re.compile(\n  '^strdisplaywidth\\\\( ?\\'(?P<text>.+)\\' ?\\\\)$' )\nREDIR_START_REGEX = re.compile( '^redir => (?P<variable>[\\\\w:]+)$' )\nREDIR_END_REGEX = re.compile( '^redir END$' )\nEXISTS_REGEX = re.compile( '^exists\\\\( \\'(?P<option>[\\\\w:]+)\\' \\\\)$' )\nLET_REGEX = re.compile( '^let (?P<option>[\\\\w:]+) = (?P<value>.*)$' )\nHAS_PATCH_REGEX = re.compile( '^has\\\\( \\'patch(?P<patch>\\\\d+)\\' \\\\)$' )\n\n# One-and only instance of mocked Vim object. The first 'import vim' that is\n# executed binds the vim module to the instance of MagicMock that is created,\n# and subsquent assignments to sys.modules[ 'vim' ] don't retrospectively\n# update them. The result is that while running the tests, we must assign only\n# one instance of MagicMock to sys.modules[ 'vim' ] and always return it.\n#\n# More explanation is available:\n# https://github.com/Valloric/YouCompleteMe/pull/1694\nVIM_MOCK = MagicMock()\n\nVIM_PROPS_FOR_BUFFER = defaultdict( list )\nVIM_SIGNS = []\n\nVIM_OPTIONS = {\n  '&completeopt': b'',\n  '&previewheight': 12,\n  '&columns': 80,\n  '&ruler': 0,\n  '&showcmd': 1,\n  '&hidden': 0,\n  '&expandtab': 1\n}\n\nVersion = namedtuple( 'Version', [ 'major', 'minor', 'patch' ] )\n\n# This variable must be patched with a Version object for tests depending on a\n# recent Vim version. Example:\n#\n#   @patch( 'ycm.tests.test_utils.VIM_VERSION', Version( 8, 1, 614 ) )\n#   def ThisTestDependsOnTheVimVersion_test():\n#     ...\n#\n# Default is the oldest supported version.\nVIM_VERSION = Version( 7, 4, 1578 )\n\nREDIR = {\n  'status': False,\n  'variable': '',\n  'output': ''\n}\n\nWindowsAndMacOnly = skipIf( not OnWindows() or not OnMac(),\n                            'Windows and macOS only' )\n\n\n@contextlib.contextmanager\ndef CurrentWorkingDirectory( path ):\n  old_cwd = GetCurrentDirectory()\n  os.chdir( path )\n  try:\n    yield\n  finally:\n    os.chdir( old_cwd )\n\n\ndef _MockGetBufferNumber( buffer_filename ):\n  for vim_buffer in VIM_MOCK.buffers:\n    if vim_buffer.name == buffer_filename:\n      return vim_buffer.number\n  return -1\n\n\ndef _MockGetBufferWindowNumber( buffer_number ):\n  for window in VIM_MOCK.windows:\n    if window.buffer.number == buffer_number:\n      return window.number\n  return -1\n\n\ndef _MockGetBufferVariable( buffer_number, option ):\n  for vim_buffer in VIM_MOCK.buffers:\n    if vim_buffer.number == buffer_number:\n      if option == '&mod':\n        return vim_buffer.modified\n      if option == '&ft':\n        return vim_buffer.filetype\n      if option == 'changedtick':\n        return vim_buffer.changedtick\n      if option == '&bh':\n        return vim_buffer.bufhidden\n      return ''\n  return ''\n\n\ndef _MockVimBufferEval( value ):\n  if value == '&omnifunc':\n    return VIM_MOCK.current.buffer.omnifunc_name\n\n  if value == '&filetype':\n    return VIM_MOCK.current.buffer.filetype\n\n  match = BUFNR_REGEX.search( value )\n  if match:\n    buffer_filename = match.group( 'buffer_filename' )\n    return _MockGetBufferNumber( buffer_filename )\n\n  match = BUFWINNR_REGEX.search( value )\n  if match:\n    buffer_number = int( match.group( 'buffer_number' ) )\n    return _MockGetBufferWindowNumber( buffer_number )\n\n  match = GETBUFVAR_REGEX.search( value )\n  if match:\n    buffer_number = int( match.group( 'buffer_number' ) )\n    option = match.group( 'option' )\n    return _MockGetBufferVariable( buffer_number, option )\n\n  current_buffer = VIM_MOCK.current.buffer\n  match = re.search( OMNIFUNC_REGEX_FORMAT.format(\n                         omnifunc_name = current_buffer.omnifunc_name ),\n                     value )\n  if match:\n    findstart = int( match.group( 'findstart' ) )\n    base = match.group( 'base' )\n    return current_buffer.omnifunc( findstart, base )\n\n  return None\n\n\ndef _MockVimWindowEval( value ):\n  if value == 'winnr(\"#\")':\n    # For simplicity, we always assume there is no previous window.\n    return 0\n\n  return None\n\n\ndef _MockVimOptionsEval( value ):\n  result = VIM_OPTIONS.get( value )\n  if result is not None:\n    return result\n\n  if value == 'keys( g: )':\n    global_options = {}\n    for key, value in VIM_OPTIONS.items():\n      if key.startswith( 'g:' ):\n        global_options[ key[ 2: ] ] = value\n    return global_options\n\n  match = EXISTS_REGEX.search( value )\n  if match:\n    option = match.group( 'option' )\n    return option in VIM_OPTIONS\n\n  return None\n\n\ndef _MockVimFunctionsEval( value ):\n  if value == 'tempname()':\n    return '_TEMP_FILE_'\n\n  if value == 'tagfiles()':\n    return [ 'tags' ]\n\n  if value == 'shiftwidth()':\n    return 2\n\n  if value.startswith( 'has( \"' ):\n    return False\n\n  match = re.match( 'sign_getplaced\\\\( (?P<bufnr>\\\\d+), '\n                    '{ \"group\": \"ycm_signs\" } \\\\)', value )\n  if match:\n    filtered = list( filter( lambda sign: sign.bufnr ==\n                                          int( match.group( 'bufnr' ) ),\n                             VIM_SIGNS ) )\n    r = [ { 'signs': filtered } ]\n    return r\n\n  match = re.match( 'sign_unplacelist\\\\( (?P<sign_list>\\\\[.*\\\\]) \\\\)', value )\n  if match:\n    sign_list = eval( match.group( 'sign_list' ) )\n    for sign in sign_list:\n      VIM_SIGNS.remove( sign )\n    return True # Why True?\n\n  match = re.match( 'sign_placelist\\\\( (?P<sign_list>\\\\[.*\\\\]) \\\\)', value )\n  if match:\n    sign_list = json.loads( match.group( 'sign_list' ).replace( \"'\", '\"' ) )\n    for sign in sign_list:\n      VIM_SIGNS.append( VimSign( sign[ 'lnum' ],\n                                 sign[ 'name' ],\n                                 sign[ 'buffer' ] ) )\n    return True # Why True?\n\n  return None\n\n\ndef _MockVimPropEval( value ):\n  if match := PROP_LIST_REGEX.search( value ):\n    if int( match.group( 'end_lnum' ) ) == -1:\n      return [ p for p in VIM_PROPS_FOR_BUFFER[ int( match.group( 'bufnr' ) ) ]\n               if p.start_line >= int( match.group( 'lnum' ) ) ]\n    else:\n      return [ p for p in VIM_PROPS_FOR_BUFFER[ int( match.group( 'bufnr' ) ) ]\n               if int( match.group( 'end_lnum' ) ) >= p.start_line and\n                  p.start_line >= int( match.group( 'lnum' ) ) ]\n\n  if match := PROP_ADD_REGEX.search( value ):\n    prop_start_line = int( match.group( 'start_line' ) )\n    prop_start_column = int( match.group( 'start_column' ) )\n    import ast\n    opts = ast.literal_eval( '{' + match.group( 'opts' ) + '}' )\n    vim_prop = VimProp(\n        opts[ 'type' ],\n        prop_start_line,\n        prop_start_column,\n        int( opts[ 'end_lnum' ] ),\n        int( opts[ 'end_col' ] )\n    )\n    VIM_PROPS_FOR_BUFFER[ int( opts[ 'bufnr' ] ) ].append( vim_prop )\n    return vim_prop.id\n\n  if match := PROP_REMOVE_REGEX.search( value ):\n    prop, lin_num = eval( match.group( 'prop' ) )\n    vim_props = VIM_PROPS_FOR_BUFFER[ prop[ 'bufnr' ] ]\n    for index, vim_prop in enumerate( vim_props ):\n      if vim_prop.id == prop[ 'id' ]:\n        vim_props.pop( index )\n        return -1\n    return 0\n\n  return None\n\n\ndef _MockVimVersionEval( value ):\n  match = HAS_PATCH_REGEX.search( value )\n  if match:\n    if not isinstance( VIM_VERSION, Version ):\n      raise RuntimeError( 'Vim version is not set.' )\n    return VIM_VERSION.patch >= int( match.group( 'patch' ) )\n\n  if value == 'v:version':\n    if not isinstance( VIM_VERSION, Version ):\n      raise RuntimeError( 'Vim version is not set.' )\n    return VIM_VERSION.major * 100 + VIM_VERSION.minor\n\n  return None\n\n\ndef _MockVimEval( value ): # noqa\n  if value == 'g:ycm_neovim_ns_id':\n    return 1\n\n  result = _MockVimOptionsEval( value )\n  if result is not None:\n    return result\n\n  result = _MockVimFunctionsEval( value )\n  if result is not None:\n    return result\n\n  result = _MockVimBufferEval( value )\n  if result is not None:\n    return result\n\n  result = _MockVimWindowEval( value )\n  if result is not None:\n    return result\n\n  result = _MockVimPropEval( value )\n  if result is not None:\n    return result\n\n  result = _MockVimVersionEval( value )\n  if result is not None:\n    return result\n\n  match = FNAMEESCAPE_REGEX.search( value )\n  if match:\n    return match.group( 'filepath' )\n\n  if value == REDIR[ 'variable' ]:\n    return REDIR[ 'output' ]\n\n  match = STRDISPLAYWIDTH_REGEX.search( value )\n  if match:\n    return len( match.group( 'text' ) )\n\n  raise VimError( f'Unexpected evaluation: { value }' )\n\n\ndef _MockWipeoutBuffer( buffer_number ):\n  buffers = VIM_MOCK.buffers\n\n  for index, buffer in enumerate( buffers ):\n    if buffer.number == buffer_number:\n      return buffers.pop( index )\n\n\ndef _MockVimCommand( command ):\n  match = BWIPEOUT_REGEX.search( command )\n  if match:\n    return _MockWipeoutBuffer( int( match.group( 1 ) ) )\n\n  match = REDIR_START_REGEX.search( command )\n  if match:\n    REDIR[ 'status' ] = True\n    REDIR[ 'variable' ] = match.group( 'variable' )\n    return\n\n  match = REDIR_END_REGEX.search( command )\n  if match:\n    REDIR[ 'status' ] = False\n    return\n\n  if command == 'unlet ' + REDIR[ 'variable' ]:\n    REDIR[ 'variable' ] = ''\n    return\n\n  match = LET_REGEX.search( command )\n  if match:\n    option = match.group( 'option' )\n    value = json.loads( match.group( 'value' ) )\n    VIM_OPTIONS[ option ] = value\n    return\n\n  return DEFAULT\n\n\ndef _MockVimOptions( option ):\n  result = VIM_OPTIONS.get( '&' + option )\n  if result is not None:\n    return result\n\n  return None\n\n\nclass VimBuffer:\n  \"\"\"An object that looks like a vim.buffer object:\n   - |name|     : full path of the buffer with symbolic links resolved;\n   - |number|   : buffer number;\n   - |contents| : list of lines representing the buffer contents;\n   - |filetype| : buffer filetype. Empty string if no filetype is set;\n   - |modified| : True if the buffer has unsaved changes, False otherwise;\n   - |bufhidden|: value of the 'bufhidden' option (see :h bufhidden);\n   - |vars|:      dict for buffer-local variables\n   - |omnifunc| : omni completion function used by the buffer. Must be a Python\n                  function that takes the same arguments and returns the same\n                  values as a Vim completion function (:h complete-functions).\n                  Example:\n\n                    def Omnifunc( findstart, base ):\n                      if findstart:\n                        return 5\n                      return [ 'a', 'b', 'c' ]\"\"\"\n\n  def __init__( self, name,\n                      number = 1,\n                      contents = [ '' ],\n                      filetype = '',\n                      modified = False,\n                      bufhidden = '',\n                      omnifunc = None,\n                      visual_start = None,\n                      visual_end = None,\n                      vars = {} ):\n    self.name = os.path.realpath( name ) if name else ''\n    self.number = number\n    self.contents = contents\n    self.filetype = filetype\n    self.modified = modified\n    self.bufhidden = bufhidden\n    self.omnifunc = omnifunc\n    self.omnifunc_name = omnifunc.__name__ if omnifunc else ''\n    self.changedtick = 1\n    self.options = {\n     'mod': modified,\n     'bh': bufhidden\n    }\n    self.visual_start = visual_start\n    self.visual_end = visual_end\n    self.vars = vars # should really be a vim-specific dict-like obj\n\n\n  def __getitem__( self, index ):\n    \"\"\"Returns the bytes for a given line at index |index|.\"\"\"\n    return self.contents[ index ]\n\n\n  def __len__( self ):\n    return len( self.contents )\n\n\n  def __setitem__( self, key, value ):\n    return self.contents.__setitem__( key, value )\n\n\n  def GetLines( self ):\n    \"\"\"Returns the contents of the buffer as a list of unicode strings.\"\"\"\n    return [ ToUnicode( x ) for x in self.contents ]\n\n\n  def mark( self, name ):\n    if name == '<':\n      return self.visual_start\n    if name == '>':\n      return self.visual_end\n    raise ValueError( f'Unexpected mark: { name }' )\n\n\n  def __repr__( self ):\n    return f\"VimBuffer( name = '{ self.name }', number = { self.number } )\"\n\n\nclass VimBuffers:\n  \"\"\"An object that looks like a vim.buffers object.\"\"\"\n\n  def __init__( self, buffers ):\n    \"\"\"|buffers| is a list of VimBuffer objects.\"\"\"\n    self._buffers = buffers\n\n\n  def __getitem__( self, number ):\n    \"\"\"Emulates vim.buffers[ number ]\"\"\"\n    for buffer_object in self._buffers:\n      if number == buffer_object.number:\n        return buffer_object\n    raise KeyError( number )\n\n\n  def __iter__( self ):\n    \"\"\"Emulates for loop on vim.buffers\"\"\"\n    return iter( self._buffers )\n\n\n  def pop( self, index ):\n    return self._buffers.pop( index )\n\n\nclass VimTabpages:\n  def __init__( self, *args ):\n    \"\"\"|buffers| is a list of VimBuffer objects.\"\"\"\n    self._tabpages = []\n    self._tabpages.extend( args )\n\n\n  def __getitem__( self, number ):\n    \"\"\"Emulates vim.buffers[ number ]\"\"\"\n    for tabpage in self._tabpages:\n      if number == tabpage.number:\n        return tabpage\n    raise KeyError( number )\n\n\n  def __iter__( self ):\n    \"\"\"Emulates for loop on vim.buffers\"\"\"\n    return iter( self._tabpages )\n\n\nclass VimWindow:\n  \"\"\"An object that looks like a vim.window object:\n    - |number|: number of the window;\n    - |buffer_object|: a VimBuffer object representing the buffer inside the\n      window;\n    - |cursor|: a tuple corresponding to the cursor position.\"\"\"\n\n  def __init__( self, tabpage, number, buffer_object, cursor = None ):\n    self.tabpage = tabpage\n    self.number = number\n    self.buffer = buffer_object\n    self.cursor = cursor\n    self.options = {}\n    self.vars = {}\n\n\n  def __repr__( self ):\n    return ( f'VimWindow( number = { self.number }, '\n                        f'buffer = { self.buffer }, '\n                        f'cursor = { self.cursor } )' )\n\n\nclass VimTabpage:\n  \"\"\"An object that looks like a vim.windows object.\"\"\"\n\n  def __init__( self, number, buffers, cursor ):\n    \"\"\"|buffers| is a list of VimBuffer objects corresponding to the window\n    layout. The first element of that list is assumed to be the current window.\n    |cursor| is the cursor position of that window.\"\"\"\n    self.number = number\n    self.windows = []\n    self.windows.append( VimWindow( self, 1, buffers[ 0 ], cursor ) )\n    for window_number in range( 1, len( buffers ) ):\n      self.windows.append( VimWindow( self,\n                                      window_number + 1,\n                                      buffers[ window_number ] ) )\n\n\n  def __getitem__( self, number ):\n    \"\"\"Emulates vim.windows[ number ]\"\"\"\n    try:\n      return self.windows[ number ]\n    except IndexError:\n      raise IndexError( 'no such window' )\n\n\n  def __iter__( self ):\n    \"\"\"Emulates for loop on vim.windows\"\"\"\n    return iter( self.windows )\n\n\nclass VimCurrent:\n  \"\"\"An object that looks like a vim.current object. |current_window| must be a\n  VimWindow object.\"\"\"\n\n  def __init__( self, current_window ):\n    self.buffer = current_window.buffer\n    self.window = current_window\n    self.tabpage = current_window.tabpage\n    self.line = self.buffer.contents[ current_window.cursor[ 0 ] - 1 ]\n\n\nclass VimProp:\n\n  def __init__( self,\n                prop_type,\n                start_line,\n                start_column,\n                end_line,\n                end_column ):\n    current_buffer = VIM_MOCK.current.buffer.number\n    self.id = len( VIM_PROPS_FOR_BUFFER[ current_buffer ] ) + 1\n    self.prop_type = prop_type\n    self.start_line = start_line\n    self.start_column = start_column\n    self.end_line = end_line if end_line else start_line\n    self.end_column = end_column if end_column else start_column\n\n\n  def __eq__( self, other ):\n    return ( self.prop_type == other.prop_type and\n             self.start_line == other.start_line and\n             self.start_column == other.start_column and\n             self.end_line == other.end_line and\n             self.end_column == other.end_column )\n\n\n  def __repr__( self ):\n    return ( f\"VimProp( prop_type = '{ self.prop_type }',\"\n             f\" start_line = { self.start_line }, \"\n             f\" start_column = { self.start_column },\"\n             f\" end_line = { self.end_line },\"\n             f\" end_column = { self.end_column } )\" )\n\n\n  def __getitem__( self, key ):\n    if key == 'type':\n      return self.prop_type\n    elif key == 'id':\n      return self.id\n    elif key == 'col':\n      return self.start_column\n    elif key == 'length':\n      return self.end_column - self.start_column\n    elif key == 'lnum':\n      return self.start_line\n\n\n  def get( self, key, default = None ):\n    if key == 'type':\n      return self.prop_type\n\n\nclass VimSign:\n\n  def __init__( self, line, name, bufnr ):\n    self.line = line\n    self.name = name\n    self.bufnr = bufnr\n\n\n  def __eq__( self, other ):\n    if isinstance( other, dict ):\n      other = VimSign( other[ 'lnum' ], other[ 'name' ], other[ 'buffer' ] )\n    return ( self.line == other.line and\n             self.name == other.name and\n             self.bufnr == other.bufnr )\n\n\n  def __repr__( self ):\n    return ( f\"VimSign( line = { self.line }, \"\n                      f\"name = '{ self.name }', bufnr = { self.bufnr } )\" )\n\n\n  def __getitem__( self, key ):\n    if key == 'group':\n      return self.group\n\n\n@contextlib.contextmanager\ndef MockVimBuffers( buffers, window_buffers, cursor_position = ( 1, 1 ) ):\n  \"\"\"Simulates the Vim buffers list |buffers| where |current_buffer| is the\n  buffer displayed in the current window and |cursor_position| is the current\n  cursor position. All buffers are represented by a VimBuffer object.\"\"\"\n  if ( not isinstance( buffers, list ) or\n       not all( isinstance( buf, VimBuffer ) for buf in buffers ) ):\n    raise RuntimeError( 'First parameter must be a list of VimBuffer objects.' )\n  if ( not isinstance( window_buffers, list ) or\n       not all( isinstance( buf, VimBuffer ) for buf in window_buffers ) ):\n    raise RuntimeError( 'Second parameter must be a list of VimBuffer objects '\n                        'representing the window layout.' )\n  if len( window_buffers ) < 1:\n    raise RuntimeError( 'Second parameter must contain at least one element '\n                        'which corresponds to the current window.' )\n\n  with patch( 'vim.buffers', VimBuffers( buffers ) ):\n    with patch( 'vim.tabpages', VimTabpages(\n      VimTabpage( 1, window_buffers, cursor_position ) ) ) as tabpages:\n      with patch( 'vim.windows', tabpages[ 1 ] ) as windows:\n        with patch( 'vim.current', VimCurrent( windows[ 0 ] ) ):\n          yield VIM_MOCK\n\n\ndef MockVimModule():\n  \"\"\"The 'vim' module is something that is only present when running inside the\n  Vim Python interpreter, so we replace it with a MagicMock for tests. If you\n  need to add additional mocks to vim module functions, then use 'patch' from\n  mock module, to ensure that the state of the vim mock is returned before the\n  next test. That is:\n\n    from ycm.tests.test_utils import MockVimModule\n    from unittest.mock import patch\n\n    # Do this once\n    MockVimModule()\n\n    @patch( 'vim.eval', return_value='test' )\n    @patch( 'vim.command', side_effect=ValueError )\n    def test( vim_command, vim_eval ):\n      # use vim.command via vim_command, e.g.:\n      vim_command.assert_has_calls( ... )\n\n  Failure to use this approach may lead to unexpected failures in other\n  tests.\"\"\"\n\n  VIM_MOCK.command = MagicMock( side_effect = _MockVimCommand )\n  VIM_MOCK.eval = MagicMock( side_effect = _MockVimEval )\n  VIM_MOCK.error = VimError\n  VIM_MOCK.options = MagicMock()\n  VIM_MOCK.options.__getitem__.side_effect = _MockVimOptions\n  sys.modules[ 'vim' ] = VIM_MOCK\n\n  return VIM_MOCK\n\n\nclass VimError( Exception ):\n\n  def __init__( self, code ):\n    self.code = code\n\n\n  def __str__( self ):\n    return repr( self.code )\n\n\nclass ExtendedMock( MagicMock ):\n  \"\"\"An extension to the MagicMock class which adds the ability to check that a\n  callable is called with a precise set of calls in a precise order.\n\n  Example Usage:\n    from ycm.tests.test_utils import ExtendedMock\n    @patch( 'test.testing', new_callable = ExtendedMock, ... )\n    def my_test( test_testing ):\n      ...\n  \"\"\"\n\n  def assert_has_exact_calls( self, calls, any_order = False ):\n    contains = contains_inanyorder if any_order else contains_exactly\n    assert_that( self.call_args_list, contains( *calls ) )\n    assert_that( self.call_count, equal_to( len( calls ) ) )\n\n\ndef ExpectedFailure( reason, *exception_matchers ):\n  \"\"\"Defines a decorator to be attached to tests. This decorator\n  marks the test as being known to fail, e.g. where documenting or exercising\n  known incorrect behaviour.\n\n  The parameters are:\n    - |reason| a textual description of the reason for the known issue. This\n               is used for the skip reason\n    - |exception_matchers| additional arguments are hamcrest matchers to apply\n                 to the exception thrown. If the matchers don't match, then the\n                 test is marked as error, with the original exception.\n\n  If the test fails (for the correct reason), then it is marked as skipped.\n  If it fails for any other reason, it is marked as failed.\n  If the test passes, then it is also marked as failed.\"\"\"\n  def decorator( test ):\n    @functools.wraps( test )\n    def Wrapper( *args, **kwargs ):\n      try:\n        test( *args, **kwargs )\n      except Exception as test_exception:\n        # Ensure that we failed for the right reason\n        test_exception_message = ToUnicode( test_exception )\n        try:\n          for matcher in exception_matchers:\n            assert_that( test_exception_message, matcher )\n        except AssertionError:\n          # Failed for the wrong reason!\n          import traceback\n          print( 'Test failed for the wrong reason: ' + traceback.format_exc() )\n          # Real failure reason is the *original* exception, we're only trapping\n          # and ignoring the exception that is expected.\n          raise test_exception\n\n        # Failed for the right reason\n        skip( reason )\n      else:\n        raise AssertionError( f'Test was expected to fail: { reason }' )\n    return Wrapper\n\n  return decorator\n"
  },
  {
    "path": "python/ycm/tests/testdata/.ycm_extra_conf.py",
    "content": "def FlagsForFile( filename, **kwargs ):\n  temp_dir = kwargs[ 'client_data' ][ 'tempname()' ]\n\n  return {\n    'flags': [ temp_dir ],\n    'do_cache': False\n  }\n"
  },
  {
    "path": "python/ycm/tests/testdata/cpp_syntax",
    "content": "--- Syntax items ---\ncCustomFunc    xxx match /\\w\\+\\s*\\((\\)\\@=/\n                   links to Function\ncCustomClass   xxx match /\\w\\+\\s*\\(::\\)\\@=/\n                   links to Function\nOperatorChars  xxx match #?\\|+\\|-\\|\\*\\|;\\|:\\|,\\|<\\|>\\|&\\||\\|!\\|\\~\\|%\\|=\\|)\\|(\\|{\\|}\\|\\.\\|\\[\\|\\]\\|/\\(/\\|*\\)\\@!#\ncStatement     xxx return goto asm continue break\n                   links to Statement\ncLabel         xxx default case\n                   links to Label\ncConditional   xxx if switch else\n                   links to Conditional\ncRepeat        xxx for while do\n                   links to Repeat\ncTodo          xxx contained XXX FIXME TODO\n                   links to Todo\ncBadContinuation xxx match /\\\\\\s\\+$/  contained\n                   links to Error\ncSpecial       xxx match /\\\\\\(x\\x\\+\\|\\o\\{1,3}\\|.\\|$\\)/  display contained\n                   match /\\\\\\(u\\x\\{4}\\|U\\x\\{8}\\)/  display contained\n                   links to SpecialChar\ncFormat        xxx match /%\\(\\d\\+\\$\\)\\=[-+' #0*]*\\(\\d*\\|\\*\\|\\*\\d\\+\\$\\)\\(\\.\\(\\d*\\|\\*\\|\\*\\d\\+\\$\\)\\)\\=\\([hlLjzt]\\|ll\\|hh\\)\\=\\([aAbdiuoxXDOUfFeEgGcCsSpn]\\|\\[\\^\\=.[^]]*\\]\\)/  display contained\n                   match /%%/  display contained\n                   links to cSpecial\ncString        xxx start=/L\\=\"/ skip=/\\\\\\\\\\|\\\\\"/ end=/\"/  extend contains=cSpecial,cFormat,@Spell\n                   start=/\\%(U\\|u8\\=\\)\"/ skip=/\\\\\\\\\\|\\\\\"/ end=/\"/  extend contains=cSpecial,cFormat,@Spell\n                   links to String\ncCppString     xxx start=/L\\=\"/ skip=/\\\\\\\\\\|\\\\\"\\|\\\\$/ end=/$/ end=/\"/  excludenl contains=cSpecial,cFormat,@Spell\n                   links to cString\ncCharacter     xxx match /L\\='[^\\\\]'/\n                   match /L'[^']*'/  contains=cSpecial\n                   match /[Uu]'[^\\\\]'/\n                   match /[Uu]'[^']*'/  contains=cSpecial\n                   links to Character\ncSpecialError  xxx match /L\\='\\\\[^'\\\"?\\\\abfnrtv]'/\n                   match /[Uu]'\\\\[^'\\\"?\\\\abfnrtv]'/\n                   links to cError\ncSpecialCharacter xxx match /L\\='\\\\['\\\"?\\\\abfnrtv]'/\n                   match /L\\='\\\\\\o\\{1,3}'/  display\n                   match /'\\\\x\\x\\{1,2}'/  display\n                   match /L'\\\\x\\x\\+'/  display\n                   match /[Uu]'\\\\['\\\"?\\\\abfnrtv]'/\n                   match /[Uu]'\\\\\\o\\{1,3}'/  display\n                   match /[Uu]'\\\\x\\x\\+'/  display\n                   links to cSpecial\ncBadBlock      xxx start=/{/ end=/}/  contained keepend transparent fold containedin=cParen,cBracket,cBadBlock\ncErrInParen    xxx match /[\\]{}]\\|<%\\|%>/  display contained\n                   links to cError\ncCppParen      xxx start=/(/ skip=/\\\\$/ end=/$/ end=/)/  contained excludenl transparent contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell\ncErrInBracket  xxx match /[);{}]\\|<%\\|%>/  display contained\n                   links to cError\ncCppBracket    xxx start=/\\[\\|<::\\@!/ skip=/\\\\$/ end=/$/ end=/]\\|:>/  contained excludenl transparent contains=ALLBUT,@cParenGroup,cErrInParen,cParen,cBracket,cString,@Spell\ncBlock         xxx start=/{/ end=/}/  transparent fold\ncParenError    xxx match /[\\])]/  display\n                   links to cError\ncIncluded      xxx start=/\"/ skip=/\\\\\\\\\\|\\\\\"/ end=/\"/  display contained\n                   match /<[^>]*>/  display contained\n                   links to cString\ncCommentStartError xxx match +/\\*+me=e-1  display contained\n                   links to cError\ncUserCont      xxx match /^\\s*\\I\\i*\\s*:$/  display contains=@cLabelGroup\n                   match /;\\s*\\I\\i*\\s*:$/  display contains=@cLabelGroup\n                   match /^\\s*\\I\\i*\\s*:[^:]/me=e-1  display contains=@cLabelGroup\n                   match /;\\s*\\I\\i*\\s*:[^:]/me=e-1  display contains=@cLabelGroup\ncUserLabel     xxx match /\\I\\i*/  display contained\n                   links to Label\ncBitField      xxx match /^\\s*\\I\\i*\\s*:\\s*[1-9]/me=e-1  display contains=cType\n                   match /;\\s*\\I\\i*\\s*:\\s*[1-9]/me=e-1  display contains=cType\ncOctalZero     xxx match /\\<0/  display contained\n                   links to PreProc\ncNumber        xxx match /\\d\\+\\(u\\=l\\{0,2}\\|ll\\=u\\)\\>/  display contained\n                   match /0x\\x\\+\\(u\\=l\\{0,2}\\|ll\\=u\\)\\>/  display contained\n                   links to Number\ncFloat         xxx match /\\d\\+f/  display contained\n                   match /\\d\\+\\.\\d*\\(e[-+]\\=\\d\\+\\)\\=[fl]\\=/  display contained\n                   match /\\.\\d\\+\\(e[-+]\\=\\d\\+\\)\\=[fl]\\=\\>/  display contained\n                   match /\\d\\+e[-+]\\=\\d\\+[fl]\\=\\>/  display contained\n                   match /0x\\x*\\.\\x\\+p[-+]\\=\\d\\+[fl]\\=\\>/  display contained\n                   match /0x\\x\\+\\.\\=p[-+]\\=\\d\\+[fl]\\=\\>/  display contained\n                   links to Float\ncOctal         xxx match /0\\o\\+\\(u\\=l\\{0,2}\\|ll\\=u\\)\\>/  display contained contains=cOctalZero\n                   links to Number\ncOctalError    xxx match /0\\o*[89]\\d*/  display contained\n                   links to cError\ncNumbersCom    xxx match /\\<\\d\\|\\.\\d/  display contained transparent contains=cNumber,cFloat,cOctal\ncParen         xxx start=/(/ end=/}/me=s-1 end=/)/  transparent contains=ALLBUT,cBlock,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell\ncBracket       xxx start=/\\[\\|<::\\@!/ end=/}/me=s-1 end=/]\\|:>/  transparent contains=ALLBUT,cBlock,@cParenGroup,cErrInParen,cCppParen,cCppBracket,cCppString,@Spell\ncNumbers       xxx match /\\<\\d\\|\\.\\d/  display transparent contains=cNumber,cFloat,cOctalError,cOctal\ncCommentL      xxx start=+//+ skip=/\\\\$/ end=/$/  keepend contains=@cCommentGroup,cSpaceError,@Spell\n                   links to cComment\ncComment       xxx matchgroup=cCommentStart start=+/\\*+ end=+\\*/+  extend fold contains=@cCommentGroup,cCommentStartError,cSpaceError,@Spell\n                   links to Comment\ncCommentError  xxx match +\\*/+  display\n                   links to cError\ncOperator      xxx _Generic sizeof _Alignof _Static_assert alignof static_assert\n                   links to Operator\ncType          xxx wchar_t uint8_t uint_fast32_t _Bool int_fast8_t float off_t _Complex uint_least32_t int_fast16_t int_fast32_t ptrdiff_t uintptr_t uint64_t uint_fast8_t int_least32_t long void wint_t complex uint_least8_t uint16_t uint_fast64_t imaginary int32_t unsigned char16_t FILE uint_least64_t int_least8_t va_list intptr_t int_fast64_t uint_fast16_t fpos_t size_t wctrans_t div_t jmp_buf uintmax_t mbstate_t int_least64_t _Imaginary uint_least16_t int8_t time_t DIR clock_t sig_atomic_t wctype_t int_least16_t ldiv_t bool ssize_t uint32_t double short char intmax_t int64_t char32_t int int16_t signed\n                   links to Type\ncStructure     xxx struct union typedef enum\n                   links to Structure\ncStorageClass  xxx inline const volatile alignas register thread_local _Noreturn static extern _Alignas _Atomic restrict noreturn _Thread_local auto\n                   links to StorageClass\ncConstant      xxx stderr USHRT_MAX CHAR_BIT SIGINT SIGINT EINVAL LDBL_MIN_EXP INT_FAST32_MIN UINT_LEAST16_MAX LONG_MAX EROFS EXIT_FAILURE ENOTSUP SCHAR_MAX SEEK_END EINPROGRESS SLONG_MIN SIGSEGV SIGSEGV UINT_FAST8_MAX EINTR true ENOSYS INT32_MAX ULLONG_MAX SINT_MIN SIGALRM SHRT_MIN INT64_MAX WINT_MAX ENOTDIR INT_FAST16_MAX ESPIPE __FILE__ M_PI TMP_MAX MB_LEN_MAX SIGKILL DBL_MIN_10_EXP INT_LEAST8_MAX LC_COLLATE ENOSPC HUGE_VAL EIO INT8_MAX LC_MONETARY LDBL_MIN INT_LEAST16_MIN INT_FAST64_MIN INT_MAX EILSEQ FLT_MANT_DIG INT_FAST32_MAX __func__ FLT_MIN EOF false DBL_MIN_EXP ETIMEDOUT INT_FAST8_MIN M_LN10 FLT_EPSILON stdin INT_FAST64_MAX EISDIR ENOENT UINTMAX_MAX SIGSTOP UINT_LEAST32_MAX LDBL_MIN_10_EXP SLONG_MAX SIG_ATOMIC_MIN SIZE_MAX SIGTERM SIGTERM EPERM NULL FOPEN_MAX EMFILE UINT_LEAST64_MAX DBL_MAX SIGFPE SIGFPE INT_LEAST32_MIN SIGPIPE SINT_MAX SHRT_MAX __STDC_VERSION__ SIGQUIT UINT16_MAX SSHRT_MIN INT_LEAST64_MIN M_SQRT2 INTPTR_MAX EMSGSIZE DBL_MANT_DIG _IOFBF DBL_MAX_10_EXP stdout SIGUSR2 LC_ALL EMLINK SIGTTOU SIGHUP SIGHUP LDBL_MAX INT_LEAST16_MAX UINT32_MAX __DATE__ FLT_MAX FILENAME_MAX INT_FAST8_MAX BUFSIZ UINT64_MAX EBADMSG INT_MIN UCHAR_MAX LDBL_EPSILON FLT_MIN_10_EXP SIGABRT SIGABRT SIG_ATOMIC_MAX M_E LLONG_MIN UINT_FAST16_MAX ECHILD INT_LEAST32_MAX M_1_PI LDBL_DIG ENOLCK L_tmpnam ENOTTY FLT_DIG SSHRT_MAX INT_LEAST64_MAX EACCES WEOF __LINE__ UINT_LEAST8_MAX __TIME__ CHAR_MIN M_PI_2 _IONBF M_PI_4 __STDC__ UINT_FAST32_MAX FLT_ROUNDS SEEK_SET EBUSY INTMAX_MIN FLT_MAX_10_EXP LC_TIME CLOCKS_PER_SEC ENXIO ERANGE _IOLBF ENODEV EXDEV FLT_MIN_EXP EFAULT M_2_PI WCHAR_MIN LDBL_MAX_EXP DBL_EPSILON ULONG_MAX ENOMEM SIGTRAP UINT_MAX M_LOG2E LLONG_MAX LDBL_MAX_10_EXP SIG_IGN M_SQRT1_2 EDEADLK ENOTEMPTY LC_NUMERIC ENOEXEC INT16_MIN PTRDIFF_MIN ESRCH MB_CUR_MAX RAND_MAX M_LN2 ENFILE INTPTR_MIN EXIT_SUCCESS CHAR_MAX SIGILL SIGILL LONG_MIN INT_LEAST8_MIN SCHAR_MIN SIG_DFL SEEK_CUR SIGTTIN FLT_MAX_EXP EDOM INT32_MIN SIGUSR1 ECANCELED UINT8_MAX EEXIST LDBL_MANT_DIG EAGAIN INT64_MIN WINT_MIN INT_FAST16_MIN LC_CTYPE ENAMETOOLONG EBADF M_LOG10E E2BIG SIGCONT M_2_SQRTPI WCHAR_MAX DBL_MAX_EXP EPIPE SIGTSTP UINTPTR_MAX UINT_FAST64_MAX SIGCHLD INTMAX_MAX EFBIG SIG_ERR INT8_MIN INT16_MAX PTRDIFF_MAX FLT_RADIX DBL_MIN DBL_DIG\n                   links to Constant\ncPreCondit     xxx start=/^\\s*\\(%:\\|#\\)\\s*\\(if\\|ifdef\\|ifndef\\|elif\\)\\>/ skip=/\\\\$/ end=/$/  keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError\n                   links to PreCondit\ncPreConditMatch xxx match /^\\s*\\(%:\\|#\\)\\s*\\(else\\|endif\\)\\>/  display\n                   links to cPreCondit\ncCppInIf       xxx matchgroup=cCppInWrapper start=/\\d\\+/ end=/^\\s*\\(%:\\|#\\)\\s*endif\\>/  contained contains=TOP,cPreCondit\ncCppInElse     xxx start==^\\s*\\(%:\\|#\\)\\s*\\(else\\>\\|elif\\s\\+\\(0*[1-9]\\d*\\s*\\($\\|//\\|/\\*\\||\\)\\)\\@!\\)= end=/.\\@=\\|$/  contained fold contains=cCppInElse2 containedin=cCppInIf\ncCppInElse2    xxx matchgroup=cCppInWrapper start=+^\\s*\\(%:\\|#\\)\\s*\\(else\\|elif\\)\\([^/]\\|/[^/*]\\)*+ end=/^\\s*\\(%:\\|#\\)\\s*endif\\>/me=s-1  contained contains=cSpaceError,cCppOutSkip\n                   links to cCppOutIf2\ncCppOutIf      xxx start=/0\\+/ matchgroup=cCppOutWrapper end=/^\\s*\\(%:\\|#\\)\\s*endif\\>/  contained contains=cCppOutIf2,cCppOutElse\ncCppOutIf2     xxx matchgroup=cCppOutWrapper start=/0\\+/ end==^\\s*\\(%:\\|#\\)\\s*\\(else\\>\\|elif\\s\\+\\(0\\+\\s*\\($\\|//\\|/\\*\\|&\\)\\)\\@!\\|endif\\>\\)=me=s-1  contained fold contains=cSpaceError,cCppOutSkip\n                   links to cCppOut2\ncCppOutElse    xxx matchgroup=cCppOutWrapper start=/^\\s*\\(%:\\|#\\)\\s*\\(else\\|elif\\)/ end=/^\\s*\\(%:\\|#\\)\\s*endif\\>/me=s-1  contained contains=TOP,cPreCondit\ncCppInSkip     xxx matchgroup=cCppInWrapper start==^\\s*\\(%:\\|#\\)\\s*\\(if\\s\\+\\(\\d\\+\\s*\\($\\|//\\|/\\*\\||\\|&\\)\\)\\@!\\|ifdef\\>\\|ifndef\\>\\)= skip=/\\\\$/ end=/^\\s*\\(%:\\|#\\)\\s*endif\\>/  contained contains=TOP,cPreProc containedin=cCppOutElse,cCppInIf,cCppInSkip\ncCppOutSkip    xxx start=/^\\s*\\(%:\\|#\\)\\s*\\(if\\>\\|ifdef\\>\\|ifndef\\>\\)/ skip=/\\\\$/ end=/^\\s*\\(%:\\|#\\)\\s*endif\\>/  contained contains=cSpaceError,cCppOutSkip\n                   links to cCppOutIf2\ncCppOutWrapper xxx start==^\\s*\\(%:\\|#\\)\\s*if\\s\\+0\\+\\s*\\($\\|//\\|/\\*\\|&\\)= end=/.\\@=\\|$/  fold contains=cCppOutIf,cCppOutElse\n                   links to cPreCondit\ncCppInWrapper  xxx start==^\\s*\\(%:\\|#\\)\\s*if\\s\\+0*[1-9]\\d*\\s*\\($\\|//\\|/\\*\\||\\)= end=/.\\@=\\|$/  fold contains=cCppInIf,cCppInElse\n                   links to cCppOutWrapper\ncPreProc       xxx start=/^\\s*\\(%:\\|#\\)\\s*\\(pragma\\>\\|line\\>\\|warning\\>\\|warn\\>\\|error\\>\\)/ skip=/\\\\$/ end=/$/  keepend contains=ALLBUT,@cPreProcGroup,@Spell\n                   links to PreProc\ncInclude       xxx match /^\\s*\\(%:\\|#\\)\\s*include\\>\\s*[\"<]/  display contains=cIncluded\n                   links to Include\ncDefine        xxx start=/^\\s*\\(%:\\|#\\)\\s*\\(define\\|undef\\)\\>/ skip=/\\\\$/ end=/$/  keepend contains=ALLBUT,@cPreProcGroup,@Spell\n                   links to Macro\ncMulti         xxx start=/?/ skip=/::/ end=/:/  transparent contains=ALLBUT,@cMultiGroup,@Spell\ncppStatement   xxx this delete using friend new\n                   links to Statement\ncppAccess      xxx public protected private\n                   links to cppStatement\ncppType        xxx wchar_t inline explicit virtual export bool\n                   links to Type\ncppExceptions  xxx catch try throw\n                   links to Exception\ncppOperator    xxx bitand or compl operator and_eq not_eq xor_eq bitor xor and or_eq not typeid\n                   links to Operator\ncppCast        xxx match /\\<\\(const\\|static\\|dynamic\\|reinterpret\\)_cast\\s*</me=e-1\n                   match /\\<\\(const\\|static\\|dynamic\\|reinterpret\\)_cast\\s*$/\n                   links to cppStatement\ncppStorageClass xxx mutable\n                   links to StorageClass\ncppStructure   xxx class typename template namespace\n                   links to Structure\ncppNumber      xxx NPOS\n                   links to Number\ncppBoolean     xxx true false\n                   links to Boolean\ncppMinMax      xxx match /[<>]?/\ncCommentGroup  cluster=cTodo,cBadContinuation\nSpell          cluster=NONE\ncParenGroup    cluster=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom\ncCppOutInGroup cluster=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip\ncPreProcGroup  cluster=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock\ncMultiGroup    cluster=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString\ncLabelGroup    cluster=cUserLabel\n\n"
  },
  {
    "path": "python/ycm/tests/testdata/java_syntax",
    "content": "--- Syntax items ---\nhtmlValue      xxx match /=[\\t ]*[^'\" \\t>][^ \\t>]*/hs=s+1  contained contains=javaScriptExpression,@htmlPreproc\n                   links to Normal\ncCustomFunc    xxx match /\\w\\+\\s*\\((\\)\\@=/\n                   links to Function\ncCustomClass   xxx match /\\w\\+\\s*\\(::\\)\\@=/\n                   links to Function\nOperatorChars  xxx match #?\\|+\\|-\\|\\*\\|;\\|:\\|,\\|<\\|>\\|&\\||\\|!\\|\\~\\|%\\|=\\|)\\|(\\|{\\|}\\|\\.\\|\\[\\|\\]\\|/\\(/\\|*\\)\\@!#\njavaFold       xxx start=/{/ end=/}/  transparent fold\njavaError      xxx const goto\n                   match /[\\\\@`]/\n                   match +<<<\\|\\.\\.\\|=>\\|||=\\|&&=\\|[^-]->\\|\\*\\/+\n                   links to Error\njavaOK         xxx match /\\.\\.\\./\njavaError2     xxx match /#\\|=</\n                   links to javaError\njavaExternal   xxx native package\n                   match /\\<import\\>\\(\\s\\+static\\>\\)\\?/\n                   links to Include\njavaConditional xxx if else switch\n                   links to Conditional\njavaRepeat     xxx do for while\n                   links to Repeat\njavaBoolean    xxx true false\n                   links to Boolean\njavaConstant   xxx null\n                   links to Constant\njavaTypedef    xxx this super\n                   match /\\.\\s*\\<class\\>/ms=s+1\n                   links to Typedef\njavaOperator   xxx new instanceof\n                   links to Operator\njavaType       xxx float boolean long void double short char byte int\n                   links to Type\njavaStatement  xxx return\n                   links to Statement\njavaStorageClass xxx transient strictfp serializable synchronized static final volatile\n                   links to StorageClass\njavaExceptions xxx finally catch try throw\n                   links to Exception\njavaAssert     xxx assert\n                   links to Statement\njavaMethodDecl xxx synchronized throws\n                   links to javaStorageClass\njavaClassDecl  xxx interface implements enum extends\n                   match /^class\\>/\n                   match /[^.]\\s*\\<class\\>/ms=s+1\n                   match /@interface\\>/\n                   links to javaStorageClass\njavaAnnotation xxx match /@\\([_$a-zA-Z][_$a-zA-Z0-9]*\\.\\)*[_$a-zA-Z][_$a-zA-Z0-9]*\\>/\n                   links to PreProc\njavaBranch     xxx nextgroup=javaUserLabelRef  skipwhite continue\n                   nextgroup=javaUserLabelRef  skipwhite break\n                   links to Conditional\njavaUserLabelRef xxx match /\\k\\+/  contained\n                   links to javaUserLabel\njavaVarArg     xxx match /\\.\\.\\./\n                   links to Function\njavaScopeDecl  xxx protected public private abstract\n                   links to javaStorageClass\njavaLabel      xxx default\n                   links to Label\njavaNumber     xxx match /\\<\\(0[0-7]*\\|0[xX]\\x\\+\\|\\d\\+\\)[lL]\\=\\>/\n                   match /\\(\\<\\d\\+\\.\\d*\\|\\.\\d\\+\\)\\([eE][-+]\\=\\d\\+\\)\\=[fFdD]\\=/\n                   match /\\<\\d\\+[eE][-+]\\=\\d\\+[fFdD]\\=\\>/\n                   match /\\<\\d\\+\\([eE][-+]\\=\\d\\+\\)\\=[fFdD]\\>/\n                   links to Number\njavaCharacter  xxx match /'[^']*'/  contains=javaSpecialChar,javaSpecialCharError\n                   match /'\\\\''/  contains=javaSpecialChar\n                   match /'[^\\\\]'/\n                   links to Character\njavaLabelRegion xxx matchgroup=javaLabel start=/\\<case\\>/ matchgroup=NONE end=/:/  transparent contains=javaNumber,javaCharacter\njavaUserLabel  xxx match /^\\s*[_$a-zA-Z][_$a-zA-Z0-9_]*\\s*:/he=e-1  contains=javaLabel\n                   links to Label\njavaTodo       xxx contained TODO XXX FIXME\n                   links to Todo\njavaSpecial    xxx match /\\\\u\\d\\{4\\}/\n                   links to Special\njavaCommentStar xxx match +^\\s*\\*[^/]+me=e-1  contained\n                   match /^\\s*\\*$/  contained\n                   links to javaComment\njavaSpecialChar xxx match /\\\\\\([4-9]\\d\\|[0-3]\\d\\d\\|[\\\"\\\\'ntbrf]\\|u\\x\\{4\\}\\)/  contained\n                   links to SpecialChar\njavaComment    xxx start=+/\\*+ end=+\\*/+  contains=@javaCommentSpecial,javaTodo,@Spell\n                   match +/\\*\\*/+\n                   links to Comment\njavaLineComment xxx match +//.*+  contains=@javaCommentSpecial2,javaTodo,@Spell\n                   links to Comment\njavaString     xxx start=/\"/ end=/$/ end=/\"/  contains=javaSpecialChar,javaSpecialError,@Spell\n                   links to String\nhtmlError      xxx match /[<>&]/  contained\n                   links to Error\nhtmlSpecialChar xxx match /&#\\=[0-9A-Za-z]\\{1,8};/  contained\n                   links to Special\nhtmlString     xxx start=/\"/ end=/\"/  contained contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc\n                   start=/'/ end=/'/  contained contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc\n                   links to String\nhtmlTagN       xxx match /<\\s*[-a-zA-Z0-9]\\+/hs=s+1  contained contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster\n                   match =</\\s*[-a-zA-Z0-9]\\+=hs=s+2  contained contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster\nhtmlTagError   xxx match /[^>]</ms=s+1  contained\n                   links to htmlError\nhtmlEndTag     xxx start=+</+ end=/>/  contained contains=htmlTagN,htmlTagError\n                   links to Identifier\nhtmlArg        xxx contained below color name gutter span classid alt marginheight target rows bgcolor ismap cellspacing object codetype frame noshade data for bordercolor clip rowspan defer cellpadding shape usemap rules multiple start selected language summary hspace lowsrc type valign hreflang noresize scheme\n                   contained class visibility checked pagex pagey headers scrolling clear charset id id declare codebase tabindex standby version link accept coords alink background vspace wrap profile width compact marginwidth above content border top maxlength prompt dir value charoff height longdesc nowrap\n                   contained accesskey cols cite rel rev style method size src axis vlink valuetype colspan nohref face lang frameborder enctype readonly action left text url char align scope code disabled abbr datetime archive\n                   match /\\<\\(http-equiv\\|href\\|title\\)=/me=e-1  contained\n                   match /\\<z-index\\>/  contained\n                   match /\\<\\(accept-charset\\|label\\)\\>/  contained\n                   links to Type\nhtmlTag        xxx start=+<[^/]+ end=/>/  contained fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster\n                   links to Function\nhtmlTagName    xxx contained marquee span ol thead pre blink tbody a p q s object legend frame acronym noframes blockquote var table input hr button bdo font caption sub del sup col basefont xmp iframe dfn html meta nobr fieldset optgroup option applet link area map li td th tr tt param center address small frameset\n                   contained label ul dir div kbd cite big layer form textarea base tfoot br strike samp select menu colgroup img nolayer spacer ilayer code abbr isindex dd ins dl dt noscript\n                   match /\\<\\(b\\|i\\|u\\|h[1-6]\\|em\\|strong\\|head\\|body\\|title\\)\\>/  contained\n                   links to htmlStatement\nhtmlSpecialTagName xxx contained script style\n                   links to Exception\nhtmlCommentPart xxx start=/--/ end=/--\\s*/  contained contains=@htmlPreproc,@Spell\n                   links to Comment\nhtmlCommentError xxx match /[^><!]/  contained\n                   links to htmlError\nhtmlComment    xxx start=/<!/ end=/>/  contained contains=htmlCommentPart,htmlCommentError,@Spell\n                   start=/<!DOCTYPE/ end=/>/  contained keepend\n                   links to Comment\nhtmlPreStmt    xxx match /<!--#\\(config\\|echo\\|exec\\|fsize\\|flastmod\\|include\\|printenv\\|set\\|if\\|elif\\|else\\|endif\\|geoguide\\)\\>/  contained\n                   links to PreProc\nhtmlPreError   xxx match /<!--#\\S*/ms=s+4  contained\n                   links to Error\nhtmlPreAttr    xxx match /\\w\\+=[^\"]\\S\\+/  contained contains=htmlPreProcAttrError,htmlPreProcAttrName\n                   start=/\\w\\+=\"/ skip=/\\\\\\\\\\|\\\\\"/ end=/\"/  contained keepend contains=htmlPreProcAttrName\n                   links to String\nhtmlPreProc    xxx start=/<!--#/ end=/-->/  contained contains=htmlPreStmt,htmlPreError,htmlPreAttr\n                   links to PreProc\nhtmlPreProcAttrError xxx match /\\w\\+=/he=e-1  contained\n                   links to Error\nhtmlPreProcAttrName xxx match /\\(expr\\|errmsg\\|sizefmt\\|timefmt\\|var\\|cgi\\|cmd\\|file\\|virtual\\|value\\)=/he=e-1  contained\n                   links to PreProc\nhtmlLink       xxx start=/<a\\>\\_[^>]*\\<href\\>/ end=+</a>+me=e-4  contained contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc\n                   links to Underlined\nhtmlBoldUnderline xxx start=/<u\\>/ end=+</u>+me=e-4  contained contains=@htmlTop,htmlBoldUnderlineItalic\nhtmlBoldItalic xxx start=/<i\\>/ end=+</i>+me=e-4  contained contains=@htmlTop,htmlBoldItalicUnderline\n                   start=/<em\\>/ end=+</em>+me=e-5  contained contains=@htmlTop,htmlBoldItalicUnderline\nhtmlBold       xxx start=/<b\\>/ end=+</b>+me=e-4  contained contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic\n                   start=/<strong\\>/ end=+</strong>+me=e-9  contained contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic\nhtmlBoldUnderlineItalic xxx start=/<i\\>/ end=+</i>+me=e-4  contained contains=@htmlTop\n                   start=/<em\\>/ end=+</em>+me=e-5  contained contains=@htmlTop\nhtmlBoldItalicUnderline xxx start=/<u\\>/ end=+</u>+me=e-4  contained contains=@htmlTop,htmlBoldUnderlineItalic\n                   links to htmlBoldUnderlineItalic\nhtmlUnderlineBold xxx start=/<b\\>/ end=+</b>+me=e-4  contained contains=@htmlTop,htmlUnderlineBoldItalic\n                   start=/<strong\\>/ end=+</strong>+me=e-9  contained contains=@htmlTop,htmlUnderlineBoldItalic\n                   links to htmlBoldUnderline\nhtmlUnderlineItalic xxx start=/<i\\>/ end=+</i>+me=e-4  contained contains=@htmlTop,htmlUnderlineItalicBold\n                   start=/<em\\>/ end=+</em>+me=e-5  contained contains=@htmlTop,htmlUnderlineItalicBold\nhtmlUnderline  xxx start=/<u\\>/ end=+</u>+me=e-4  contained contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic\nhtmlUnderlineBoldItalic xxx start=/<i\\>/ end=+</i>+me=e-4  contained contains=@htmlTop\n                   start=/<em\\>/ end=+</em>+me=e-5  contained contains=@htmlTop\n                   links to htmlBoldUnderlineItalic\nhtmlUnderlineItalicBold xxx start=/<b\\>/ end=+</b>+me=e-4  contained contains=@htmlTop\n                   start=/<strong\\>/ end=+</strong>+me=e-9  contained contains=@htmlTop\n                   links to htmlBoldUnderlineItalic\nhtmlItalicBold xxx start=/<b\\>/ end=+</b>+me=e-4  contained contains=@htmlTop,htmlItalicBoldUnderline\n                   start=/<strong\\>/ end=+</strong>+me=e-9  contained contains=@htmlTop,htmlItalicBoldUnderline\n                   links to htmlBoldItalic\nhtmlItalicUnderline xxx start=/<u\\>/ end=+</u>+me=e-4  contained contains=@htmlTop,htmlItalicUnderlineBold\n                   links to htmlUnderlineItalic\nhtmlItalic     xxx start=/<i\\>/ end=+</i>+me=e-4  contained contains=@htmlTop,htmlItalicBold,htmlItalicUnderline\n                   start=/<em\\>/ end=+</em>+me=e-5  contained contains=@htmlTop\nhtmlItalicBoldUnderline xxx start=/<u\\>/ end=+</u>+me=e-4  contained contains=@htmlTop\n                   links to htmlBoldUnderlineItalic\nhtmlItalicUnderlineBold xxx start=/<b\\>/ end=+</b>+me=e-4  contained contains=@htmlTop\n                   start=/<strong\\>/ end=+</strong>+me=e-9  contained contains=@htmlTop\n                   links to htmlBoldUnderlineItalic\nhtmlLeadingSpace xxx match /^\\s\\+/  contained\n                   links to None\nhtmlH1         xxx start=/<h1\\>/ end=+</h1>+me=e-5  contained contains=@htmlTop\n                   links to Title\nhtmlH2         xxx start=/<h2\\>/ end=+</h2>+me=e-5  contained contains=@htmlTop\n                   links to htmlH1\nhtmlH3         xxx start=/<h3\\>/ end=+</h3>+me=e-5  contained contains=@htmlTop\n                   links to htmlH2\nhtmlH4         xxx start=/<h4\\>/ end=+</h4>+me=e-5  contained contains=@htmlTop\n                   links to htmlH3\nhtmlH5         xxx start=/<h5\\>/ end=+</h5>+me=e-5  contained contains=@htmlTop\n                   links to htmlH4\nhtmlH6         xxx start=/<h6\\>/ end=+</h6>+me=e-5  contained contains=@htmlTop\n                   links to htmlH5\nhtmlTitle      xxx start=/<title\\>/ end=+</title>+me=e-8  contained contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc\n                   links to Title\nhtmlHead       xxx start=/<head\\>/ end=/<h[1-6]\\>/me=e-3 end=/<body\\>/me=e-5 end=+</head>+me=e-7  contained contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc\n                   links to PreProc\njavaCommentTitle xxx matchgroup=javaDocComment start=+/\\*\\*+ matchgroup=javaCommentTitle end=+\\*/+me=s-1,he=s-1 end=/[^{]@/me=s-2,he=s-1 end=/\\.[ \\t\\r<&]/me=e-1 end=/\\.$/  contained keepend contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags,javaDocSeeTag\n                   links to SpecialComment\njavaDocTags    xxx start=/{@\\(code\\|link\\|linkplain\\|inherit[Dd]oc\\|doc[rR]oot\\|value\\)/ end=/}/  contained\n                   match /@\\(param\\|exception\\|throws\\|since\\)\\s\\+\\S\\+/  contained contains=javaDocParam\n                   match /@\\(version\\|author\\|return\\|deprecated\\|serial\\|serialField\\|serialData\\)\\>/  contained\n                   links to Special\njavaDocSeeTag  xxx matchgroup=javaDocTags start=/@see\\s\\+/ matchgroup=NONE end=/\\_./re=e-1  contained contains=javaDocSeeTagParam\njavaDocComment xxx start=+/\\*\\*+ end=+\\*/+  keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaTodo,@Spell\n                   links to Comment\njavaDocParam   xxx match /\\s\\S\\+/  contained\n                   links to Function\njavaDocSeeTagParam xxx match @\"\\_[^\"]\\+\"\\|<a\\s\\+\\_.\\{-}</a>\\|\\(\\k\\|\\.\\)*\\(#\\k\\+\\((\\_[^)]\\+)\\)\\=\\)\\=@  contained extend\n                   links to Function\njavaSpecialError xxx match /\\\\./  contained\n                   links to Error\njavaSpecialCharError xxx match /[^']/  contained\n                   links to Error\njavaParenT1    xxx matchgroup=javaParen1 start=/(/ end=/)/  contained transparent contains=@javaTop,javaParenT2\n                   matchgroup=javaParen1 start=/\\[/ end=/\\]/  contained transparent contains=@javaTop,javaParenT2\njavaParenT     xxx matchgroup=javaParen start=/(/ end=/)/  transparent contains=@javaTop,javaParenT1\n                   matchgroup=javaParen start=/\\[/ end=/\\]/  transparent contains=@javaTop,javaParenT1\njavaParenT2    xxx matchgroup=javaParen2 start=/(/ end=/)/  contained transparent contains=@javaTop,javaParenT\n                   matchgroup=javaParen2 start=/\\[/ end=/\\]/  contained transparent contains=@javaTop,javaParenT\njavaParenError xxx match /)/\n                   match /\\]/\n                   links to javaError\njavaTop        cluster=javaError,javaError,javaError,javaError2,javaExternal,javaConditional,javaRepeat,javaBoolean,javaConstant,javaTypedef,javaOperator,javaType,javaType,javaStatement,javaStorageClass,javaExceptions,javaAssert,javaMethodDecl,javaClassDecl,javaClassDecl,javaClassDecl,javaAnnotation,javaBranch,javaVarArg,javaScopeDecl,javaLangObject,javaLabel,javaNumber,javaCharacter,javaLabelRegion,javaUserLabel,javaSpecial,javaComment,javaLineComment,javaString,javaStringError\nSpell          cluster=NONE\njavaCommentSpecial cluster=NONE\njavaCommentSpecial2 cluster=NONE\njavaHtml       cluster=htmlError,htmlSpecialChar,htmlEndTag,htmlTag,htmlComment,htmlPreProc,htmlLink,htmlBold,htmlUnderline,htmlItalic,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,htmlTitle,htmlHead\nhtmlPreproc    cluster=NONE\nhtmlArgCluster cluster=NONE\nhtmlTagNameCluster cluster=NONE\nhtmlTop        cluster=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc\nhtmlJavaScript cluster=@htmlPreproc\nhtmlVbScript   cluster=NONE\nhtmlCss        cluster=NONE\njavaClasses    cluster=NONE\n\n"
  },
  {
    "path": "python/ycm/tests/testdata/php_syntax",
    "content": "\n\n--- Syntax items ---\nhtmlValue      xxx match /=[\\t ]*[^'\" \\t>][^ \\t>]*/hs=s+1  contained contains=javaScriptExpression,@htmlPreproc \n                   links to Normal\ntrailingWhitespace xxx match /\\v\\s+%#@<!$/  containedin=ALLBUT,trailingWhitespace,literalTab \n                   match /\\v\\s+%#@<!$/  contained containedin=ALLBUT,trailingWhitespace,literalTab \n                   match /\\v\\s+%#@<!$/  contained containedin=ALLBUT,trailingWhitespace,literalTab \n                   match /\\v\\s+%#@<!$/  contained containedin=ALLBUT,trailingWhitespace,literalTab \n                   links to Todo\nliteralTab     xxx match /\\v\\t/  containedin=ALL \n                   match /\\v\\t/  contained containedin=ALL \n                   match /\\v\\t/  contained containedin=ALL \n                   match /\\v\\t/  contained containedin=ALL \n                   links to Todo\ncCustomFunc    xxx match /\\w\\+\\s*\\((\\)\\@=/  \n                   links to Function\ncCustomClass   xxx match /\\w\\+\\s*\\(::\\)\\@=/  \n                   links to Function\nOperatorChars  xxx match #?\\|+\\|-\\|\\*\\|;\\|:\\|,\\|<\\|>\\|&\\||\\|!\\|\\~\\|%\\|=\\|)\\|(\\|{\\|}\\|\\.\\|\\[\\|\\]\\|/\\(/\\|*\\)\\@!#  \nhtmlTagName    xxx contained path hgroup feBlend animateTransform glyphRef altGlyphItem feImage altGlyph embed feOffset glyph g ellipse feMerge symbol details clipPath canvas section view data vkern command altGlyphDef radialGradient bdi output image feSpecularLighting meter filter stop font-face-format header\n                   contained textPath feConvolveMatrix tspan rp rt svg polygon mark font hkern figure datalist feComposite template font-face-name feDisplacementMap feMergeNode circle feSpotLight mask wbr main nav font-face tref line rect foreignObject missing-glyph audio figcaption pattern content video article time\n                   contained footer fePointLight feGaussianBlur defs switch aside feComponentTransfer animate source feFlood set animateMotion linearGradient feTile font-face-uri polyline marker feDiffuseLighting ruby font-face-src dialog menu feDistantLight feTurbulence summary feColorMatrix text color-profile\n                   contained feFuncA feFuncB feFuncG progress feFuncR keygen mpath desc feMorphology track shadow cursor animateColor use\n                   contained marquee a p q s noframes blockquote button caption big meta address form img ilayer ins var fieldset option applet link frameset br dd dl dt noscript bdo tbody nobr cite li strike colgroup acronym select ol blink td th tr tt ul kbd textarea thead table input param center layer base tfoot\n                   contained samp nolayer code font sub sup col optgroup iframe menu object hr span del xmp dfn html legend small dir div abbr isindex pre basefont spacer area map frame label\n                   match /\\<[a-z_]\\+\\(\\-[a-z_]\\+\\)\\+\\>/  contained \n                   match /\\<\\(b\\|i\\|u\\|h[1-6]\\|em\\|strong\\|head\\|body\\|title\\)\\>/  contained \n                   links to htmlStatement\nhtmlArg        xxx contained accumulate font-stretch font-stretch stdDeviation keySplines color list strikethrough-position clip-path path edgeMode marker-mid maskContentUnits opacity media media onselect local onloadeddata glyphRef onvolumechange scale ondragstart onseeking transform targetX targetY primitiveUnits\n                   contained fx text-anchor v-mathematical onkeypress onmousemove onmousemove direction additive string onsuspend d contenteditable ascent format format glyph-orientation-vertical numOctaves in2 r u x y operator kind srclang name pubdate spreadMethod xlink:href marker-end glyph-orientation-horizontal\n                   contained k onloadstart preserveAspectRatio itemprop xlink:role color-interpolation-filters stitchTiles formtarget orientation placeholder diffuseConstant onforminput azimuth fy onafterprint writing-mode onresize onresize onfocusin onplaying attributeType onzoom alignment-baseline stroke-linecap\n                   contained contextmenu zoomAndPan g1 g2 onreadystatechange ondblclick patternTransform spacing onblur onblur ry ononline itemid tabindex origin ondragover repeatDur dominant-baseline limitingConeAngle intercept method font-variant font-variant onmessage requiredFeatures filter onredo vert-origin-x\n                   contained kernelMatrix step markerUnits 1 slope async ideographic oncanplaythrough offset offset result alphabetic icon controls onended x2 descent onemptied min min onpause type ondrag x1 gradientUnits ondragenter divisor keyPoints v-alphabetic overline-thickness preload stroke-dasharray\n                   contained xlink:type overline-position attributeName from elevation bbox rx formnovalidate font-size-adjust class class externalResourcesRequired visibility accent-height stroke rotate amplitude vert-adv-y viewBox oninput onmouseout onmouseout onerror onerror onerror loop lengthAdjust\n                   contained enable-background fill fill onshow xml:space xml:space radius onabort onabort mathematical onplay k2 contentScriptType onprogress onoffline unicode-bidi word-spacing maskUnits onfocusout charset mode lighting-color stroke-width id id onmouseover onmouseover poster restart in mask\n                   contained fill-opacity is onscroll onscroll formaction underline-thickness v-ideographic markerWidth version oncontextmenu onchange onmousewheel patternUnits clip max max target hanging font-family font-family calcMode arabic-form begin vert-origin-y color-interpolation rendering-intent to onsubmit\n                   contained stroke-opacity pointsAtX pointsAtY pointsAtZ requiredExtensions exponent pathLength onrepeat stroke-linejoin onstalled onfocus onfocus onwaiting z baseline-shift itemtype u2 width oncanplay flood-opacity underline-position xlink:title units-per-em onformchange k1 onpopstate k3 end stemh\n                   contained specularConstant onbeforeprint order stemv label unicode-range onkeyup points oninvalid onmouseup onmouseup text-decoration itemscope onclick onclick dir baseProfile onload onload onload onload onbeforeunload contentStyleType values onactivate specularExponent widths hidden autofocus\n                   contained autofocus cap-height repeatCount onloadedmetadata height translate strikethrough-thickness draggable bias startOffset xlink:actuate xlink:actuate ondrop accesskey systemLanguage xChannelSelector shape-rendering stop-opacity color-rendering clipPathUnits formmethod title title ondragleave\n                   contained panose-1 horiz-origin-y text-rendering glyph-name pointer-events overflow flood-color onhashchange stop-color autoplay xlink:show xlink:show onbegin font-size font-size form letter-spacing filterUnits fill-rule clip-rule refX refY by onkeydown markerHeight stroke-dashoffset xmlns lang\n                   contained lang kernelUnitLength font-style font-style orient open style unicode gradientTransform horiz-adv-x v-hanging preserveAlpha onend onmousedown onmousedown display dur patternContentUnits seed kerning k4 onunload onunload ondragend y1 baseFrequency textLength cx cy dx spellcheck\n                   contained autocomplete x-height font-weight font-weight color-profile ontimeupdate itemref onstorage viewTarget onseeked image-rendering ondurationchange marker-start xml:base xml:base required yChannelSelector track keyTimes filterRes surfaceScale select datetime xml:lang xml:lang cursor\n                   contained stroke-miterlimit onratechange formenctype dy y2 xlink:arcrole tableValues onundo\n                   contained usemap target bgcolor ismap shape language scheme headers content axis noshade style vlink nohref left disabled color classid alt marginheight data cellpadding gutter class scrolling link codebase longdesc rel rev lang datetime archive media noresize start hspace cols hreflang visibility\n                   contained charset id id version width compact border charoff accesskey cite codetype valuetype enctype rows for valign profile value face text bordercolor defer multiple lowsrc pagex pagey checked declare above maxlength nowrap colspan align scope code src cellspacing standby accept coords wrap\n                   contained alink size action prompt type below name object readonly rowspan span selected vspace top dir height frameborder summary char abbr method rules tabindex background clear clip url marginwidth frame\n                   match /\\<\\(data\\(\\-[a-z]\\+\\)\\+\\)\\=\\>/  contained \n                   match /\\<\\(http-equiv\\|href\\|title\\)=/me=e-1  contained \n                   match /\\<z-index\\>/  contained \n                   match /\\<\\(accept-charset\\|label\\)\\>/  contained \n                   links to Type\nhtmlError      xxx match /[<>&]/  \n                   links to Error\nhtmlSpecialChar xxx match /&#\\=[0-9A-Za-z]\\{1,8};/  \n                   links to Special\njavaScriptExpression xxx start=/&{/ end=/};/  contained keepend contains=@htmlJavaScript,@htmlPreproc \n                   links to javaScript\nhtmlString     xxx start=/\"/ end=/\"/  contained contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc \n                   start=/'/ end=/'/  contained contains=htmlSpecialChar,javaScriptExpression,@htmlPreproc \n                   links to String\nhtmlTagN       xxx match /<\\s*[-a-zA-Z0-9]\\+/hs=s+1  contained contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster \n                   match =</\\s*[-a-zA-Z0-9]\\+=hs=s+2  contained contains=htmlTagName,htmlSpecialTagName,@htmlTagNameCluster \nhtmlTagError   xxx match /[^>]</ms=s+1  contained \n                   links to htmlError\nhtmlEndTag     xxx start=+</+ end=/>/  contains=htmlTagN,htmlTagError \n                   links to Identifier\nhtmlEvent      xxx start=/\\<on\\a\\+\\s*=[\\t ]*'/ end=/'/  contained keepend contains=htmlEventSQ \n                   start=/\\<on\\a\\+\\s*=[\\t ]*\"/ end=/\"/  contained keepend contains=htmlEventDQ \n                   links to javaScript\nhtmlCssDefinition xxx matchgroup=htmlArg start=/style=\"/ matchgroup=htmlString end=/\"/  keepend contains=cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssLength,cssColor,cssURL,cssImportant,cssError,cssString,@htmlPreproc \n                   links to Special\nhtmlTag        xxx start=+<[^/]+ end=/>/  fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent,htmlCssDefinition,@htmlPreproc,@htmlArgCluster \n                   links to Function\nhtmlSpecialTagName xxx contained style script\n                   links to Exception\nhtmlCommentPart xxx start=/--/ end=/--\\s*/  contained contains=@htmlPreproc,@Spell \n                   links to Comment\nhtmlCommentError xxx match /[^><!]/  contained \n                   links to htmlError\nhtmlComment    xxx start=/<!/ end=/>/  contains=htmlCommentPart,htmlCommentError,@Spell \n                   start=/<!DOCTYPE/ end=/>/  keepend \n                   links to Comment\nhtmlPreStmt    xxx match /<!--#\\(config\\|echo\\|exec\\|fsize\\|flastmod\\|include\\|printenv\\|set\\|if\\|elif\\|else\\|endif\\|geoguide\\)\\>/  contained \n                   links to PreProc\nhtmlPreError   xxx match /<!--#\\S*/ms=s+4  contained \n                   links to Error\nhtmlPreAttr    xxx match /\\w\\+=[^\"]\\S\\+/  contained contains=htmlPreProcAttrError,htmlPreProcAttrName \n                   start=/\\w\\+=\"/ skip=/\\\\\\\\\\|\\\\\"/ end=/\"/  contained keepend contains=htmlPreProcAttrName \n                   links to String\nhtmlPreProc    xxx start=/<!--#/ end=/-->/  contains=htmlPreStmt,htmlPreError,htmlPreAttr \n                   links to PreProc\nhtmlPreProcAttrError xxx match /\\w\\+=/he=e-1  contained \n                   links to Error\nhtmlPreProcAttrName xxx match /\\(expr\\|errmsg\\|sizefmt\\|timefmt\\|var\\|cgi\\|cmd\\|file\\|virtual\\|value\\)=/he=e-1  contained \n                   links to PreProc\nhtmlLink       xxx start=/<a\\>\\_[^>]*\\<href\\>/ end=+</a>+me=e-4  contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLeadingSpace,javaScript,@htmlPreproc \n                   links to Underlined\njavaScript     xxx start=/<script\\_[^>]*>/ end=+</script>+me=s-1  keepend contains=@htmlJavaScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc \n                   start=/<script \\_[^>]*language *=\\_[^>]*vbscript\\_[^>]*>/ end=+</script>+me=s-1  keepend contains=@htmlVbScript,htmlCssStyleComment,htmlScriptTag,@htmlPreproc \n                   links to Special\nhtmlBoldUnderline xxx start=/<u\\>/ end=+</u>+me=e-4  contained contains=@htmlTop,htmlBoldUnderlineItalic \nhtmlBoldItalic xxx start=/<i\\>/ end=+</i>+me=e-4  contained contains=@htmlTop,htmlBoldItalicUnderline \n                   start=/<em\\>/ end=+</em>+me=e-5  contained contains=@htmlTop,htmlBoldItalicUnderline \nhtmlBold       xxx start=/<b\\>/ end=+</b>+me=e-4  contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic \n                   start=/<strong\\>/ end=+</strong>+me=e-9  contains=@htmlTop,htmlBoldUnderline,htmlBoldItalic \nhtmlBoldUnderlineItalic xxx start=/<i\\>/ end=+</i>+me=e-4  contained contains=@htmlTop \n                   start=/<em\\>/ end=+</em>+me=e-5  contained contains=@htmlTop \nhtmlBoldItalicUnderline xxx start=/<u\\>/ end=+</u>+me=e-4  contained contains=@htmlTop,htmlBoldUnderlineItalic \n                   links to htmlBoldUnderlineItalic\nhtmlUnderlineBold xxx start=/<b\\>/ end=+</b>+me=e-4  contained contains=@htmlTop,htmlUnderlineBoldItalic \n                   start=/<strong\\>/ end=+</strong>+me=e-9  contained contains=@htmlTop,htmlUnderlineBoldItalic \n                   links to htmlBoldUnderline\nhtmlUnderlineItalic xxx start=/<i\\>/ end=+</i>+me=e-4  contained contains=@htmlTop,htmlUnderlineItalicBold \n                   start=/<em\\>/ end=+</em>+me=e-5  contained contains=@htmlTop,htmlUnderlineItalicBold \nhtmlUnderline  xxx start=/<u\\>/ end=+</u>+me=e-4  contains=@htmlTop,htmlUnderlineBold,htmlUnderlineItalic \nhtmlUnderlineBoldItalic xxx start=/<i\\>/ end=+</i>+me=e-4  contained contains=@htmlTop \n                   start=/<em\\>/ end=+</em>+me=e-5  contained contains=@htmlTop \n                   links to htmlBoldUnderlineItalic\nhtmlUnderlineItalicBold xxx start=/<b\\>/ end=+</b>+me=e-4  contained contains=@htmlTop \n                   start=/<strong\\>/ end=+</strong>+me=e-9  contained contains=@htmlTop \n                   links to htmlBoldUnderlineItalic\nhtmlItalicBold xxx start=/<b\\>/ end=+</b>+me=e-4  contained contains=@htmlTop,htmlItalicBoldUnderline \n                   start=/<strong\\>/ end=+</strong>+me=e-9  contained contains=@htmlTop,htmlItalicBoldUnderline \n                   links to htmlBoldItalic\nhtmlItalicUnderline xxx start=/<u\\>/ end=+</u>+me=e-4  contained contains=@htmlTop,htmlItalicUnderlineBold \n                   links to htmlUnderlineItalic\nhtmlItalic     xxx start=/<i\\>/ end=+</i>+me=e-4  contains=@htmlTop,htmlItalicBold,htmlItalicUnderline \n                   start=/<em\\>/ end=+</em>+me=e-5  contains=@htmlTop \nhtmlItalicBoldUnderline xxx start=/<u\\>/ end=+</u>+me=e-4  contained contains=@htmlTop \n                   links to htmlBoldUnderlineItalic\nhtmlItalicUnderlineBold xxx start=/<b\\>/ end=+</b>+me=e-4  contained contains=@htmlTop \n                   start=/<strong\\>/ end=+</strong>+me=e-9  contained contains=@htmlTop \n                   links to htmlBoldUnderlineItalic\nhtmlLeadingSpace xxx match /^\\s\\+/  contained \n                   links to None\nhtmlH1         xxx start=/<h1\\>/ end=+</h1>+me=e-5  contains=@htmlTop \n                   links to Title\nhtmlH2         xxx start=/<h2\\>/ end=+</h2>+me=e-5  contains=@htmlTop \n                   links to htmlH1\nhtmlH3         xxx start=/<h3\\>/ end=+</h3>+me=e-5  contains=@htmlTop \n                   links to htmlH2\nhtmlH4         xxx start=/<h4\\>/ end=+</h4>+me=e-5  contains=@htmlTop \n                   links to htmlH3\nhtmlH5         xxx start=/<h5\\>/ end=+</h5>+me=e-5  contains=@htmlTop \n                   links to htmlH4\nhtmlH6         xxx start=/<h6\\>/ end=+</h6>+me=e-5  contains=@htmlTop \n                   links to htmlH5\nhtmlTitle      xxx start=/<title\\>/ end=+</title>+me=e-8  contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc \n                   links to Title\ncssStyle       xxx start=/<style/ end=+</style>+  keepend contains=@htmlCss,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc \nhtmlHead       xxx start=/<head\\>/ end=/<h[1-6]\\>/me=e-3 end=/<body\\>/me=e-5 end=+</head>+me=e-7  contains=htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,htmlTitle,javaScript,cssStyle,@htmlPreproc \n                   links to PreProc\njavaScriptCommentTodo xxx contained tbd todo fixme xxx\n                   links to Todo\njavaScriptLineComment xxx match +\\/\\/.*+  contained contains=@Spell,javaScriptCommentTodo \n                   links to Comment\njavaScriptCommentSkip xxx match /^[ \\t]*\\*\\($\\|[ \\t]\\+\\)/  contained \njavaScriptComment xxx start=+/\\*+ end=+\\*/+  contained contains=@Spell,javaScriptCommentTodo \n                   links to Comment\njavaScriptSpecial xxx match /\\\\\\d\\d\\d\\|\\\\./  contained \n                   links to Special\njavaScriptStringD xxx start=/\"/ skip=/\\\\\\\\\\|\\\\\"/ end=/\"\\|$/  contained contains=javaScriptSpecial,@htmlPreproc \n                   links to String\njavaScriptStringS xxx start=/'/ skip=/\\\\\\\\\\|\\\\'/ end=/'\\|$/  contained contains=javaScriptSpecial,@htmlPreproc \n                   links to String\njavaScriptSpecialCharacter xxx match /'\\\\.'/  contained \n                   links to javaScriptSpecial\njavaScriptNumber xxx match /-\\=\\<\\d\\+L\\=\\>\\|0[xX][0-9a-fA-F]\\+\\>/  contained \n                   links to javaScriptValue\njavaScriptRegexpString xxx start=+/[^/*]+me=e-1 skip=+\\\\\\\\\\|\\\\/+ end=+/[gim]\\{0,2\\}\\s*[;.,)\\]}]+me=e-1 end=+/[gim]\\{0,2\\}\\s*$+  contained oneline contains=@htmlPreproc \n                   links to String\njavaScriptConditional xxx contained switch if else\n                   links to Conditional\njavaScriptRepeat xxx contained do for while in\n                   links to Repeat\njavaScriptBranch xxx contained continue break\n                   links to Conditional\njavaScriptOperator xxx contained new typeof instanceof delete\n                   links to Operator\njavaScriptType xxx contained number function array string boolean regexp object date\n                   links to Type\njavaScriptStatement xxx contained return with\n                   links to Statement\njavaScriptBoolean xxx contained false true\n                   links to Boolean\njavaScriptNull xxx contained undefined null\n                   links to Keyword\njavaScriptIdentifier xxx contained this var arguments let\n                   links to Identifier\njavaScriptLabel xxx contained case default\n                   links to Label\njavaScriptException xxx contained catch try finally throw\n                   links to Exception\njavaScriptMessage xxx contained status confirm prompt alert\n                   links to Keyword\njavaScriptGlobal xxx contained window self parent top\n                   links to Keyword\njavaScriptMember xxx contained event location document\n                   links to Keyword\njavaScriptDeprecated xxx contained unescape escape\n                   links to Exception\njavaScriptReserved xxx contained const import enum debugger int implements extends class synchronized final goto static boolean float interface short byte super protected export long public native double package transient private volatile char abstract throws\n                   links to Keyword\njavaScriptFunction xxx contained function\n                   links to Function\njavaScriptBraces xxx match /[{}\\[\\]]/  contained \n                   links to Function\njavaScriptParens xxx match /[()]/  contained \nhtmlCssStyleComment xxx match /\\(<!--\\|-->\\)/  contained \n                   links to Comment\nhtmlScriptTag  xxx start=/<script/ end=/>/  contained fold contains=htmlTagN,htmlString,htmlArg,htmlValue,htmlTagError,htmlEvent \n                   links to htmlTag\nhtmlEventSQ    xxx start=/'/ms=s+1 end=/'/me=s-1  contained contains=@htmlJavaScript \n                   links to htmlEvent\nhtmlEventDQ    xxx start=/\"/ms=s+1 end=/\"/me=s-1  contained contains=@htmlJavaScript \n                   links to htmlEvent\nvbConditional  xxx contained elseif if case select then else\n                   links to Conditional\nvbOperator     xxx contained addressof imp mod like and eqv or is to not byref byval xor in\n                   match #[()+.,\\-/*=&]#  contained \n                   match /[<>]=\\=/  contained \n                   match /<>/  contained \n                   match /\\s\\+_$/  contained \n                   links to Operator\nvbBoolean      xxx contained false true\n                   links to Boolean\nvbConst        xxx contained null nothing\n                   links to Constant\nvbRepeat       xxx contained wend step do to for next until loop while foreach\n                   links to Repeat\nvbEvents       xxx contained devicequeryremovefailed nodeclick queryclose seriesselected deactivate endrequest pointlabelupdated gotfocus begintrans devmodechange dataarrival splitchange linkclose infomessage dblclick beginrequest afterwritefile expand powerquerysuspend keyup devicearrival displaychanged oncomm\n                   contained heightchanged seriesupdated pointlabelselected itemactivated processingtimeout rollbacktrans buttonlostfocus footnoteselected powersuspend validationerror beforeupdate willchangedata deviceremovecomplete unboundadddata willupdaterows columnclick scroll asyncreadprogress change\n                   contained querycompleted querytimeout validate buttongotfocus axislabelselected decommandremoved retainedproject willassociate rowcurrencychange asyncreadcomplete titleactivated beforecoledit axistitleupdated dataupdated beforeinsert plotactivated visiblerecordchanged keypress settingchanged\n                   contained deconnectionpropertychanged unformat sendcomplete editquery afterlabeledit start plotselected timer configchanged dragover activerowchanged dogetnewfilename chartupdated configchagecancelled requestwritefile footnoteupdated show resultschanged statechanged panelclick objectmove\n                   contained dateclicked dragdrop legendselected deconnectionremoved beforelabeledit mouseup devicequeryremove iniproperties pointlabelactivated exitfocus userevent itemrenamed willdissociate afterclosefile beforedelete closeup connect pathchange committrans itemseletected beforeclick dropdown\n                   contained terminate itemcheck enterfocus rowstatuschanged unload associate querycomplete statusupdate ambientchanged olecompletedrag legendupdated aftercoledit fontchanged format decommandpropertychanged requestchangefilename unboundreaddata done compare buttonclick callbackkeydown afterupdate\n                   contained paint afterremovefile itemclick itemremoved connectionrequest keydown leavecell accesskeypress writeproperties axisupdated axisselected axistitleselected footnoteactivated dissociate onaddnew close editproperty axislabelupdated click afterinsert deviceotherevent oledragdrop buttondropdown\n                   contained disconnect entercell currentrecordchanged chartselected olesetdata seriesactivated titleselected mousemove rowresize beforeloadfile afteraddfile beforeconnect datachanged donepainting linkexecute linknotify changed patternchange formatsize updated sendprogress titleupdated mousedown\n                   contained lostfocus linkerror readproperties axislabelactivated afterchangefilename aftercolupdate selectionchanged repeatedcontrolloaded upclick resize axisactivated olegivefeedback initproperties axistitleactivated applychanges powerstatuschanged paneldblclick repeatedcontrolunloaded itemadded\n                   contained headclick configchangedcancelled activate legendactivated afterdelete initialize queryunload selchange processtag pointactivated buttoncompleted itemreloaded olestartdrag asyncprogress chartactivated beforecolupdate linkopen unboundgetrelativebookmark syscolorschanged pointselected\n                   contained unboundwritedata plotupdated downclick collapse deconnectionadded querychangeconfig powerresume rowcolchange oledragover timechanged nodecheck unbounddeleterow closequery reposition willexecute pointupdated colresize objectevent deviceremovepending coledit hide decommandadded load\n                   links to Special\nvbFunction     xxx contained clng nper vartype mirr abs doevents isnull space weekdayname msgbox cdate second mid min trim ascb ascw year iif cvdate join ismissing chrb chrw createobject switch loadresstring left int inputbox weekday isempty var eof command now ubound environ leftb lenb tab inputb atn rgb syd ltrim\n                   contained instr avg instrb cint minute fileattr datepart fv error formatdatetime hex timer isobject cvar asc count fix rnd time loadrespicture cdbl imestatus array npv cbyte qbcolor string freefile replace lcase loadresdata strreverse cstr oct lbound seek right sgn timeserial format sin isdate\n                   contained input month getallstrings partition sln chr callbyname ipmt filterfix ucase spc sqr monthname round loadpicture formatcurrency typename dateadd str max rtrim getobject tan sum cos hour dateserial strcomp csng strconv filedatetime day stdevp isnumeric curdir len iserror split timevalue ddb\n                   contained getautoserversettings cverr dir midb isarray exp datediff stdev cbool bof loc lof log ccur date val formatnumber pv getsetting filelen rate cdec choose datevalue pmt formatpercent rightb shell getattr varp ppmt\n                   links to Identifier\nvbMethods      xxx contained skip createtoolwindow addfromfile getfile movenext folderexists showwhatsthis propertychanged removeaddinfromtoolbar savetoolbar createfolder navigateto add copyfolder getclipstring import paste openquerydef finditem begintrans settext findprevious registerdatabase appendchunk enddoc\n                   contained writeproperty drag readall refresh createrelation expand urlfor establishconnection loadresstring oledrag open captureimage edit editcopy rollbacktrans scale getselection resolvename printreport makereplica gettempname showcolor writetemplate createpreparedstatement whatsthismode\n                   contained printform scroll pastspecialdlg repairdatabase line exists arrange createembed bind nextrecordset createindex randomdatafill rowbookmark startlogging peekdata linkrequest paintpicture savetofile tag execute trace rebind makecompilefile updaterecord removeitem readline ensurevisible rowtop\n                   contained fileexists showsave rowcontaining scalex scaley stop startlabeledit setsize point saveas createdatabase newpage lines createquerydef fetch loadfile circle savetoole1file doverb compactdatabase count deselectall show columnsize loadrespicture fillcache initializelabels getdrive\n                   contained deletecolumnlabels clearstructure linksend findfirst getformat zorder setselection validatecontrols selectall addnew deletelines hittest buildpath colcontaining loadresdata listen editpaste driveexists render movelast files connect findnext value committrans set item createquery\n                   contained refreshlink linkpoke update getselectedpart releaseinstance draw cancelasyncread beginqueryedit removeall goback move deletefile layout onaddinsupdate moveprevious restoretoolbar getbookmark deletefolder addfromstring resync clone insertrows replyall reload openastextstream updatecontrols\n                   contained todefaults onstartupcomplete deleterows cancelupdate showprinter clearfields remove aboutbox find keys export append appendappendchunk getabsolutepathname insert clearselcols copy send openresultset refill insertlines print onconnection writeblanklines newpassword close showfont\n                   contained insertrowlabels pset getvisiblecount getdata write randomfillcolumns getfolder requery signon cls createfield idle randomfillrows extracticon createlink opendatabase addfromtemplate additem cancel addcustom showopen holdfields read reply canpropertychange populatepartial showhelp\n                   contained writeline ondisconnection fetchverbs exportreport selprint customize linkexecute readfromfile getspecialfolder addfromguid accept movefile gettext insertfile goforward addtoolboxprogid deleterowlabels save readproperty createpropery setdata size deletecolumns clearsel cut addfile delete\n                   contained openrecordset typebycharttype movefolder openurl setfocus skipline split setviewport signoff replaceline textwidth span selectpart resetcustomlabel addtoaddintoolbar popupmenu creategroup synchronize getfilename getheader insertcolumnlabels textheight activate rollback cancelbatch\n                   contained savefile getchunk rdocreateenvironment getlinefromchar play getdrivename rdoregisterdatasource updaterow forward movedata getrows createtextfile logevent makecompiledfile collapseall insertobjdlg findlast insertcolumns createworkspace splitcontaining copyfile senddata getbasename\n                   contained createtabledef upto setoption celltext createuser designerwindow openconnection copyquerydef quit resetcustom movefirst overlay clear batchupdate cellvalue asyncread createdragimage compose raise twipstochartpart getparentfoldername getnumticks getfirstvisible assert setautoserversettings\n                   contained hide moreresults killdoc\n                   links to PreProc\nvbStatement    xxx contained const wend mid setattr defint elseif open enum randomize implements end event erase step explicit function option as rem raiseevent do savepicture error call stop preserve reset defbool width sendkeys sendkeys time goto static return on kill for beep defobj exit deletesetting next begin\n                   contained savesetting set unload seek lineinput defdate unlock get lock lset filecopy defsng alias resume onerror declare until base close defstr write deftype sub gosub gosub loop public while redim redim defcur chdir chdrive each defdbl with property type defdec let name private lib foreach\n                   contained deflng dim rmdir mkdir rset date defvar put appactivate load defbyte\n                   links to Statement\nvbKeyword      xxx contained empty publicnotcreateable mid onnewprocesssingleuse globalmultiuse step option as new optional error is time static withevents me on string byref byval set insameprocessmultiuse seek get lock input resume binary paramarray print null nothing friend public property len private date\n                   links to Statement\nvbTodo         xxx contained todo\n                   links to Todo\nvbTypes        xxx contained currency empty single string boolean byte variant long double integer object date decimal\n                   links to Type\nvbDefine       xxx contained vbkeyback vbyesno vbcyan vbcr vbcurrency vbhidden vbkeyf10 vbkeyf11 vbkeyf13 vbkeyf14 vbkeyf15 vbkeyf16 vbfirstfourdays vbmonday vbimeoff vbcalgreg vbinformation vbdesktop vbkeytab dbfloat dbcurrency vbblack vbkeyseparator vbvolume dblong vbwednesday vbimenoop dbsingle vblf vbgreen\n                   contained vbkeynumlock vbkeyhome vbkeypagedown vbno vbarray vbok vbokonly vb3dshadow vbimemodekatakana vbimemodealphafull vbimemodekatakanahalf vbexclamation vbmsgboxrtlreading vbkeydivide vbkeydown vbsystem vbthursday vbwindowbackground vb3dlight vbretrycancel vbkeyright vbsystemmodal vbfirstjan1\n                   contained dbchar vbkeypause vbyes vbsingle vbvariant vbabort vbformfeed vbmenubar vbdataobject vbsaturday vbkeydecimal vbhighlighttext vbalias vbkeylbutton vbscrollbars vbimemodealpha vbgraytext vbwindowtext vbinfotext vbfirstfullweek vbkeyselect vbkeysnapshot vbkeyreturn vbnormalnofocus vbback\n                   contained vbmagenta vbkeyprint vbnarrow vbkey6 vbkeyrbutton vbkeydelete dbinteger vbapplicationmodal vbcancel vbdefaultbutton2 vbbuttonshadow vblowercase dbdecimal vbbinarycompare vbkeyi vbmsgboxsetforeground vbformmdiform dbbinary vbkeyo vbkeyp vbwindowframe vbkeycapital vbkeyadd vbkatakana\n                   contained vbkeyf12 vbstring vbverticaltab vbformcode vbignore vberror vbquestion vbbyte vbkeypageup vbimemodehiragana vbfriday vbred dbmemo dbboolean vbretry vbmenutext vbwide vbimedisable vbimemodeoff vbinactivetitlebar vbkeyinsert vbokcancel vbmsgboxright vbkeyend vbkey0 vbkey1 vbkey2 vbkey3\n                   contained vbkey4 vbkey5 vbkey7 vbkey8 vbkey9 vbkeya vbkeyb vbkeyc vbkeyd vbkeye vbkeyf vbkeyg vbkeyh vbkeyj vbkeyk vbkeyl vbkeym vbkeyn vbkeyq vbkeyr vbkeys vbkeyt vbkeyu vbkeyv vbkeyw vbkeyx vbkeyy vbkeyz vbwhite vbnormal vbinactiveborder dbdate vbformcontrolmenu vbkeymenu vbkeyexecute\n                   contained vbyesnocancel vbtitlebartext vbtextcompare dbdouble vbunicode vbnull vbimekatakanasng vbkeymultiply vbinteger vbkeysubtract vbkeyshift vbmsgboxhelpbutton vbkeycancel vbimemodehangulfull vb3dhighlight dbnumeric vbminimizednofocus dbguid vbdecimal vbcrlf vbsunday vbimealphasng\n                   contained vbminimizedfocus vbapplicationworkspace vbimemodedisable vbkeyescape vbobjecterror vbimemodenocontrol vbtuesday vbkeyclear vbcritical vbusesystem vbkeyhelp vbkeyleft vbnormalfocus dblongbinary vbhiragana vbfromunicode vbcalhijri vbboolean vbkeycontrol vbmsgboxtext vbnullchar\n                   contained vbinfobackground vbactiveborder dbtime vb3ddkshadow vbimeon vbkeyf1 vbkeyf2 vbkeyf3 vbkeyf4 vbkeyf5 vbkeyf6 vbkeyf7 vbkeyf8 vbkeyf9 vbkeynumpad3 vbreadonly vbkeynumpad5 vbkeynumpad0 vbkeynumpad1 vbkeynumpad2 vbkeynumpad4 vbkeynumpad6 vbkeynumpad7 vbkeynumpad8 vbkeynumpad9 vbempty vbdouble\n                   contained vbkeyspace vbappwindows vbimekatakanadbl vbmsgbox vbactivetitlebar vbyellow vbapptaskmanager vbobject vbkeymbutton vbmaximizedfocus dbvarbinary vbimealphadbl vbdatabasecompare vbimehiragana vbusesystemdayofweek vbdate vbhighlight vbpropercase vbdirectory dbtimestamp vbuppercase\n                   contained vbnullstring vbblue vbdefaultbutton1 vbdefaultbutton3 vbdefaultbutton4 vbbuttonface vbimemodehangul vbimemodeon vbbuttontext dbtext vbarchive vbtab dbbyte vblong vbabortretryignore vbinactivecaptiontext vbnewline dbbigint vbkeyup vbhide vb3dface\n                   links to Constant\nvbNumber       xxx match /\\<\\d\\+\\>/  contained \n                   match /\\<\\d\\+\\.\\d*\\>/  contained \n                   match /\\.\\d\\+\\>/  contained \n                   links to Number\nvbFloat        xxx match /[-+]\\=\\<\\d\\+[eE][\\-+]\\=\\d\\+/  contained \n                   match /[-+]\\=\\<\\d\\+\\.\\d*\\([eE][\\-+]\\=\\d\\+\\)\\=/  contained \n                   match /[-+]\\=\\<\\.\\d\\+\\([eE][\\-+]\\=\\d\\+\\)\\=/  contained \n                   links to Float\nvbString       xxx start=/\"/ end=/\"\\|$/  contained \n                   links to String\nvbComment      xxx start=/\\(^\\|\\s\\)REM\\s/ end=/$/  contained contains=vbTodo \n                   start=/\\(^\\|\\s\\)\\'/ end=/$/  contained contains=vbTodo \n                   links to Comment\nvbLineNumber   xxx match /^\\d\\+\\(\\s\\|$\\)/  contained \n                   links to Comment\nvbTypeSpecifier xxx match /[a-zA-Z0-9][\\$%&!#]/ms=s+1  contained \n                   match /#[a-zA-Z0-9]/me=e-1  contained \n                   links to Type\ncssTagName     xxx contained a a b b p p q q s s u u noframes noframes blockquote blockquote source source source source button button caption caption big big mark mark mark mark meta meta mask mask address address i i article article article article title title style style form form img img img img ins ins meter\n                   contained meter meter meter data data data data var var command command fieldset fieldset option option applet applet nav nav nav nav link link frameset frameset br br track track track track dd dd dl dl dt dt noscript noscript bdo bdo em em canvas canvas canvas canvas section section section\n                   contained section bdi bdi bdi bdi h1 h1 h2 h2 h3 h3 h4 h4 h5 h5 tbody tbody time time time time audio audio audio audio cite cite li li strike strike colgroup colgroup acronym acronym progress progress progress progress select select ol ol embed embed embed embed rtc rtc output output output output\n                   contained wbr wbr wbr wbr rb rb rp rp rp rp datalist datalist datalist datalist template template td td th th tr tr tt tt ul ul kbd kbd textarea textarea menuitem menuitem thead thead rt rt rt rt hgroup hgroup table table input input param param center center base base tfoot tfoot samp samp ruby\n                   contained ruby ruby ruby code code details details font font sub sub sup sup col col svg svg optgroup optgroup figcaption figcaption figcaption figcaption iframe iframe video video video video dialog dialog h6 h6 menu menu script script object object hr hr span span del del dfn dfn html html legend\n                   contained legend small small dir dir div div body body strong strong summary summary keygen keygen keygen keygen abbr abbr isindex isindex figure figure figure figure pre pre basefont basefont header header header header main main main main area area map map frame frame label label footer footer\n                   contained footer footer aside aside aside aside head head\n                   match /\\*/  contained \n                   match /\\*/  contained \n                   links to Statement\ncssDeprecated  xxx contained noframes noframes big big applet applet frameset frameset strike strike acronym acronym tt tt center center font font dir dir basefont basefont frame frame\n                   links to Error\ncssSelectorOp  xxx match /[,>+~]/  contained \n                   match /[,>+~]/  contained \n                   match /[|]/  contained \n                   match /[|]/  contained \n                   links to Special\ncssSelectorOp2 xxx match /[~|^$*]\\?=/  contained \n                   match /[~|^$*]\\?=/  contained \n                   match +/deep/+  contained \n                   match +/deep/+  contained \n                   links to Special\ncssUnicodeEscape xxx match /\\\\\\x\\{1,6}\\s\\?/  contained \n                   match /\\\\\\x\\{1,6}\\s\\?/  contained \n                   links to Special\ncssStringQ     xxx start=/'/ skip=/\\\\\\\\\\|\\\\'/ end=/'/  contained contains=cssUnicodeEscape,cssSpecialCharQ \n                   start=/'/ skip=/\\\\\\\\\\|\\\\'/ end=/'/  contained contains=cssUnicodeEscape,cssSpecialCharQ \n                   links to String\ncssStringQQ    xxx start=/\"/ skip=/\\\\\\\\\\|\\\\\"/ end=/\"/  contained contains=cssUnicodeEscape,cssSpecialCharQQ \n                   start=/\"/ skip=/\\\\\\\\\\|\\\\\"/ end=/\"/  contained contains=cssUnicodeEscape,cssSpecialCharQQ \n                   links to String\ncssAttributeSelector xxx matchgroup=cssSelectorOp start=/\\[/ end=/]/  contained contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ \n                   matchgroup=cssSelectorOp start=/\\[/ end=/]/  contained contains=cssUnicodeEscape,cssSelectorOp2,cssStringQ,cssStringQQ \n                   links to String\ncssClassNameDot xxx match /\\./  contained \n                   match /\\./  contained \n                   links to Function\ncssClassName   xxx match /\\.[A-Za-z][A-Za-z0-9_-]\\+/  contained contains=cssClassNameDot \n                   match /\\.[A-Za-z][A-Za-z0-9_-]\\+/  contained contains=cssClassNameDot \n                   links to Function\ncssIdentifier  xxx match /#[A-Za-z<c0>-<ff>_@][A-Za-z<c0>-<ff>0-9_@-]*/  contained \n                   match /#[A-Za-z<c0>-<ff>_@][A-Za-z<c0>-<ff>0-9_@-]*/  contained \n                   links to Function\ncssUnitDecorators xxx match /\\(#\\|-\\|%\\|mm\\|cm\\|in\\|pt\\|pc\\|em\\|ex\\|px\\|rem\\|dpi\\|dppx\\|dpcm\\|Hz\\|kHz\\|s\\|ms\\|deg\\|grad\\|rad\\)/  contained \n                   match /\\(#\\|-\\|%\\|mm\\|cm\\|in\\|pt\\|pc\\|em\\|ex\\|px\\|rem\\|dpi\\|dppx\\|dpcm\\|Hz\\|kHz\\|s\\|ms\\|deg\\|grad\\|rad\\)/  contained \n                   links to Number\ncssValueInteger xxx match /[-+]\\=\\d\\+/  contained contains=cssUnitDecorators \n                   match /[-+]\\=\\d\\+/  contained contains=cssUnitDecorators \n                   links to Number\ncssValueNumber xxx match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=/  contained contains=cssUnitDecorators \n                   match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=/  contained contains=cssUnitDecorators \n                   match /[01]\\(.\\d\\+\\)\\=fr/  contained \n                   match /\\d\\+gd/  contained \n                   match /[-+]\\=\\d\\+\\(dB\\|st\\)/  contained \n                   match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=dp\\(i\\|cm\\|px\\)/  contained \n                   match /[-+]\\=\\d\\+\\(dB\\|st\\)/  contained \n                   match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=dp\\(i\\|cm\\|px\\)/  contained \n                   match /[01]\\(.\\d\\+\\)\\=fr/  contained \n                   match /\\d\\+gd/  contained \n                   links to Number\ncssValueLength xxx match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=\\(%\\|mm\\|cm\\|in\\|pt\\|pc\\|em\\|ex\\|px\\|rem\\|dpi\\|dppx\\|dpcm\\)/  contained contains=cssUnitDecorators \n                   match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=\\(%\\|mm\\|cm\\|in\\|pt\\|pc\\|em\\|ex\\|px\\|rem\\|dpi\\|dppx\\|dpcm\\)/  contained contains=cssUnitDecorators \n                   match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=\\(ch\\|rem\\|vw\\|vh\\|vmin\\|vmax\\)/  contained \n                   match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=\\(ch\\|rem\\|vw\\|vh\\|vmin\\|vmax\\)/  contained \n                   links to Number\ncssValueAngle  xxx match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=\\(deg\\|grad\\|rad\\)/  contained contains=cssUnitDecorators \n                   match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=\\(deg\\|grad\\|rad\\)/  contained contains=cssUnitDecorators \n                   match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=turn/  contained \n                   match /[-+]\\=\\d\\+\\(\\.\\d*\\)\\=turn/  contained \n                   links to Number\ncssValueTime   xxx match /+\\=\\d\\+\\(\\.\\d*\\)\\=\\(ms\\|s\\)/  contained contains=cssUnitDecorators \n                   match /+\\=\\d\\+\\(\\.\\d*\\)\\=\\(ms\\|s\\)/  contained contains=cssUnitDecorators \n                   links to Number\ncssValueFrequency xxx match /+\\=\\d\\+\\(\\.\\d*\\)\\=\\(Hz\\|kHz\\)/  contained contains=cssUnitDecorators \n                   match /+\\=\\d\\+\\(\\.\\d*\\)\\=\\(Hz\\|kHz\\)/  contained contains=cssUnitDecorators \n                   links to Number\ncssIncludeKeyword xxx match /@\\(-[a-z]+-\\)\\=\\(media\\|keyframes\\|import\\|charset\\|namespace\\|page\\)/  contained \n                   match /@\\(-[a-z]+-\\)\\=\\(media\\|keyframes\\|import\\|charset\\|namespace\\|page\\)/  contained \n                   links to atKeyword\ncssMediaProp   xxx contained orientation orientation width width grid grid height height scan scan\n                   match /\\(\\(device\\)-\\)\\=aspect-ratio/  contained \n                   match /\\(\\(max\\|min\\)-\\)\\=device-pixel-ratio/  contained \n                   match /\\(\\(max\\|min\\)-\\)\\=device-\\(height\\|width\\)/  contained \n                   match /\\(\\(max\\|min\\)-\\)\\=\\(height\\|width\\|resolution\\|monochrome\\|color\\(-index\\)\\=\\)/  contained \n                   match /\\(\\(device\\)-\\)\\=aspect-ratio/  contained \n                   match /\\(\\(max\\|min\\)-\\)\\=device-pixel-ratio/  contained \n                   match /\\(\\(max\\|min\\)-\\)\\=device-\\(height\\|width\\)/  contained \n                   match /\\(\\(max\\|min\\)-\\)\\=\\(height\\|width\\|resolution\\|monochrome\\|color\\(-index\\)\\=\\)/  contained \n                   links to cssProp\ncssMediaKeyword xxx contained and and not not only only\n                   links to Statement\ncssMediaAttr   xxx contained interlace interlace portrait portrait progressive progressive landscape landscape\n                   links to cssAttr\ncssVendor      xxx match /\\(-\\(webkit\\|moz\\|o\\|ms\\)-\\)/  contained \n                   match /\\(-\\(webkit\\|moz\\|o\\|ms\\)-\\)/  contained \n                   links to Comment\ncssMediaType   xxx contained all\n                   contained all\n                   contained aural\n                   contained aural\n                   contained tv\n                   contained tv\n                   contained speech\n                   contained speech\n                   contained handheld\n                   contained handheld\n                   contained print\n                   contained print\n                   contained screen\n                   contained screen\n                   contained embossed\n                   contained embossed\n                   contained projection\n                   contained projection\n                   contained braille\n                   contained braille\n                   contained tty\n                   contained tty\n                   links to Special\ncssMediaComma  xxx match /,/  contained \n                   match /,/  contained \n                   links to Normal\ncssComment     xxx start=+/\\*+ end=+\\*/+  contained fold contains=@Spell \n                   start=+/\\*+ end=+\\*/+  contained fold contains=@Spell \n                   links to Comment\ncssMediaBlock  xxx matchgroup=cssBraces start=/{/ end=/}/  contained transparent fold contains=cssMediaAttr,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssTagName,cssClassName,cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,cssAttributeSelector \n                   matchgroup=cssBraces start=/{/ end=/}/  contained transparent fold contains=cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssTagName,cssClassName,cssIdentifier,cssPseudoClass,cssSelectorOp,cssSelectorOp2,cssAttributeSelector \ncssInclude     xxx start=/@media\\>/ end=/\\ze{/  contained contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssIncludeKeyword,cssMediaComma,cssComment nextgroup=cssMediaBlock skipwhite skipnl \n                   start=/@import\\>/ end=/\\ze;/  contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword,cssURL,cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType \n                   start=/@charset\\>/ end=/\\ze;/  contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword \n                   start=/@namespace\\>/ end=/\\ze;/  contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword \n                   start=/@media\\>/ end=/\\ze{/  contained contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssIncludeKeyword,cssMediaComma,cssComment nextgroup=cssMediaBlock skipwhite skipnl \n                   start=/@import\\>/ end=/\\ze;/  contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword,cssURL,cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType \n                   start=/@charset\\>/ end=/\\ze;/  contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword \n                   start=/@namespace\\>/ end=/\\ze;/  contained transparent contains=cssStringQ,cssStringQQ,cssUnicodeEscape,cssComment,cssIncludeKeyword \n                   start=/@counter-style\\>/ end=/\\ze{/  contained contains=cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssValueInteger,cssValueLength,cssMediaKeyword,cssVendor,cssIncludeKeyword,cssComment nextgroup=cssMediaBlock skipwhite skipnl \n                   start=/@scope\\>/ end=/\\ze{/  contained nextgroup=cssMediaBlock skipwhite skipnl \n                   start=/@supports\\>/ end=/\\ze{/  contained contains=cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssValueInteger,cssValueLength,cssMediaKeyword,cssVendor,cssIncludeKeyword,cssComment nextgroup=cssMediaBlock skipwhite skipnl \n                   start=/@supports\\>/ end=/\\ze{/  contained contains=cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssValueInteger,cssValueLength,cssMediaKeyword,cssVendor,cssIncludeKeyword,cssComment nextgroup=cssMediaBlock skipwhite skipnl \n                   start=/@counter-style\\>/ end=/\\ze{/  contained contains=cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssValueInteger,cssValueLength,cssMediaKeyword,cssVendor,cssIncludeKeyword,cssComment nextgroup=cssMediaBlock skipwhite skipnl \n                   start=/@scope\\>/ end=/\\ze{/  contained nextgroup=cssMediaBlock skipwhite skipnl \n                   links to Include\ncssBraces      xxx match /[{}]/  contained \n                   match /[{}]/  contained \n                   links to Function\ncssColor       xxx contained GrayText GrayText ThreeDShadow ThreeDShadow ThreeDFace ThreeDFace ButtonHighlight ButtonHighlight Scrollbar Scrollbar ActiveBorder ActiveBorder ThreeDDarkShadow ThreeDDarkShadow ButtonShadow ButtonShadow InfoBackground InfoBackground Highlight Highlight ThreeDLightShadow ThreeDLightShadow\n                   contained Background Background InfoText InfoText CaptionText CaptionText ButtonText ButtonText ThreeDHighlight ThreeDHighlight ButtonFace ButtonFace ActiveCaption ActiveCaption WindowText WindowText HighlightText HighlightText MenuText MenuText InactiveCaptionText InactiveCaptionText Window Window\n                   contained AppWorkspace AppWorkspace WindowFrame WindowFrame Menu Menu InactiveBorder InactiveBorder InactiveCaption InactiveCaption\n                   contained indianred indianred purple purple lavender lavender cyan cyan linen linen cornflowerblue cornflowerblue lemonchiffon lemonchiffon orange orange sienna sienna plum plum moccasin moccasin midnightblue midnightblue cornsilk cornsilk orchid orchid lime lime chartreuse chartreuse teal teal red\n                   contained red deepskyblue deepskyblue peru peru blanchedalmond blanchedalmond thistle thistle aliceblue aliceblue pink pink black black silver silver papayawhip papayawhip blue blue maroon maroon slategray slategray gainsboro gainsboro chocolate chocolate indigo indigo bisque bisque gray gray olive\n                   contained olive ivory ivory antiquewhite antiquewhite cadetblue cadetblue coral coral seagreen seagreen firebrick firebrick aquamarine aquamarine olivedrab olivedrab azure azure rosybrown rosybrown tomato tomato khaki khaki dimgray dimgray oldlace oldlace wheat wheat brown brown dimgrey dimgrey\n                   contained crimson crimson peachpuff peachpuff springgreen springgreen burlywood burlywood goldenrod goldenrod grey grey tan tan hotpink hotpink mintcream mintcream magenta magenta yellowgreen yellowgreen ghostwhite ghostwhite sandybrown sandybrown floralwhite floralwhite slateblue slateblue\n                   contained royalblue royalblue salmon salmon yellow yellow blueviolet blueviolet aqua aqua limegreen limegreen gold gold snow snow turquoise turquoise deeppink deeppink skyblue skyblue slategrey slategrey fuchsia fuchsia powderblue powderblue seashell seashell navy navy whitesmoke whitesmoke green\n                   contained green beige beige greenyellow greenyellow lavenderblush lavenderblush violet violet navajowhite navajowhite orangered orangered lawngreen lawngreen saddlebrown saddlebrown steelblue steelblue forestgreen forestgreen honeydew honeydew dodgerblue dodgerblue mistyrose mistyrose\n                   match /dark\\(blue\\|cyan\\|goldenrod\\|gray\\|green\\|grey\\|khaki\\)/  contained \n                   match /dark\\(magenta\\|olivegreen\\|orange\\|orchid\\|red\\|salmon\\|seagreen\\)/  contained \n                   match /darkslate\\(blue\\|gray\\|grey\\)/  contained \n                   match /dark\\(turquoise\\|violet\\)/  contained \n                   match /light\\(blue\\|coral\\|cyan\\|goldenrodyellow\\|gray\\|green\\)/  contained \n                   match /light\\(grey\\|pink\\|salmon\\|seagreen\\|skyblue\\|yellow\\)/  contained \n                   match /light\\(slategray\\|slategrey\\|steelblue\\)/  contained \n                   match /medium\\(aquamarine\\|blue\\|orchid\\|purple\\|seagreen\\)/  contained \n                   match /medium\\(slateblue\\|springgreen\\|turquoise\\|violetred\\)/  contained \n                   match /pale\\(goldenrod\\|green\\|turquoise\\|violetred\\)/  contained \n                   match /\\<transparent\\>/  contained \n                   match /\\<white\\>/  contained \n                   match /#[0-9A-Fa-f]\\{3\\}\\>/  contained contains=cssUnitDecorators \n                   match /#[0-9A-Fa-f]\\{6\\}\\>/  contained contains=cssUnitDecorators \n                   match /dark\\(blue\\|cyan\\|goldenrod\\|gray\\|green\\|grey\\|khaki\\)/  contained \n                   match /dark\\(magenta\\|olivegreen\\|orange\\|orchid\\|red\\|salmon\\|seagreen\\)/  contained \n                   match /darkslate\\(blue\\|gray\\|grey\\)/  contained \n                   match /dark\\(turquoise\\|violet\\)/  contained \n                   match /light\\(blue\\|coral\\|cyan\\|goldenrodyellow\\|gray\\|green\\)/  contained \n                   match /light\\(grey\\|pink\\|salmon\\|seagreen\\|skyblue\\|yellow\\)/  contained \n                   match /light\\(slategray\\|slategrey\\|steelblue\\)/  contained \n                   match /medium\\(aquamarine\\|blue\\|orchid\\|purple\\|seagreen\\)/  contained \n                   match /medium\\(slateblue\\|springgreen\\|turquoise\\|violetred\\)/  contained \n                   match /pale\\(goldenrod\\|green\\|turquoise\\|violetred\\)/  contained \n                   match /\\<transparent\\>/  contained \n                   match /\\<white\\>/  contained \n                   match /#[0-9A-Fa-f]\\{3\\}\\>/  contained contains=cssUnitDecorators \n                   match /#[0-9A-Fa-f]\\{6\\}\\>/  contained contains=cssUnitDecorators \n                   match /\\<currentColor\\>/  contained \n                   match /\\<currentColor\\>/  contained \n                   links to Constant\ncssURL         xxx matchgroup=cssFunctionName start=/\\<url\\s*(/ end=/)/  contained oneline extend \n                   matchgroup=cssFunctionName start=/\\<url\\s*(/ end=/)/  contained oneline extend \n                   links to String\ncssImportant   xxx match /!\\s*important\\>/  contained \n                   match /!\\s*important\\>/  contained \n                   links to Special\ncssError       xxx match /{@<>/  contained \n                   match /{@<>/  contained \n                   links to Error\ncssFunction    xxx matchgroup=cssFunctionName start=/\\<\\(rgb\\|clip\\|attr\\|counter\\|rect\\|cubic-bezier\\|steps\\)\\s*(/ end=/)/  contained oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma \n                   matchgroup=cssFunctionName start=/\\<\\(rgba\\|hsl\\|hsla\\|color-stop\\|from\\|to\\)\\s*(/ end=/)/  contained oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction \n                   matchgroup=cssFunctionName start=/\\<\\(linear-\\|radial-\\)\\=\\gradient\\s*(/ end=/)/  contained oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma \n                   matchgroup=cssFunctionName start=/\\<\\(matrix\\(3d\\)\\=\\|scale\\(3d\\|X\\|Y\\|Z\\)\\=\\|translate\\(3d\\|X\\|Y\\|Z\\)\\=\\|skew\\(X\\|Y\\)\\=\\|rotate\\(3d\\|X\\|Y\\|Z\\)\\=\\|perspective\\)\\s*(/ end=/)/  contained oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma \n                   matchgroup=cssFunctionName start=/\\<\\(rgb\\|clip\\|attr\\|counter\\|rect\\|cubic-bezier\\|steps\\)\\s*(/ end=/)/  contained oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma \n                   matchgroup=cssFunctionName start=/\\<\\(rgba\\|hsl\\|hsla\\|color-stop\\|from\\|to\\)\\s*(/ end=/)/  contained oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction \n                   matchgroup=cssFunctionName start=/\\<\\(linear-\\|radial-\\)\\=\\gradient\\s*(/ end=/)/  contained oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma \n                   matchgroup=cssFunctionName start=/\\<\\(matrix\\(3d\\)\\=\\|scale\\(3d\\|X\\|Y\\|Z\\)\\=\\|translate\\(3d\\|X\\|Y\\|Z\\)\\=\\|skew\\(X\\|Y\\)\\=\\|rotate\\(3d\\|X\\|Y\\|Z\\)\\=\\|perspective\\)\\s*(/ end=/)/  contained oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma \n                   matchgroup=cssFunctionName start=/\\<symbols\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(string\\|running\\|element\\|leader\\|target-\\(counter\\|counters\\|text\\)\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(minmax\\|repeat\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<round\\(down\\|up\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<counters\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(inset\\|circle\\|ellipse\\|polygon\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<var\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(rgba\\|hsla\\=\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(stylistic\\|styleset\\|character-variant\\|swash\\|ornaments\\|annotation\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(image\\|\\(repeating-\\)\\=\\(linear\\|radial\\)-gradient\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(matrix\\(3d\\)\\=\\|translate\\(3d\\|X\\|Y\\|Z\\)\\=\\|scale\\(3d\\|X\\|Y\\|Z\\)\\=\\|rotate\\(3d\\|X\\|Y\\|Z\\)\\=\\|skew\\(X\\|Y\\)\\=\\|perspective\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(steps\\|cubic-bezier\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(calc\\|toggle\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(rgba\\|hsla\\=\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(stylistic\\|styleset\\|character-variant\\|swash\\|ornaments\\|annotation\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(image\\|\\(repeating-\\)\\=\\(linear\\|radial\\)-gradient\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(matrix\\(3d\\)\\=\\|translate\\(3d\\|X\\|Y\\|Z\\)\\=\\|scale\\(3d\\|X\\|Y\\|Z\\)\\=\\|rotate\\(3d\\|X\\|Y\\|Z\\)\\=\\|skew\\(X\\|Y\\)\\=\\|perspective\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(steps\\|cubic-bezier\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(calc\\|toggle\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<symbols\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(string\\|running\\|element\\|leader\\|target-\\(counter\\|counters\\|text\\)\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(minmax\\|repeat\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<round\\(down\\|up\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<counters\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<\\(inset\\|circle\\|ellipse\\|polygon\\)\\s*(/ end=/)/  contained oneline keepend \n                   matchgroup=cssFunctionName start=/\\<var\\s*(/ end=/)/  contained oneline keepend \n                   links to Constant\ncssDefinition  xxx matchgroup=cssBraces start=/{/ end=/}/  contained keepend transparent fold contains=cssAttrRegion,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks \n                   matchgroup=cssBraces start=/{/ end=/}/  contained keepend transparent fold contains=cssAttrRegion,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,@cssColors \n                   matchgroup=cssBraces start=/{/ end=/}/  contained keepend transparent fold contains=cssAttrRegion,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks \n                   matchgroup=cssBraces start=/{/ end=/}/  contained keepend transparent fold contains=cssAttrRegion,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,@cssColors \n                   matchgroup=cssBraces start=/{/ end=/}/  contained keepend transparent fold contains=cssAttrRegion,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,@cssColors,@cssColors \ncssPseudoClass xxx match /:[A-Za-z0-9_-]*/  contained contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn \n                   match /:[A-Za-z0-9_-]*/  contained contains=cssNoise,cssPseudoClassId,cssUnicodeEscape,cssVendor,cssPseudoClassFn \ncssPagePseudo  xxx match /:\\(left\\|right\\|first\\|blank\\)/  contained \n                   match /:\\(left\\|right\\|first\\|blank\\)/  contained \n                   links to PreProc\ncssPageWrap    xxx matchgroup=cssBraces start=/{/ end=/}/  contained transparent contains=cssPageMargin,cssPageProp,cssAttrRegion,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks \n                   matchgroup=cssBraces start=/{/ end=/}/  contained transparent contains=cssPageMargin,cssPageProp,cssAttrRegion,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks \ncssPage        xxx match /@page\\>[^{]*{\\@=/  contained transparent contains=cssPagePseudo,cssIncludeKeyword nextgroup=cssPageWrap skipwhite skipnl \n                   match /@page\\>[^{]*{\\@=/  contained transparent contains=cssPagePseudo,cssIncludeKeyword nextgroup=cssPageWrap skipwhite skipnl \n                   links to atKeyword\ncssPageMargin  xxx match /@\\(\\(top\\|left\\|right\\|bottom\\)-\\(left\\|center\\|right\\|middle\\|bottom\\)\\)\\(-corner\\)\\=/  contained nextgroup=cssDefinition skipwhite skipnl \n                   match /@\\(\\(top\\|left\\|right\\|bottom\\)-\\(left\\|center\\|right\\|middle\\|bottom\\)\\)\\(-corner\\)\\=/  contained nextgroup=cssDefinition skipwhite skipnl \n                   links to atKeyword\ncssPageProp    xxx contained content content orphans orphans widows widows size size\n                   links to cssProp\ncssAttrRegion  xxx start=/:/ end=/;/  contained keepend contains=cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssColor,cssImportant,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFunction,cssStringQQ,cssStringQ,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise \n                   start=/transition\\s*:/ end=/;/  contained keepend contains=cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssColor,cssImportant,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFunction,cssStringQQ,cssStringQ,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise \n                   start=/:/ end=/;/  contained keepend contains=cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssColor,cssImportant,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFunction,cssString,cssStringQQ,cssStringQ,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise \n                   start=/transition\\s*:/ end=/;/  contained keepend contains=cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssColor,cssImportant,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFunction,cssString,cssStringQQ,cssStringQ,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise \ncssHacks       xxx match /\\(_\\|*\\)/  contained \n                   match /\\(_\\|*\\)/  contained \n                   links to Comment\ncssKeyFrameWrap xxx matchgroup=cssBraces start=/{/ end=/}/  contained transparent contains=cssKeyFrameSelector \n                   matchgroup=cssBraces start=/{/ end=/}/  contained transparent contains=cssKeyFrameSelector \ncssKeyFrame    xxx match /@\\(-[a-z]+-\\)\\=keyframes\\>[^{]*{\\@=/  contained transparent contains=cssVendor,cssIncludeKeyword nextgroup=cssKeyFrameWrap skipwhite skipnl \n                   match /@\\(-[a-z]+-\\)\\=keyframes\\>[^{]*{\\@=/  contained transparent contains=cssVendor,cssIncludeKeyword nextgroup=cssKeyFrameWrap skipwhite skipnl \n                   links to atKeyword\ncssKeyFrameSelector xxx match /\\(\\d*%\\|from\\|to\\)\\=/  contained nextgroup=cssDefinition skipwhite skipnl \n                   match /\\(\\d*%\\|from\\|to\\)\\=/  contained nextgroup=cssDefinition skipwhite skipnl \n                   links to Constant\ncssFontDescriptorBlock xxx matchgroup=cssBraces start=/{/ end=/}/  contained transparent contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr \n                   matchgroup=cssBraces start=/{/ end=/}/  contained transparent contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr \ncssFontDescriptor xxx match /@font-face\\>/  contained nextgroup=cssFontDescriptorBlock skipwhite skipnl \n                   match /@font-face\\>/  contained nextgroup=cssFontDescriptorBlock skipwhite skipnl \n                   links to Special\ncssFontProp    xxx contained all all columns columns order order isolation isolation\n                   match /\\<font\\(-\\(family\\|\\|feature-settings\\|kerning\\|language-override\\|size\\(-adjust\\)\\=\\|stretch\\|style\\|synthesis\\|variant\\(-\\(alternates\\|caps\\|east-asian\\|ligatures\\|numeric\\|position\\)\\)\\=\\|weight\\)\\)\\=\\>/  contained \n                   match /\\<font-smooth\\>/  contained \n                   match /\\<font\\(-\\(family\\|\\|feature-settings\\|kerning\\|language-override\\|size\\(-adjust\\)\\=\\|stretch\\|style\\|synthesis\\|variant\\(-\\(alternates\\|caps\\|east-asian\\|ligatures\\|numeric\\|position\\)\\)\\=\\|weight\\)\\)\\=\\>/  contained \n                   match /\\<font-smooth\\>/  contained \n                   match /\\<\\(mix\\|background\\)-blend-mode\\>/  contained \n                   match /\\<display-\\(inside\\|outside\\|extras\\|box\\)\\>/  contained \n                   match /\\<flex\\(-\\(basis\\|direction\\|flow\\|grow\\|shrink\\|wrap\\)\\)\\=\\>/  contained \n                   match /\\<grid-template\\(-\\(columns\\|rows\\|areas\\)\\)\\=\\>/  contained \n                   match /\\<grid-auto-\\(columns\\|rows\\|flow\\|position\\)\\>/  contained \n                   match /\\<grid-\\(row\\|column\\)\\(-\\(start\\|end\\)\\)\\=\\>/  contained \n                   match /\\<grid-area\\>/  contained \n                   match /\\<line-\\(grid\\|snap\\|slack\\)/  contained \n                   match /\\<box-snap\\>/  contained \n                   match /\\<clip-\\(path\\|rule\\)\\>/  contained \n                   match /\\<mask\\(-\\(image\\|mode\\|repeat\\|position\\|clip\\|origin\\|size\\|composite\\|type\\)\\)\\=\\>/  contained \n                   match /\\<mask-border\\(-\\(source\\|mode\\|slice\\|width\\|outset\\|repeat\\)\\)\\=\\>/  contained \n                   match /\\<max-lines\\>/  contained \n                   match /\\<ruby-\\(position\\|merge\\|align\\)/  contained \n                   match /\\<shape-\\(outside\\|image-threshold\\|margin\\)\\>/  contained \n                   match /\\<var-[A-Za-z_][A-Za-z0-9_-]\\+\\>/  contained \n                   match /\\<will-change\\>/  contained \n                   match /\\<text-\\(orientation\\|combine-horizontal\\)\\>/  contained \n                   match /\\<writing-mode\\>/  contained \n                   match /\\<\\(justify\\|align\\)-\\(self\\|content\\|items\\)\\>/  contained \n                   match /\\<animation\\(-\\(name\\|duration\\|timing-function\\|iteration-count\\|direction\\|play-state\\|delay\\|fill-mode\\)\\)\\=\\>/  contained \n                   match /\\<background-\\(clip\\|origin\\|size\\)\\>/  contained \n                   match /\\<border-image\\(-\\(source\\|slice\\|width\\|outset\\|repeat\\)\\)\\=\\>/  contained \n                   match /\\<border-\\(\\(top-right\\|bottom-right\\|bottom-left\\|top-left\\)-\\)\\=radius\\>/  contained \n                   match /\\<box-shadow\\>/  contained \n                   match /\\<break-\\(after\\|before\\|inside\\)\\>/  contained \n                   match /\\<box-decoration-break\\>/  contained \n                   match /\\<wrap-\\(flow\\|through\\)\\>/  contained \n                   match /\\<font-feature-settings\\>/  contained \n                   match /\\<font-kerning\\>/  contained \n                   match /\\<font-language-override\\>/  contained \n                   match /\\<font-synthesis\\>/  contained \n                   match /\\<font-variant-\\(alternates\\|caps\\|east-asian\\|ligatures\\|numeric\\|position\\)\\>/  contained \n                   match /\\<target\\(-\\(name\\|new\\|position\\)\\)\\=\\>/  contained \n                   match /\\<object-\\(fit\\|position\\)\\>/  contained \n                   match /\\<image-\\(resolution\\|orientation\\)\\>/  contained \n                   match /\\<alignment-\\(adjust\\|baseline\\)\\>/  contained \n                   match /\\<baseline-shift\\>/  contained \n                   match /\\<dominate-baseline\\>/  contained \n                   match /\\<drop-initial-\\(after-\\(adjust\\|align\\)\\|before-\\(adjust\\|align\\)\\|size\\|value\\)\\>/  contained \n                   match /\\<inline-box-align\\>/  contained \n                   match /\\<line-stacking\\(-\\(ruby\\|shift\\|strategy\\)\\)\\=\\>/  contained \n                   match /\\<text-height\\>/  contained \n                   match /\\<marquee-\\(direction\\|play-count\\|speed\\|style\\)\\>/  contained \n                   match /\\<column-\\(count\\|fill\\|gap\\|rule\\(-\\(color\\|style\\|width\\)\\)\\=\\|span\\|width\\)\\>/  contained \n                   match /\\<presentation-level\\>/  contained \n                   match /\\<flow-\\(into\\|from\\)\\>/  contained \n                   match /\\<region-fragment\\>/  contained \n                   match /\\<backface-visibility\\>/  contained \n                   match /\\<perspective\\(-origin\\)\\=\\>/  contained \n                   match /\\<transform\\(-\\(origin\\|style\\)\\)\\=\\>/  contained \n                   match /\\<transition\\(-\\(property\\|duration\\|timing-function\\|delay\\)\\)\\=\\>/  contained \n                   match /\\<\\(mix\\|background\\)-blend-mode\\>/  contained \n                   match /\\<\\(justify\\|align\\)-\\(self\\|content\\|items\\)\\>/  contained \n                   match /\\<animation\\(-\\(name\\|duration\\|timing-function\\|iteration-count\\|direction\\|play-state\\|delay\\|fill-mode\\)\\)\\=\\>/  contained \n                   match /\\<background-\\(clip\\|origin\\|size\\)\\>/  contained \n                   match /\\<border-image\\(-\\(source\\|slice\\|width\\|outset\\|repeat\\)\\)\\=\\>/  contained \n                   match /\\<border-\\(\\(top-right\\|bottom-right\\|bottom-left\\|top-left\\)-\\)\\=radius\\>/  contained \n                   match /\\<box-shadow\\>/  contained \n                   match /\\<break-\\(after\\|before\\|inside\\)\\>/  contained \n                   match /\\<box-decoration-break\\>/  contained \n                   match /\\<wrap-\\(flow\\|through\\)\\>/  contained \n                   match /\\<font-feature-settings\\>/  contained \n                   match /\\<font-kerning\\>/  contained \n                   match /\\<font-language-override\\>/  contained \n                   match /\\<font-synthesis\\>/  contained \n                   match /\\<font-variant-\\(alternates\\|caps\\|east-asian\\|ligatures\\|numeric\\|position\\)\\>/  contained \n                   match /\\<target\\(-\\(name\\|new\\|position\\)\\)\\=\\>/  contained \n                   match /\\<object-\\(fit\\|position\\)\\>/  contained \n                   match /\\<image-\\(resolution\\|orientation\\)\\>/  contained \n                   match /\\<alignment-\\(adjust\\|baseline\\)\\>/  contained \n                   match /\\<baseline-shift\\>/  contained \n                   match /\\<dominate-baseline\\>/  contained \n                   match /\\<drop-initial-\\(after-\\(adjust\\|align\\)\\|before-\\(adjust\\|align\\)\\|size\\|value\\)\\>/  contained \n                   match /\\<inline-box-align\\>/  contained \n                   match /\\<line-stacking\\(-\\(ruby\\|shift\\|strategy\\)\\)\\=\\>/  contained \n                   match /\\<text-height\\>/  contained \n                   match /\\<marquee-\\(direction\\|play-count\\|speed\\|style\\)\\>/  contained \n                   match /\\<column-\\(count\\|fill\\|gap\\|rule\\(-\\(color\\|style\\|width\\)\\)\\=\\|span\\|width\\)\\>/  contained \n                   match /\\<presentation-level\\>/  contained \n                   match /\\<flow-\\(into\\|from\\)\\>/  contained \n                   match /\\<region-fragment\\>/  contained \n                   match /\\<backface-visibility\\>/  contained \n                   match /\\<perspective\\(-origin\\)\\=\\>/  contained \n                   match /\\<transform\\(-\\(origin\\|style\\)\\)\\=\\>/  contained \n                   match /\\<transition\\(-\\(property\\|duration\\|timing-function\\|delay\\)\\)\\=\\>/  contained \n                   match /\\<display-\\(inside\\|outside\\|extras\\|box\\)\\>/  contained \n                   match /\\<flex\\(-\\(basis\\|direction\\|flow\\|grow\\|shrink\\|wrap\\)\\)\\=\\>/  contained \n                   match /\\<grid-template\\(-\\(columns\\|rows\\|areas\\)\\)\\=\\>/  contained \n                   match /\\<grid-auto-\\(columns\\|rows\\|flow\\|position\\)\\>/  contained \n                   match /\\<grid-\\(row\\|column\\)\\(-\\(start\\|end\\)\\)\\=\\>/  contained \n                   match /\\<grid-area\\>/  contained \n                   match /\\<line-\\(grid\\|snap\\|slack\\)/  contained \n                   match /\\<box-snap\\>/  contained \n                   match /\\<clip-\\(path\\|rule\\)\\>/  contained \n                   match /\\<mask\\(-\\(image\\|mode\\|repeat\\|position\\|clip\\|origin\\|size\\|composite\\|type\\)\\)\\=\\>/  contained \n                   match /\\<mask-border\\(-\\(source\\|mode\\|slice\\|width\\|outset\\|repeat\\)\\)\\=\\>/  contained \n                   match /\\<max-lines\\>/  contained \n                   match /\\<ruby-\\(position\\|merge\\|align\\)/  contained \n                   match /\\<shape-\\(outside\\|image-threshold\\|margin\\)\\>/  contained \n                   match /\\<var-[A-Za-z_][A-Za-z0-9_-]\\+\\>/  contained \n                   match /\\<will-change\\>/  contained \n                   match /\\<text-\\(orientation\\|combine-horizontal\\)\\>/  contained \n                   match /\\<writing-mode\\>/  contained \n                   links to cssProp\ncssFontAttr    xxx contained grande grande space space zapf zapf caption caption add add backwards backwards content content create create geneva geneva color color flat flat arial arial any any contain contain mathematical mathematical mixed mixed maximum maximum flex flex front front tab tab oblique oblique\n                   contained simplified simplified new new new new balance balance jis04 jis04 paused paused york york symbol symbol fantasy fantasy saturation saturation georgia georgia black black times times unset unset palatino palatino monospace monospace row row alpha alpha jis83 jis83 webdings webdings jis90\n                   contained jis90 stretch stretch ms ms minimum minimum comic comic tahoma tahoma smaller smaller on on rows rows back back icon icon impact impact plaintext plaintext difference difference recto recto dingbats dingbats cover cover italic italic nonzero nonzero wingdings wingdings helvetica helvetica\n                   contained roman roman grid grid off off forwards forwards luminance luminance courier courier local local reverse reverse safe safe contents contents evenodd evenodd multiply multiply infinite infinite clone clone subtract subtract fill fill color-burn color-burn columns columns window window\n                   contained traditional traditional trebuchet trebuchet luminosity luminosity before before exclude exclude same same antiqua antiqua monaco monaco round round true true screen screen snap snap after after unicase unicase unicase unicase wrap wrap central central bolder bolder running running\n                   contained exclusion exclusion menu menu subgrid subgrid cursive cursive hard-light hard-light charcoal charcoal span span alternate alternate ordinal ordinal verdana verdana lighten lighten lighter lighter linotype linotype neue neue forward forward modal modal lucida lucida break break linear\n                   contained linear color-dodge color-dodge fragments fragments increment increment soft-light soft-light isolate isolate slice slice element element slide slide current current overlay overlay unicode unicode bold bold roboto roboto darken darken dense dense intersect intersect gadget gadget hue hue\n                   contained book book verso verso jis78 jis78 larger larger\n                   match /\\<small-\\(caps\\|caption\\)\\>/  contained \n                   match /\\<message-box\\>/  contained \n                   match /\\<status-bar\\>/  contained \n                   match /\\<\\(x\\{1,2\\}-\\)\\=\\(large\\|small\\)\\>/  contained \n                   match /\\<\\(sans-\\)\\=serif\\>/  contained \n                   match /\\<\\(\\(ultra\\|extra\\|semi\\)-\\)\\=\\(condensed\\|expanded\\)\\>/  contained \n                   match /\\<\\(all-\\)\\=\\(small-\\|petite-\\|titling-\\)caps\\>/  contained \n                   match /\\<\\(subpixel-\\)\\=\\antialiased\\>/  contained \n                   match /\\<small-\\(caps\\|caption\\)\\>/  contained \n                   match /\\<message-box\\>/  contained \n                   match /\\<status-bar\\>/  contained \n                   match /\\<\\(x\\{1,2\\}-\\)\\=\\(large\\|small\\)\\>/  contained \n                   match /\\<\\(sans-\\)\\=serif\\>/  contained \n                   match /\\<\\(\\(ultra\\|extra\\|semi\\)-\\)\\=\\(condensed\\|expanded\\)\\>/  contained \n                   match /\\<\\(all-\\)\\=\\(small-\\|petite-\\|titling-\\)caps\\>/  contained \n                   match /\\<\\(subpixel-\\)\\=\\antialiased\\>/  contained \n                   match /\\<\\(block\\|inline\\)-level\\>/  contained \n                   match /\\<inline-list-item\\>/  contained \n                   match /\\<inline-flex\\>/  contained \n                   match /\\<\\(row\\|column\\|wrap\\)-reverse\\>/  contained \n                   match /\\<inline-grid\\>/  contained \n                   match /\\<half-border\\>/  contained \n                   match /\\<\\(fill\\|stroke\\|view\\)-box\\>/  contained \n                   match /\\<no-clip\\>/  contained \n                   match /\\<paged-\\(x\\|y\\)\\(-controls\\)\\=\\>/  contained \n                   match /\\<ruby-\\(base\\|text\\)-container\\>/  contained \n                   match /\\<inter-character\\>/  contained \n                   match /\\<margin-box\\>/  contained \n                   match /\\<scroll-position\\>/  contained \n                   match /\\<\\(upright\\|sideways\\(-right\\|-left\\)\\=\\|use-glyph-orientation\\)\\>/  contained \n                   match /\\<isolate-override\\>/  contained \n                   match /\\<\\(horizontal-tb\\|vertical-\\(rl\\|lr\\)\\)\\>/  contained \n                   match /\\<\\(self\\|flex\\)-\\(start\\|end\\)\\>/  contained \n                   match /\\<space-\\(between\\|around\\|evenly\\)\\>/  contained \n                   match /\\<alternate-reverse\\>/  contained \n                   match /\\<\\(padding\\|border\\|content\\)-box\\>/  contained \n                   match /\\<\\(no-\\)\\=\\(common\\|discretionary\\|historical\\)-ligatures\\>/  contained \n                   match /\\<\\(no-\\)\\=contextual\\>/  contained \n                   match /\\<historical-forms\\>/  contained \n                   match /\\<all-small-caps\\>/  contained \n                   match /\\<\\(all-\\)\\=petite-caps\\>/  contained \n                   match /\\<titling-caps\\>/  contained \n                   match /\\<\\(lining\\|oldstyle\\|proportional\\|tabular\\)-nums\\>/  contained \n                   match /\\<\\(diagonal\\|stacked\\)-fractions\\>/  contained \n                   match /\\<slashed-zero\\>/  contained \n                   match /\\<proportional-width\\>/  contained \n                   match /\\<from-image\\>/  contained \n                   match /\\<scale-down\\>/  contained \n                   match /\\<\\(text-\\)\\=\\(before\\|after\\)-edge\\>/  contained \n                   match /\\<use-script\\>/  contained \n                   match /\\<caps-height\\>/  contained \n                   match /\\<\\(exclude\\|include\\)-ruby\\>/  contained \n                   match /\\<\\(consider\\|disregard\\)-shift\\>/  contained \n                   match /\\<\\(\\(inline\\|block\\)-line\\|max\\|grid\\)-height\\>/  contained \n                   match /\\<\\(font\\|text\\|max\\)-size\\>/  contained \n                   match /\\<marquee-\\(line\\|block\\)\\>/  contained \n                   match /\\<\\(avoid-\\)\\=column\\>/  contained \n                   match /\\<\\(avoid-\\)\\=page\\>/  contained \n                   match /\\<\\(avoid-\\)\\=region\\>/  contained \n                   match /\\<\\(\\(min\\|max\\|fit\\)-content\\|fill-available\\|repudiate-floats\\)\\>/  contained \n                   match /\\<contain-floats\\>/  contained \n                   match /\\<preserve-3d\\>/  contained \n                   match /\\<ease\\(-\\(in\\|out\\|in-out\\)\\)\\=\\>/  contained \n                   match /\\<step-\\(start\\|end\\)\\>/  contained \n                   match /\\<\\(self\\|flex\\)-\\(start\\|end\\)\\>/  contained \n                   match /\\<space-\\(between\\|around\\|evenly\\)\\>/  contained \n                   match /\\<alternate-reverse\\>/  contained \n                   match /\\<\\(padding\\|border\\|content\\)-box\\>/  contained \n                   match /\\<\\(no-\\)\\=\\(common\\|discretionary\\|historical\\)-ligatures\\>/  contained \n                   match /\\<\\(no-\\)\\=contextual\\>/  contained \n                   match /\\<historical-forms\\>/  contained \n                   match /\\<all-small-caps\\>/  contained \n                   match /\\<\\(all-\\)\\=petite-caps\\>/  contained \n                   match /\\<titling-caps\\>/  contained \n                   match /\\<\\(lining\\|oldstyle\\|proportional\\|tabular\\)-nums\\>/  contained \n                   match /\\<\\(diagonal\\|stacked\\)-fractions\\>/  contained \n                   match /\\<slashed-zero\\>/  contained \n                   match /\\<proportional-width\\>/  contained \n                   match /\\<from-image\\>/  contained \n                   match /\\<scale-down\\>/  contained \n                   match /\\<\\(text-\\)\\=\\(before\\|after\\)-edge\\>/  contained \n                   match /\\<use-script\\>/  contained \n                   match /\\<caps-height\\>/  contained \n                   match /\\<\\(exclude\\|include\\)-ruby\\>/  contained \n                   match /\\<\\(consider\\|disregard\\)-shift\\>/  contained \n                   match /\\<\\(\\(inline\\|block\\)-line\\|max\\|grid\\)-height\\>/  contained \n                   match /\\<\\(font\\|text\\|max\\)-size\\>/  contained \n                   match /\\<marquee-\\(line\\|block\\)\\>/  contained \n                   match /\\<\\(avoid-\\)\\=column\\>/  contained \n                   match /\\<\\(avoid-\\)\\=page\\>/  contained \n                   match /\\<\\(avoid-\\)\\=region\\>/  contained \n                   match /\\<\\(\\(min\\|max\\|fit\\)-content\\|fill-available\\|repudiate-floats\\)\\>/  contained \n                   match /\\<contain-floats\\>/  contained \n                   match /\\<preserve-3d\\>/  contained \n                   match /\\<ease\\(-\\(in\\|out\\|in-out\\)\\)\\=\\>/  contained \n                   match /\\<step-\\(start\\|end\\)\\>/  contained \n                   match /\\<\\(block\\|inline\\)-level\\>/  contained \n                   match /\\<inline-list-item\\>/  contained \n                   match /\\<inline-flex\\>/  contained \n                   match /\\<\\(row\\|column\\|wrap\\)-reverse\\>/  contained \n                   match /\\<inline-grid\\>/  contained \n                   match /\\<half-border\\>/  contained \n                   match /\\<\\(fill\\|stroke\\|view\\)-box\\>/  contained \n                   match /\\<no-clip\\>/  contained \n                   match /\\<paged-\\(x\\|y\\)\\(-controls\\)\\=\\>/  contained \n                   match /\\<ruby-\\(base\\|text\\)-container\\>/  contained \n                   match /\\<inter-character\\>/  contained \n                   match /\\<margin-box\\>/  contained \n                   match /\\<scroll-position\\>/  contained \n                   match /\\<\\(upright\\|sideways\\(-right\\|-left\\)\\=\\|use-glyph-orientation\\)\\>/  contained \n                   match /\\<isolate-override\\>/  contained \n                   match /\\<\\(horizontal-tb\\|vertical-\\(rl\\|lr\\)\\)\\>/  contained \n                   links to cssAttr\ncssCommonAttr  xxx contained all all none none stretch stretch initial initial auto auto inherit inherit bottom bottom normal normal visible visible center center top top hidden hidden default default\n                   links to cssAttr\ncssFontDescriptorProp xxx contained src src\n                   match /\\<unicode-range\\>/  contained \n                   match /\\<unicode-range\\>/  contained \n                   links to cssProp\ncssFontDescriptorFunction xxx matchgroup=cssFunctionName start=/\\<\\(uri\\|url\\|local\\|format\\)\\s*(/ end=/)/  contained oneline keepend contains=cssStringQ,cssStringQQ \n                   matchgroup=cssFunctionName start=/\\<\\(uri\\|url\\|local\\|format\\)\\s*(/ end=/)/  contained oneline keepend contains=cssStringQ,cssStringQQ \n                   links to Constant\ncssUnicodeRange xxx match /U+[0-9A-Fa-f?]\\+/  contained \n                   match /U+\\x\\+-\\x\\+/  contained \n                   match /U+[0-9A-Fa-f?]\\+/  contained \n                   match /U+\\x\\+-\\x\\+/  contained \n                   links to Constant\ncssFontDescriptorAttr xxx contained all all\n                   links to cssAttr\ncssFunctionComma xxx match /,/  contained \n                   match /,/  contained \n                   links to Function\ncssGradientAttr xxx contained left left at at ellipse ellipse cover cover bottom bottom right right center center top top middle middle\n                   links to cssAttr\ncssAnimationProp xxx match /\\<animation\\(-\\(delay\\|direction\\|duration\\|fill-mode\\|name\\|play-state\\|timing-function\\|iteration-count\\)\\)\\=\\>/  contained \n                   match /\\<animation\\(-\\(delay\\|direction\\|duration\\|fill-mode\\|name\\|play-state\\|timing-function\\|iteration-count\\)\\)\\=\\>/  contained \n                   links to cssProp\ncssAnimationAttr xxx contained both both backwards backwards paused paused forwards forwards reverse reverse running running alternate alternate\n                   match /\\<alternate-reverse\\>/  contained \n                   match /\\<alternate-reverse\\>/  contained \n                   links to cssAttr\ncssBackgroundProp xxx match /\\<background\\(-\\(attachment\\|clip\\|color\\|image\\|origin\\|position\\|repeat\\|size\\)\\)\\=\\>/  contained \n                   match /\\<background\\(-\\(attachment\\|clip\\|color\\|image\\|origin\\|position\\|repeat\\|size\\)\\)\\=\\>/  contained \n                   links to cssProp\ncssBackgroundAttr xxx contained space space left left contain contain scroll scroll fixed fixed cover cover bottom bottom right right local local center center round round top top\n                   match /\\<no-repeat\\>/  contained \n                   match /\\<repeat\\(-[xy]\\)\\=\\>/  contained \n                   match /\\<no-repeat\\>/  contained \n                   match /\\<repeat\\(-[xy]\\)\\=\\>/  contained \n                   links to cssAttr\ncssBorderProp  xxx match /\\<border\\(-\\(top\\|right\\|bottom\\|left\\)\\)\\=\\(-\\(width\\|color\\|style\\)\\)\\=\\>/  contained \n                   match /\\<border\\(-\\(top\\|bottom\\)-\\(left\\|right\\)\\)\\=-radius\\>/  contained \n                   match /\\<border-image\\(-\\(outset\\|repeat\\|slice\\|source\\|width\\)\\)\\=\\>/  contained \n                   match /\\<box-decoration-break\\>/  contained \n                   match /\\<box-shadow\\>/  contained \n                   match /\\<border\\(-\\(top\\|right\\|bottom\\|left\\)\\)\\=\\(-\\(width\\|color\\|style\\)\\)\\=\\>/  contained \n                   match /\\<border\\(-\\(top\\|bottom\\)-\\(left\\|right\\)\\)\\=-radius\\>/  contained \n                   match /\\<border-image\\(-\\(outset\\|repeat\\|slice\\|source\\|width\\)\\)\\=\\>/  contained \n                   match /\\<box-decoration-break\\>/  contained \n                   match /\\<box-shadow\\>/  contained \n                   links to cssProp\ncssBorderAttr  xxx contained space space solid solid thin thin inset inset groove groove stretch stretch thick thick clone clone fill fill round round ridge ridge double double dashed dashed slice slice outset outset dotted dotted medium medium\n                   links to cssAttr\ncssBoxProp     xxx match /\\<padding\\(-\\(top\\|right\\|bottom\\|left\\)\\)\\=\\>/  contained \n                   match /\\<margin\\(-\\(top\\|right\\|bottom\\|left\\)\\)\\=\\>/  contained \n                   match /\\<overflow\\(-\\(x\\|y\\|style\\)\\)\\=\\>/  contained \n                   match /\\<rotation\\(-point\\)\\=\\>/  contained \n                   match /\\<padding\\(-\\(top\\|right\\|bottom\\|left\\)\\)\\=\\>/  contained \n                   match /\\<margin\\(-\\(top\\|right\\|bottom\\|left\\)\\)\\=\\>/  contained \n                   match /\\<overflow\\(-\\(x\\|y\\|style\\)\\)\\=\\>/  contained \n                   match /\\<rotation\\(-point\\)\\=\\>/  contained \n                   match /\\<overflow-\\(style\\|x\\|y\\)\\>/  contained \n                   match /\\<rotation\\(-point\\)\\=\\>/  contained \n                   match /\\<overflow-\\(style\\|x\\|y\\)\\>/  contained \n                   match /\\<rotation\\(-point\\)\\=\\>/  contained \n                   links to cssProp\ncssBoxAttr     xxx contained marquee marquee scroll scroll auto auto visible visible panner panner scrollbar scrollbar hidden hidden\n                   match /\\<no-\\(display\\|content\\)\\>/  contained \n                   match /\\<no-\\(display\\|content\\)\\>/  contained \n                   match /\\<ruby\\(-\\(base\\(-group\\)\\=\\|text\\(-group\\)\\=\\)\\)\\=\\>/  contained \n                   match /\\<no-\\(display\\|content\\)\\>/  contained \n                   match /\\<ruby\\(-\\(base\\(-group\\)\\=\\|text\\(-group\\)\\=\\)\\)\\=\\>/  contained \n                   match /\\<no-\\(display\\|content\\)\\>/  contained \n                   links to cssAttr\ncssColorProp   xxx contained opacity opacity opacity opacity\n                   match /\\<color-profile\\>/  contained \n                   match /\\<rendering-intent\\>/  contained \n                   match /\\<color-profile\\>/  contained \n                   match /\\<rendering-intent\\>/  contained \n                   links to cssProp\ncssDimensionProp xxx contained width width height height\n                   match /\\<\\(min\\|max\\)-\\(width\\|height\\)\\>/  contained \n                   match /\\<\\(min\\|max\\)-\\(width\\|height\\)\\>/  contained \n                   links to cssProp\ncssFlexibleBoxProp xxx match /\\<box-\\(align\\|direction\\|flex\\|ordinal-group\\|orient\\|pack\\|shadow\\|sizing\\)\\>/  contained \n                   match /\\<box-\\(align\\|direction\\|flex\\|ordinal-group\\|orient\\|pack\\|shadow\\|sizing\\)\\>/  contained \n                   links to cssProp\ncssFlexibleBoxAttr xxx contained baseline baseline end end single single start start horizontal horizontal mulitple mulitple reverse reverse\n                   match /\\<vertical\\(-align\\)\\@!\\>/  contained \n                   match /\\<\\(inline\\|block\\)-axis\\>/  contained \n                   match /\\<vertical\\(-align\\)\\@!\\>/  contained \n                   match /\\<\\(inline\\|block\\)-axis\\>/  contained \n                   links to cssAttr\ncssMultiColumnProp xxx contained columns columns\n                   match /\\<break-\\(after\\|before\\|inside\\)\\>/  contained \n                   match /\\<column-\\(count\\|fill\\|gap\\|rule\\(-\\(color\\|style\\|width\\)\\)\\=\\|span\\|width\\)\\>/  contained \n                   match /\\<page\\(-break-\\(before\\|after\\|inside\\)\\)\\=\\>/  contained \n                   match /\\<break-\\(after\\|before\\|inside\\)\\>/  contained \n                   match /\\<column-\\(count\\|fill\\|gap\\|rule\\(-\\(color\\|style\\|width\\)\\)\\=\\|span\\|width\\)\\>/  contained \n                   match /\\<page\\(-break-\\(before\\|after\\|inside\\)\\)\\=\\>/  contained \n                   links to cssProp\ncssMultiColumnAttr xxx contained left left column column balance balance always always right right page page avoid avoid medium medium\n                   match /\\<avoid-\\(page\\|column\\)\\>/  contained \n                   match /\\<avoid-\\(page\\|column\\)\\>/  contained \n                   links to cssAttr\ncssGeneratedContentProp xxx contained system system range range negative negative prefix prefix crop crop pad pad running running quotes quotes suffix suffix fallback fallback\n                   match /\\<counter-\\(reset\\|increment\\)\\>/  contained \n                   match /\\<move-to\\>/  contained \n                   match /\\<page-policy\\>/  contained \n                   match /\\<counter-\\(reset\\|increment\\)\\>/  contained \n                   match /\\<move-to\\>/  contained \n                   match /\\<page-policy\\>/  contained \n                   match /\\<\\(additive-\\)\\=symbols\\>/  contained \n                   match /\\<speak-as\\>/  contained \n                   match /\\<string-set\\>/  contained \n                   match /\\<footnote-\\(display\\|policy\\)\\>/  contained \n                   match /\\<bookmark-\\(label\\|level\\|state\\)\\>/  contained \n                   match /\\<marker-side\\>/  contained \n                   match /\\<counter-set\\>/  contained \n                   match /\\<move-to\\>/  contained \n                   match /\\<page-policy\\>/  contained \n                   match /\\<move-to\\>/  contained \n                   match /\\<page-policy\\>/  contained \n                   match /\\<\\(additive-\\)\\=symbols\\>/  contained \n                   match /\\<speak-as\\>/  contained \n                   match /\\<string-set\\>/  contained \n                   match /\\<footnote-\\(display\\|policy\\)\\>/  contained \n                   match /\\<bookmark-\\(label\\|level\\|state\\)\\>/  contained \n                   match /\\<marker-side\\>/  contained \n                   match /\\<counter-set\\>/  contained \n                   links to cssProp\ncssGeneratedContentAttr xxx contained words words first first open open footnote footnote extends extends here here line line marker marker last last additive additive symbolic symbolic inhibit inhibit bullets bullets numbers numbers closed closed cyclic cyclic\n                   match /\\<\\(no-\\)\\=\\(open\\|close\\)-quote\\>/  contained \n                   match /\\<\\(no-\\)\\=\\(open\\|close\\)-quote\\>/  contained \n                   match /\\<cjk-decimal\\>/  contained \n                   match /\\<disclosure-\\(open\\|closed\\)\\>/  contained \n                   match /\\<simp-chinese-\\(in\\)\\=formal\\>/  contained \n                   match /\\<trad-chinese-\\(in\\)\\=formal\\>/  contained \n                   match /\\<ethiopic-numeric\\>/  contained \n                   match /\\<list-container\\>/  contained \n                   match /\\<cjk-decimal\\>/  contained \n                   match /\\<disclosure-\\(open\\|closed\\)\\>/  contained \n                   match /\\<simp-chinese-\\(in\\)\\=formal\\>/  contained \n                   match /\\<trad-chinese-\\(in\\)\\=formal\\>/  contained \n                   match /\\<ethiopic-numeric\\>/  contained \n                   match /\\<list-container\\>/  contained \n                   links to cssAttr\ncssGridProp    xxx match /\\<grid-\\(columns\\|rows\\)\\>/  contained \n                   match /\\<grid-\\(columns\\|rows\\)\\>/  contained \n                   links to cssProp\ncssHyerlinkProp xxx match /\\<target\\(-\\(name\\|new\\|position\\)\\)\\=\\>/  contained \n                   match /\\<target\\(-\\(name\\|new\\|position\\)\\)\\=\\>/  contained \n                   links to cssProp\ncssListProp    xxx match /\\<list-style\\(-\\(type\\|position\\|image\\)\\)\\=\\>/  contained \n                   match /\\<list-style\\(-\\(type\\|position\\|image\\)\\)\\=\\>/  contained \n                   links to cssProp\ncssListAttr    xxx contained outside outside disc disc hebrew hebrew armenian armenian circle circle inside inside square square georgian georgian\n                   match /\\<\\(lower\\|upper\\)-\\(roman\\|alpha\\|greek\\|latin\\)\\>/  contained \n                   match /\\<\\(hiragana\\|katakana\\)\\(-iroha\\)\\=\\>/  contained \n                   match /\\<\\(decimal\\(-leading-zero\\)\\=\\|cjk-ideographic\\)\\>/  contained \n                   match /\\<\\(lower\\|upper\\)-\\(roman\\|alpha\\|greek\\|latin\\)\\>/  contained \n                   match /\\<\\(hiragana\\|katakana\\)\\(-iroha\\)\\=\\>/  contained \n                   match /\\<\\(decimal\\(-leading-zero\\)\\=\\|cjk-ideographic\\)\\>/  contained \n                   links to cssAttr\ncssPositioningProp xxx contained display display left left visibility visibility float float bottom bottom right right top top clear clear clip clip position position\n                   match /\\<z-index\\>/  contained \n                   match /\\<z-index\\>/  contained \n                   links to cssProp\ncssPositioningAttr xxx contained absolute absolute both both left left relative relative compact compact static static fixed fixed block block right right\n                   match /\\<table\\(-\\(row-group\\|\\(header\\|footer\\)-group\\|row\\|column\\(-group\\)\\=\\|cell\\|caption\\)\\)\\=\\>/  contained \n                   match /\\<list-item\\>/  contained \n                   match /\\<inline\\(-\\(block\\|box\\|table\\)\\)\\=\\>/  contained \n                   match /\\<table\\(-\\(row-group\\|\\(header\\|footer\\)-group\\|row\\|column\\(-group\\)\\=\\|cell\\|caption\\)\\)\\=\\>/  contained \n                   match /\\<list-item\\>/  contained \n                   match /\\<inline\\(-\\(block\\|box\\|table\\)\\)\\=\\>/  contained \n                   links to cssAttr\ncssPrintAttr   xxx contained cross cross always always portrait portrait crop crop landscape landscape avoid avoid\n                   links to cssAttr\ncssTableProp   xxx match /\\<\\(caption-side\\|table-layout\\|border-collapse\\|border-spacing\\|empty-cells\\)\\>/  contained \n                   match /\\<\\(caption-side\\|table-layout\\|border-collapse\\|border-spacing\\|empty-cells\\)\\>/  contained \n                   links to cssProp\ncssTableAttr   xxx contained separate separate show show always always fixed fixed once once collapse collapse hide hide\n                   links to cssAttr\ncssTextProp    xxx contained direction direction color color hyphens hyphens\n                   match /\\<\\(\\(word\\|letter\\)-spacing\\|text\\(-\\(decoration\\|transform\\|align\\|index\\|shadow\\)\\)\\=\\|vertical-align\\|unicode-bidi\\|line-height\\)\\>/  contained \n                   match /\\<text-\\(justify\\|outline\\|warp\\|align-last\\|size-adjust\\|rendering\\|stroke\\|indent\\)\\>/  contained \n                   match /\\<word-\\(break\\|\\wrap\\)\\>/  contained \n                   match /\\<white-space\\>/  contained \n                   match /\\<hanging-punctuation\\>/  contained \n                   match /\\<punctuation-trim\\>/  contained \n                   match /\\<\\(\\(word\\|letter\\)-spacing\\|text\\(-\\(decoration\\|transform\\|align\\|index\\|shadow\\)\\)\\=\\|vertical-align\\|unicode-bidi\\|line-height\\)\\>/  contained \n                   match /\\<text-\\(justify\\|outline\\|warp\\|align-last\\|size-adjust\\|rendering\\|stroke\\|indent\\)\\>/  contained \n                   match /\\<word-\\(break\\|\\wrap\\)\\>/  contained \n                   match /\\<white-space\\>/  contained \n                   match /\\<hanging-punctuation\\>/  contained \n                   match /\\<punctuation-trim\\>/  contained \n                   match /\\<line-break\\>/  contained \n                   match /\\<overflow-wrap\\>/  contained \n                   match /\\<tab-size\\>/  contained \n                   match /\\<text-\\(decoration\\(-\\(color\\|line\\|skip\\|style\\)\\)\\=\\|underline-position\\|emphasis\\(-\\(color\\|position\\|style\\)\\)\\=\\)\\>/  contained \n                   match /\\<line-break\\>/  contained \n                   match /\\<overflow-wrap\\>/  contained \n                   match /\\<tab-size\\>/  contained \n                   match /\\<text-\\(decoration\\(-\\(color\\|line\\|skip\\|style\\)\\)\\=\\|underline-position\\|emphasis\\(-\\(color\\|position\\|style\\)\\)\\=\\)\\>/  contained \n                   links to cssProp\ncssTextAttr    xxx contained baseline baseline optimizespeed optimizespeed loose loose first first ink ink end end hanging hanging optimizelegibility optimizelegibility strict strict start start alphabetic alphabetic last last ellipsis ellipsis overline overline objects objects embed embed blink blink rtl rtl dot dot\n                   contained lowercase lowercase distribute distribute suppress suppress manual manual filled filled super super super super over over nowrap nowrap justify justify under under hyphenate hyphenate sub sub sub sub triangle triangle capitalize capitalize edges edges wavy wavy kashida kashida adjacent\n                   contained adjacent underline underline middle middle unrestricted unrestricted sesame sesame ltr ltr uppercase uppercase clip clip spaces spaces\n                   match /\\<line-through\\>/  contained \n                   match /\\<\\(text-\\)\\=\\(top\\|bottom\\)\\>/  contained \n                   match /\\<pre\\(-\\(line\\|wrap\\)\\)\\=\\>/  contained \n                   match /\\<\\(allow\\|force\\)-end\\>/  contained \n                   match /\\<inter-\\(word\\|ideographic\\|cluster\\)\\>/  contained \n                   match /\\<break-all\\>/  contained \n                   match /\\<break-word\\>/  contained \n                   match /\\<bidi-override\\>/  contained \n                   match /\\<line-through\\>/  contained \n                   match /\\<\\(text-\\)\\=\\(top\\|bottom\\)\\>/  contained \n                   match /\\<pre\\(-\\(line\\|wrap\\)\\)\\=\\>/  contained \n                   match /\\<\\(allow\\|force\\)-end\\>/  contained \n                   match /\\<inter-\\(word\\|ideographic\\|cluster\\)\\>/  contained \n                   match /\\<break-all\\>/  contained \n                   match /\\<break-word\\>/  contained \n                   match /\\<bidi-override\\>/  contained \n                   match /\\<match-parent\\>/  contained \n                   match /\\<each-line\\>/  contained \n                   match /\\<full-width\\>/  contained \n                   match /\\<box-decoration\\>/  contained \n                   match /\\<match-parent\\>/  contained \n                   match /\\<each-line\\>/  contained \n                   match /\\<full-width\\>/  contained \n                   match /\\<box-decoration\\>/  contained \n                   links to cssAttr\ncssTransformProp xxx match /\\<transform\\(-\\(origin\\|style\\)\\)\\=\\>/  contained \n                   match /\\<perspective\\(-origin\\)\\=\\>/  contained \n                   match /\\<backface-visibility\\>/  contained \n                   match /\\<transform\\(-\\(origin\\|style\\)\\)\\=\\>/  contained \n                   match /\\<perspective\\(-origin\\)\\=\\>/  contained \n                   match /\\<backface-visibility\\>/  contained \n                   links to cssProp\ncssTransitionProp xxx match /\\<transition\\(-\\(delay\\|duration\\|property\\|timing-function\\)\\)\\=\\>/  contained \n                   match /\\<transition\\(-\\(delay\\|duration\\|property\\|timing-function\\)\\)\\=\\>/  contained \n                   links to cssProp\ncssTransitionAttr xxx match /\\<linear\\(-gradient\\)\\@!\\>/  contained \n                   match /\\<ease\\(-\\(in-out\\|out\\|in\\)\\)\\=\\>/  contained \n                   match /\\<step\\(-start\\|-end\\)\\=\\>/  contained \n                   match /\\<linear\\(-gradient\\)\\@!\\>/  contained \n                   match /\\<ease\\(-\\(in-out\\|out\\|in\\)\\)\\=\\>/  contained \n                   match /\\<step\\(-start\\|-end\\)\\=\\>/  contained \n                   links to cssAttr\ncssUIProp      xxx contained icon icon icon icon cursor cursor appearance appearance resize resize resize resize\n                   match /\\<box-sizing\\>/  contained \n                   match /\\<ime-mode\\>/  contained \n                   match /\\<nav-\\(down\\|index\\|left\\|right\\|up\\)\\=\\>/  contained \n                   match /\\<outline\\(-\\(width\\|style\\|color\\|offset\\)\\)\\=\\>/  contained \n                   match /\\<text-overflow\\>/  contained \n                   match /\\(tap-highlight-color\\|user-select\\|touch-callout\\)/  contained \n                   match /\\<box-sizing\\>/  contained \n                   match /\\<ime-mode\\>/  contained \n                   match /\\<nav-\\(down\\|index\\|left\\|right\\|up\\)\\=\\>/  contained \n                   match /\\<outline\\(-\\(width\\|style\\|color\\|offset\\)\\)\\=\\>/  contained \n                   match /\\<text-overflow\\>/  contained \n                   match /\\(tap-highlight-color\\|user-select\\|touch-callout\\)/  contained \n                   match /\\<box-sizing\\>/  contained \n                   match /\\<ime-mode\\>/  contained \n                   match /\\<nav-\\(index\\|up\\|right\\|down\\|left\\)/  contained \n                   match /\\<outline-offset\\>/  contained \n                   match /\\<text-overflow\\>/  contained \n                   match /\\<box-sizing\\>/  contained \n                   match /\\<ime-mode\\>/  contained \n                   match /\\<nav-\\(index\\|up\\|right\\|down\\|left\\)/  contained \n                   match /\\<outline-offset\\>/  contained \n                   match /\\<text-overflow\\>/  contained \n                   links to cssProp\ncssUIAttr      xxx contained button button both both help help disabled disabled disabled disabled vertical vertical vertical vertical cell cell root root ellipsis ellipsis ellipsis ellipsis pointer pointer progress progress horizontal horizontal horizontal horizontal icon icon invert invert text text move move move\n                   contained move alias alias window window copy copy wait wait document document menu menu field field inactive inactive inactive inactive active active active active crosshair crosshair clip clip clip clip\n                   match /\\<\\(content\\|padding\\|border\\)\\(-box\\)\\=\\>/  contained \n                   match /\\<\\(\\([ns]\\=[ew]\\=\\)\\|col\\|row\\|nesw\\|nwse\\)-resize\\>/  contained \n                   match /\\<context-menu\\>/  contained \n                   match /\\<no-drop\\>/  contained \n                   match /\\<not-allowed\\>/  contained \n                   match /\\<all-scroll\\>/  contained \n                   match /\\<\\(vertical-\\)\\=text\\>/  contained \n                   match /\\<zoom\\(-in\\|-out\\)\\=\\>/  contained \n                   match /\\(preserve-3d\\)/  contained \n                   match /\\<\\(content\\|padding\\|border\\)\\(-box\\)\\=\\>/  contained \n                   match /\\<\\(\\([ns]\\=[ew]\\=\\)\\|col\\|row\\|nesw\\|nwse\\)-resize\\>/  contained \n                   match /\\<context-menu\\>/  contained \n                   match /\\<no-drop\\>/  contained \n                   match /\\<not-allowed\\>/  contained \n                   match /\\<all-scroll\\>/  contained \n                   match /\\<\\(vertical-\\)\\=text\\>/  contained \n                   match /\\<zoom\\(-in\\|-out\\)\\=\\>/  contained \n                   match /\\(preserve-3d\\)/  contained \n                   links to cssAttr\ncssIEUIAttr    xxx match /\\(bicubic\\)/  contained \n                   match /\\(bicubic\\)/  contained \n                   links to cssAttr\ncssIEUIProp    xxx match /\\(interpolation-mode\\|zoom\\|filter\\)/  contained \n                   match /\\(interpolation-mode\\|zoom\\|filter\\)/  contained \n                   links to cssProp\ncssAuralProp   xxx contained volume volume richness richness stress stress during during azimuth azimuth elevation elevation\n                   match /\\<\\(pause\\|cue\\)\\(-\\(before\\|after\\)\\)\\=\\>/  contained \n                   match /\\<\\(play-during\\|speech-rate\\|voice-family\\|pitch\\(-range\\)\\=\\|speak\\(-\\(punctuation\\|numeral\\|header\\)\\)\\=\\)\\>/  contained \n                   match /\\<\\(pause\\|cue\\)\\(-\\(before\\|after\\)\\)\\=\\>/  contained \n                   match /\\<\\(play-during\\|speech-rate\\|voice-family\\|pitch\\(-range\\)\\=\\|speak\\(-\\(punctuation\\|numeral\\|header\\)\\)\\=\\)\\>/  contained \n                   match /\\<voice-\\(volume\\|balance\\|rate\\|pitch\\|range\\|stress\\|duration\\)\\>/  contained \n                   match /\\<rest\\(-\\(before\\|after\\)\\)\\=\\>/  contained \n                   match /\\<voice-\\(volume\\|balance\\|rate\\|pitch\\|range\\|stress\\|duration\\)\\>/  contained \n                   match /\\<rest\\(-\\(before\\|after\\)\\)\\=\\>/  contained \n                   links to cssProp\ncssAuralAttr   xxx contained mix mix rightwards rightwards neutral neutral behind behind moderate moderate silent silent higher higher preserve preserve non non young young faster faster leftwards leftwards female female old old above above continuous continuous code code reduced reduced below below lower lower\n                   contained digits digits slower slower level level child child male male\n                   match /\\<\\(x-\\)\\=\\(soft\\|loud\\)\\>/  contained \n                   match /\\<spell-out\\>/  contained \n                   match /\\<\\(left\\|right\\)-side\\>/  contained \n                   match /\\<\\(far\\|center\\)-\\(left\\|center\\|right\\)\\>/  contained \n                   match /\\<\\(x-\\)\\=\\(slow\\|fast\\|low\\|high\\)\\>/  contained \n                   match /\\<\\(x-\\)\\=\\(soft\\|loud\\)\\>/  contained \n                   match /\\<spell-out\\>/  contained \n                   match /\\<\\(left\\|right\\)-side\\>/  contained \n                   match /\\<\\(far\\|center\\)-\\(left\\|center\\|right\\)\\>/  contained \n                   match /\\<\\(x-\\)\\=\\(slow\\|fast\\|low\\|high\\)\\>/  contained \n                   match /\\<\\(literal\\|no\\)-punctuation\\>/  contained \n                   match /\\<\\(x-\\)\\=\\(weak\\|strong\\)\\>/  contained \n                   match /\\<\\(literal\\|no\\)-punctuation\\>/  contained \n                   match /\\<\\(x-\\)\\=\\(weak\\|strong\\)\\>/  contained \n                   links to cssAttr\ncssMobileTextProp xxx match /\\<text-size-adjust\\>/  contained \n                   match /\\<text-size-adjust\\>/  contained \n                   links to cssProp\ncssBraceError  xxx match /}/  contained \n                   match /}/  contained \n                   links to Error\ncssAttrComma   xxx match /,/  contained \n                   match /,/  contained \n                   links to Special\ncssNoise       xxx match +\\(:\\|;\\|\\/\\)+  contained \n                   match +\\(:\\|;\\|\\/\\)+  contained \n                   links to Noise\ncssPseudoClassId xxx contained empty empty empty empty target target target target content content left left disabled disabled disabled disabled link link marker marker optional optional root root root root valid valid future future slot slot past past region region blank blank right right invalid invalid invalid\n                   contained invalid checked checked checked checked before before scope scope host host after after required required indeterminate indeterminate active active shadow shadow enabled enabled hover hover visited visited enable enable current current default default\n                   match /\\<first-\\(line\\|letter\\)\\>/  contained \n                   match /\\<\\(first\\|last\\|only\\)-\\(of-type\\|child\\)\\>/  contained \n                   match /\\<selection\\>/  contained \n                   match /\\<focus\\(-inner\\)\\=\\>/  contained \n                   match /\\<\\(input-\\)\\=placeholder\\>/  contained \n                   match /\\<first-\\(line\\|letter\\)\\>/  contained \n                   match /\\<\\(first\\|last\\|only\\)-\\(of-type\\|child\\)\\>/  contained \n                   match /\\<selection\\>/  contained \n                   match /\\<focus\\(-inner\\)\\=\\>/  contained \n                   match /\\<\\(input-\\)\\=placeholder\\>/  contained \n                   match /\\<footnote-\\(call\\|marker\\)\\>/  contained \n                   match /\\<\\(scope\\|host\\)-context\\>/  contained \n                   match /\\<last-\\(child\\|of-type\\)\\>/  contained \n                   match /\\<first-of-type\\>/  contained \n                   match /\\<only-\\(child\\|of-type\\)\\>/  contained \n                   match /\\<\\(any\\|local\\)-link\\>/  contained \n                   match /\\<read-\\(only\\|write\\)\\>/  contained \n                   match /\\<placeholder-shown\\>/  contained \n                   match /\\<\\(in\\|out-of\\)-range\\>/  contained \n                   match /\\<user-error\\>/  contained \n                   match /\\<\\(active\\|valid\\|invalid\\)-drop-target\\>/  contained \n                   match /\\<last-\\(child\\|of-type\\)\\>/  contained \n                   match /\\<first-of-type\\>/  contained \n                   match /\\<only-\\(child\\|of-type\\)\\>/  contained \n                   match /\\<footnote-\\(call\\|marker\\)\\>/  contained \n                   match /\\<\\(scope\\|host\\)-context\\>/  contained \n                   match /\\<\\(any\\|local\\)-link\\>/  contained \n                   match /\\<read-\\(only\\|write\\)\\>/  contained \n                   match /\\<placeholder-shown\\>/  contained \n                   match /\\<\\(in\\|out-of\\)-range\\>/  contained \n                   match /\\<user-error\\>/  contained \n                   match /\\<\\(active\\|valid\\|invalid\\)-drop-target\\>/  contained \n                   links to PreProc\ncssPseudoClassFn xxx matchgroup=cssFunctionName start=/\\<\\(not\\|lang\\|\\(nth\\|nth-last\\)-\\(of-type\\|child\\)\\)(/ end=/)/  contained \n                   matchgroup=cssFunctionName start=/\\<\\(not\\|lang\\|\\(nth\\|nth-last\\)-\\(of-type\\|child\\)\\)(/ end=/)/  contained \ncssSpecialCharQQ xxx match /\\\\\\\\\\|\\\\\"/  contained \n                   match /\\\\\\\\\\|\\\\\"/  contained \ncssSpecialCharQ xxx match /\\\\\\\\\\|\\\\'/  contained \n                   match /\\\\\\\\\\|\\\\'/  contained \ncssPseudoClassLang xxx matchgroup=cssPseudoClassId start=/:\\(host\\)(/ end=/)/  contained oneline \n                   matchgroup=cssPseudoClassId start=/:\\(nth\\(-last\\)\\=-\\(child\\|of-type\\)\\|not\\)(/ end=/)/  contained oneline \n                   matchgroup=cssPseudoClassId start=/:\\(matches\\|dir\\|local-link\\|current\\|nth\\(-last\\)\\=-\\(match\\|column\\)\\|column\\)(/ end=/)/  contained oneline \n                   matchgroup=cssPseudoClassId start=/:\\(nth\\(-last\\)\\=-\\(child\\|of-type\\)\\|not\\)(/ end=/)/  contained oneline \n                   matchgroup=cssPseudoClassId start=/:\\(host\\)(/ end=/)/  contained oneline \n                   matchgroup=cssPseudoClassId start=/:\\(matches\\|dir\\|local-link\\|current\\|nth\\(-last\\)\\=-\\(match\\|column\\)\\|column\\)(/ end=/)/  contained oneline \n                   links to Constant\ncssColor800000 xxx contained maroon maroon maroon\ncssColorff0000 xxx contained red red red\ncssColorffA500 xxx contained orange orange orange\ncssColorffff00 xxx contained yellow yellow yellow\ncssColor808000 xxx contained olive olive olive\ncssColor800080 xxx contained purple purple purple\ncssColorff00ff xxx contained magenta magenta magenta fuchsia fuchsia fuchsia\ncssColorffffff xxx contained white white white\ncssColor00ff00 xxx contained lime lime lime\ncssColor008000 xxx contained green green green\ncssColor000080 xxx contained navy navy navy\ncssColor0000ff xxx contained blue blue blue\ncssColor00ffff xxx contained cyan cyan cyan aqua aqua aqua\ncssColor008080 xxx contained teal teal teal\ncssColor000000 xxx contained black black black\ncssColorc0c0c0 xxx contained silver silver silver\ncssColor808080 xxx contained gray gray gray grey grey grey\ncssColorF0F8FF xxx contained aliceblue aliceblue aliceblue\ncssColorFAEBD7 xxx contained antiquewhite antiquewhite antiquewhite\ncssColor7FFFD4 xxx contained aquamarine aquamarine aquamarine\ncssColorF0FFFF xxx contained azure azure azure\ncssColorF5F5DC xxx contained beige beige beige\ncssColorFFE4C4 xxx contained bisque bisque bisque\ncssColorFFEBCD xxx contained blanchedalmond blanchedalmond blanchedalmond\ncssColor8A2BE2 xxx contained blueviolet blueviolet blueviolet\ncssColorA52A2A xxx contained brown brown brown\ncssColorDEB887 xxx contained burlywood burlywood burlywood\ncssColor5F9EA0 xxx contained cadetblue cadetblue cadetblue\ncssColor7FFF00 xxx contained chartreuse chartreuse chartreuse\ncssColorD2691E xxx contained chocolate chocolate chocolate\ncssColorFF7F50 xxx contained coral coral coral\ncssColor6495ED xxx contained cornflowerblue cornflowerblue cornflowerblue\ncssColorFFF8DC xxx contained cornsilk cornsilk cornsilk\ncssColorDC143C xxx contained crimson crimson crimson\ncssColor00008B xxx contained darkblue darkblue darkblue\ncssColor008B8B xxx contained darkcyan darkcyan darkcyan\ncssColorB8860B xxx contained darkgoldenrod darkgoldenrod darkgoldenrod\ncssColorA9A9A9 xxx contained darkgray darkgray darkgray darkgrey darkgrey darkgrey\ncssColor006400 xxx contained darkgreen darkgreen darkgreen\ncssColorBDB76B xxx contained darkkhaki darkkhaki darkkhaki\ncssColor8B008B xxx contained darkmagenta darkmagenta darkmagenta\ncssColor556B2F xxx contained darkolivegreen darkolivegreen darkolivegreen\ncssColorFF8C00 xxx contained darkorange darkorange darkorange\ncssColor9932CC xxx contained darkorchid darkorchid darkorchid\ncssColor8B0000 xxx contained darkred darkred darkred\ncssColorE9967A xxx contained darksalmon darksalmon darksalmon\ncssColor8FBC8F xxx contained darkseagreen darkseagreen darkseagreen\ncssColor483D8B xxx contained darkslateblue darkslateblue darkslateblue\ncssColor2F4F4F xxx contained darkslategray darkslategray darkslategray darkslategrey darkslategrey darkslategrey\ncssColor00CED1 xxx contained darkturquoise darkturquoise darkturquoise\ncssColor9400D3 xxx contained darkviolet darkviolet darkviolet\ncssColorFF1493 xxx contained deeppink deeppink deeppink\ncssColor00BFFF xxx contained deepskyblue deepskyblue deepskyblue\ncssColor696969 xxx contained dimgray dimgray dimgray dimgrey dimgrey dimgrey\ncssColor1E90FF xxx contained dodgerblue dodgerblue dodgerblue\ncssColorB22222 xxx contained firebrick firebrick firebrick\ncssColorFFFAF0 xxx contained floralwhite floralwhite floralwhite\ncssColor228B22 xxx contained forestgreen forestgreen forestgreen\ncssColorDCDCDC xxx contained gainsboro gainsboro gainsboro\ncssColorF8F8FF xxx contained ghostwhite ghostwhite ghostwhite\ncssColorFFD700 xxx contained gold gold gold\ncssColorDAA520 xxx contained goldenrod goldenrod goldenrod\ncssColorADFF2F xxx contained greenyellow greenyellow greenyellow\ncssColorF0FFF0 xxx contained honeydew honeydew honeydew\ncssColorFF69B4 xxx contained hotpink hotpink hotpink\ncssColorCD5C5C xxx contained indianred indianred indianred\ncssColor4B0082 xxx contained indigo indigo indigo\ncssColorFFFFF0 xxx contained ivory ivory ivory\ncssColorF0E68C xxx contained khaki khaki khaki\ncssColorE6E6FA xxx contained lavender lavender lavender\ncssColorFFF0F5 xxx contained lavenderblush lavenderblush lavenderblush\ncssColor7CFC00 xxx contained lawngreen lawngreen lawngreen\ncssColorFFFACD xxx contained lemonchiffon lemonchiffon lemonchiffon\ncssColorADD8E6 xxx contained lightblue lightblue lightblue\ncssColorF08080 xxx contained lightcoral lightcoral lightcoral\ncssColorE0FFFF xxx contained lightcyan lightcyan lightcyan\ncssColorFAFAD2 xxx contained lightgoldenrodyellow lightgoldenrodyellow lightgoldenrodyellow\ncssColorD3D3D3 xxx contained lightgray lightgray lightgray lightgrey lightgrey lightgrey\ncssColor90EE90 xxx contained lightgreen lightgreen lightgreen\ncssColorFFB6C1 xxx contained lightpink lightpink lightpink\ncssColorFFA07A xxx contained lightsalmon lightsalmon lightsalmon\ncssColor20B2AA xxx contained lightseagreen lightseagreen lightseagreen\ncssColor87CEFA xxx contained lightskyblue lightskyblue lightskyblue\ncssColor778899 xxx contained lightslategrey lightslategrey lightslategrey lightslategray lightslategray lightslategray\ncssColorB0C4DE xxx contained lightsteelblue lightsteelblue lightsteelblue\ncssColorFFFFE0 xxx contained lightyellow lightyellow lightyellow\ncssColor32CD32 xxx contained limegreen limegreen limegreen\ncssColorFAF0E6 xxx contained linen linen linen\ncssColor66CDAA xxx contained mediumaquamarine mediumaquamarine mediumaquamarine\ncssColor0000CD xxx contained mediumblue mediumblue mediumblue\ncssColorBA55D3 xxx contained mediumorchid mediumorchid mediumorchid\ncssColor9370D8 xxx contained mediumpurple mediumpurple mediumpurple\ncssColor3CB371 xxx contained mediumseagreen mediumseagreen mediumseagreen\ncssColor7B68EE xxx contained mediumslateblue mediumslateblue mediumslateblue\ncssColor00FA9A xxx contained mediumspringgreen mediumspringgreen mediumspringgreen\ncssColor48D1CC xxx contained mediumturquoise mediumturquoise mediumturquoise\ncssColorC71585 xxx contained mediumvioletred mediumvioletred mediumvioletred\ncssColor191970 xxx contained midnightblue midnightblue midnightblue\ncssColorF5FFFA xxx contained mintcream mintcream mintcream\ncssColorFFE4E1 xxx contained mistyrose mistyrose mistyrose\ncssColorFFE4B5 xxx contained moccasin moccasin moccasin\ncssColorFFDEAD xxx contained navajowhite navajowhite navajowhite\ncssColorFDF5E6 xxx contained oldlace oldlace oldlace\ncssColor6B8E23 xxx contained olivedrab olivedrab olivedrab\ncssColorFF4500 xxx contained orangered orangered orangered\ncssColorDA70D6 xxx contained orchid orchid orchid\ncssColorEEE8AA xxx contained palegoldenrod palegoldenrod palegoldenrod\ncssColor98FB98 xxx contained palegreen palegreen palegreen\ncssColorAFEEEE xxx contained paleturquoise paleturquoise paleturquoise\ncssColorD87093 xxx contained palevioletred palevioletred palevioletred\ncssColorFFEFD5 xxx contained papayawhip papayawhip papayawhip\ncssColorFFDAB9 xxx contained peachpuff peachpuff peachpuff\ncssColorCD853F xxx contained peru peru peru\ncssColorFFC0CB xxx contained pink pink pink\ncssColorDDA0DD xxx contained plum plum plum\ncssColorB0E0E6 xxx contained powderblue powderblue powderblue\ncssColorBC8F8F xxx contained rosybrown rosybrown rosybrown\ncssColor4169E1 xxx contained royalblue royalblue royalblue\ncssColor8B4513 xxx contained saddlebrown saddlebrown saddlebrown\ncssColorFA8072 xxx contained salmon salmon salmon\ncssColorF4A460 xxx contained sandybrown sandybrown sandybrown\ncssColor2E8B57 xxx contained seagreen seagreen seagreen\ncssColorFFF5EE xxx contained seashell seashell seashell\ncssColorA0522D xxx contained sienna sienna sienna\ncssColor87CEEB xxx contained skyblue skyblue skyblue\ncssColor6A5ACD xxx contained slateblue slateblue slateblue\ncssColor708090 xxx contained slategray slategray slategray slategrey slategrey slategrey\ncssColorFFFAFA xxx contained snow snow snow\ncssColor00FF7F xxx contained springgreen springgreen springgreen\ncssColor4682B4 xxx contained steelblue steelblue steelblue\ncssColorD2B48C xxx contained tan tan tan\ncssColorD8BFD8 xxx contained thistle thistle thistle\ncssColorFF6347 xxx contained tomato tomato tomato\ncssColor40E0D0 xxx contained turquoise turquoise turquoise\ncssColorEE82EE xxx contained violet violet violet\ncssColorF5DEB3 xxx contained wheat wheat wheat\ncssColorF5F5F5 xxx contained whitesmoke whitesmoke whitesmoke\ncssColor9ACD32 xxx contained yellowgreen yellowgreen yellowgreen\nlessDefinition xxx matchgroup=cssBraces start=/{/ end=/}/  contained transparent fold contains=cssRenderAttr,cssTransformAttr,cssSpeechAttr,cssRubyAttr,cssPagedMediaAttr,cssPaddingAttr,cssMarqueeAttr,cssMarginAttr,cssLineboxAttr,cssHyerlinkAttr,cssGridAttr,cssDimensionAttr,cssContentForPagedMediaAttr,cssAttr,cssAuralAttr,cssIEUIAttr,cssUIAttr,cssTransitionAttr,cssTextAttr,cssTableAttr,cssPrintAttr,cssPositioningAttr,cssListAttr,cssGeneratedContentAttr,cssMultiColumnAttr,cssFlexibleBoxAttr,cssBoxAttr,cssBorderAttr,cssBackgroundAttr,cssAnimationAttr,cssGradientAttr,cssFontDescriptorAttr,cssCommonAttr,cssFontAttr,cssMediaAttr,cssRenderProp,cssSpeechProp,cssRubyProp,cssPrintProp,cssPagedMediaProp,cssMarqueeProp,cssLineboxProp,cssContentForPagedMediaProp,cssProp,cssMobileTextProp,cssAuralProp,cssIEUIProp,cssUIProp,cssTransitionProp,cssTransformProp,cssTextProp,cssTableProp,cssPositioningProp,cssListProp,cssHyerlinkProp,cssGridProp,cssGeneratedContentProp,cssMultiColumnProp,cssFlexibleBoxProp,cssDimensionProp,cssColorProp,cssBoxProp,cssBorderProp,cssBackgroundProp,cssAnimationProp,cssFontDescriptorProp,cssFontProp,cssPageProp,cssMediaProp,cssComment,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,cssColor,cssTagName,cssPseudoClass,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,lessDefinition,lessComment,lessClassChar,lessVariable,lessMixinChar,lessAmpersandChar,lessFunction,lessNestedSelector,@cssColors \nlessComment    xxx match +//.*$+  contained contains=@Spell \n                   links to Comment\nlessVariable   xxx match /@[[:alnum:]_-]\\+/  contained \n                   match /@[[:alnum:]_-]\\+/  contained nextgroup=lessVariableAssignment skipwhite \n                   links to Special\nlessMixinChar  xxx match /\\.[[:alnum:]_-]\\@=/  contained nextgroup=lessClass \n                   links to Special\nlessAmpersandChar xxx match /&/  contained nextgroup=lessClass,cssPseudoClass \n                   links to Special\nlessFunction   xxx contained containedin=cssDefinition  %\n                   contained containedin=cssDefinition  e\n                   contained containedin=cssDefinition  mix\n                   contained containedin=cssDefinition  luma\n                   contained containedin=cssDefinition  greyscale\n                   contained containedin=cssDefinition  rgba\n                   contained containedin=cssDefinition  average\n                   contained containedin=cssDefinition  red\n                   contained containedin=cssDefinition  ceil\n                   contained containedin=cssDefinition  spin\n                   contained containedin=cssDefinition  rgb\n                   contained containedin=cssDefinition  fadein\n                   contained containedin=cssDefinition  unit\n                   contained containedin=cssDefinition  negation\n                   contained containedin=cssDefinition  saturation\n                   contained containedin=cssDefinition  contrast\n                   contained containedin=cssDefinition  blue\n                   contained containedin=cssDefinition  fadeout\n                   contained containedin=cssDefinition  alpha\n                   contained containedin=cssDefinition  desaturate\n                   contained containedin=cssDefinition  difference\n                   contained containedin=cssDefinition  lightness\n                   contained containedin=cssDefinition  multiply\n                   contained containedin=cssDefinition  hsla\n                   contained containedin=cssDefinition  percentage\n                   contained containedin=cssDefinition  softlight\n                   contained containedin=cssDefinition  floor\n                   contained containedin=cssDefinition  round\n                   contained containedin=cssDefinition  screen\n                   contained containedin=cssDefinition  hsva\n                   contained containedin=cssDefinition  exclusion\n                   contained containedin=cssDefinition  saturate\n                   contained containedin=cssDefinition  lighten\n                   contained containedin=cssDefinition  hardlight\n                   contained containedin=cssDefinition  argb\n                   contained containedin=cssDefinition  green\n                   contained containedin=cssDefinition  escape\n                   contained containedin=cssDefinition  overlay\n                   contained containedin=cssDefinition  fade\n                   contained containedin=cssDefinition  hsl\n                   contained containedin=cssDefinition  hsv\n                   contained containedin=cssDefinition  darken\n                   contained containedin=cssDefinition  hue\n                   links to Function\nlessNestedSelector xxx match +[^/]* {+me=e-1  contained contains=cssTagName,cssAttributeSelector,lessAmpersandChar,lessVariable,lessMixinChar,lessFunction,lessNestedProperty \nlessVariableAssignment xxx match /:/  contained nextgroup=lessVariableValue skipwhite \nlessVariableValue xxx match /.*;/me=e-1  contained contains=lessVariable,lessOperator,lessDefault,cssValueFrequency,cssValueTime,cssValueAngle,cssValueLength,cssValueNumber,cssValueInteger,@cssColors \n                   links to Constant\nlessOperator   xxx match /+/  contained \n                   match /-/  contained \n                   match +/+  contained \n                   match /*/  contained \nlessDefault    xxx match /!default/  contained \n                   links to Special\nlessNestedProperty xxx match /[[:alnum:]]\\+:/me=e-1  contained \n                   links to Type\nlessClass      xxx match /[[:alnum:]_-]\\+/  contained \n                   links to PreProc\nlessStyle      xxx start=+<style [^>]*type *=[^>]*text/less[^>]*>+ end=+</style>+  keepend contains=@htmlLess,htmlTag,htmlEndTag,htmlCssStyleComment,@htmlPreproc containedin=htmlHead \nphpRegion      xxx matchgroup=Delimiter start=/<?\\(php\\)\\=/ end=/?>/  keepend contains=@phpClTop \nphpRegionSc    xxx matchgroup=Delimiter start=/<script language=\"php\">/ end=+</script>+  keepend contains=@phpClTop \nsqlSpecial     xxx contained false true null\n                   links to Special\nsqlKeyword     xxx contained add cluster share rowlabel desc end maxextents function into option validate synonym exclusive pctfree as smallint by column start compress if is asc values resource row whenever to nocompress offline return then of on index rows procedure initial for immediate privileges unique begin\n                   contained connect user modify session cursor nowait table identified file trigger order else having loop public exception size with access type view where from using elsif mode rownum check increment online current level decimal default group successful uid\n                   links to sqlSpecial\nsqlOperator    xxx contained some all like and any exists or not between sysdate prior out in escape minus intersect union distinct\n                   links to sqlStatement\nsqlStatement   xxx contained create comment execute alter audit noaudit revoke select set grant update lock drop insert truncate explain delete rename rollback analyze savepoint commit\n                   links to Statement\nsqlType        xxx contained rowid number varray raw boolean varchar2 float varchar long integer char mlslabel date character\n                   links to Type\nsqlString      xxx start=/\"/ skip=/\\\\\\\\\\|\\\\\"/ end=/\"/  contained \n                   start=/'/ skip=/\\\\\\\\\\|\\\\'/ end=/'/  contained \n                   links to String\nsqlNumber      xxx match /-\\=\\<\\d*\\.\\=[0-9_]\\>/  contained \n                   links to Number\nsqlTodo        xxx contained note todo debug fixme xxx\n                   links to Todo\nsqlComment     xxx start=+/\\*+ end=+\\*/+  contained contains=sqlTodo \n                   match /--.*$/  contained contains=sqlTodo \n                   links to Comment\nphpEnvVar      xxx contained SERVER_SIGNATURE HTTP_USER_AGENT SERVER_NAME SERVER_PROTOCOL SERVER_SOFTWARE GATEWAY_INTERFACE HTTP_ENCODING SCRIPT_FILENAME SERVER_PORT REQUEST_METHOD SERVER_ADMIN HTTP_ACCEPT_CHARSET REMOTE_PORT HTTP_HOST HTTP_CONNECTION QUERY_STRING HTTP_ACCEPT_LANGUAGE HTTP_REFERER HTTP_ACCEPT\n                   contained DOCUMENT_ROOT REQUEST_URI SCRIPT_NAME PATH_TRANSLATED REMOTE_ADDR\n                   links to Identifier\nphpIntVar      xxx contained _COOKIE HTTP_ENV_VARS GLOBALS _SERVER _SERVER HTTP_SESSION_VARS _REQUEST HTTP_RAW_POST_DATA _SESSION _GET HTTP_SERVER_VARS PHP_SELF HTTP_GET_VARS HTTP_STATE_VARS _FILES PHP_ERRMSG HTTP_COOKIE_VARS _ENV _POST HTTP_POST_FILES HTTP_POST_VARS\n                   links to Identifier\nphpCoreConstant xxx contained E_PARSE E_WARNING PHP_VERSION E_ALL PHP_OUTPUT_HANDLER_CONT PHP_LOCALSTATEDIR PHP_OUTPUT_HANDLER_START E_NOTICE E_USER_ERROR E_CORE_WARNING PHP_SYSCONFDIR E_USER_WARNING PHP_BINDIR DEFAULT_INCLUDE_PATH E_STRICT E_COMPILE_ERROR E_CORE_ERROR PEAR_EXTENSION_DIR E_COMPILE_WARNING E_ERROR\n                   contained PHP_OUTPUT_HANDLER_END PHP_EXTENSION_DIR PHP_OS PHP_LIBDIR PHP_CONFIG_FILE_PATH PHP_DATADIR E_USER_NOTICE PEAR_INSTALL_DIR\n                   links to Constant\nphpConstant    xxx contained __function__ __line__ __class__ __namespace__ __method__ __dir__ __file__\n                   links to Constant\nphpFunctions   xxx contained gzclose yaz_syntax html_entity_decode fbsql_read_blob png2wbmp mssql_init cpdf_set_title gztell fbsql_insert_id empty cpdf_restore mysql_field_type closelog swftext ldap_search curl_errno gmp_div_r mssql_data_seek getmyinode printer_draw_pie mcve_initconn ncurses_getmaxyx defined\n                   contained localeconv socket_set_block is_file dio_close dbmclose array_change_key_case bcscale mysqli_use_result tidy_parse_file dba_sync bzcompress udm_alloc_agent fdf_set_flags ftp_nb_put ncurses_update_panels abs mb_regex_set_options msql_fetch_object stream_context_set_params cpdf_lineto uksort\n                   contained symlink mcve_destroyconn mcal_event_set_class mssql_field_type sqlite_escape_string php_sapi_name ncurses_mvgetch pdf_open mb_convert_variables mssql_fetch_row sql_regcase fsockopen ncurses_slk_refresh imagecolorallocatealpha mcve_setssl ftp_pwd fbsql_autocommit vpopmail_alias_add\n                   contained shm_remove mysqli_info msession_set_array ncurses_move_panel pdf_close_image mailparse_msg_create mysqli_fetch_field_direct mb_ereg_search_getregs pg_tty ccvs_status dbplus_freerlocks hw_getchildcoll get_extension_funcs tidy_get_head mcve_preauth fdf_enum_values yaz_ccl_conf\n                   contained mysqli_get_server_info ora_errorcode ctype_alnum session_id cpdf_set_subject pdf_close_pdi stat mailparse_msg_extract_part_file dbplus_info mysql_list_processes pspell_check mcve_transinqueue dbplus_rcreate sizeof imap_renamemailbox ncurses_pnoutrefresh tidy_get_root stream_get_transports\n                   contained addcslashes imap_fetch_overview mcve_liststats openssl_x509_checkpurpose get_resource_type ibase_timefmt ctype_space imap_set_quota openssl_private_encrypt ifx_prepare chop imagecreatetruecolor hw_insertanchors pdf_set_text_pos udm_crc32 socket_strerror mb_decode_mimeheader xpath_eval\n                   contained quoted_printable_decode session_is_registered msql_fieldlen dbplus_undoprepare ob_get_status mcve_uwait ncurses_keypad mysqli_profiler swf_rotate stream_get_filters posix_ctermid min explode mcve_setssl_files trim hw_getobjectbyqueryobj fopen socket_create_pair pdf_setpolydash\n                   contained pg_lo_unlink imap_get_quotaroot array_pop imagefill printer_select_font ifxus_write_slob ncurses_mouse_trafo imagecopymergegray mysql_error clearstatcache mssql_result ob_get_contents msql_listfields msession_create pg_free_result ini_restore cpdf_closepath_stroke ftp_close getmyuid\n                   contained pg_field_type ftp_get_option ibase_blob_info fstat openssl_pkey_get_private ircg_set_on_die filepro ocicloselob sqlite_fetch_array mime_content_type pg_connection_reset mssql_close imagecreatefromjpeg get_browser sqlite_next array_fill file_exists get_class is_int swf_posround\n                   contained posix_mkfifo yp_err_string mb_regex_encoding imap_clearflag_full mysqli_init ldap_dn2ufn filetype dbx_escape_string mysqli_param_count easter_date fmod sybase_pconnect msql_free_result ocinewcollection ifxus_free_slob join is_double udm_api_version ncurses_bottom_panel fbsql_field_name\n                   contained swf_setfont ncurses_wgetch odbc_exec pdf_get_value imagecolorclosestalpha pg_cancel_query log1p recode_string mcve_setblocking bzread dbase_create ncurses_ungetch swf_translate ora_commit ncurses_init_color sesam_field_name imap_last_error pdf_open_file serialize cpdf_place_inline_image\n                   contained swffill wddx_deserialize ocicollassign ftp_mdtm ncurses_nocbreak ociwritetemporarylob fbsql_result phpinfo preg_split mssql_fetch_batch mcal_event_set_recur_daily pdf_set_horiz_scaling printer_start_page filegroup cpdf_arc imagepsencodefont dbplus_close vpopmail_add_alias_domain_ex\n                   contained stream_get_line ncurses_mvaddchstr ibase_pconnect ncurses_newwin notes_header_info strrpos openssl_x509_read sha1_file com_addref msql_pconnect yaz_wait closedir odbc_field_num mysql_errno udm_add_search_limit mb_send_mail floatval aspell_new pdf_place_pdi_page array_keys fdf_get_flags\n                   contained imagesavealpha dba_insert swf_startsymbol is_readable printer_set_option zend_version jpeg2wbmp pdf_set_border_style ncurses_slk_clear is_object pg_put_line mcrypt_list_modes fdf_get_status strip_tags fbsql_list_fields ftp_systype fbsql_fetch_object pg_affected_rows cpdf_set_creator\n                   contained ncurses_delwin ncurses_new_panel ob_list_handlers imap_errors filepro_fieldname hw_document_bodytag glob pdf_set_info_subject dio_seek strnatcmp ldap_modify hw_document_content ncurses_slk_attroff wddx_packet_end ibase_affected_rows sqlite_fetch_string mcve_transactionbatch\n                   contained pg_fetch_object ociparse ncurses_pair_content imap_headerinfo deaggregate strftime ncurses_attrset pg_host disk_total_space socket_iovec_delete unregister_tick_function mb_ereg_search_init zip_entry_read w32api_deftype ezmlm_hash mysql_num_fields openssl_pkey_export tidy_is_xhtml\n                   contained yaz_set_option gzgetc odbc_execute hw_getobjectbyquerycoll msql_connect ircg_register_format_messages image_type_to_mime_type spliti swf_ortho2 connection_aborted stream_set_write_buffer is_scalar ncurses_flushinp pdf_set_parameter set_include_path dbplus_runlink ncurses_mouseinterval\n                   contained imagefilledpolygon ncurses_panel_window xml_set_character_data_handler vpopmail_auth_user ifx_connect getopt ncurses_mvaddstr stream_get_wrappers hw_insdoc gzuncompress fbsql_select_db get_include_path ctype_upper pcntl_wstopsig fgetcsv swfmovie dbplus_setindexbynumber jddayofweek\n                   contained xmlrpc_server_add_introspection_data fbsql_create_blob odbc_errormsg fam_monitor_file mssql_query ocifreedesc rand cpdf_output_buffer pcntl_wexitstatus ifxus_close_slob dbx_close output_add_rewrite_var debug_print_backtrace ldap_set_option socket_create_listen socket_recvmsg\n                   contained xml_get_error_code cpdf_setrgbcolor vprintf mb_preferred_mime_name imagepng mcal_date_compare session_set_save_handler stream_wrapper_register mb_strimwidth asin mb_output_handler cybercash_base64_encode pdf_stroke mysqli_stat socket_set_option ibase_blob_import ftp_nlist ncurses_mvvline\n                   contained vpopmail_alias_get_all mcve_deluser easter_days imap_headers mysqli_slave_query ldap_mod_replace create_function readline_info udm_check_charset cpdf_rotate_text fbsql_database_password ncurses_has_key curl_init shm_remove_var mysql_create_db ncurses_attroff udm_close_stored cpdf_rect\n                   contained set_file_buffer hw_new_document ncurses_wstandend set_magic_quotes_runtime hw_incollections array_udiff sybase_fetch_assoc printer_create_dc pdf_get_image_width hw_info cpdf_continue_text msql_drop_db ibase_free_result gmp_hamdist localtime mt_getrandmax ircg_html_encode posix_getsid\n                   contained array_map nsapi_request_headers cal_to_jd ocicollgetelem ircg_set_current pdf_continue_text ibase_rollback_ret bindec socket_iovec_free ldap_compare imap_thread stripcslashes end odbc_free_result ocifreecollection mb_encode_mimeheader swf_shapemoveto mysqli_commit gregoriantojd\n                   contained sybase_min_server_severity msession_get_array hw_identify ovrimos_prepare unpack fbsql_close connection_timeout ccvs_count sesam_fetch_row pdf_fill mcal_fetch_event ibase_gen_id ming_setscale sybase_fetch_row ncurses_curs_set iconv_mime_encode mcal_event_set_recur_yearly\n                   contained ingres_field_scale mysql_pconnect ldap_next_reference gmp_init cpdf_save checkdnsrr strncmp is_a wordwrap pg_options domxml_xslt_stylesheet imagefontwidth stream_copy_to_stream imap_fetchstructure printer_end_doc readline_write_history imap_listsubscribed preg_quote swf_definepoly\n                   contained swf_getbitmapinfo ftp_chdir mhash_count var_export pdf_endpath printer_select_brush get_magic_quotes_runtime mcve_initengine uasort pdf_add_locallink ifx_update_char ifxus_open_slob pdf_setrgbcolor_stroke mcal_expunge pdf_setgray_stroke swf_placeobject mcrypt_ofb bzwrite\n                   contained mcve_iscommadelimited mcrypt_decrypt ircg_nickname_escape aggregate odbc_autocommit mcve_verifyconnection memory_get_usage notes_find_note mysqli_execute str_ireplace cpdf_set_action_url msession_get strstr unlink ircg_whois swf_closefile pdf_get_pdi_value session_decode lstat swfgradient\n                   contained is_finite pcntl_exec http_build_query mcve_transactionauth tidy_setopt openssl_public_decrypt array_walk pack get_meta_tags ncurses_noecho mysql_field_seek pdf_add_launchlink cyrus_close ncurses_instr ncurses_wvline dbase_close vpopmail_del_domain crack_closedict ncurses_color_content\n                   contained system odbc_tableprivileges ora_rollback diskfreespace recode_file tidy_get_status posix_getuid pg_field_prtlen posix_getpgid getmygid dbx_query imagecreatefromwbmp soundex fbsql_drop_db apache_child_terminate mcve_settle bcdiv ora_logoff ldap_err2str dbplus_restorepos\n                   contained pdf_set_border_color fdf_open ftp_quit hw_inscoll curl_error mcve_deletetrans ociloadlob jdtogregorian odbc_setoption metaphone pdf_lineto gmp_intval pg_last_oid shmop_write imap_search shm_get_var ingres_connect pdf_place_image mysqli_bind_result srand mcrypt_enc_get_algorithms_name\n                   contained checkdate mssql_field_name cpdf_set_char_spacing ibase_commit_ret mcal_event_set_title ovrimos_field_type openssl_x509_check_private_key pdf_get_font ccvs_done mysql_field_name xml_set_element_handler ingres_field_name ocibindbyname cpdf_page_init cpdf_moveto link mysqli_error\n                   contained ifx_textasvarchar swf_addcolor array_diff_uassoc java_last_exception_get mysql_fetch_lengths iconv swf_definefont nl2br mssql_fetch_assoc msql_num_rows pdf_close_pdi_page gmp_prob_prime dbplus_tremove dbplus_sql ncurses_addnstr gmp_clrbit ovrimos_field_num sesam_execimm ob_clean\n                   contained imap_getsubscribed hw_getobjectbyquery gmp_scan0 gmp_scan1 sqlite_current call_user_func ovrimos_connect mssql_fetch_array ifx_copy_blob dngettext shm_detach ldap_count_entries posix_geteuid ocicollassignelem urlencode parse_ini_file dns_get_record ovrimos_rollback odbc_error\n                   contained msession_list swf_actiongotolabel yp_first fbsql_query ming_useswfversion range readline_list_history mysql_result odbc_result_all mysqli_thread_id sort dbase_get_header_info stream_filter_prepend swf_shapefilloff cpdf_set_word_spacing mhash_keygen_s2k sscanf mb_strpos gethostbyaddr\n                   contained ncurses_delay_output ncurses_mvaddch ereg_replace posix_getpwuid dbplus_undo hw_document_size tidy_repair_string pg_insert pg_fetch_array pdf_show_xy passthru dbplus_rkeys juliantojd pdf_moveto lzf_decompress mcal_event_set_recur_weekly sleep tidy_config_count mssql_free_statement expm1\n                   contained gzfile ocistatementtype mysql_fetch_array mysql_data_seek ibase_param_info pdf_set_info_title muscat_setup_net mysqli_fetch hw_childrenobj is_writeable cpdf_set_keywords mysqli_fetch_array bcsqrt swfdisplayitem yp_master ncurses_slk_attron ftp_rawlist notes_create_note fdf_errno\n                   contained ncurses_bkgd debugger_off dbx_fetch_row jdmonthname dio_write aggregate_methods_by_list import_request_variables pg_pconnect imap_get_quota ceil ocicancel socket_set_nonblock cpdf_circle ocicolumnscale cpdf_newpath php_ini_scanned_files com_release posix_setgid fdf_create imap_qprint\n                   contained imap_deletemailbox pdf_show_boxed dbplus_freealllocks xmlrpc_get_type hypot swf_shapearc mcrypt_enc_is_block_algorithm cyrus_query fbsql_rollback mcve_numrows fileinode imagedestroy ncurses_panel_below socket_set_timeout ora_open mcal_event_init hw_stat str_word_count mcal_date_valid\n                   contained fwrite imap_mail_move stream_set_timeout imap_reopen array_reverse pdf_set_value hw_errormsg nl_langinfo vpopmail_set_user_quota bin2hex java_last_exception_clear token_get_all dio_fcntl cpdf_set_leading imagepsloadfont hw_getremotechildren pdf_set_text_rise ascii2ebcdic aggregate_info\n                   contained imagepsfreefont ftp_raw putenv msql_dbname hw_output_document ocinumcols mcve_transactionavs imagefontheight msession_count mssql_rows_affected printer_start_doc ltrim mcve_return openssl_pkcs7_verify imap_status xmlrpc_encode_request array_merge_recursive ifx_getsqlca ovrimos_longreadlen\n                   contained dl printer_get_option strrchr msg_set_queue fdf_get_encoding fbsql_password mysqli_free_result mysqli_rpl_probe list pg_fetch_row domxml_open_file com_propset openssl_free_key mysql_connect atan2 odbc_prepare fgets pdf_open_image mcal_store_event array_diff_assoc mysqli_fetch_lengths\n                   contained dbplus_curr ifx_nullformat fdf_add_doc_javascript posix_setegid readline mb_get_info imagecopy swf_textwidth ncurses_newpad readlink bcpow socket_getsockname pg_query com_load vpopmail_del_user ifxus_create_slob printer_draw_elipse swfbutton_keypress iconv_strpos msql_fieldtype\n                   contained unserialize rsort yaz_addinfo mb_ereg call_user_method_array bzdecompress mb_split fpassthru imap_listscan pdf_rect printer_delete_brush ncurses_standout ifx_pconnect printer_end_page mysqli_disable_reads_from_master dbplus_tcl ncurses_wcolor_set atan pspell_save_wordlist domxml_new_doc\n                   contained pspell_new_config pg_client_encoding ccvs_sale mysqli_num_fields odbc_cursor fbsql_affected_rows mcal_event_set_category array_udiff_uassoc ifx_create_blob acos imap_lsub mysql_close apache_getenv ovrimos_exec lzf_compress gzdeflate fbsql_pconnect ifx_byteasvarchar pg_lo_write dio_read\n                   contained imagecreatefromgd2 cpdf_begin_text pg_update cpdf_rotate exif_imagetype is_dir mysqli_ping ncurses_reset_shell_mode pdf_setlinewidth ftell sybase_set_message_handler mysqli_prepare_result textdomain imagecreatefromstring hw_mapid mb_substr posix_setsid swf_startdoaction\n                   contained mysqli_enable_reads_from_master cpdf_finalize posix_getppid imagecolorexact cpdf_set_viewer_preferences msql_listtables ncurses_slk_color mysqli_stmt_errno imagecolorresolve gmp_neg ncurses_def_prog_mode mysql_drop_db ovrimos_num_fields crack_opendict disk_free_space cpdf_setgray_fill\n                   contained mcrypt_enc_self_test gmp_strval dbplus_last curl_multi_getcontent fam_pending krsort ldap_set_rebind_proc pdf_get_image_height imap_createmailbox getprotobynumber odbc_num_rows pg_result_seek mcve_gft stream_get_contents bzclose odbc_data_source pdf_skew mb_detect_order mcrypt_cfb\n                   contained swf_fontslant ob_get_level swf_modifyobject readgzfile ociserverversion mysql_field_flags swf_endbutton ncurses_inch ifx_get_blob unset iconv_mime_decode_headers msession_timeout ini_set msg_stat_queue ncurses_noraw bzerrstr escapeshellarg domxml_xmltree implode func_get_args str_rot13\n                   contained ncurses_typeahead ibase_wait_event imagecolorset pdf_concat get_parent_class log10 fdf_get_attachment printer_draw_text xml_set_end_namespace_decl_handler pdf_get_parameter pdf_stringwidth filepro_fieldcount mysqli_field_count ifx_do pspell_config_runtogether ircg_lookup_format_messages\n                   contained apache_setenv imagepalettecopy posix_setpgid hw_children filepro_fieldwidth fdf_save imap_num_msg hw_api_content yaz_database mysql_insert_id hw_unlock ftp_ssl_connect msql_numrows gmp_gcd get_included_files udm_free_ispell_data sybase_result mssql_select_db udm_error ircg_pconnect\n                   contained socket_clear_error set_error_handler odbc_result acosh is_callable ifx_free_char xml_set_default_handler com_propget odbc_connect mysqli_query pspell_new getservbyname mysqli_stmt_close curl_multi_exec hebrevc ingres_fetch_object intval mysqli_prepare reset odbc_close_all session_destroy\n                   contained print_r printer_delete_pen mcrypt_module_is_block_mode pdf_setfont convert_cyr_string ingres_field_precision mysqli_master_query ncurses_mvhline msql_tablename ftp_mkdir ldap_first_reference ibase_blob_add dbminsert ncurses_getch fdf_set_javascript_action tidy_warning_count hebrev usort\n                   contained sqlite_last_error fdf_next_field_name sprintf ncurses_wnoutrefresh ncurses_mvaddchnstr dbplus_lockrel hw_getchilddoccoll fileperms rad2deg pcntl_wtermsig restore_include_path count ncurses_flash posix_getrlimit mt_srand compact base64_encode hw_pconnect htmlspecialchars imagefttext\n                   contained mailparse_determine_best_xfer_encoding apache_get_version cpdf_setlinewidth zip_read swf_ortho ldap_get_option fbsql_list_dbs gzread session_register hw_getobjectbyquerycollobj ncurses_panel_above mcve_transactionssent dirname time sybase_min_error_severity fbsql_fetch_lengths\n                   contained udm_get_doc_count mysql_affected_rows fputs fbsql_free_result snmpset imap_num_recent ldap_first_entry mcal_time_valid sybase_connect udm_find iconv_mime_decode json_last_error ucwords curl_setopt fbsql_warnings imagettftext call_user_func_array sqlite_column ldap_explode_dn\n                   contained mcrypt_enc_get_block_size xpath_new_context ifx_fetch_row msession_connect mailparse_stream_encode pfpro_process in_array array_count_values pclose mcve_getcell msession_set atanh imagecreatefromgif mcve_getuserarg mcal_days_in_month ob_start iconv_get_encoding mcve_transactionitem\n                   contained odbc_fetch_into sqlite_rewind wddx_serialize_vars ociwritelobtofile ingres_field_length mcal_create_calendar openssl_verify printer_logical_fontheight ncurses_border array_rand odbc_pconnect unixtojd getservbyport pspell_config_mode hw_gettext curl_version ociexecute ldap_rename\n                   contained mssql_fetch_object pdf_setrgbcolor_fill aggregate_methods_by_regexp preg_replace_callback mysqli_stmt_store_result hwapi_hgcsp ncurses_nl xml_set_external_entity_ref_handler swfshape ob_get_clean get_html_translation_table swf_actiongeturl cal_info hw_getanchors ora_commitoff\n                   contained socket_getpeername array_filter mktime domxml_open_mem xslt_set_sax_handler printer_open mcal_open pdf_add_bookmark ldap_sort ctype_alpha imagechar mcrypt_enc_get_modes_name mssql_get_last_message ncurses_reset_prog_mode odbc_primarykeys swf_polarview bzerrno udm_get_res_param\n                   contained fbsql_tablename dbplus_prev ocinewdescriptor imageistruecolor bccomp mcal_reopen dbmreplace mcve_adduserarg udm_clear_search_limits msession_uniq ibase_add_user msql_numfields mysql_fetch_row mb_strwidth sem_get odbc_field_name mcal_delete_event vsprintf mysqli_field_seek array\n                   contained msql_selectdb pdf_restore prev cpdf_set_font_map_file extension_loaded ncurses_insstr fclose imap_utf7_encode pcntl_waitpid socket_last_error fileatime pdf_arcn mysql_get_proto_info ncurses_insch ncurses_init com_isenum snmpwalkoid cpdf_scale mssql_guid_string imageantialias func_get_arg\n                   contained ctype_cntrl openssl_pkey_export_to_file register_tick_function ncurses_meta socket_send sesam_diagnostic mysqli_connect imap_utf8 fbsql_field_flags exec session_get_cookie_params ip2long hw_cp pdf_circle printer_create_pen cpdf_import_jpeg php_uname xslt_set_scheme_handlers mb_strtolower\n                   contained fgetc printer_create_brush is_integer parse_url sqlite_busy_timeout msql_fetch_array mysql_list_tables ocilogon ocisavelob pdf_add_pdflink bcadd imagepolygon cpdf_set_text_matrix mb_substitute_character levenshtein yaz_es_result ldap_unbind imagesetbrush class_exists cpdf_clip mysql_info\n                   contained fdf_set_submit_form_action array_combine socket_sendto tanh strtoupper ibase_free_query zip_entry_close mysqli_dump_debug_info mcve_listusers pg_get_notify debugger_on sybase_select_db setlocale ncurses_slk_attrset pdf_open_memory_image ccvs_lookup pdf_save pcntl_fork iconv_substr\n                   contained ncurses_wclear imagecolormatch xmlrpc_server_register_introspection_callback pg_lo_open fdf_set_value swf_perspective openssl_private_decrypt ncurses_vidattr ftp_cdup gzpassthru ocinlogon swf_enddoaction cpdf_setrgbcolor_stroke posix_uname ncurses_mousemask\n                   contained mcal_event_set_recur_monthly_wday cpdf_rmoveto dbplus_savepos ingres_rollback pi ocinewcursor cpdf_set_font udm_free_agent aggregate_methods yaz_get_option ncurses_waddch ibase_blob_create pg_escape_string fbsql_get_autostart_info is_executable pg_lo_import msql_num_fields stristr\n                   contained ifx_blobinfile_mode tidy_get_body get_defined_functions getrandmax mcal_rename_calendar mb_http_output ob_flush fdf_error ifxus_read_slob ldap_errno imap_8bit mysqli_fetch_assoc session_module_name yp_get_default_domain str_pad mcal_delete_calendar fileowner ovrimos_commit ncurses_timeout\n                   contained strcoll error_log strncasecmp posix_ttyname udm_check_stored xml_parser_create_ns ifx_error cpdf_closepath ncurses_slk_restore hw_root dba_close com_load_typelib pdf_set_leading ibase_errmsg hw_who imageellipse ibase_fetch_object sybase_min_client_severity sesam_seek_row\n                   contained ncurses_replace_panel ncurses_mvaddnstr cyrus_authenticate proc_open udm_open_stored imagewbmp ftp_fget strval hw_free_document ldap_error ingres_commit swf_shapecurveto imap_close pg_ping preg_match dbx_sort ircg_nickname_unescape is_numeric openssl_csr_sign stream_context_get_options\n                   contained pg_set_client_encoding pdf_fill_stroke yaz_ccl_parse ftp_nb_continue fseek gzgetss mb_strcut ibase_field_info array_intersect_assoc odbc_columns dechex mssql_execute imap_list set_time_limit mysql_client_encoding yp_match ncurses_whline exit ora_close mcrypt_generic dbase_open\n                   contained get_loaded_extensions ncurses_vline imagecreatefromxbm msql_list_fields strtolower ccvs_auth dba_delete fbsql_set_lob_mode substr_compare mcve_numcolumns mysqli_kill ora_exec ncurses_mvinch ifx_fieldproperties com_invoke mysqli_affected_rows cybercash_encr sybase_close mb_strlen\n                   contained fam_suspend_monitor pdf_set_duration curl_multi_select hw_insertdocument pspell_store_replacement hw_setlinkroot array_chunk sesam_connect session_regenerate_id ftp_chmod imap_listmailbox ora_plogon hw_docbyanchor hw_error muscat_give utf8_encode pdf_open_ccitt ncurses_keyok mcve_ping\n                   contained pdf_makespotcolor mysqli_ssl_set gmp_legendre mysql_escape_string stream_socket_accept sinh next strtotime ncurses_werase mcal_day_of_week mssql_field_length pdf_setgray dbase_replace_record imap_rfc822_parse_headers array_diff msql_result dba_replace dbmnextkey mcrypt_module_open\n                   contained ftp_login fbsql_hostname dbx_connect pg_escape_bytea swf_fontsize odbc_statistics mysqli_real_escape_string ibase_num_fields odbc_field_scale mb_encode_numericentity ncurses_wattron msql stream_socket_get_name xslt_create fdf_remove_item gmp_cmp mssql_next_result mcal_next_recurrence\n                   contained mb_strtoupper curl_exec xslt_free ncurses_qiflush udm_set_agent_param ncurses_slk_set mssql_bind dotnet_load pg_lo_close cybercash_decr ncurses_slk_attr openssl_x509_free mcve_connectionerror parse_str bcmod snmp_get_quick_print ncurses_termattrs pg_lo_export preg_replace hw_getrellink\n                   contained headers_list qdom_tree ncurses_show_panel ncurses_termname ircg_join imap_timeout ereg mb_eregi ocirowcount hw_getparents mcve_void w32api_invoke_function imap_base64 imagecreatefromgd ksort sybase_num_fields pspell_add_to_session flock ingres_close pg_field_num hw_getusername\n                   contained ncurses_scr_init dbmfirstkey msql_createdb ora_commiton hw_getremote openssl_x509_export socket_write mb_http_input aspell_suggest ctype_digit pdf_arc opendir cpdf_stringwidth ldap_free_result gmp_sub imap_mail_copy cpdf_setdash ncurses_has_colors imagerotate mailparse_msg_get_part\n                   contained func_num_args fbsql_change_user imagefilltoborder mcrypt_module_get_algo_block_size imagecolorstotal vpopmail_alias_del imagepsbbox msession_lock notes_unread msql_select_db gethostbynamel odbc_columnprivileges mcal_popen natsort scandir zip_entry_compressedsize pg_copy_to getmypid\n                   contained ctype_punct mysql_query iptcembed curl_multi_add_handle notes_list_msgs xml_parser_create ncurses_addchnstr ncurses_erase quotemeta imagetypes msql_close fbsql_start_db swf_popmatrix mcve_responseparam microtime pdf_findfont sqlite_libversion cpdf_setflat getcwd yp_cat cpdf_add_annotation\n                   contained filesize dbplus_xunlockrel ldap_8859_to_t61 str_split odbc_fetch_row dbase_pack ifx_free_result fdf_add_template socket_connect array_udiff_assoc domxml_xslt_stylesheet_doc pg_lo_seek udm_load_ispell_data json_decode mysqli_change_user ldap_connect mysqli_select_db getprotobyname define\n                   contained ncurses_can_change_color extract ociresult mb_ereg_search hw_mv get_current_user tidy_getopt ora_do zip_entry_filesize asinh ocicolumnisnull ircg_is_conn_alive imap_body swf_removeobject get_declared_classes ingres_pconnect usleep key gmp_div_q imap_fetchheader socket_get_status\n                   contained shm_put_var imap_ping tidy_access_count openlog ctype_graph hexdec bzopen curl_close proc_get_status aggregation_info odbc_procedurecolumns get_defined_constants get_class_vars curl_getinfo fdf_header odbc_foreignkeys xptr_new_context dbase_numrecords sin pdf_curveto ldap_list\n                   contained readline_clear_history odbc_field_type xmlrpc_set_type pspell_add_to_personal mb_ereg_search_pos dbplus_rcrtexact curl_multi_info_read swfsprite openssl_x509_parse stream_filter_register ibase_fetch_assoc sybase_fetch_field file_get_contents mysqli_close imageline ldap_get_entries\n                   contained ocicolumnname stream_set_blocking mysqli_field_tell dbase_get_record ocifreecursor ncurses_nonl imap_mail pdf_closepath_stroke domxml_version ncurses_killchar ociinternaldebug cal_days_in_month gmp_sign swf_scale cal_from_jd ingres_fetch_array method_exists msession_find fbsql_commit\n                   contained mcve_getheader dba_nextkey ifx_fieldtypes array_intersect mcal_event_set_end pdf_get_pdi_parameter socket_listen uniqid posix_times bcmul xmlrpc_server_register_method fbsql_fetch_array swfaction mysql_get_server_info mcve_transactioncv call_user_method ibase_free_event_handler\n                   contained xml_parser_set_option openssl_pkcs7_decrypt mssql_num_rows cpdf_save_to_file stream_socket_recvfrom pdf_clip rewinddir zip_close cpdf_set_page_animation xmlrpc_server_create mysql_db_query imagecopyresized pdf_open_png mysql_num_rows ifx_update_blob sybase_fetch_object gmp_sqrtrem\n                   contained wddx_packet_start zip_entry_open cpdf_open ncurses_clear mcve_chkpwd printer_draw_chord posix_getlogin ob_get_flush output_reset_rewrite_vars fprintf frenchtojd filepro_retrieve ora_getcolumn imap_mime_header_decode strnatcasecmp register_shutdown_function mysqli_real_query\n                   contained mssql_min_error_severity msql_dropdb openssl_pkcs7_sign filepro_rowcount fbsql_db_query file openssl_pkey_get_public getmxrr ncurses_filter fribidi_log2vis imap_getmailboxes sybase_min_message_severity mysql_free_result getlastmod ibase_blob_echo ibase_prepare mcve_destroyengine\n                   contained openssl_seal chgrp stream_socket_server odbc_fetch_array ora_parse yaz_record swf_actionplay ldap_mod_del posix_isatty imap_expunge mcve_getcommadelimited sybase_field_seek swf_pushmatrix fdf_get_value ncurses_use_default_colors yp_all ncurses_deleteln fdf_close dbplus_first\n                   contained mysqli_rollback mcrypt_module_is_block_algorithm ncurses_mvcur sybase_unbuffered_query imagecopymerge xml_get_current_line_number openssl_pkey_new posix_getpwnam pdf_open_pdi_page crack_getlastmessage odbc_field_len fdf_set_version ocisetprefetch swffont msql_fieldtable\n                   contained wddx_serialize_value mysqli_fetch_fields is_infinite imagecolorclosesthwb dbplus_find stream_context_set_option odbc_specialcolumns msql_affected_rows openssl_csr_export_to_file pg_copy_from pdf_open_tiff pfpro_cleanup substr_replace chr mysql_field_table getallheaders ibase_trans\n                   contained imap_rfc822_parse_adrlist odbc_commit chown gd_info mysqli_get_client_info gmp_fact ora_numrows pdf_set_text_matrix gmp_or gethostbyname pfpro_process_raw strtok xmlrpc_parse_method_descriptions ncurses_echo getrusage is_null sem_release ocierror swf_setframe ncurses_insertln\n                   contained swf_shapefillsolid ncurses_clrtoeol pg_delete aggregate_properties cpdf_global_set_document_limits yaz_schema mcve_preauthcompletion pdf_close printer_delete_font hw_objrec2array mb_ereg_search_getpos ovrimos_num_rows openssl_csr_new dbplus_open sqlite_unbuffered_query sqrt ctype_xdigit\n                   contained mysqli_options xmlrpc_encode mcve_getuserparam ob_iconv_handler copy sqlite_create_function mhash gmp_div_qr ldap_close iconv_set_encoding restore_error_handler mysqli_real_connect mysqli_autocommit dbplus_rchperm ncurses_refresh mcve_bt pdf_add_weblink ncurses_getyx ftp_get iconv_strrpos\n                   contained mcal_event_set_recur_none sqlite_popen filemtime pdf_closepath fdf_save_string imagedashedline imagecolorat ncurses_slk_noutrefresh fdf_get_ap pspell_new_personal mysqli_num_rows mhash_get_block_size swf_shapefillbitmaptile imagecreatefromxpm ncurses_init_pair ovrimos_free_result\n                   contained udm_get_res_field imap_getacl imagecolorallocate ncurses_scr_restore mysql_get_client_info print is_bool mailparse_msg_get_structure dbplus_flush pg_connect fread chroot mcrypt_generic_deinit ncurses_putp dbplus_setindex imap_mailboxmsginfo pg_num_fields jewishtojd feof asort\n                   contained msession_randstr apache_response_headers ignore_user_abort cpdf_set_text_rise strripos fdf_get_opt odbc_num_fields substr cyrus_connect sesam_errormsg ifxus_seek_slob count_chars pdf_begin_template hw_api_attribute is_array ncurses_insdelln mysql_change_user mysqli_enable_rpl_parse\n                   contained mysqli_stmt_affected_rows imagefilledellipse ifx_num_rows getdate floor gzeof tempnam ncurses_addch imap_rfc822_write_address ctype_print vpopmail_add_alias_domain yaz_range mb_ereg_search_setpos dba_open printer_draw_rectangle ncurses_attron yp_errno basename dba_key_split\n                   contained ibase_modify_user readfile dbplus_add fbsql_num_rows gzgets ob_implicit_flush swf_shapelinesolid stream_filter_append xpath_eval_expression dbplus_freelock mcve_transactionid pg_lo_tell assert_options curl_multi_close imap_setflag_full imap_bodystruct number_format gmp_xor pdf_setlinecap\n                   contained posix_getgrgid ob_end_flush pg_send_query dbplus_unlockrel swf_shapefillbitmapclip ocicolumnprecision fdf_set_ap mysqli_disable_rpl_parse filepro_fieldtype imagecreate version_compare sybase_num_rows is_nan pdf_set_info ftp_pasv overload ovrimos_fetch_row posix_setuid ccvs_command\n                   contained imap_setacl round pg_port mssql_connect iconv_strlen array_merge pdf_open_image_file mcve_override lcg_value odbc_do ftp_nb_get ftp_exec ncurses_prefresh imap_msgno ircg_notice printer_close crypt mysql_ping mcve_deleteresponse mb_ereg_match ucfirst ingres_query variant\n                   contained imagecolorexactalpha swf_actionprevframe isset ibase_drop_db pdf_setcolor ncurses_waddstr ibase_rollback mysql_unbuffered_query ftp_fput ncurses_start_color trigger_error ncurses_scr_dump pdf_closepath_fill_stroke pspell_config_create socket_accept dns_check_record ircg_set_file\n                   contained mcal_event_add_attribute is_subclass_of gzinflate constant sqlite_libencoding base_convert cpdf_setrgbcolor_fill notes_create_db socket_bind mcrypt_encrypt imagettfbbox ircg_fetch_error_msg gmp_div ncurses_addstr get_cfg_var socket_iovec_set posix_kill xml_parse_into_struct\n                   contained imagepsextendfont shell_exec ovrimos_field_name tidy_get_config sqlite_query max mysqli_character_set_name imap_binary mcve_gl ncurses_bkgdset dbase_get_record_with_names odbc_gettypeinfo mysql_fetch_object pdf_set_border_dash mcrypt_get_iv_size sqlite_close mysqli_debug\n                   contained swf_addbuttonrecord ibase_connect ibase_delete_user rtrim pdf_set_text_rendering get_defined_vars swf_startbutton ibase_commit tan xmlrpc_server_destroy ifx_get_char zip_entry_compressionmethod pg_end_copy mysql_tablename mailparse_msg_get_part_data printer_create_font mcve_disableuser\n                   contained com yaz_scan odbc_fetch_object msql_field_seek cos chunk_split imagecreatefrompng swf_mulcolor gmp_pow udm_cat_list xslt_errno sqlite_array_query sqlite_seek imap_append pdf_set_font phpversion pdf_rotate mysqli_rpl_query_type mysqli_send_long_data zlib_get_coding_type mcve_text_code\n                   contained sybase_fetch_array pg_fetch_all ncurses_wstandout mcrypt_ecb mysqli_fetch_field fbsql_db_status imagerectangle yaz_connect dbplus_unselect notes_mark_read dba_fetch fam_next_event dns_get_mx preg_grep ob_end_clean pdf_get_majorversion msql_freeresult vpopmail_passwd md5_file\n                   contained mcrypt_get_block_size jdtojewish ocidefinebyname ncurses_longname imap_undelete mcve_deleteusersetup pdf_scale pg_result_status is_long apache_request_headers swf_showframe xslt_error shmop_read session_start ocifetchstatement ldap_start_tls exif_read_data dbplus_update ircg_kick\n                   contained sesam_fetch_array swf_actiongotoframe vpopmail_add_user swf_actiontogglequality printer_draw_line hw_getobject mysqli_read_query_result imap_unsubscribe error_reporting gmp_sqrt wddx_add_vars gmp_random msql_list_tables com_set xmlrpc_decode_request umask pdf_setrgbcolor get_class_methods\n                   contained cyrus_unbind mysqli_fetch_object ncurses_cbreak imap_check xslt_set_log posix_seteuid str_shuffle ncurses_isendwin mysqli_reload mcve_force xml_set_start_namespace_decl_handler is_real highlight_string dba_exists ncurses_halfdelay rewind pdf_setdash ldap_next_entry yaz_element\n                   contained ncurses_wmove tidy_get_html gzputs fbsql_num_fields cybercash_base64_decode mcal_event_set_start ncurses_use_extended_names ldap_delete vpopmail_alias_del_domain swf_definebitmap fam_cancel_monitor ocicollmax ncurses_baudrate strpos sesam_rollback ircg_get_username gmp_abs\n                   contained tidy_get_error_buffer mcal_event_set_recur_monthly_mday odbc_tables bind_textdomain_codeset muscat_setup dcngettext gettext mb_ereg_replace gzwrite ftp_nb_fget shmop_open session_encode vpopmail_del_domain_ex ocicommit dblist sesam_fetch_result dba_popen notes_nav_create pg_get_result\n                   contained ora_logon swfbitmap ncurses_resetty msql_create_db array_reduce chdir mcrypt_get_key_size each ifx_errormsg hw_getchilddoccollobj get_required_files fdf_set_opt fbsql_set_transaction shmop_close mssql_min_message_severity pfsockopen dbmfetch snmpget dbmdelete yaz_present dbmexists\n                   contained array_splice imagesetpixel imagesettile mcve_transsend ncurses_ungetmouse md5 mysqli_rpl_parse_enabled dio_open com_propput fbsql_fetch_assoc hw_getanchorsobj stream_socket_sendto msession_getdata pg_fetch_assoc imagejpeg apache_lookup_uri array_multisort ccvs_delete pg_num_rows\n                   contained swf_endsymbol swf_shapelineto xslt_output_process ifx_num_fields posix_getpgrp mb_strrpos fnmatch gettimeofday aggregate_properties_by_regexp socket_iovec_alloc session_unset swf_fonttracking posix_getgrnam gmp_popcount socket_iovec_fetch array_unique tidy_set_encoding mcrypt_module_close\n                   contained dio_stat ccvs_textvalue msql_fieldname ob_gzhandler escapeshellcmd imap_subscribe imap_alerts hw_array2objrec socket_sendmsg ingres_field_type mailparse_msg_parse_file ncurses_beep ifx_close cpdf_setgray shmop_delete ccvs_init mcve_transactiontext ifx_htmltbl_result socket_set_blocking\n                   contained pspell_config_repl snmprealwalk gmp_setbit ircg_topic qdom_error pdf_add_thumbnail dbplus_errno shmop_size filectime openssl_error_string addslashes proc_terminate printer_draw_bmp mcve_monitor cpdf_stroke dbplus_ropen dbplus_rrename pg_convert posix_getgid vpopmail_error\n                   contained xslt_set_sax_handlers msg_remove_queue bcpowmod mysql_fetch_field gmp_jacobi delete ccvs_add com_get cpdf_setlinecap readline_add_history pdf_set_char_spacing xml_parser_get_option pg_trace mb_language sybase_free_result ldap_parse_reference sesam_query imap_sort sem_acquire\n                   contained mcrypt_enc_get_key_size ibase_name_result mssql_fetch_field xml_set_object money_format pg_get_pid pdf_open_gif imagegd ob_get_length ircg_part exif_thumbnail ncurses_noqiflush mysqli_store_result mcve_chngpwd pg_meta_data yaz_close mysql_get_host_info array_flip setcookie\n                   contained xml_error_string posix_get_last_error imap_open dba_handlers yaz_itemorder ldap_bind mcve_sale session_write_close mcal_event_set_description tidy_repair_file split ccvs_report hw_close pdf_add_outline msession_unlock arsort sybase_deadlock_retry_count jdtofrench mcve_edituser\n                   contained msession_inc imagefilledarc imagecolorresolvealpha gmp_invert is_float xslt_set_scheme_handler hw_modifyobject cpdf_fill_stroke dba_list mcve_checkstatus ftp_rmdir pspell_config_personal mysql_field_len msg_get_queue ibase_blob_open gzopen array_values ncurses_addchstr fbsql_read_clob\n                   contained imap_scanmailbox cpdf_closepath_fill_stroke msql_list_dbs mcrypt_module_get_algo_key_size pg_last_error swf_nextid fbsql_username mcve_qc ncurses_wattrset pg_connection_status pdf_end_pattern msg_receive connection_status pdf_end_page mcal_snooze ncurses_wrefresh array_push\n                   contained imagefilledrectangle ncurses_end ibase_errcode mcal_fetch_current_stream_event pdf_setmiterlimit pdf_initgraphics swf_shapecurveto3 getenv dbplus_chdir session_name dbplus_aql odbc_rollback swf_endshape cyrus_bind cpdf_show socket_iovec_add swf_actionnextframe imagegd2 swf_getframe\n                   contained ldap_first_attribute swf_definetext session_set_cookie_params pspell_clear_session mcrypt_enc_get_supported_key_sizes zend_logo_guid pdf_setlinejoin readdir mdecrypt_generic pathinfo pfpro_init ibase_blob_close read_exif_data mcal_append_event cpdf_translate printer_list swf_startshape\n                   contained socket_readv ifx_query crack_check dba_firstkey zip_open fbsql_database pdf_setflat pg_fetch_result ocicollsize sqlite_create_aggregate udm_cat_path dbx_error xml_get_current_byte_index flush sqlite_num_rows sybase_get_last_message ncurses_del_panel swfmorph pspell_config_ignore\n                   contained fbsql_field_seek ncurses_delch readline_completion_function msql_error mcve_text_cv printer_draw_roundrect dbx_compare fdf_set_file hw_deleteobject stripslashes linkinfo ora_fetch_into rename ibase_close dbplus_resolve ocifreestatement mcve_text_avs headers_sent mb_internal_encoding\n                   contained ingres_field_nullable sqlite_error_string sqlite_last_insert_rowid ncurses_use_env preg_match_all notes_mark_unread sqlite_changes ini_get recode ibase_blob_get hw_changeobject imap_mail_compose pcntl_wifsignaled posix_getgroups imagesetstyle odbc_field_precision session_unregister\n                   contained fbsql_errno pdf_set_info_creator ncurses_assume_default_colors sesam_field_array hw_dummy is_uploaded_file pdf_get_buffer swf_defineline ldap_mod_add ora_numcols ncurses_doupdate ocicollappend printf is_link dbplus_rzap msession_listvar mssql_free_result mt_rand ovrimos_close\n                   contained file_put_contents php_logo_guid hw_getparentsobj pdf_end_template sem_remove w32api_register_function str_repeat yaz_sort tidy_get_release dbplus_rsecindex ncurses_def_shell_mode fbsql_field_table mcrypt_create_iv ncurses_define_key ncurses_wattroff posix_getegid yaz_scan_result\n                   contained mysqli_get_host_info ftp_nb_fput fbsql_error gmstrftime function_exists bzflush sqlite_has_more mysql_select_db ldap_parse_result mssql_num_fields udm_errno yaz_search cpdf_set_font_directories strlen session_cache_expire ftruncate mcve_ub imagestringup bindtextdomain swfbutton\n                   contained apache_get_modules imagepscopyfont ncurses_hline sesam_affected_rows fbsql_create_db ifxus_tell_slob stream_register_wrapper msql_fetch_field fbsql_field_len mcve_gut zip_entry_name mcal_list_events shuffle mcve_getcellbynum doubleval ftp_delete ncurses_scrl imagecopyresampled pg_dbname\n                   contained ociplogon mb_decode_numericentity die odbc_close ocicolumntyperaw tidy_diagnose imagecolorsforindex imap_fetchbody dir ccvs_return mysqli_get_server_version eval urldecode mcrypt_generic_init fdf_set_status cpdf_finalize_page mcve_completeauthorizations array_shift ftp_rename ord\n                   contained pcntl_wifexited gzencode ncurses_standend cpdf_curveto ncurses_wborder rmdir imap_uid ftp_set_option gzcompress pg_untrace token_name cpdf_close openssl_sign pdf_add_note gmp_com mcrypt_module_get_supported_key_sizes touch fbsql_list_tables strchr xslt_set_encoding var_dump\n                   contained hw_insertobject tidy_clean_repair rawurlencode ingres_num_rows muscat_get yaz_errno mysql_list_fields gmp_add ncurses_echochar cpdf_set_text_pos mysql_fetch_assoc utf8_decode exp ncurses_move sesam_settransaction imagegif hw_connect pos mcrypt_get_cipher_name sqlite_field_name pow\n                   contained imagecolordeallocate printer_write imagesetthickness msql_query stream_context_create tidy_error_count array_sum mcve_transparam mb_convert_case mysqli_data_seek ncurses_has_ic cosh ncurses_has_il mcve_transnew gmp_divexact ibase_fetch_row ircg_disconnect tidy_get_html_ver\n                   contained sybase_affected_rows ming_setcubicthreshold mcrypt_module_self_test ibase_query fam_resume_monitor mcve_adduser fdf_set_target_frame fam_monitor_directory ldap_get_values mysql_thread_id printer_select_pen pg_close msession_plugin ibase_execute sqlite_udf_encode_binary\n                   contained mysql_real_escape_string settype ini_get_all virtual muscat_close pg_field_name strspn mcve_returnstatus mb_convert_encoding cpdf_set_current_page ingres_autocommit nsapi_virtual printer_abort dbplus_next notes_drop_db pfpro_version log ocirollback array_pad pcntl_signal ftp_connect\n                   contained ncurses_scr_set socket_shutdown mysqli_warning_count imageloadfont gmp_perfect_square sesam_num_fields mkdir mysqli_errno msg_send ifx_affected_rows fdf_open_string swf_labelframe cpdf_rlineto array_slice mysqli_insert_id debug_backtrace fbsql_connect msql_data_seek pdf_set_info_keywords\n                   contained udm_free_res tidy_parse_string imagecharup mcal_event_set_alarm tidy_reset_config pg_connection_busy imap_delete crc32 socket_select ircg_msg ovrimos_result_all pdf_delete mb_eregi_replace socket_read mcve_settimeout ocilogoff fbsql_create_clob hw_document_setcontent stripos mcve_setip\n                   contained pdf_get_fontname highlight_file xmlrpc_server_call_method mailparse_rfc822_parse_addresses date array_key_exists ocifetch mailparse_msg_extract_part pdf_begin_page msql_fetch_row imagegammacorrect stream_get_meta_data deg2rad ctype_lower mhash_get_hash_name swf_viewport tidy_get_output\n                   contained ifx_create_char imagestring xslt_set_base stream_socket_client swftextfield domxml_xslt_stylesheet_file cpdf_set_text_rendering mysql_stat phpcredits iptcparse openssl_pkcs7_encrypt pdf_get_fontsize swf_actionsettarget ftp_alloc pdf_get_minorversion gzseek imageftbbox mysqli_stmt_error\n                   contained fflush ncurses_mvwaddstr openssl_x509_export_to_file ldap_get_dn str_replace xslt_set_error_handler cpdf_set_horiz_scaling pg_result_error mcve_maxconntimeout pdf_open_pdi xptr_eval pcntl_wifstopped pg_unescape_bytea swf_lookat gettype fbsql_field_type shm_attach sesam_free_result popen\n                   contained dbmopen dbplus_errcode mcve_returncode ocicolltrim gmdate gmmktime ovrimos_fetch_into ibase_num_params pg_last_notice imagesx imagesy base64_decode proc_nice mysqli_fetch_row mysqli_thread_safe notes_body apache_note ocicolumnsize printer_delete_dc pdf_set_info_author swf_oncondition\n                   contained strrev imagecreatefromgd2part hw_edittext yaz_hits mcve_enableuser mysqli_get_proto_info socket_recv tmpfile ingres_fetch_row ftp_site ocifetchinto snmp_set_quick_print show_source sybase_data_seek dbplus_rquery ldap_get_attributes pdf_set_word_spacing ovrimos_cursor\n                   contained mcrypt_list_algorithms user_error header dcgettext ora_error similar_text socket_writev cpdf_setgray_stroke dbplus_xlockrel dio_truncate mssql_field_seek strcmp fbsql_data_seek notes_copy_db dbplus_getlock array_search json_encode mb_detect_encoding odbc_procedures fscanf fdf_get_version\n                   contained mailparse_msg_free hw_getsrcbydestobj msession_destroy array_unshift cpdf_end_text octdec imagealphablending ora_columnsize ldap_read fam_close openssl_open fbsql_stop_db mcal_list_alarms current mb_ereg_search_regs cpdf_text ovrimos_field_len gmp_mod imagecolortransparent socket_close\n                   contained curl_multi_remove_handle dbase_add_record fbsql_fetch_row mcal_is_leap_year imagearc cpdf_add_outline hw_getandlock mysql_list_dbs mcal_day_of_year imageinterlace mailparse_msg_parse posix_getcwd realpath openssl_get_privatekey w32api_set_call_method swf_actionstop msession_setdata\n                   contained pdf_begin_pattern dbplus_getunique sybase_query vpopmail_add_domain ora_columntype swf_actionwaitforframe ingres_num_fields hw_api_object mail main pdf_show sesam_disconnect ircg_channel_mode get_magic_quotes_gpc ircg_ignore_del fam_open mcrypt_enc_is_block_mode pg_field_size\n                   contained hw_document_attributes ora_fetch imagetruecolortopalette ncurses_top_panel imap_utf7_decode get_object_vars ibase_set_event_handler cpdf_setmiterlimit ncurses_clrtobot mb_convert_kana pg_field_is_null mcrypt_enc_is_block_algorithm_mode mcrypt_cbc gmp_gcdext vpopmail_alias_get notes_search\n                   contained readline_read_history ccvs_new dio_tcsetattr posix_getpid gmp_sqrtrm pg_lo_read msession_disconnect rawurldecode gmp_powm ldap_add strcspn openssl_public_encrypt fgetss ovrimos_result mb_parse_str mcal_close mssql_pconnect cpdf_setlinejoin msql_listdbs ora_columnname dgettext ngettext\n                   contained fdf_set_encoding pdf_attach_file posix_strerror mailparse_uudecode_all proc_close xml_parser_free w32api_init_dtype ldap_t61_to_8859 ifx_free_blob ncurses_hide_panel ircg_ignore_add stream_select pdf_open_jpeg xml_parse mb_substr_count yp_next substr_count sqlite_fetch_single assert\n                   contained mcve_setdropfile htmlentities jdtojulian ncurses_getmouse dbase_numfields ncurses_wmouse_trafo bzerror openssl_csr_export pdf_translate xml_set_processing_instruction_handler getimagesize sha1 strtr pg_lo_create ldap_next_attribute pspell_config_save_repl odbc_longreadlen ora_bind\n                   contained ibase_blob_cancel sqlite_udf_decode_binary hw_getchildcollobj gmp_and sesam_commit sqlite_open pdf_setmatrix ncurses_napms mysql_db_name mcve_initusersetup snmpwalk aspell_check ccvs_void mcve_parsecommadelimited yp_order mcve_connect fbsql_next_result fdf_get_file ftok socket_recvfrom\n                   contained mcrypt_module_is_block_algorithm_mode hw_connection_info vpopmail_add_domain_ex xml_set_unparsed_entity_decl_handler notes_version eregi_replace xmlrpc_decode pdf_setgray_fill ini_alter is_writable ncurses_savetty jdtounix hw_docbyanchorobj yaz_error is_resource pdf_add_annotation\n                   contained dba_optimize odbc_binmode long2ip nsapi_response_headers socket_create ocisavelobfile fbsql_fetch_field ldap_get_values_len session_cache_limiter hw_pipedocument ftp_size dbplus_rcrtlike mysqli_bind_param mcal_week_of_year msql_regcase gzrewind strcasecmp xml_set_notation_decl_handler\n                   contained ncurses_color_set define_syslog_variables ocicolumntype imagepsslantfont ccvs_reverse chmod move_uploaded_file cpdf_show_xy cpdf_fill curl_multi_init ircg_nick sqlite_num_fields natcasesort eregi ovrimos_execute mcrypt_enc_get_iv_size openssl_get_publickey syslog\n                   contained xml_get_current_column_number imap_header aggregate_properties_by_list lzf_optimized_for mcrypt_generic_end ebcdic2ascii fam_monitor_collection dbase_delete_record mysqli_send_query msql_fieldflags mcve_verifysslcert imagepstext ncurses_raw tidy_save_config pspell_suggest is_string\n                   contained pg_lo_read_all tidy_load_config socket_get_option ftp_put image2wbmp swf_openfile ncurses_slk_touch ncurses_mvdelch pg_select pdf_new odbc_next_result session_save_path ncurses_erasechar decbin decoct swf_definerect swf_getfontinfo imagecolorclosest ncurses_slk_init gmp_mul bcsub\n                   links to Function\nphpMethods     xxx contained target dump_node next_sibling setbackground add add setlinespacing multcolor content streammp3 identify addcolor drawcurveto title doctype notations previous_sibling xinclude append_child scale last_child set_attribute setover data create_cdata_section setmargins link setdown insertanchor\n                   contained system_id is_xhtml getwidth getwidth getwidth setratio langdepvalue children children reason drawlineto setframes setframes process dstanchors owner_document child_nodes setcommitedversion has_children info drawline count count has_siblings setname setname get_attribute values\n                   contained result_dump_mem rotateto rotateto tidy_node rotate getshape2 insert_before prev is_xml skewxto skewxto setleftfill document_element skewx skewy output is_asp replace ftstat setdimension is_html setspacing set_namespace next setup create_text_node setindentation user setaction value value\n                   contained value insertcollection prefix dstofsrcanchors get_nodes get_elements_by_tagname get_elements_by_tagname attributes attributes create_comment get_content dump_file dcstat unlock key node_type description first_child lock move move get_attr create_attribute setheight setheight dbstat\n                   contained drawcurve remove remove remove remove remove find insert insert copy set_name get_element_by_id checkin objectbyanchor moveto moveto moveto align setfont setfont setleftmargin setrightfill addstring addstring read mimetype addaction getshape1 addentry result_dump_file has_attribute\n                   contained has_child_nodes skewyto skewyto save getheight create_processing_instruction addfill create_entity_reference type is_text name name remove_child setline parent_node object parents public_id is_blank_node setrightmargin srcanchors is_jste setbounds nextframe nextframe sethit set_content\n                   contained create_element_ns movepen setcolor setcolor clone_node srcsofdst replace_node movepento create_element setdepth is_comment is_jsp unlink_node checkout append_sibling entities tagname remove_attribute setrate node_value attreditable scaleto scaleto add_namespace dump_mem internal_subset\n                   contained replace_child has_attributes specified insertdocument assign node_name hwstat addshape get_attribute_node html_dump_mem userlist\n                   links to Function\nphpConditional xxx contained switch switch elseif if enddeclare declare else endswitch endif\n                   links to Conditional\nphpRepeat      xxx contained as endfor do endforeach for endwhile while foreach\n                   links to Repeat\nphpLabel       xxx contained switch case default\n                   links to Label\nphpStatement   xxx contained goto return exit continue die break\n                   links to Statement\nphpKeyword     xxx contained const var\n                   links to Statement\nphpType        xxx contained inte int boole intege array string boolean float integ null double integer object bool real boolea\n                   links to Type\nphpStructure   xxx contained implements extends class list\n                   trait\n                   contained interface namespace self parent instanceof abstract\n                   links to Structure\nphpOperator    xxx match /[-=+%^&|*!.~?:]/  display contained \n                   match #[-+*/%^&|.]=#  display contained \n                   match +/[^*/]+me=e-1  display contained \n                   match /\\$/  display contained \n                   match /&&\\|\\<and\\>/  display contained \n                   match /||\\|\\<x\\=or\\>/  display contained \n                   links to Operator\nphpRelation    xxx match /[!=<>]=/  display contained \n                   match /[<>]/  display contained \n                   links to Operator\nphpMemberSelector xxx match /->/  display contained \n                   links to Structure\nphpVarSelector xxx match /\\$/  display contained \n                   links to Operator\nphpIdentifier  xxx match /$\\h\\w*/  display contained contains=phpEnvVar,phpIntVar,phpVarSelector \n                   links to Identifier\nphpParent      xxx match /[({[\\]})]/  contained \n                   links to Delimiter\nphpIdentifierSimply xxx match /${\\h\\w*}/  display contained contains=phpOperator,phpParent \n                   links to Identifier\nphpIdentifierComplexP xxx matchgroup=phpParent start=/\\[/ end=/]/  contained contains=@phpClInside \n                   matchgroup=phpParent start=/\\[/ end=/]/  contained contains=@phpClInside \nphpIdentifierComplex xxx matchgroup=phpParent start=/{\\$/rs=e-1 end=/}/  contained extend contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP \nphpBrackets    xxx match /[][}{]/  display contained \n                   links to Delimiter\nphpInterpSimpleError xxx match /\\[[^]]*\\]/  display contained \n                   match /->[^a-zA-Z_]/  display contained \n                   links to Error\nphpInterpBogusDollarCurley xxx match /${[^}]*}/  display contained \n                   match /${\\h\\w*->}/  display contained \n                   match /${\\h\\w*\\[]}/  display contained \n                   links to Error\nphpinterpSimpleBracketsInner xxx match /\\w\\+/  contained \n                   links to String\nphpInterpSimpleBrackets xxx match /\\[\\h\\w*]/  contained contains=phpBrackets,phpinterpSimpleBracketsInner \n                   match /\\[\\d\\+]/  contained contains=phpBrackets,phpinterpSimpleBracketsInner \n                   match /\\[0[xX]\\x\\+]/  contained contains=phpBrackets,phpinterpSimpleBracketsInner \nphpInterpSimple xxx match /\\$\\h\\w*\\(\\[[^]]*\\]\\|->\\h\\w*\\)\\?/  display contained contains=phpInterpSimpleBrackets,phpIdentifier,phpInterpSimpleError,phpMethods,phpMemberSelector \nphpInterpVarname xxx match /\\h\\w*/  contained \n                   links to Identifier\nphpInterpMethodName xxx match /\\h\\w*/  contained \nphpInterpSimpleCurly xxx match /\\${\\h\\w*}/  contained extend contains=phpInterpVarname \n                   links to Delimiter\nphpInterpDollarCurley1Helper xxx matchgroup=phpParent start=/{/ end=/\\[/  contained contains=phpInterpVarname \nphpInterpDollarCurly1 xxx matchgroup=phpParent start=/\\${\\h\\w*\\[/rs=s+1 end=/]}/  contained extend contains=phpInterpDollarCurley1Helper,@phpClConst \n                   links to Error\nphpInterpDollarCurley2Helper xxx match /{\\h\\w*->/  contained contains=phpBrackets,phpInterpVarname,phpMemberSelector \nphpInterpDollarCurly2 xxx matchgroup=phpParent start=/\\${\\h\\w*->/rs=s+1 end=/}/  contained contains=phpInterpDollarCurley2Helper,phpInterpMethodName \n                   links to Error\nphpInterpComplex xxx matchgroup=phpParent start=/{\\$/rs=e-1 end=/}/  contained extend contains=phpIdentifier,phpMemberSelector,phpVarSelector,phpIdentifierComplexP \nphpMethodsVar  xxx match /->\\h\\w*/  display contained contains=phpMethods,phpMemberSelector \nphpInclude     xxx contained use require require_once include include_once\n                   links to Include\nphpDefine      xxx contained function new clone print echo\n                   links to Define\nphpBoolean     xxx contained false true\n                   links to Boolean\nphpNumber      xxx match /-\\=\\<\\d\\+\\>/  display contained \n                   match /\\<0x\\x\\{1,8}\\>/  display contained \n                   links to Number\nphpFloat       xxx match /\\(-\\=\\<\\d+\\|-\\=\\)\\.\\d\\+\\>/  display contained \n                   links to Float\nphpBackslashSequences xxx match /\\\\[fnrtv\\\\\\\"$]/  display contained \n                   match /\\\\\\d\\{1,3}/  display contained contains=phpOctalError \n                   match /\\\\x\\x\\{1,2}/  display contained \n                   links to SpecialChar\nphpOctalError  xxx match /[89]/  display contained \n                   links to Error\nphpBackslashDoubleQuote xxx match /\\\\[\\\"]/  display contained \n                   links to SpecialChar\nphpBackslashSingleQuote xxx match /\\\\[\\\\']/  display contained \n                   links to SpecialChar\nphpTodo        xxx contained todo fixme xxx\n                   links to Todo\nphpComment     xxx start=+/\\*+ end=+\\*/+  contained extend contains=phpTodo \n                   match /#.\\{-}\\(?>\\|$\\)\\@=/  contained contains=phpTodo \n                   match +//.\\{-}\\(?>\\|$\\)\\@=+  contained contains=phpTodo \n                   links to Comment\nphpStringDouble xxx matchgroup=None start=/\"/ skip=/\\\\\\\\\\|\\\\\"/ end=/\"/  contained keepend extend contains=@phpAddStrings,phpBackslashSequences,phpBackslashDoubleQuote,@phpInterpDouble \n                   links to String\nphpBacktick    xxx matchgroup=None start=/`/ skip=/\\\\\\\\\\|\\\\\"/ end=/`/  contained keepend extend contains=@phpAddStrings,phpIdentifier,phpBackslashSequences,phpIdentifierSimply,phpIdentifierComplex \n                   links to String\nphpStringSingle xxx matchgroup=None start=/'/ skip=/\\\\\\\\\\|\\\\'/ end=/'/  contained keepend extend contains=@phpAddStrings,phpBackslashSingleQuote \n                   links to String\nphpHereDoc     xxx matchgroup=Delimiter start=/\\(<<<\\)\\@<=\\(\\\"\\=\\)\\z(\\I\\i*\\)\\2$/ end=/^\\z1\\(;\\=$\\)\\@=/  contained keepend extend contains=phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar \n                   matchgroup=Delimiter start=/\\(<<<\\)\\@<=\\(\\\"\\=\\)\\z(\\(\\I\\i*\\)\\=\\(html\\)\\c\\(\\i*\\)\\)\\2$/ end=/^\\z1\\(;\\=$\\)\\@=/  contained keepend extend contains=@htmlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar \n                   matchgroup=Delimiter start=/\\(<<<\\)\\@<=\\(\\\"\\=\\)\\z(\\(\\I\\i*\\)\\=\\(sql\\)\\c\\(\\i*\\)\\)\\2$/ end=/^\\z1\\(;\\=$\\)\\@=/  contained keepend extend contains=@sqlTop,phpIdentifier,phpIdentifierSimply,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar \n                   matchgroup=Delimiter start=/\\(<<<\\)\\@<=\\(\\\"\\=\\)\\z(\\(\\I\\i*\\)\\=\\(javascript\\)\\c\\(\\i*\\)\\)\\2$/ end=/^\\z1\\(;\\=$\\)\\@=/  contained keepend extend contains=@htmlJavaScript,phpIdentifierSimply,phpIdentifier,phpIdentifierComplex,phpBackslashSequences,phpMethodsVar \nphpNowDoc      xxx matchgroup=Delimiter start=/\\(<<<\\)\\@<='\\z(\\I\\i*\\)'$/ end=/^\\z1\\(;\\=$\\)\\@=/  contained keepend extend \n                   matchgroup=Delimiter start=/\\(<<<\\)\\@<='\\z(\\(\\I\\i*\\)\\=\\(html\\)\\c\\(\\i*\\)\\)'$/ end=/^\\z1\\(;\\=$\\)\\@=/  contained keepend extend contains=@htmlTop \n                   matchgroup=Delimiter start=/\\(<<<\\)\\@<='\\z(\\(\\I\\i*\\)\\=\\(sql\\)\\c\\(\\i*\\)\\)'$/ end=/^\\z1\\(;\\=$\\)\\@=/  contained keepend extend contains=@sqlTop \n                   matchgroup=Delimiter start=/\\(<<<\\)\\@<='\\z(\\(\\I\\i*\\)\\=\\(javascript\\)\\c\\(\\i*\\)\\)'$/ end=/^\\z1\\(;\\=$\\)\\@=/  contained keepend extend contains=@htmlJavaScript \nphpException   xxx contained catch try throw\n                   links to Exception\nphpStorageClass xxx contained final static protected public private global\n                   links to StorageClass\nphpSpecialFunction xxx containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle  empty\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __construct\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __set\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __tostring\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __wakeup\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __set_state\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __isset\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __clone\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __call\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle  unset\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle  compact\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __get\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __destruct\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle  extract\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __unset\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle  isset\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle  trigger_error\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier  __sleep\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle  eval\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  __autoload\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle  user_error\n                   links to phpOperator\nphpClasses     xxx containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  php_user_filter\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domprocessinginstruction\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  emptyiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  simplexmlelement\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  errorexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  directoryiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  reflectionextension\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domelement\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  recursivedirectoryiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  reflectionparameter\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  unexpectedvalueexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domdomerror\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domimplementationsource\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  pdorow\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domnotation\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  invalidargumentexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  limititerator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  badmethodcallexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  spltempfileobject\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domcharacterdata\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domnamednodemap\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  arrayobject\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domstringextend\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  arrayiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  reflectionexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  pdo\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domuserdatahandler\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  xmlreader\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domerrorhandler\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domcomment\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domnamespacenode\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domimplementation\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  reflectionmethod\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domconfiguration\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  recursivefilteriterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domentityreference\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  norewinditerator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  libxmlerror\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  underflowexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  reflectionfunction\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domtext\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  pdoexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  infiniteiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  splfileobject\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  runtimeexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  cachingiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  directory\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  badfunctioncallexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  reflectionclass\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  outofrangeexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domlocator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domdocumentfragment\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domentity\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domnodelist\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  recursiveiteratoriterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  pdostatement\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  overflowexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  reflectionobject\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  splfileinfo\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  simplexmliterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domxpath\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domcdatasection\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  __php_incomplete_class\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domainexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  exception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domnamelist\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  parentiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  xmlwriter\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  appenditerator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domnode\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  rangeexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  logicexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  iteratoriterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  reflectionproperty\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domstringlist\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domtypeinfo\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  outofboundsexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domimplementationlist\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  splobjectstorage\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  recursivearrayiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  lengthexception\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  stdclass\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  recursivecachingiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  filteriterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  reflection\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domdocumenttype\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domattr\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  domdocument\n                   links to phpFunctions\nphpInterfaces  xxx containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  countable\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  iteratoraggregate\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  outeriterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  iterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  serializable\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  splobserver\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  arrayaccess\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  traversable\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  recursiveiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  seekableiterator\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  reflector\n                   containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle,phpIdentifier,phpMethodsVar  splsubject\n                   links to phpConstant\nphpAssignByRef xxx match /=\\s*&/  containedin=ALLBUT,phpComment,phpStringDouble,phpStringSingle \n                   links to Type\nphpComparison  xxx contained containedin=phpRegion  instanceof\n                   match /\\v[=!]\\=\\=?/  contained containedin=phpRegion \n                   match /\\v[=<>-]@<![<>]\\=?[<>]@!/  contained containedin=phpRegion \n                   links to Statement\nphpDocCustomTags xxx match /@[a-zA-Z]*\\(\\s\\+\\|\\n\\|\\r\\)/  containedin=phpComment \n                   links to Type\nphpDocTags     xxx start=/{@\\(example\\|id\\|internal\\|inheritdoc\\|link\\|source\\|toc\\|tutorial\\)/ end=/}/  containedin=phpComment \n                   match /@\\(abstract\\|access\\|author\\|category\\|copyright\\|deprecated\\|example\\|final\\|global\\|ignore\\|internal\\|license\\|link\\|method\\|name\\|package\\|param\\|property\\|return\\|see\\|since\\|static\\|staticvar\\|subpackage\\|tutorial\\|uses\\|var\\|version\\|contributor\\|modified\\|filename\\|description\\|filesource\\|throws\\)\\(\\s\\+\\)\\?/  containedin=phpComment \n                   links to PreProc\nphpDocTodo     xxx match /@\\(todo\\|fixme\\|xxx\\)\\(\\s\\+\\)\\?/  containedin=phpComment \n                   links to Todo\nhtmlPreproc    cluster=phpRegion,phpRegionAsp,phpRegionSc \nhtmlArgCluster cluster=NONE\nhtmlTagNameCluster cluster=NONE\nSpell          cluster=NONE\nhtmlTop        cluster=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,htmlLink,javaScript,@htmlPreproc \nhtmlJavaScript cluster=trailingWhitespace,literalTab,javaScriptLineComment,javaScriptCommentSkip,javaScriptComment,javaScriptSpecial,javaScriptStringD,javaScriptStringS,javaScriptSpecialCharacter,javaScriptNumber,javaScriptRegexpString,javaScriptConditional,javaScriptRepeat,javaScriptBranch,javaScriptOperator,javaScriptType,javaScriptStatement,javaScriptBoolean,javaScriptNull,javaScriptIdentifier,javaScriptLabel,javaScriptException,javaScriptMessage,javaScriptGlobal,javaScriptMember,javaScriptDeprecated,javaScriptReserved,javaScriptFunction,javaScriptBraces,javaScriptParens,@htmlPreproc \nhtmlVbScript   cluster=vbConditional,vbOperator,vbBoolean,vbConst,vbRepeat,vbEvents,vbFunction,vbMethods,vbStatement,vbKeyword,vbTypes,vbDefine,vbNumber,vbFloat,vbString,vbComment,vbLineNumber,vbTypeSpecifier \nhtmlCss        cluster=trailingWhitespace,literalTab,cssTagName,cssDeprecated,cssSelectorOp,cssSelectorOp2,cssUnicodeEscape,cssStringQ,cssStringQQ,cssAttributeSelector,cssClassName,cssIdentifier,cssComment,cssMediaBlock,cssInclude,cssDefinition,cssPseudoClass,cssPage,cssKeyFrame,cssFontDescriptor,cssFontProp,cssFontAttr,cssTextProp,cssBraceError,cssAttrComma,cssPseudoClassLang \ncssColors      cluster=cssColor800000,cssColorff0000,cssColorffA500,cssColorffff00,cssColor808000,cssColor800080,cssColorff00ff,cssColorffffff,cssColor00ff00,cssColor008000,cssColor000080,cssColor0000ff,cssColor00ffff,cssColor008080,cssColor000000,cssColorc0c0c0,cssColor808080,cssColorF0F8FF,cssColorFAEBD7,cssColor7FFFD4,cssColorF0FFFF,cssColorF5F5DC,cssColorFFE4C4,cssColorFFEBCD,cssColor8A2BE2,cssColorA52A2A,cssColorDEB887,cssColor5F9EA0,cssColor7FFF00,cssColorD2691E,cssColorFF7F50,cssColor6495ED,cssColorFFF8DC,cssColorDC143C,cssColor00008B,cssColor008B8B,cssColorB8860B,cssColorA9A9A9,cssColor006400,cssColorBDB76B,cssColor8B008B,cssColor556B2F,cssColorFF8C00,cssColor9932CC,cssColor8B0000,cssColorE9967A,cssColor8FBC8F,cssColor483D8B,cssColor2F4F4F,cssColor00CED1,cssColor9400D3,cssColorFF1493,cssColor00BFFF,cssColor696969,cssColor1E90FF,cssColorB22222,cssColorFFFAF0,cssColor228B22,cssColorDCDCDC,cssColorF8F8FF,cssColorFFD700,cssColorDAA520,cssColorADFF2F,cssColorF0FFF0,cssColorFF69B4,cssColorCD5C5C,cssColor4B0082,cssColorFFFFF0,cssColorF0E68C,cssColorE6E6FA,cssColorFFF0F5,cssColor7CFC00,cssColorFFFACD,cssColorADD8E6,cssColorF08080,cssColorE0FFFF,cssColorFAFAD2,cssColorD3D3D3,cssColor90EE90,cssColorFFB6C1,cssColorFFA07A,cssColor20B2AA,cssColor87CEFA,cssColor778899,cssColorB0C4DE,cssColorFFFFE0,cssColor32CD32,cssColorFAF0E6,cssColor66CDAA,cssColor0000CD,cssColorBA55D3,cssColor9370D8,cssColor3CB371,cssColor7B68EE,cssColor00FA9A,cssColor48D1CC,cssColorC71585,cssColor191970,cssColorF5FFFA,cssColorFFE4E1,cssColorFFE4B5,cssColorFFDEAD,cssColorFDF5E6,cssColor6B8E23,cssColorFF4500,cssColorDA70D6,cssColorEEE8AA,cssColor98FB98,cssColorAFEEEE,cssColorD87093,cssColorFFEFD5,cssColorFFDAB9,cssColorCD853F,cssColorFFC0CB,cssColorDDA0DD,cssColorB0E0E6,cssColorBC8F8F,cssColor4169E1,cssColor8B4513,cssColorFA8072,cssColorF4A460,cssColor2E8B57,cssColorFFF5EE,cssColorA0522D,cssColor87CEEB,cssColor6A5ACD,cssColor708090,cssColorFFFAFA,cssColor00FF7F,cssColor4682B4,cssColorD2B48C,cssColorD8BFD8,cssColorFF6347,cssColor40E0D0,cssColorEE82EE,cssColorF5DEB3,cssColorF5F5F5,cssColor9ACD32 \nhtmlLess       cluster=trailingWhitespace,literalTab,cssTagName,cssDeprecated,cssSelectorOp,cssSelectorOp2,cssUnicodeEscape,cssStringQ,cssStringQQ,cssAttributeSelector,cssClassName,cssIdentifier,cssComment,cssMediaBlock,cssInclude,cssDefinition,cssPseudoClass,cssPage,cssKeyFrame,cssFontDescriptor,cssFontProp,cssFontAttr,cssTextProp,cssBraceError,cssAttrComma,cssPseudoClassLang,lessDefinition,lessComment,lessVariable \nsqlTop         cluster=sqlSpecial,sqlKeyword,sqlOperator,sqlStatement,sqlType,sqlNumber \nphpClInside    cluster=@phpClConst,phpComment,phpLabel,phpParent,phpParentError,phpInclude,phpHereDoc,phpNowDoc \nphpClConst     cluster=phpFunctions,phpIdentifier,phpConditional,phpRepeat,phpStatement,phpOperator,phpRelation,phpStringSingle,phpStringDouble,phpBacktick,phpNumber,phpFloat,phpKeyword,phpType,phpBoolean,phpStructure,phpMethodsVar,phpConstant,phpCoreConstant,phpException \nphpInterpDouble cluster=phpInterpSimple,phpInterpSimpleCurly,phpInterpDollarCurly1,phpInterpDollarCurly2,phpInterpBogusDollarCurley,phpInterpComplex \nphpAddStrings  cluster=NONE\nphpClFunction  cluster=@phpClInside,phpDefine,phpParentError,phpStorageClass \nphpClTop       cluster=@phpClFunction,phpFoldFunction,phpFoldClass,phpFoldInterface,phpFoldTry,phpFoldCatch \n"
  },
  {
    "path": "python/ycm/tests/testdata/python_syntax",
    "content": "--- Syntax items ---\ncCustomFunc    xxx match /\\w\\+\\s*\\((\\)\\@=/\n                   links to Function\ncCustomClass   xxx match /\\w\\+\\s*\\(::\\)\\@=/\n                   links to Function\npythonStatement xxx return True lambda\n                   nextgroup=pythonFunction  skipwhite def\n                   del\n                   nextgroup=pythonFunction  skipwhite class\n                   global nonlocal as None, False, yield with print continue break pass assert exec\n                   links to Statement\npythonFunction xxx match /\\%(\\%(def\\s\\|class\\s\\|@\\)\\s*\\)\\@<=\\h\\%(\\w\\|\\.\\)*/  contained\n                   links to Function\npythonConditional xxx if else elif\n                   links to Conditional\npythonRepeat   xxx for while\n                   links to Repeat\npythonOperator xxx or is and in not\n                   links to Operator\npythonException xxx finally raise except try\n                   links to Exception\npythonInclude  xxx from import\n                   links to Include\npythonDecorator xxx match /@/  display nextgroup=pythonFunction skipwhite\n                   links to Define\npythonTodo     xxx contained NOTE XXX TODO NOTES FIXME\n                   links to Todo\npythonComment  xxx match /#.*$/  contains=pythonTodo,@Spell\n                   links to Comment\npythonEscape   xxx match /\\\\[abfnrtv'\"\\\\]/  contained\n                   match /\\\\\\o\\{1,3}/  contained\n                   match /\\\\x\\x\\{2}/  contained\n                   match /\\%(\\\\u\\x\\{4}\\|\\\\U\\x\\{8}\\)/  contained\n                   match /\\\\N{\\a\\+\\%(\\s\\a\\+\\)*}/  contained\n                   match /\\\\$/\n                   links to Special\npythonString   xxx start=/[uU]\\=\\z(['\"]\\)/ skip=/\\\\\\\\\\|\\\\\\z1/ end=/\\z1/  contains=pythonEscape,@Spell\n                   start=/[uU]\\=\\z('''\\|\"\"\"\\)/ end=/\\z1/  keepend contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell\n                   links to String\npythonDoctest  xxx start=/^\\s*>>>\\s/ end=/^\\s*$/  contained contains=ALLBUT,pythonDoctest,@Spell\n                   links to Special\npythonRawString xxx start=/[uU]\\=[rR]\\z(['\"]\\)/ skip=/\\\\\\\\\\|\\\\\\z1/ end=/\\z1/  contains=@Spell\n                   start=/[uU]\\=[rR]\\z('''\\|\"\"\"\\)/ end=/\\z1/  keepend contains=pythonSpaceError,pythonDoctest,@Spell\n                   links to String\npythonNumber   xxx match /\\<0[oO]\\=\\o\\+[Ll]\\=\\>/\n                   match /\\<0[xX]\\x\\+[Ll]\\=\\>/\n                   match /\\<0[bB][01]\\+[Ll]\\=\\>/\n                   match /\\<\\%([1-9]\\d*\\|0\\)[Ll]\\=\\>/\n                   match /\\<\\d\\+[jJ]\\>/\n                   match /\\<\\d\\+[eE][+-]\\=\\d\\+[jJ]\\=\\>/\n                   match /\\<\\d\\+\\.\\%([eE][+-]\\=\\d\\+\\)\\=[jJ]\\=\\%(\\W\\|$\\)\\@=/\n                   match /\\%(^\\|\\W\\)\\@<=\\d*\\.\\d\\+\\%([eE][+-]\\=\\d\\+\\)\\=[jJ]\\=\\>/\n                   links to Number\npythonBuiltin  xxx list locals all classmethod None abs cmp reduce ord hex object memoryview enumerate __debug__ compile str False True issubclass input hasattr frozenset slice callable sum filter range any long execfile min type sorted reload super complex xrange file ascii setattr unicode staticmethod basestring unichr float iter map globals max isinstance dict chr reversed buffer delattr __import__ oct dir eval raw_input hash getattr tuple id bin vars apply bytes repr pow print zip open NotImplemented intern round format bool help property coerce Ellipsis len int next exec set bytearray divmod\n                   links to Function\npythonExceptions xxx OSError EnvironmentError UserWarning NameError ArithmeticError NotImplementedError ReferenceError BaseException LookupError ImportWarning OverflowError SystemExit IndentationError GeneratorExit Warning RuntimeError MemoryError WindowsError AssertionError UnicodeWarning KeyError TypeError TabError ImportError SyntaxWarning SyntaxError UnboundLocalError KeyboardInterrupt UnicodeDecodeError IOError Exception FutureWarning AttributeError UnicodeTranslateError VMSError EOFError FloatingPointError ValueError IndexError RuntimeWarning DeprecationWarning PendingDeprecationWarning UnicodeEncodeError StopIteration UnicodeError BytesWarning StandardError SystemError ZeroDivisionError BufferError\n                   links to Structure\npythonDoctestValue xxx start=/^\\s*\\%(>>>\\s\\|\\.\\.\\.\\s\\|\"\"\"\\|'''\\)\\@!\\S\\+/ end=/$/  contained\n                   links to Define\nOperatorChars  xxx match #?\\|+\\|-\\|\\*\\|;\\|:\\|,\\|<\\|>\\|&\\||\\|!\\|\\~\\|%\\|=\\|)\\|(\\|{\\|}\\|\\.\\|\\[\\|\\]\\|/\\(/\\|*\\)\\@!#\nSpell          cluster=NONE\nNoSpell        cluster=NONE\n\n"
  },
  {
    "path": "python/ycm/tests/testdata/uni¢od€/tags",
    "content": ""
  },
  {
    "path": "python/ycm/tests/vimsupport_test.py",
    "content": "# Copyright (C) 2015-2018 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\nfrom ycm.tests import PathToTestFile\nfrom ycm.tests.test_utils import ( CurrentWorkingDirectory, ExtendedMock,\n                                   MockVimBuffers, MockVimModule, Version,\n                                   VimBuffer, VimError, WindowsAndMacOnly )\nMockVimModule()\n\nfrom ycm import vimsupport\nfrom hamcrest import ( assert_that, calling, contains_exactly, empty, equal_to,\n                       has_entry, raises )\nfrom unittest import TestCase\nfrom unittest.mock import MagicMock, call, patch\nfrom ycmd.utils import ToBytes\nimport os\nimport json\n\n\ndef AssertBuffersAreEqualAsBytes( result_buffer, expected_buffer ):\n  assert_that( len( result_buffer ), equal_to( len( expected_buffer ) ) )\n  for result_line, expected_line in zip( result_buffer, expected_buffer ):\n    assert_that( ToBytes( result_line ), equal_to( ToBytes( expected_line ) ) )\n\n\ndef _BuildChunk( start_line,\n                 start_column,\n                 end_line,\n                 end_column,\n                 replacement_text, filepath='test_file_name' ):\n  return {\n    'range': {\n      'start': {\n        'filepath': filepath,\n        'line_num': start_line,\n        'column_num': start_column,\n      },\n      'end': {\n        'filepath': filepath,\n        'line_num': end_line,\n        'column_num': end_column,\n      },\n    },\n    'replacement_text': replacement_text\n  }\n\n\ndef _BuildLocations( start_line, start_column, end_line, end_column ):\n  return {\n    'line_num'  : start_line,\n    'column_num': start_column,\n  }, {\n    'line_num'  : end_line,\n    'column_num': end_column,\n  }\n\n\nclass VimsupportTest( TestCase ):\n  @patch( 'ycm.vimsupport.WinIDForWindow', side_effect = range( 1001, 1010 ) )\n  @patch( 'vim.eval', new_callable = ExtendedMock )\n  def test_SetLocationListsForBuffer_Current( self, vim_eval, *args ):\n    diagnostics = [ {\n      'bufnr': 3,\n      'filename': 'some_filename',\n      'lnum': 5,\n      'col': 22,\n      'type': 'E',\n      'valid': 1\n    } ]\n    current_buffer = VimBuffer( '/test', number = 3 )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      vimsupport.SetLocationListsForBuffer( 3, diagnostics )\n\n    vim_eval.assert_has_exact_calls( [\n      call( 'setloclist( 1001, [], \" \", { \"title\": \"ycm_loc\", '\n            '\"items\": [{\"bufnr\": 3, \"filename\": \"some_filename\", \"lnum\": 5, '\n            '\"col\": 22, \"type\": \"E\", \"valid\": 1}] } )' ),\n      call( 'getloclist( 1001, { \"nr\": \"$\", \"id\": 0 } ).id' ),\n    ] )\n\n\n  @patch( 'vim.eval', new_callable = ExtendedMock )\n  def test_SetLocationListsForBuffer_NotCurrent( self, vim_eval ):\n    diagnostics = [ {\n      'bufnr': 3,\n      'filename': 'some_filename',\n      'lnum': 5,\n      'col': 22,\n      'type': 'E',\n      'valid': 1\n    } ]\n    current_buffer = VimBuffer( '/test', number = 3 )\n    other_buffer = VimBuffer( '/notcurrent', number = 1 )\n    with MockVimBuffers( [ current_buffer, other_buffer ], [ current_buffer ] ):\n      vimsupport.SetLocationListsForBuffer( 1, diagnostics )\n\n    vim_eval.assert_not_called()\n\n\n  @patch( 'vim.eval', new_callable = ExtendedMock, side_effect = [ -1, 1 ] )\n  def test_SetLocationListsForBuffer_NotVisible( self, vim_eval ):\n    diagnostics = [ {\n      'bufnr': 3,\n      'filename': 'some_filename',\n      'lnum': 5,\n      'col': 22,\n      'type': 'E',\n      'valid': 1\n    } ]\n    current_buffer = VimBuffer( '/test', number = 3 )\n    other_buffer = VimBuffer( '/notcurrent', number = 1 )\n    with MockVimBuffers( [ current_buffer, other_buffer ], [ current_buffer ] ):\n      vimsupport.SetLocationListsForBuffer( 1, diagnostics )\n\n    vim_eval.assert_not_called()\n\n\n  @patch( 'ycm.vimsupport.WinIDForWindow', side_effect = range( 1001, 1010 ) )\n  @patch( 'vim.eval', new_callable = ExtendedMock, side_effect = [ -1, 1 ] )\n  def test_SetLocationListsForBuffer_MultipleWindows( self, vim_eval, *args ):\n    diagnostics = [ {\n      'bufnr': 3,\n      'filename': 'some_filename',\n      'lnum': 5,\n      'col': 22,\n      'type': 'E',\n      'valid': 1\n    } ]\n    current_buffer = VimBuffer( '/test', number = 3 )\n    other_buffer = VimBuffer( '/notcurrent', number = 1 )\n    with MockVimBuffers( [ current_buffer, other_buffer ],\n                         [ current_buffer, other_buffer ] ):\n      vimsupport.SetLocationListsForBuffer( 1, diagnostics )\n\n    vim_eval.assert_has_exact_calls( [\n      call( 'setloclist( 1001, [], \" \", { \"title\": \"ycm_loc\", \"items\": '\n           f'{ json.dumps( diagnostics ) } }} )' ),\n      call( 'getloclist( 1001, { \"nr\": \"$\", \"id\": 0 } ).id' ),\n    ] )\n\n\n  @patch( 'ycm.vimsupport.WinIDForWindow', side_effect = range( 1001, 1010 ) )\n  @patch( 'vim.eval', new_callable = ExtendedMock )\n  def test_SetLocationList( self, vim_eval, *args ):\n    diagnostics = [ {\n      'bufnr': 3,\n      'filename': 'some_filename',\n      'lnum': 5,\n      'col': 22,\n      'type': 'E',\n      'valid': 1\n    } ]\n    current_buffer = VimBuffer( '/test', number = 3 )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 1 ) ):\n      vimsupport.SetLocationList( diagnostics )\n\n    vim_eval.assert_has_exact_calls( [\n      call( 'setloclist( 1001, [], \" \", { \"title\": \"ycm_loc\", \"items\": '\n            '[{\"bufnr\": 3, \"filename\": \"some_filename\", \"lnum\": '\n            '5, \"col\": 22, \"type\": \"E\", \"valid\": 1}] } )' ),\n      call( 'getloclist( 1001, { \"nr\": \"$\", \"id\": 0 } ).id' ),\n    ] )\n\n\n  @patch( 'ycm.vimsupport.WinIDForWindow', side_effect = range( 1001, 1010 ) )\n  @patch( 'vim.eval', new_callable = ExtendedMock )\n  def test_SetLocationList_NotCurrent( self, vim_eval, *args ):\n    diagnostics = [ {\n      'bufnr': 3,\n      'filename': 'some_filename',\n      'lnum': 5,\n      'col': 22,\n      'type': 'E',\n      'valid': 1\n    } ]\n    current_buffer = VimBuffer( '/test', number = 3 )\n    other_buffer = VimBuffer( '/notcurrent', number = 1 )\n    with MockVimBuffers( [ current_buffer, other_buffer ],\n                         [ current_buffer, other_buffer ],\n                         ( 1, 1 ) ):\n      vimsupport.SetLocationList( diagnostics )\n\n    # This version does not check the current\n    # buffer and just sets the current win\n    vim_eval.assert_has_exact_calls( [\n      call( 'setloclist( 1001, [], \" \", { \"title\": \"ycm_loc\", \"items\": '\n            '[{\"bufnr\": 3, \"filename\": \"some_filename\", \"lnum\": 5, \"col\": 22, '\n            '\"type\": \"E\", \"valid\": 1}] } )' ),\n      call( 'getloclist( 1001, { \"nr\": \"$\", \"id\": 0 } ).id' ),\n    ] )\n\n\n  @patch( 'ycm.vimsupport.VariableExists', return_value = True )\n  @patch( 'ycm.vimsupport.SetFittingHeightForCurrentWindow' )\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_OpenLocationList(\n      self, vim_command, fitting_height, variable_exists ):\n    vimsupport.OpenLocationList( focus = False, autoclose = True )\n    vim_command.assert_has_exact_calls( [\n      call( 'lopen' ),\n      call( 'augroup ycmlocation' ),\n      call( 'autocmd! * <buffer>' ),\n      call( 'autocmd WinLeave <buffer> '\n            'if bufnr( \"%\" ) == expand( \"<abuf>\" ) | q | endif '\n            '| autocmd! ycmlocation' ),\n      call( 'augroup END' ),\n      call( 'doautocmd User YcmLocationOpened' ),\n      call( 'silent! wincmd p' )\n    ] )\n    fitting_height.assert_called_once_with()\n    variable_exists.assert_called_once_with( '#User#YcmLocationOpened' )\n\n\n  @patch( 'vim.command' )\n  def test_SetFittingHeightForCurrentWindow_LineWrapOn(\n      self, vim_command, *args ):\n    # Create a two lines buffer whose first\n    # line is longer than the window width.\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'a' * 140, 'b' * 80 ] )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vim.current.window.width = 120\n      vim.current.window.options[ 'wrap' ] = True\n      vimsupport.SetFittingHeightForCurrentWindow()\n    vim_command.assert_called_once_with( '3wincmd _' )\n\n\n  @patch( 'vim.command' )\n  def test_SetFittingHeightForCurrentWindow_NoResize(\n      self, vim_command, *args ):\n    # Create a two lines buffer whose first\n    # line is longer than the window width.\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'a' * 140, 'b' * 80 ],\n                                vars = { 'ycm_no_resize': 1 } )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vim.current.window.width = 120\n      vim.current.window.options[ 'wrap' ] = True\n      vimsupport.SetFittingHeightForCurrentWindow()\n    vim_command.assert_not_called()\n\n\n  @patch( 'vim.command' )\n  def test_SetFittingHeightForCurrentWindow_LineWrapOff(\n      self, vim_command, *args ):\n    # Create a two lines buffer whose first\n    # line is longer than the window width.\n    current_buffer = VimBuffer( 'buffer',\n                                contents = [ 'a' * 140, 'b' * 80 ] )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vim.current.window.width = 120\n      vim.current.window.options[ 'wrap' ] = False\n      vimsupport.SetFittingHeightForCurrentWindow()\n    vim_command.assert_called_once_with( '2wincmd _' )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Repl_1( self ):\n    # Replace with longer range\n    result_buffer = VimBuffer( 'buffer', contents = [ 'This is a string' ] )\n    start, end = _BuildLocations( 1, 11, 1, 17 )\n    vimsupport.ReplaceChunk( start, end, 'pie', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This is a pie' ], result_buffer )\n\n    # and replace again\n    start, end = _BuildLocations( 1, 10, 1, 11 )\n    vimsupport.ReplaceChunk( start, end, ' piece of ', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This is a piece of pie' ], result_buffer )\n\n    # and once more, for luck\n    start, end = _BuildLocations( 1, 1, 1, 5 )\n    vimsupport.ReplaceChunk( start, end, 'How long', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'How long is a piece of pie' ],\n                                  result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Repl_2( self ):\n    # Replace with shorter range\n    result_buffer = VimBuffer( 'buffer', contents = [ 'This is a string' ] )\n    start, end = _BuildLocations( 1, 11, 1, 17 )\n    vimsupport.ReplaceChunk( start, end, 'test', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This is a test' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Repl_3( self ):\n    # Replace with equal range\n    result_buffer = VimBuffer( 'buffer', contents = [ 'This is a string' ] )\n    start, end = _BuildLocations( 1, 6, 1, 8 )\n    vimsupport.ReplaceChunk( start, end, 'be', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This be a string' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Add_1( self ):\n    # Insert at start\n    result_buffer = VimBuffer( 'buffer', contents = [ 'is a string' ] )\n    start, end = _BuildLocations( 1, 1, 1, 1 )\n    vimsupport.ReplaceChunk( start, end, 'This ', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This is a string' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Add_2( self ):\n    # Insert at end\n    result_buffer = VimBuffer( 'buffer', contents = [ 'This is a ' ] )\n    start, end = _BuildLocations( 1, 11, 1, 11 )\n    vimsupport.ReplaceChunk( start, end, 'string', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This is a string' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Add_3( self ):\n    # Insert in the middle\n    result_buffer = VimBuffer( 'buffer', contents = [ 'This is a string' ] )\n    start, end = _BuildLocations( 1, 8, 1, 8 )\n    vimsupport.ReplaceChunk( start, end, ' not', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This is not a string' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Del_1( self ):\n    # Delete from start\n    result_buffer = VimBuffer( 'buffer', contents = [ 'This is a string' ] )\n    start, end = _BuildLocations( 1, 1, 1, 6 )\n    vimsupport.ReplaceChunk( start, end, '', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'is a string' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Del_2( self ):\n    # Delete from end\n    result_buffer = VimBuffer( 'buffer', contents = [ 'This is a string' ] )\n    start, end = _BuildLocations( 1, 10, 1, 18 )\n    vimsupport.ReplaceChunk( start, end, '', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This is a' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Del_3( self ):\n    # Delete from middle\n    result_buffer = VimBuffer( 'buffer', contents = [ 'This is not a string' ] )\n    start, end = _BuildLocations( 1, 9, 1, 13 )\n    vimsupport.ReplaceChunk( start, end, '', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This is a string' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Unicode_ReplaceUnicodeChars( self ):\n    # Replace Unicode characters.\n    result_buffer = VimBuffer(\n      'buffer', contents = [ 'This Uniçø∂‰ string is in the middle' ] )\n    start, end = _BuildLocations( 1, 6, 1, 20 )\n    vimsupport.ReplaceChunk( start, end, 'Unicode ', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This Unicode string is in the middle' ],\n                                   result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Unicode_ReplaceAfterUnicode( self ):\n    # Replace ASCII characters after Unicode characters in the line.\n    result_buffer = VimBuffer(\n      'buffer', contents = [ 'This Uniçø∂‰ string is in the middle' ] )\n    start, end = _BuildLocations( 1, 30, 1, 43 )\n    vimsupport.ReplaceChunk( start, end, 'fåke', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'This Uniçø∂‰ string is fåke' ],\n                                   result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleLine_Unicode_Grown( self ):\n    # Replace ASCII characters after Unicode characters in the line.\n    result_buffer = VimBuffer( 'buffer', contents = [ 'a' ] )\n    start, end = _BuildLocations( 1, 1, 1, 2 )\n    vimsupport.ReplaceChunk( start, end, 'å', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'å' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_RemoveSingleLine( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa' ] )\n    start, end = _BuildLocations( 2, 1, 3, 1 )\n    vimsupport.ReplaceChunk( start, end, '', result_buffer )\n    # First line is not affected.\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aCa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleToMultipleLines( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa' ] )\n    start, end = _BuildLocations( 2, 3, 2, 4 )\n    vimsupport.ReplaceChunk( start, end, 'cccc', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aBcccc',\n                                    'aCa' ], result_buffer )\n\n    # now make another change to the second line\n    start, end = _BuildLocations( 2, 2, 2, 2 )\n    vimsupport.ReplaceChunk( start, end, 'Eb\\nbF', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aEb',\n                                    'bFBcccc',\n                                    'aCa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleToMultipleLines2( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa' ] )\n    start, end = _BuildLocations( 2, 2, 2, 2 )\n    vimsupport.ReplaceChunk( start, end, 'Eb\\nbFb\\nG', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aEb',\n                                    'bFb',\n                                    'GBa',\n                                    'aCa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleToMultipleLines3( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa' ] )\n    start, end = _BuildLocations( 2, 2, 2, 2 )\n    vimsupport.ReplaceChunk( start, end, 'Eb\\nbFb\\nbGb', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aEb',\n                                    'bFb',\n                                    'bGbBa',\n                                    'aCa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleToMultipleLinesReplace( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa' ] )\n    start, end = _BuildLocations( 1, 2, 1, 4 )\n    vimsupport.ReplaceChunk( start, end, 'Eb\\nbFb\\nbGb', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aEb',\n                                    'bFb',\n                                    'bGb',\n                                    'aBa',\n                                    'aCa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SingleToMultipleLinesReplace_2( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa' ] )\n    start, end = _BuildLocations( 1, 4, 1, 4 )\n    vimsupport.ReplaceChunk( start, end, 'cccc', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAacccc',\n                                    'aBa',\n                                    'aCa', ], result_buffer )\n\n    # now do a subsequent change (insert in the middle of the first line)\n    start, end = _BuildLocations( 1, 2, 1, 4 )\n    vimsupport.ReplaceChunk( start, end, 'Eb\\nbFb\\nbGb', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aEb',\n                                    'bFb',\n                                    'bGbcccc',\n                                    'aBa',\n                                    'aCa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_MultipleLinesToSingleLine( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCaaaa' ] )\n    start, end = _BuildLocations( 3, 4, 3, 5 )\n    vimsupport.ReplaceChunk( start, end, 'dd\\ndd', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aBa',\n                                    'aCadd',\n                                    'ddaa' ], result_buffer )\n\n    # make another modification applying offsets\n    start, end = _BuildLocations( 3, 3, 3, 4 )\n    vimsupport.ReplaceChunk( start, end, 'cccc', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aBa',\n                                    'aCccccdd',\n                                    'ddaa' ], result_buffer )\n\n    # and another, for luck\n    start, end = _BuildLocations( 2, 2, 3, 2 )\n    vimsupport.ReplaceChunk( start, end, 'E', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aECccccdd',\n                                    'ddaa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_MultipleLinesToSameMultipleLines( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa',\n                                                      'aDe' ] )\n    start, end = _BuildLocations( 2, 2, 3, 2 )\n    vimsupport.ReplaceChunk( start, end, 'Eb\\nbF', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aEb',\n                                    'bFCa',\n                                    'aDe' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_MultipleLinesToMoreMultipleLines( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa',\n                                                      'aDe' ] )\n    start, end = _BuildLocations( 2, 2, 3, 2 )\n    vimsupport.ReplaceChunk( start, end, 'Eb\\nbFb\\nbG', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aEb',\n                                    'bFb',\n                                    'bGCa',\n                                    'aDe' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_MultipleLinesToLessMultipleLines( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa',\n                                                      'aDe' ] )\n    start, end = _BuildLocations( 1, 2, 3, 2 )\n    vimsupport.ReplaceChunk( start, end, 'Eb\\nbF', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aEb',\n                                    'bFCa',\n                                    'aDe' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_MultipleLinesToEvenLessMultipleLines( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa',\n                                                      'aDe' ] )\n    start, end = _BuildLocations( 1, 2, 4, 2 )\n    vimsupport.ReplaceChunk( start, end, 'Eb\\nbF', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aEb',\n                                    'bFDe' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_SpanBufferEdge( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa' ] )\n    start, end = _BuildLocations( 1, 1, 1, 3 )\n    vimsupport.ReplaceChunk( start, end, 'bDb', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'bDba',\n                                    'aBa',\n                                    'aCa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_DeleteTextInLine( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa' ] )\n    start, end = _BuildLocations( 2, 2, 2, 3 )\n    vimsupport.ReplaceChunk( start, end, '', result_buffer )\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'aa',\n                                    'aCa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_AddTextInLine( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa' ] )\n    start, end = _BuildLocations( 2, 2, 2, 2 )\n    vimsupport.ReplaceChunk( start, end, 'bDb', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'abDbBa',\n                                    'aCa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_ReplaceTextInLine( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'aAa',\n                                                      'aBa',\n                                                      'aCa' ] )\n    start, end = _BuildLocations( 2, 2, 2, 3 )\n    vimsupport.ReplaceChunk( start, end, 'bDb', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'aAa',\n                                    'abDba',\n                                    'aCa' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_NewlineChunk( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'first line',\n                                                      'second line' ] )\n    start, end = _BuildLocations( 1, 11, 2, 1 )\n    vimsupport.ReplaceChunk( start, end, '\\n', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'first line',\n                                    'second line' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunk_BeyondEndOfFile( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'first line',\n                                                      'second line' ] )\n    start, end = _BuildLocations( 1, 11, 3, 1 )\n    vimsupport.ReplaceChunk( start, end, '\\n', result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'first line' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 3 ) )\n  def test_ReplaceChunk_CursorPosition( self ):\n    result_buffer = VimBuffer( 'buffer', contents = [ 'bar' ] )\n    start, end = _BuildLocations( 1, 1, 1, 1 )\n    vimsupport.ReplaceChunk( start,\n                             end,\n                             'xyz\\nfoo',\n                             result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'xyz', 'foobar' ], result_buffer )\n    # Cursor line is 0-based.\n    assert_that( vimsupport.CurrentLineAndColumn(), contains_exactly( 1, 6 ) )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunksInBuffer_SortedChunks( self ):\n    chunks = [\n      _BuildChunk( 1, 4, 1, 4, '(' ),\n      _BuildChunk( 1, 11, 1, 11, ')' )\n    ]\n\n    result_buffer = VimBuffer( 'buffer', contents = [ 'CT<10 >> 2> ct' ] )\n    vimsupport.ReplaceChunksInBuffer( chunks, result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'CT<(10 >> 2)> ct' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunksInBuffer_UnsortedChunks( self ):\n    chunks = [\n      _BuildChunk( 1, 11, 1, 11, ')' ),\n      _BuildChunk( 1, 4, 1, 4, '(' )\n    ]\n\n    result_buffer = VimBuffer( 'buffer', contents = [ 'CT<10 >> 2> ct' ] )\n    vimsupport.ReplaceChunksInBuffer( chunks, result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'CT<(10 >> 2)> ct' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunksInBuffer_LineOverlappingChunks( self ):\n    chunks = [\n      _BuildChunk( 1, 11, 2, 1, '\\n    ' ),\n      _BuildChunk( 2, 12, 3, 1, '\\n    ' ),\n      _BuildChunk( 3, 11, 4, 1, '\\n    ' )\n    ]\n\n    result_buffer = VimBuffer( 'buffer', contents = [ 'first line',\n                                                      'second line',\n                                                      'third line',\n                                                      'fourth line' ] )\n    vimsupport.ReplaceChunksInBuffer( chunks, result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'first line',\n                                    '    second line',\n                                    '    third line',\n                                    '    fourth line' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunksInBuffer_OutdentChunks( self ):\n    chunks = [\n      _BuildChunk( 1,  1, 1, 5, '  ' ),\n      _BuildChunk( 1, 15, 2, 9, '\\n    ' ),\n      _BuildChunk( 2, 20, 3, 3, '\\n' )\n    ]\n\n    result_buffer = VimBuffer( 'buffer', contents = [ '    first line',\n                                                      '        second line',\n                                                      '    third line' ] )\n    vimsupport.ReplaceChunksInBuffer( chunks, result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ '  first line',\n                                    '    second line',\n                                    '  third line' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunksInBuffer_OneLineIndentingChunks( self ):\n    chunks = [\n      _BuildChunk( 1,  8, 2,  1, '\\n ' ),\n      _BuildChunk( 2,  9, 2, 10, '\\n  ' ),\n      _BuildChunk( 2, 19, 2, 20, '\\n ' )\n    ]\n\n    result_buffer = VimBuffer( 'buffer', contents = [ 'class {',\n                                                      'method { statement }',\n                                                      '}' ] )\n    vimsupport.ReplaceChunksInBuffer( chunks, result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'class {',\n                                    ' method {',\n                                    '  statement',\n                                    ' }',\n                                    '}' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  def test_ReplaceChunksInBuffer_SameLocation( self ):\n    chunks = [\n      _BuildChunk( 1, 1, 1, 1, 'this ' ),\n      _BuildChunk( 1, 1, 1, 1, 'is ' ),\n      _BuildChunk( 1, 1, 1, 1, 'pure ' )\n    ]\n\n    result_buffer = VimBuffer( 'buffer', contents = [ 'folly' ] )\n    vimsupport.ReplaceChunksInBuffer( chunks, result_buffer )\n\n    AssertBuffersAreEqualAsBytes( [ 'this is pure folly' ], result_buffer )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  @patch( 'ycm.vimsupport.VariableExists', return_value = False )\n  @patch( 'ycm.vimsupport.SetFittingHeightForCurrentWindow' )\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.GetBufferNumberForFilename',\n          return_value = 1,\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.BufferIsVisible',\n          return_value = True,\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.OpenFilename' )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  @patch( 'vim.eval', new_callable = ExtendedMock )\n  def test_ReplaceChunks_SingleFile_Open( self,\n                                          vim_eval,\n                                          post_vim_message,\n                                          open_filename,\n                                          buffer_is_visible,\n                                          get_buffer_number_for_filename,\n                                          *args ):\n    single_buffer_name = os.path.realpath( 'single_file' )\n\n    chunks = [\n      _BuildChunk( 1, 1, 2, 1, 'replacement', single_buffer_name )\n    ]\n\n    result_buffer = VimBuffer(\n      single_buffer_name,\n      contents = [\n        'line1',\n        'line2',\n        'line3'\n      ]\n    )\n\n    with patch( 'vim.buffers', [ None, result_buffer, None ] ):\n      vimsupport.ReplaceChunks( chunks )\n\n    # Ensure that we applied the replacement correctly\n    assert_that( result_buffer.GetLines(), contains_exactly(\n      'replacementline2',\n      'line3',\n    ) )\n\n    # GetBufferNumberForFilename is called twice:\n    #  - once to the check if we would require opening the file (so that we can\n    #    raise a warning)\n    #  - once whilst applying the changes\n    get_buffer_number_for_filename.assert_has_exact_calls( [\n      call( single_buffer_name ),\n      call( single_buffer_name ),\n    ] )\n\n    # BufferIsVisible is called twice for the same reasons as above\n    buffer_is_visible.assert_has_exact_calls( [\n      call( 1 ),\n      call( 1 ),\n    ] )\n\n    # we don't attempt to open any files\n    open_filename.assert_not_called()\n\n    qflist = json.dumps( [ {\n      'bufnr': 1,\n      'filename': single_buffer_name,\n      'lnum': 1,\n      'col': 1,\n      'text': 'replacement',\n      'type': 'F'\n    } ] )\n    # But we do set the quickfix list\n    vim_eval.assert_has_exact_calls( [\n      call( f'setqflist( { qflist } )' )\n    ] )\n\n    # And it is ReplaceChunks that prints the message showing the number of\n    # changes\n    post_vim_message.assert_has_exact_calls( [\n      call( 'Applied 1 changes', warning = False ),\n    ] )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  @patch( 'ycm.vimsupport.VariableExists', return_value = False )\n  @patch( 'ycm.vimsupport.SetFittingHeightForCurrentWindow' )\n  @patch( 'ycm.vimsupport.GetBufferNumberForFilename',\n          side_effect = [ -1, -1, 1 ],\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.BufferIsVisible',\n          side_effect = [ False, False, True ],\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.OpenFilename',\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.Confirm',\n          return_value = True,\n          new_callable = ExtendedMock )\n  @patch( 'vim.eval', return_value = 10, new_callable = ExtendedMock )\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_ReplaceChunks_SingleFile_NotOpen( self,\n                                             vim_command,\n                                             vim_eval,\n                                             confirm,\n                                             post_vim_message,\n                                             open_filename,\n                                             buffer_is_visible,\n                                             get_buffer_number_for_filename,\n                                             set_fitting_height,\n                                             variable_exists ):\n    single_buffer_name = os.path.realpath( 'single_file' )\n\n    chunks = [\n      _BuildChunk( 1, 1, 2, 1, 'replacement', single_buffer_name )\n    ]\n\n    result_buffer = VimBuffer(\n      single_buffer_name,\n      contents = [\n        'line1',\n        'line2',\n        'line3'\n      ]\n    )\n\n    with patch( 'vim.buffers', [ None, result_buffer, None ] ):\n      vimsupport.ReplaceChunks( chunks )\n\n    # We checked if it was OK to open the file\n    confirm.assert_has_exact_calls( [\n      call( vimsupport.FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( 1 ) )\n    ] )\n\n    # Ensure that we applied the replacement correctly\n    assert_that( result_buffer.GetLines(), contains_exactly(\n      'replacementline2',\n      'line3',\n    ) )\n\n    # GetBufferNumberForFilename is called 3 times. The return values are set in\n    # the @patch call above:\n    #  - once to the check if we would require opening the file (so that we can\n    #    raise a warning) (-1 return)\n    #  - once whilst applying the changes (-1 return)\n    #  - finally after calling OpenFilename (1 return)\n    get_buffer_number_for_filename.assert_has_exact_calls( [\n      call( single_buffer_name ),\n      call( single_buffer_name ),\n      call( single_buffer_name ),\n    ] )\n\n    # BufferIsVisible is called 3 times for the same reasons as above, with the\n    # return of each one\n    buffer_is_visible.assert_has_exact_calls( [\n      call( -1 ),\n      call( -1 ),\n      call( 1 ),\n    ] )\n\n    # We open 'single_file' as expected.\n    open_filename.assert_called_with( single_buffer_name, {\n      'focus': True,\n      'fix': True,\n      'size': 10\n    } )\n\n    # And close it again, then show the quickfix window.\n    vim_command.assert_has_exact_calls( [\n      call( 'lclose' ),\n      call( 'hide' ),\n    ] )\n\n    qflist = json.dumps( [ {\n      'bufnr': 1,\n      'filename': single_buffer_name,\n      'lnum': 1,\n      'col': 1,\n      'text': 'replacement',\n      'type': 'F'\n    } ] )\n    # And update the quickfix list\n    vim_eval.assert_has_exact_calls( [\n      call( '&previewheight' ),\n      call( f'setqflist( { qflist } )' )\n    ] )\n\n    # And it is ReplaceChunks that prints the message showing the number of\n    # changes\n    post_vim_message.assert_has_exact_calls( [\n      call( 'Applied 1 changes', warning = False ),\n    ] )\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  @patch( 'ycm.vimsupport.VariableExists', return_value = False )\n  @patch( 'ycm.vimsupport.SetFittingHeightForCurrentWindow' )\n  @patch( 'ycm.vimsupport.GetBufferNumberForFilename',\n          side_effect = [ -1, 1 ],\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.BufferIsVisible',\n          side_effect = [ False, True ],\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.OpenFilename',\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.Confirm',\n          return_value = True,\n          new_callable = ExtendedMock )\n  @patch( 'vim.eval', return_value = 10, new_callable = ExtendedMock )\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_ReplaceChunks_SingleFile_NotOpen_Silent(\n    self,\n    vim_command,\n    vim_eval,\n    confirm,\n    post_vim_message,\n    open_filename,\n    buffer_is_visible,\n    get_buffer_number_for_filename,\n    set_fitting_height,\n    variable_exists ):\n\n    # This test is the same as ReplaceChunks_SingleFile_NotOpen_test, but we\n    # pass the silent flag, as used by post-complete actions, and shows the\n    # stuff we _don't_ call in that case.\n\n    single_buffer_name = os.path.realpath( 'single_file' )\n\n    chunks = [\n      _BuildChunk( 1, 1, 2, 1, 'replacement', single_buffer_name )\n    ]\n\n    result_buffer = VimBuffer(\n      single_buffer_name,\n      contents = [\n        'line1',\n        'line2',\n        'line3'\n      ]\n    )\n\n    with patch( 'vim.buffers', [ None, result_buffer, None ] ):\n      vimsupport.ReplaceChunks( chunks, silent=True )\n\n    # We didn't check if it was OK to open the file (silent)\n    confirm.assert_not_called()\n\n    # Ensure that we applied the replacement correctly\n    assert_that( result_buffer.GetLines(), contains_exactly(\n      'replacementline2',\n      'line3',\n    ) )\n\n    # GetBufferNumberForFilename is called 2 times. The return values are set in\n    # the @patch call above:\n    #  - once whilst applying the changes (-1 return)\n    #  - finally after calling OpenFilename (1 return)\n    get_buffer_number_for_filename.assert_has_exact_calls( [\n      call( single_buffer_name ),\n      call( single_buffer_name ),\n    ] )\n\n    # BufferIsVisible is called 2 times for the same reasons as above, with the\n    # return of each one\n    buffer_is_visible.assert_has_exact_calls( [\n      call( -1 ),\n      call( 1 ),\n    ] )\n\n    # We open 'single_file' as expected.\n    open_filename.assert_called_with( single_buffer_name, {\n      'focus': True,\n      'fix': True,\n      'size': 10\n    } )\n\n    # And close it again, but don't show the quickfix window\n    vim_command.assert_has_exact_calls( [\n      call( 'lclose' ),\n      call( 'hide' ),\n    ] )\n    set_fitting_height.assert_not_called()\n\n    # But we _don't_ update the QuickFix list\n    vim_eval.assert_has_exact_calls( [\n      call( '&previewheight' ),\n    ] )\n\n    # And we don't print a message either\n    post_vim_message.assert_not_called()\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  @patch( 'ycm.vimsupport.GetBufferNumberForFilename',\n          side_effect = [ -1, -1, 1 ],\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.BufferIsVisible',\n          side_effect = [ False, False, True ],\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.OpenFilename',\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.PostVimMessage',\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.Confirm',\n          return_value = False,\n          new_callable = ExtendedMock )\n  @patch( 'vim.eval',\n          return_value = 10,\n          new_callable = ExtendedMock )\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_ReplaceChunks_User_Declines_To_Open_File(\n                                             self,\n                                             vim_command,\n                                             vim_eval,\n                                             confirm,\n                                             post_vim_message,\n                                             open_filename,\n                                             buffer_is_visible,\n                                             get_buffer_number_for_filename ):\n\n    # Same as above, except the user selects Cancel when asked if they should\n    # allow us to open lots of (ahem, 1) file.\n    single_buffer_name = os.path.realpath( 'single_file' )\n\n    chunks = [\n      _BuildChunk( 1, 1, 2, 1, 'replacement', single_buffer_name )\n    ]\n\n    result_buffer = VimBuffer(\n      single_buffer_name,\n      contents = [\n        'line1',\n        'line2',\n        'line3'\n      ]\n    )\n\n    with patch( 'vim.buffers', [ None, result_buffer, None ] ):\n      vimsupport.ReplaceChunks( chunks )\n\n    # We checked if it was OK to open the file\n    confirm.assert_has_exact_calls( [\n      call( vimsupport.FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( 1 ) )\n    ] )\n\n    # Ensure that buffer is not changed\n    assert_that( result_buffer.GetLines(), contains_exactly(\n      'line1',\n      'line2',\n      'line3',\n    ) )\n\n    # GetBufferNumberForFilename is called once. The return values are set in\n    # the @patch call above:\n    #  - once to the check if we would require opening the file (so that we can\n    #    raise a warning) (-1 return)\n    get_buffer_number_for_filename.assert_has_exact_calls( [\n      call( single_buffer_name ),\n    ] )\n\n    # BufferIsVisible is called once for the above file, which wasn't visible.\n    buffer_is_visible.assert_has_exact_calls( [\n      call( -1 ),\n    ] )\n\n    # We don't attempt to open any files or update any quickfix list or anything\n    # like that\n    open_filename.assert_not_called()\n    vim_eval.assert_not_called()\n    vim_command.assert_not_called()\n    post_vim_message.assert_not_called()\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  @patch( 'ycm.vimsupport.GetBufferNumberForFilename',\n          side_effect = [ -1, -1, 1 ],\n          new_callable = ExtendedMock )\n  # Key difference is here: In the final check, BufferIsVisible returns False\n  @patch( 'ycm.vimsupport.BufferIsVisible',\n          side_effect = [ False, False, False ],\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.OpenFilename',\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.PostVimMessage',\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.Confirm',\n          return_value = True,\n          new_callable = ExtendedMock )\n  @patch( 'vim.eval',\n          return_value = 10,\n          new_callable = ExtendedMock )\n  @patch( 'vim.command',\n          new_callable = ExtendedMock )\n  def test_ReplaceChunks_User_Aborts_Opening_File(\n                                             self,\n                                             vim_command,\n                                             vim_eval,\n                                             confirm,\n                                             post_vim_message,\n                                             open_filename,\n                                             buffer_is_visible,\n                                             get_buffer_number_for_filename ):\n\n    # Same as above, except the user selects Abort or Quick during the\n    # \"swap-file-found\" dialog\n    single_buffer_name = os.path.realpath( 'single_file' )\n\n    chunks = [\n      _BuildChunk( 1, 1, 2, 1, 'replacement', single_buffer_name )\n    ]\n\n    result_buffer = VimBuffer(\n      single_buffer_name,\n      contents = [\n        'line1',\n        'line2',\n        'line3'\n      ]\n    )\n\n    with patch( 'vim.buffers', [ None, result_buffer, None ] ):\n      assert_that(\n        calling( vimsupport.ReplaceChunks ).with_args( chunks ),\n                 raises( RuntimeError,\n                   'Unable to open file: .+single_file\\n'\n                   'FixIt/Refactor operation aborted prior to completion. '\n                   'Your files have not been fully updated. '\n                   'Please use undo commands to revert the applied changes.' ) )\n\n    # We checked if it was OK to open the file\n    confirm.assert_has_exact_calls( [\n      call( vimsupport.FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( 1 ) )\n    ] )\n\n    # Ensure that buffer is not changed\n    assert_that( result_buffer.GetLines(), contains_exactly(\n      'line1',\n      'line2',\n      'line3',\n    ) )\n\n    # We tried to open this file\n    open_filename.assert_called_with( single_buffer_name, {\n      'focus': True,\n      'fix': True,\n      'size': 10\n    } )\n    vim_eval.assert_called_with( \"&previewheight\" )\n\n    # But raised an exception before issuing the message at the end\n    post_vim_message.assert_not_called()\n\n\n  @patch( 'vim.current.window.cursor', ( 1, 1 ) )\n  @patch( 'ycm.vimsupport.VariableExists', return_value = False )\n  @patch( 'ycm.vimsupport.SetFittingHeightForCurrentWindow' )\n  @patch( 'ycm.vimsupport.GetBufferNumberForFilename', side_effect = [\n            22, # first_file (check)\n            -1, # second_file (check)\n            22, # first_file (apply)\n            -1, # second_file (apply)\n            19, # second_file (check after open)\n          ],\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.BufferIsVisible', side_effect = [\n            True,  # first_file (check)\n            False, # second_file (check)\n            True,  # first_file (apply)\n            False, # second_file (apply)\n            True,  # side_effect (check after open)\n          ],\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.OpenFilename',\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.PostVimMessage',\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.Confirm', return_value = True,\n          new_callable = ExtendedMock )\n  @patch( 'vim.eval', return_value = 10,\n          new_callable = ExtendedMock )\n  @patch( 'vim.command',\n          new_callable = ExtendedMock )\n  def test_ReplaceChunks_MultiFile_Open( self,\n                                         vim_command,\n                                         vim_eval,\n                                         confirm,\n                                         post_vim_message,\n                                         open_filename,\n                                         buffer_is_visible,\n                                         get_buffer_number_for_filename,\n                                         set_fitting_height,\n                                         variable_exists ):\n\n    # Chunks are split across 2 files, one is already open, one isn't\n    first_buffer_name = os.path.realpath( '1_first_file' )\n    second_buffer_name = os.path.realpath( '2_second_file' )\n\n    chunks = [\n      _BuildChunk( 1, 1, 2, 1, 'first_file_replacement ', first_buffer_name ),\n      _BuildChunk( 2, 1, 2, 1, 'second_file_replacement ', second_buffer_name ),\n    ]\n\n    first_file = VimBuffer(\n      first_buffer_name,\n      number = 22,\n      contents = [\n        'line1',\n        'line2',\n        'line3',\n      ]\n    )\n    second_file = VimBuffer(\n      second_buffer_name,\n      number = 19,\n      contents = [\n        'another line1',\n        'ACME line2',\n      ]\n    )\n\n    vim_buffers = [ None ] * 23\n    vim_buffers[ 22 ] = first_file\n    vim_buffers[ 19 ] = second_file\n\n    with patch( 'vim.buffers', vim_buffers ):\n      vimsupport.ReplaceChunks( chunks )\n\n    # We checked for the right file names\n    get_buffer_number_for_filename.assert_has_exact_calls( [\n      call( first_buffer_name ),\n      call( second_buffer_name ),\n      call( first_buffer_name ),\n      call( second_buffer_name ),\n      call( second_buffer_name ),\n    ] )\n\n    # We checked if it was OK to open the file\n    confirm.assert_has_exact_calls( [\n      call( vimsupport.FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( 1 ) )\n    ] )\n\n    # Ensure that buffers are updated\n    assert_that( second_file.GetLines(), contains_exactly(\n      'another line1',\n      'second_file_replacement ACME line2',\n    ) )\n    assert_that( first_file.GetLines(), contains_exactly(\n      'first_file_replacement line2',\n      'line3',\n    ) )\n\n    # We open '2_second_file' as expected.\n    open_filename.assert_called_with( second_buffer_name, {\n      'focus': True,\n      'fix': True,\n      'size': 10\n    } )\n\n    # And close it again, then show the quickfix window.\n    vim_command.assert_has_exact_calls( [\n      call( 'lclose' ),\n      call( 'hide' ),\n    ] )\n\n    qflist = json.dumps( [ {\n      'bufnr': 22,\n      'filename': first_buffer_name,\n      'lnum': 1,\n      'col': 1,\n      'text': 'first_file_replacement ',\n      'type': 'F'\n    }, {\n      'bufnr': 19,\n      'filename': second_buffer_name,\n      'lnum': 2,\n      'col': 1,\n      'text': 'second_file_replacement ',\n      'type': 'F'\n    } ] )\n    # And update the quickfix list with each entry\n    vim_eval.assert_has_exact_calls( [\n      call( '&previewheight' ),\n      call( f'setqflist( { qflist } )' )\n    ] )\n\n    # And it is ReplaceChunks that prints the message showing the number of\n    # changes\n    post_vim_message.assert_has_exact_calls( [\n      call( 'Applied 2 changes', warning = False ),\n    ] )\n\n\n  @patch( 'vim.command', new_callable=ExtendedMock )\n  @patch( 'vim.current', new_callable=ExtendedMock )\n  def test_WriteToPreviewWindow( self, vim_current, vim_command ):\n    vim_current.window.options.__getitem__ = MagicMock( return_value = True )\n\n    vimsupport.WriteToPreviewWindow( \"test\", '' )\n\n    vim_command.assert_has_exact_calls( [\n      call( 'silent! pclose!' ),\n      call( 'silent! pedit! _TEMP_FILE_' ),\n      call( 'silent! wincmd P' ),\n      call( 'silent! wincmd p' ) ] )\n\n    vim_current.buffer.__setitem__.assert_called_with(\n        slice( None, None, None ), [ 'test' ] )\n\n    vim_current.buffer.options.__setitem__.assert_has_exact_calls( [\n      call( 'modifiable', True ),\n      call( 'readonly', False ),\n      call( 'buftype', 'nofile' ),\n      call( 'bufhidden', 'wipe' ),\n      call( 'buflisted', False ),\n      call( 'swapfile', False ),\n      call( 'modifiable', False ),\n      call( 'modified', False ),\n      call( 'readonly', True ),\n    ], any_order = True )\n\n  @patch( 'vim.command', new_callable=ExtendedMock )\n  @patch( 'vim.current', new_callable=ExtendedMock )\n  def test_WriteToPreviewWindow_Mods( self, vim_current, vim_command ):\n    vim_current.window.options.__getitem__ = MagicMock( return_value = True )\n\n    vimsupport.WriteToPreviewWindow( \"test\", 'tab leftabove' )\n\n    vim_command.assert_has_exact_calls( [\n      call( 'silent! pclose!' ),\n      call( 'silent! tab leftabove pedit! _TEMP_FILE_' ),\n      call( 'silent! wincmd P' ),\n      call( 'silent! wincmd p' ) ] )\n\n    vim_current.buffer.__setitem__.assert_called_with(\n        slice( None, None, None ), [ 'test' ] )\n\n    vim_current.buffer.options.__setitem__.assert_has_exact_calls( [\n      call( 'modifiable', True ),\n      call( 'readonly', False ),\n      call( 'buftype', 'nofile' ),\n      call( 'bufhidden', 'wipe' ),\n      call( 'buflisted', False ),\n      call( 'swapfile', False ),\n      call( 'modifiable', False ),\n      call( 'modified', False ),\n      call( 'readonly', True ),\n    ], any_order = True )\n\n\n  @patch( 'vim.current' )\n  def test_WriteToPreviewWindow_MultiLine( self, vim_current ):\n    vim_current.window.options.__getitem__ = MagicMock( return_value = True )\n    vimsupport.WriteToPreviewWindow( \"test\\ntest2\", '' )\n\n    vim_current.buffer.__setitem__.assert_called_with(\n        slice( None, None, None ), [ 'test', 'test2' ] )\n\n\n  @patch( 'vim.command', new_callable=ExtendedMock )\n  @patch( 'vim.current', new_callable=ExtendedMock )\n  def test_WriteToPreviewWindow_JumpFail( self, vim_current, vim_command ):\n    vim_current.window.options.__getitem__ = MagicMock( return_value = False )\n\n    vimsupport.WriteToPreviewWindow( \"test\", '' )\n\n    vim_command.assert_has_exact_calls( [\n      call( 'silent! pclose!' ),\n      call( 'silent! pedit! _TEMP_FILE_' ),\n      call( 'silent! wincmd P' ),\n      call( 'redraw' ),\n      call( \"echo 'test'\" ),\n    ] )\n\n    vim_current.buffer.__setitem__.assert_not_called()\n    vim_current.buffer.options.__setitem__.assert_not_called()\n\n\n  @patch( 'vim.command', new_callable=ExtendedMock )\n  @patch( 'vim.current', new_callable=ExtendedMock )\n  def test_WriteToPreviewWindow_JumpFail_MultiLine(\n      self, vim_current, vim_command ):\n\n    vim_current.window.options.__getitem__ = MagicMock( return_value = False )\n\n    vimsupport.WriteToPreviewWindow( \"test\\ntest2\", '' )\n\n    vim_command.assert_has_exact_calls( [\n      call( 'silent! pclose!' ),\n      call( 'silent! pedit! _TEMP_FILE_' ),\n      call( 'silent! wincmd P' ),\n      call( 'redraw' ),\n      call( \"echo 'test'\" ),\n      call( \"echo 'test2'\" ),\n    ] )\n\n    vim_current.buffer.__setitem__.assert_not_called()\n    vim_current.buffer.options.__setitem__.assert_not_called()\n\n\n  def test_BufferIsVisibleForFilename( self ):\n    visible_buffer = VimBuffer( 'visible_filename', number = 1 )\n    hidden_buffer = VimBuffer( 'hidden_filename', number = 2 )\n\n    with MockVimBuffers( [ visible_buffer, hidden_buffer ],\n                         [ visible_buffer ] ):\n      assert_that( vimsupport.BufferIsVisibleForFilename( 'visible_filename' ) )\n      assert_that(\n          not vimsupport.BufferIsVisibleForFilename( 'hidden_filename' ) )\n      assert_that(\n          not vimsupport.BufferIsVisibleForFilename( 'another_filename' ) )\n\n\n  def test_CloseBuffersForFilename( self ):\n    current_buffer = VimBuffer( 'some_filename', number = 2 )\n    other_buffer = VimBuffer( 'some_filename', number = 5 )\n\n    with MockVimBuffers( [ current_buffer, other_buffer ],\n                         [ current_buffer ] ) as vim:\n      vimsupport.CloseBuffersForFilename( 'some_filename' )\n\n    assert_that( vim.buffers, empty() )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  @patch( 'vim.current', new_callable = ExtendedMock )\n  def test_OpenFilename( self, vim_current, vim_command ):\n    # Options used to open a logfile.\n    options = {\n      'size': vimsupport.GetIntValue( '&previewheight' ),\n      'fix': True,\n      'focus': False,\n      'watch': True,\n      'position': 'end'\n    }\n\n    vimsupport.OpenFilename( __file__, options )\n\n    vim_command.assert_has_exact_calls( [\n      call( f'12split { __file__ }' ),\n      call( f\"exec 'au BufEnter <buffer> :silent! checktime { __file__ }'\" ),\n      call( 'silent! normal! Gzz' ),\n      call( 'silent! wincmd p' )\n    ] )\n\n    vim_current.buffer.options.__setitem__.assert_has_exact_calls( [\n      call( 'autoread', True ),\n    ] )\n\n    vim_current.window.options.__setitem__.assert_has_exact_calls( [\n      call( 'winfixheight', True )\n    ] )\n\n\n  def test_GetUnsavedAndSpecifiedBufferData_EncodedUnicodeCharsInBuffers(\n      self ):\n    filepath = os.path.realpath( 'filename' )\n    contents = [ ToBytes( 'abc' ), ToBytes( 'fДa' ) ]\n    vim_buffer = VimBuffer( filepath, contents = contents )\n\n    with patch( 'vim.buffers', [ vim_buffer ] ):\n      assert_that( vimsupport.GetUnsavedAndSpecifiedBufferData( vim_buffer,\n                                                                filepath ),\n                   has_entry( filepath,\n                              has_entry( 'contents', 'abc\\nfДa\\n' ) ) )\n\n\n  def test_GetBufferFilepath_NoBufferName_UnicodeWorkingDirectory( self ):\n    vim_buffer = VimBuffer( '', number = 42 )\n    unicode_dir = PathToTestFile( 'uni¢od€' )\n    with CurrentWorkingDirectory( unicode_dir ):\n      assert_that( vimsupport.GetBufferFilepath( vim_buffer ),\n                   equal_to( os.path.join( unicode_dir, '42' ) ) )\n\n\n  # NOTE: Vim returns byte offsets for columns, not actual character columns.\n  # This makes 'ДД' have 4 columns: column 0, column 2 and column 4.\n  @patch( 'vim.current.line', ToBytes( 'ДДaa' ) )\n  @patch( 'ycm.vimsupport.CurrentColumn', side_effect = [ 4 ] )\n  def test_TextBeforeCursor_EncodedUnicode( *args ):\n    assert_that( vimsupport.TextBeforeCursor(), equal_to( 'ДД' ) )\n\n\n  # NOTE: Vim returns byte offsets for columns, not actual character columns.\n  # This makes 'ДД' have 4 columns: column 0, column 2 and column 4.\n  @patch( 'vim.current.line', ToBytes( 'aaДД' ) )\n  @patch( 'ycm.vimsupport.CurrentColumn', side_effect = [ 2 ] )\n  def test_TextAfterCursor_EncodedUnicode( *args ):\n    assert_that( vimsupport.TextAfterCursor(), equal_to( 'ДД' ) )\n\n\n  @patch( 'vim.current.line', ToBytes( 'fДa' ) )\n  def test_CurrentLineContents_EncodedUnicode( *args ):\n    assert_that( vimsupport.CurrentLineContents(), equal_to( 'fДa' ) )\n\n\n  @patch( 'vim.eval', side_effect = lambda x: x )\n  def test_VimExpressionToPythonType_IntAsUnicode( *args ):\n    assert_that( vimsupport.VimExpressionToPythonType( '123' ),\n                 equal_to( 123 ) )\n\n\n  @patch( 'vim.eval', side_effect = lambda x: x )\n  def test_VimExpressionToPythonType_IntAsBytes( *args ):\n    assert_that( vimsupport.VimExpressionToPythonType( ToBytes( '123' ) ),\n                 equal_to( 123 ) )\n\n\n  @patch( 'vim.eval', side_effect = lambda x: x )\n  def test_VimExpressionToPythonType_StringAsUnicode( *args ):\n    assert_that( vimsupport.VimExpressionToPythonType( 'foo' ),\n                 equal_to( 'foo' ) )\n\n\n  @patch( 'vim.eval', side_effect = lambda x: x )\n  def test_VimExpressionToPythonType_StringAsBytes( *args ):\n    assert_that( vimsupport.VimExpressionToPythonType( ToBytes( 'foo' ) ),\n                 equal_to( 'foo' ) )\n\n\n  @patch( 'vim.eval', side_effect = lambda x: x )\n  def test_VimExpressionToPythonType_ListPassthrough( *args ):\n    assert_that( vimsupport.VimExpressionToPythonType( [ 1, 2 ] ),\n                 equal_to( [ 1, 2 ] ) )\n\n\n  @patch( 'vim.eval', side_effect = lambda x: x )\n  def test_VimExpressionToPythonType_ObjectPassthrough( *args ):\n    assert_that( vimsupport.VimExpressionToPythonType( { 1: 2 } ),\n                 equal_to( { 1: 2 } ) )\n\n\n  @patch( 'vim.eval', side_effect = lambda x: x )\n  def test_VimExpressionToPythonType_GeneratorPassthrough( *args ):\n    gen = ( x**2 for x in [ 1, 2, 3 ] )\n    assert_that( vimsupport.VimExpressionToPythonType( gen ), equal_to( gen ) )\n\n\n  @patch( 'vim.eval',\n          new_callable = ExtendedMock,\n          side_effect = [ None, 2, None ] )\n  def test_SelectFromList_LastItem( self, vim_eval ):\n    assert_that( vimsupport.SelectFromList( 'test', [ 'a', 'b' ] ),\n                 equal_to( 1 ) )\n\n    vim_eval.assert_has_exact_calls( [\n      call( 'inputsave()' ),\n      call( 'inputlist( [\"test\", \"1: a\", \"2: b\"] )' ),\n      call( 'inputrestore()' )\n    ] )\n\n\n  @patch( 'vim.eval',\n          new_callable = ExtendedMock,\n          side_effect = [ None, 1, None ] )\n  def test_SelectFromList_FirstItem( self, vim_eval ):\n    assert_that( vimsupport.SelectFromList( 'test', [ 'a', 'b' ] ),\n                 equal_to( 0 ) )\n\n    vim_eval.assert_has_exact_calls( [\n      call( 'inputsave()' ),\n      call( 'inputlist( [\"test\", \"1: a\", \"2: b\"] )' ),\n      call( 'inputrestore()' )\n    ] )\n\n\n  @patch( 'vim.eval', side_effect = [ None, 3, None ] )\n  def test_SelectFromList_OutOfRange( self, vim_eval ):\n    assert_that( calling( vimsupport.SelectFromList ).with_args( 'test',\n                                                                 [ 'a', 'b' ] ),\n                 raises( RuntimeError, vimsupport.NO_SELECTION_MADE_MSG ) )\n\n\n  @patch( 'vim.eval', side_effect = [ None, 0, None ] )\n  def test_SelectFromList_SelectPrompt( self, vim_eval ):\n    assert_that( calling( vimsupport.SelectFromList ).with_args( 'test',\n                                                               [ 'a', 'b' ] ),\n                 raises( RuntimeError, vimsupport.NO_SELECTION_MADE_MSG ) )\n\n\n  @patch( 'vim.eval', side_effect = [ None, -199, None ] )\n  def test_SelectFromList_Negative( self, vim_eval ):\n    assert_that( calling( vimsupport.SelectFromList ).with_args( 'test',\n                                                                 [ 'a', 'b' ] ),\n                 raises( RuntimeError, vimsupport.NO_SELECTION_MADE_MSG ) )\n\n\n  def test_Filetypes_IntegerFiletype( self ):\n    current_buffer = VimBuffer( 'buffer', number = 1, filetype = '42' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      assert_that( vimsupport.CurrentFiletypes(), contains_exactly( '42' ) )\n      assert_that( vimsupport.GetBufferFiletypes( 1 ),\n                   contains_exactly( '42' ) )\n      assert_that( vimsupport.FiletypesForBuffer( current_buffer ),\n                   contains_exactly( '42' ) )\n\n\n  @patch( 'ycm.vimsupport.VariableExists', return_value = False )\n  @patch( 'ycm.vimsupport.SearchInCurrentBuffer', return_value = 0 )\n  @patch( 'vim.current' )\n  def test_InsertNamespace_insert( self, vim_current, *args ):\n    contents = [ '',\n                 'namespace Taqueria {',\n                 '',\n                 '  int taco = Math' ]\n    vim_current.buffer = VimBuffer( '', contents = contents )\n    vim_current.window.cursor = ( 1, 1 )\n\n    vimsupport.InsertNamespace( 'System' )\n\n    expected_buffer = [ 'using System;',\n                        '',\n                        'namespace Taqueria {',\n                        '',\n                        '  int taco = Math' ]\n    AssertBuffersAreEqualAsBytes( expected_buffer, vim_current.buffer )\n\n\n  @patch( 'ycm.vimsupport.VariableExists', return_value = False )\n  @patch( 'ycm.vimsupport.SearchInCurrentBuffer', return_value = 2 )\n  @patch( 'vim.current' )\n  def test_InsertNamespace_append( self, vim_current, *args ):\n    contents = [ 'namespace Taqueria {',\n                 '  using System;',\n                 '',\n                 '  class Tasty {',\n                 '    int taco;',\n                 '    List salad = new List' ]\n    vim_current.buffer = VimBuffer( '', contents = contents )\n    vim_current.window.cursor = ( 1, 1 )\n\n    vimsupport.InsertNamespace( 'System.Collections' )\n\n    expected_buffer = [ 'namespace Taqueria {',\n                        '  using System;',\n                        '  using System.Collections;',\n                        '',\n                        '  class Tasty {',\n                        '    int taco;',\n                        '    List salad = new List' ]\n    AssertBuffersAreEqualAsBytes( expected_buffer, vim_current.buffer )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_SameFile_SameBuffer_NoSwapFile( self, vim_command ):\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vimsupport.JumpToLocation( os.path.realpath( 'uni¢𐍈d€' ),\n                                 2,\n                                 5,\n                                 'aboveleft',\n                                 'same-buffer' )\n\n      assert_that( vim.current.window.cursor, equal_to( ( 2, 4 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( 'normal! zv' ),\n        call( 'normal! zz' )\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_SameBuffer_Unmodified(\n      self, vim_command ):\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n\n      vimsupport.JumpToLocation( target_name,\n                                 2,\n                                 5,\n                                 'belowright',\n                                 'same-buffer' )\n\n      assert_that( vim.current.window.cursor, equal_to( ( 2, 4 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps belowright edit { target_name }' ),\n        call( 'normal! zv' ),\n        call( 'normal! zz' )\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_SameFile_NoLineCol( self, vim_command ):\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vim.current.window.cursor = ( 99, 99 )\n\n      target_name = os.path.realpath( 'uni¢𐍈d€' )\n      vimsupport.JumpToLocation( target_name,\n                                 None,\n                                 None,\n                                 'belowright',\n                                 'same-buffer' )\n\n      assert_that( vim.current.window.cursor, equal_to( ( 99, 99 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_SameFile_NoLine( self, vim_command ):\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vim.current.window.cursor = ( 99, 99 )\n\n      target_name = os.path.realpath( 'uni¢𐍈d€' )\n      vimsupport.JumpToLocation( target_name,\n                                 None,\n                                 1,\n                                 'belowright',\n                                 'same-buffer' )\n\n      assert_that( vim.current.window.cursor, equal_to( ( 99, 99 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_SameFile_NoCol( self, vim_command ):\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vim.current.window.cursor = ( 99, 99 )\n\n      target_name = os.path.realpath( 'uni¢𐍈d€' )\n      vimsupport.JumpToLocation( target_name,\n                                 1,\n                                 None,\n                                 'belowright',\n                                 'same-buffer' )\n\n      assert_that( vim.current.window.cursor, equal_to( ( 99, 99 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_NoLineCol( self, vim_command ):\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vim.current.window.cursor = ( 99, 99 )\n\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n      vimsupport.JumpToLocation( target_name,\n                                 None,\n                                 None,\n                                 'belowright',\n                                 'same-buffer' )\n\n      assert_that( vim.current.window.cursor, equal_to( ( 99, 99 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps belowright edit { target_name }' ),\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_NoLine( self, vim_command ):\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vim.current.window.cursor = ( 99, 99 )\n\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n      vimsupport.JumpToLocation( target_name,\n                                 None,\n                                 1,\n                                 'belowright',\n                                 'same-buffer' )\n\n      assert_that( vim.current.window.cursor, equal_to( ( 99, 99 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps belowright edit { target_name }' ),\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_NoCol( self, vim_command ):\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vim.current.window.cursor = ( 99, 99 )\n\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n      vimsupport.JumpToLocation( target_name,\n                                 1,\n                                 None,\n                                 'belowright',\n                                 'same-buffer' )\n\n      assert_that( vim.current.window.cursor, equal_to( ( 99, 99 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps belowright edit { target_name }' ),\n      ] )\n\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_SameBuffer_Modified_CannotHide(\n      self, vim_command ):\n\n    current_buffer = VimBuffer( 'uni¢𐍈d€', modified = True )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n\n      vimsupport.JumpToLocation( target_name, 2, 5, 'botright', 'same-buffer' )\n\n      assert_that( vim.current.window.cursor, equal_to( ( 2, 4 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps botright split { target_name }' ),\n        call( 'normal! zv' ),\n        call( 'normal! zz' )\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_SameBuffer_Modified_CanHide(\n      self, vim_command ):\n\n    current_buffer = VimBuffer( 'uni¢𐍈d€', modified = True, bufhidden = \"hide\" )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n\n      vimsupport.JumpToLocation( target_name, 2, 5, 'leftabove', 'same-buffer' )\n\n      assert_that( vim.current.window.cursor, equal_to( ( 2, 4 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps leftabove edit { target_name }' ),\n        call( 'normal! zv' ),\n        call( 'normal! zz' )\n      ] )\n\n\n  @patch( 'vim.command',\n          side_effect = [ None, VimError( 'Unknown code' ), None ] )\n  def test_JumpToLocation_DifferentFile_SameBuffer_SwapFile_Unexpected(\n      self, vim_command ):\n\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      assert_that(\n        calling( vimsupport.JumpToLocation ).with_args(\n          os.path.realpath( 'different_uni¢𐍈d€' ),\n          2,\n          5,\n          'rightbelow',\n          'same-buffer' ),\n        raises( VimError, 'Unknown code' )\n      )\n\n\n  @patch( 'vim.command',\n          new_callable = ExtendedMock,\n          side_effect = [ None, VimError( 'E325' ), None ] )\n  def test_JumpToLocation_DifferentFile_SameBuffer_SwapFile_Quit(\n      self, vim_command ):\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n\n      vimsupport.JumpToLocation( target_name, 2, 5, 'topleft', 'same-buffer' )\n\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps topleft edit { target_name }' )\n      ] )\n\n\n  @patch( 'vim.command',\n          new_callable = ExtendedMock,\n          side_effect = [ None, KeyboardInterrupt, None ] )\n  def test_JumpToLocation_DifferentFile_SameBuffer_SwapFile_Abort(\n      self, vim_command ):\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n\n      vimsupport.JumpToLocation( target_name, 2, 5, 'vertical', 'same-buffer' )\n\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps vertical edit { target_name }' )\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_Split_CurrentTab_NotAlreadyOpened(\n      self, vim_command ):\n\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    current_window = MagicMock( buffer = current_buffer )\n    current_tab = MagicMock( windows = [ current_window ] )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ) as vim:\n      vim.current.tabpage = current_tab\n\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n\n      vimsupport.JumpToLocation( target_name,\n                                 2,\n                                 5,\n                                 'aboveleft',\n                                 'split-or-existing-window' )\n\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps aboveleft split { target_name }' ),\n        call( 'normal! zv' ),\n        call( 'normal! zz' )\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_Split_CurrentTab_AlreadyOpened(\n      self, vim_command ):\n\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    different_buffer = VimBuffer( 'different_uni¢𐍈d€' )\n    current_window = MagicMock( buffer = current_buffer )\n    different_window = MagicMock( buffer = different_buffer )\n    current_tab = MagicMock( windows = [ current_window, different_window ] )\n    with MockVimBuffers( [ current_buffer, different_buffer ],\n                         [ current_buffer ] ) as vim:\n      vim.current.tabpage = current_tab\n\n      vimsupport.JumpToLocation( os.path.realpath( 'different_uni¢𐍈d€' ),\n                                 2,\n                                 5,\n                                 'belowright',\n                                 'split-or-existing-window' )\n\n      assert_that( vim.current.tabpage, equal_to( current_tab ) )\n      assert_that( vim.current.window, equal_to( different_window ) )\n      assert_that( vim.current.window.cursor, equal_to( ( 2, 4 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( 'normal! zv' ),\n        call( 'normal! zz' )\n      ] )\n\n\n  @WindowsAndMacOnly\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_Split_CurrentTab_AlreadyOpened_Case(\n      self, vim_command ):\n\n    current_buffer = VimBuffer( 'current_buffer' )\n    different_buffer = VimBuffer( 'AnotHer_buFfeR' )\n    current_window = MagicMock( buffer = current_buffer )\n    different_window = MagicMock( buffer = different_buffer )\n    current_tab = MagicMock( windows = [ current_window, different_window ] )\n    with MockVimBuffers( [ current_buffer, different_buffer ],\n                         [ current_buffer ] ) as vim:\n      vim.current.tabpage = current_tab\n\n      vimsupport.JumpToLocation( os.path.realpath( 'anOther_BuffEr' ),\n                                 4,\n                                 1,\n                                 'belowright',\n                                 'split-or-existing-window' )\n\n      assert_that( vim.current.tabpage, equal_to( current_tab ) )\n      assert_that( vim.current.window, equal_to( different_window ) )\n      assert_that( vim.current.window.cursor, equal_to( ( 4, 0 ) ) )\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( 'normal! zv' ),\n        call( 'normal! zz' )\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_Split_AllTabs_NotAlreadyOpened(\n      self, vim_command ):\n\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n\n      vimsupport.JumpToLocation( target_name,\n                                 2,\n                                 5,\n                                 'tab',\n                                 'split-or-existing-window' )\n\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps tab split { target_name }' ),\n        call( 'normal! zv' ),\n        call( 'normal! zz' )\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_Split_AllTabs_AlreadyOpened(\n      self, vim_command ):\n\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    different_buffer = VimBuffer( 'different_uni¢𐍈d€' )\n    current_window = MagicMock( buffer = current_buffer )\n    different_window = MagicMock( buffer = different_buffer )\n    current_tab = MagicMock( windows = [ current_window, different_window ] )\n    with MockVimBuffers( [ current_buffer, different_buffer ],\n                         [ current_buffer ] ) as vim:\n      with patch( 'vim.tabpages', [ current_tab ] ):\n        vimsupport.JumpToLocation( os.path.realpath( 'different_uni¢𐍈d€' ),\n                                   2,\n                                   5,\n                                   'tab',\n                                   'split-or-existing-window' )\n\n        assert_that( vim.current.tabpage, equal_to( current_tab ) )\n        assert_that( vim.current.window, equal_to( different_window ) )\n        assert_that( vim.current.window.cursor, equal_to( ( 2, 4 ) ) )\n        vim_command.assert_has_exact_calls( [\n          call( 'normal! m\\'' ),\n          call( 'normal! zv' ),\n          call( 'normal! zz' )\n        ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_NewOrExistingTab_NotAlreadyOpened(\n      self, vim_command ):\n\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      target_name = os.path.realpath( 'different_uni¢𐍈d€' )\n\n      vimsupport.JumpToLocation( target_name,\n                                 2,\n                                 5,\n                                 'aboveleft vertical',\n                                 'new-or-existing-tab' )\n\n      vim_command.assert_has_exact_calls( [\n        call( 'normal! m\\'' ),\n        call( f'keepjumps aboveleft vertical tabedit { target_name }' ),\n        call( 'normal! zv' ),\n        call( 'normal! zz' )\n      ] )\n\n\n  @patch( 'vim.command', new_callable = ExtendedMock )\n  def test_JumpToLocation_DifferentFile_NewOrExistingTab_AlreadyOpened(\n      self, vim_command ):\n\n    current_buffer = VimBuffer( 'uni¢𐍈d€' )\n    different_buffer = VimBuffer( 'different_uni¢𐍈d€' )\n    current_window = MagicMock( buffer = current_buffer )\n    different_window = MagicMock( buffer = different_buffer )\n    current_tab = MagicMock( windows = [ current_window, different_window ] )\n    with MockVimBuffers( [ current_buffer, different_buffer ],\n                         [ current_buffer ] ) as vim:\n      with patch( 'vim.tabpages', [ current_tab ] ):\n        vimsupport.JumpToLocation( os.path.realpath( 'different_uni¢𐍈d€' ),\n                                   2,\n                                   5,\n                                   'belowright tab',\n                                   'new-or-existing-tab' )\n\n        assert_that( vim.current.tabpage, equal_to( current_tab ) )\n        assert_that( vim.current.window, equal_to( different_window ) )\n        assert_that( vim.current.window.cursor, equal_to( ( 2, 4 ) ) )\n        vim_command.assert_has_exact_calls( [\n          call( 'normal! m\\'' ),\n          call( 'normal! zv' ),\n          call( 'normal! zz' )\n        ] )\n\n\n  @patch( 'ycm.tests.test_utils.VIM_VERSION', Version( 7, 4, 1578 ) )\n  def test_VimVersionAtLeast( self ):\n    assert_that( vimsupport.VimVersionAtLeast( '7.3.414' ) )\n    assert_that( vimsupport.VimVersionAtLeast( '7.4.1578' ) )\n    assert_that( not vimsupport.VimVersionAtLeast( '7.4.1579' ) )\n    assert_that( not vimsupport.VimVersionAtLeast( '7.4.1898' ) )\n    assert_that( not vimsupport.VimVersionAtLeast( '8.1.278' ) )\n"
  },
  {
    "path": "python/ycm/tests/youcompleteme_test.py",
    "content": "# Copyright (C) 2016-2018 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nfrom ycm.client.messages_request import MessagesPoll\nfrom ycm.tests.test_utils import ( ExtendedMock,\n                                   MockVimBuffers,\n                                   MockVimModule,\n                                   Version,\n                                   VimBuffer,\n                                   VimProp,\n                                   VimSign )\nMockVimModule()\n\nimport vim\n\nimport os\nimport sys\nfrom hamcrest import ( assert_that, contains_exactly, empty, equal_to,\n                       has_entries, is_in, is_not, matches_regexp )\nfrom unittest.mock import call, MagicMock, patch\nfrom unittest import TestCase\n\nfrom ycm.paths import _PathToPythonUsedDuringBuild\nfrom ycm.vimsupport import SetVariableValue\nfrom ycm.tests import ( StopServer,\n                        test_utils,\n                        UserOptions,\n                        WaitUntilReady,\n                        YouCompleteMeInstance )\nfrom ycm.client.base_request import _LoadExtraConfFile\nfrom ycm.youcompleteme import YouCompleteMe\nfrom ycmd.responses import ServerError\nfrom ycm.tests.mock_utils import ( MockAsyncServerResponseDone,\n                                   MockAsyncServerResponseInProgress,\n                                   MockAsyncServerResponseException )\n\n\ndef RunNotifyUserIfServerCrashed( ycm, post_vim_message, test ):\n  StopServer( ycm )\n\n  ycm._logger = MagicMock( autospec = True )\n  ycm._server_popen = MagicMock( autospec = True )\n  ycm._server_popen.poll.return_value = test[ 'return_code' ]\n\n  ycm.OnFileReadyToParse()\n\n  assert_that( ycm._logger.error.call_args[ 0 ][ 0 ],\n               test[ 'expected_message' ] )\n  assert_that( post_vim_message.call_args[ 0 ][ 0 ],\n               test[ 'expected_message' ] )\n\n\ndef YouCompleteMe_UpdateDiagnosticInterface( ycm, post_vim_message, *args ):\n\n  contents = \"\\nint main() { int x, y; x == y }\"\n\n  # List of diagnostics returned by ycmd for the above code.\n  diagnostics = [ {\n    'kind': 'ERROR',\n    'text': \"expected ';' after expression (fix available) \"\n    \"[expected_semi_after_expr]\",\n    'location': {\n      'filepath': 'buffer',\n      'line_num': 2,\n      'column_num': 31\n    },\n    'location_extent': {\n      'start': {\n        'filepath': 'buffer',\n        'line_num': 2,\n        'column_num': 31,\n      },\n      'end': {\n        'filepath': 'buffer',\n        'line_num': 2,\n        'column_num': 32,\n      }\n    },\n    'ranges': [ {\n      'start': {\n        'line_num': 2,\n        'column_num': 31,\n        'filepath': 'buffer'\n      },\n      'end': {\n        'line_num': 2,\n        'column_num': 31,\n        'filepath': 'buffer'\n      }\n    } ],\n    'fixit_available': False\n  }, {\n    'kind': 'WARNING',\n    'text': 'equality comparison result unused',\n    'location': {\n      'filepath': 'buffer',\n      'line_num': 2,\n      'column_num': 31,\n    },\n    'location_extent': {\n      'start': {\n        'filepath': 'buffer',\n        'line_num': 2,\n        'column_num': 31,\n      },\n      'end': {\n        'filepath': 'buffer',\n        'line_num': 2,\n        'column_num': 32,\n      }\n    },\n    'ranges': [ {\n      'start': {\n        'filepath': 'buffer',\n        'line_num': 2,\n        'column_num': 24,\n      },\n      'end': {\n        'filepath': 'buffer',\n        'line_num': 2,\n        'column_num': 30,\n      }\n    } ],\n    'fixit_available': False\n  } ]\n\n  current_buffer = VimBuffer( 'buffer',\n                              filetype = 'c',\n                              contents = contents.splitlines(),\n                              number = 5 )\n\n  test_utils.VIM_SIGNS = []\n  with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 2, 1 ) ):\n    with patch( 'ycm.client.event_notification.EventNotification.Response',\n                return_value = diagnostics ):\n      ycm.OnFileReadyToParse()\n      ycm.HandleFileParseRequest( block = True )\n    # The error on the current line is echoed, not the warning.\n    post_vim_message.assert_called_once_with(\n      \"expected ';' after expression (fix available) \"\n      \"[expected_semi_after_expr]\",\n      truncate = True, warning = False )\n\n    # Error match is added after warning matches.\n    assert_that(\n      test_utils.VIM_PROPS_FOR_BUFFER,\n      has_entries( {\n        current_buffer.number: contains_exactly(\n          VimProp( 'YcmWarningProperty', 2, 31, 2, 32 ),\n          VimProp( 'YcmWarningProperty', 2, 24, 2, 30 ),\n          VimProp( 'YcmErrorProperty', 2, 31, 2, 32 ),\n          VimProp( 'YcmErrorProperty', 2, 31, 2, 31 ),\n        )\n      } )\n    )\n\n    # Only the error sign is placed.\n    assert_that(\n      test_utils.VIM_SIGNS,\n      contains_exactly(\n        VimSign( 2, 'YcmError', 5 )\n      )\n    )\n\n  # The error is not echoed again when moving the cursor along the line.\n  with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 2, 2 ) ):\n    post_vim_message.reset_mock()\n    ycm.OnCursorMoved()\n    post_vim_message.assert_not_called()\n\n  # The error is cleared when moving the cursor to another line.\n  with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 2 ) ):\n    post_vim_message.reset_mock()\n    ycm.OnCursorMoved()\n    post_vim_message.assert_called_once_with( \"\", warning = False )\n\n  # The error is echoed when moving the cursor back.\n  with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 2, 2 ) ):\n    post_vim_message.reset_mock()\n    ycm.OnCursorMoved()\n    post_vim_message.assert_called_once_with(\n      \"expected ';' after expression (fix available) \"\n      \"[expected_semi_after_expr]\",\n      truncate = True, warning = False )\n\n    with patch( 'ycm.client.event_notification.EventNotification.Response',\n                return_value = diagnostics[ 1 : ] ):\n      ycm.OnFileReadyToParse()\n      ycm.HandleFileParseRequest( block = True )\n\n    assert_that(\n      test_utils.VIM_PROPS_FOR_BUFFER,\n      has_entries( {\n        current_buffer.number: contains_exactly(\n          VimProp( 'YcmWarningProperty', 2, 31, 2, 32 ),\n          VimProp( 'YcmWarningProperty', 2, 24, 2, 30 )\n        )\n      } )\n    )\n\n    assert_that(\n      test_utils.VIM_SIGNS,\n      contains_exactly(\n        VimSign( 2, 'YcmWarning', 5 )\n      )\n    )\n\n\nclass YouCompleteMeTest( TestCase ):\n  @YouCompleteMeInstance()\n  def test_YouCompleteMe_YcmCoreNotImported( self, ycm ):\n    assert_that( 'ycm_core', is_not( is_in( sys.modules ) ) )\n\n\n  @patch( 'ycm.vimsupport.PostVimMessage' )\n  def test_YouCompleteMe_InvalidPythonInterpreterPath( self, post_vim_message ):\n    with UserOptions( {\n      'g:ycm_server_python_interpreter': '/invalid/python/path' } ):\n      try:\n        ycm = YouCompleteMe()\n\n        assert_that( ycm.IsServerAlive(), equal_to( False ) )\n        post_vim_message.assert_called_once_with(\n          \"Unable to start the ycmd server. \"\n          \"Path in 'g:ycm_server_python_interpreter' option does not point \"\n          \"to a valid Python 3.6+. \"\n          \"Correct the error then restart the server with \"\n          \"':YcmRestartServer'.\" )\n\n        post_vim_message.reset_mock()\n\n        SetVariableValue( 'g:ycm_server_python_interpreter',\n                          _PathToPythonUsedDuringBuild() )\n        ycm.RestartServer()\n\n        assert_that( ycm.IsServerAlive(), equal_to( True ) )\n        post_vim_message.assert_called_once_with( 'Restarting ycmd server...' )\n      finally:\n        WaitUntilReady()\n        StopServer( ycm )\n\n\n  @patch( 'ycmd.utils.PathToFirstExistingExecutable', return_value = None )\n  @patch( 'ycm.paths._EndsWithPython', return_value = False )\n  @patch( 'ycm.vimsupport.PostVimMessage' )\n  def test_YouCompleteMe_NoPythonInterpreterFound(\n      self, post_vim_message, *args ):\n    with UserOptions( {} ):\n      try:\n        with patch( 'ycmd.utils.ReadFile', side_effect = IOError ):\n          ycm = YouCompleteMe()\n\n        assert_that( ycm.IsServerAlive(), equal_to( False ) )\n        post_vim_message.assert_called_once_with(\n          \"Unable to start the ycmd server. Cannot find Python 3.6+. \"\n          \"Set the 'g:ycm_server_python_interpreter' option to a Python \"\n          \"interpreter path. \"\n          \"Correct the error then restart the server with \"\n          \"':YcmRestartServer'.\" )\n\n        post_vim_message.reset_mock()\n\n        SetVariableValue( 'g:ycm_server_python_interpreter',\n                          _PathToPythonUsedDuringBuild() )\n        ycm.RestartServer()\n\n        assert_that( ycm.IsServerAlive(), equal_to( True ) )\n        post_vim_message.assert_called_once_with( 'Restarting ycmd server...' )\n      finally:\n        WaitUntilReady()\n        StopServer( ycm )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_NotifyUserIfServerCrashed_UnexpectedCore(\n      self, ycm, post_vim_message ):\n    message = (\n      \"The ycmd server SHUT DOWN \\\\(restart with ':YcmRestartServer'\\\\). \"\n      \"Unexpected error while loading the YCM core library. Type \"\n      \"':YcmToggleLogs ycmd_\\\\d+_stderr_.+.log' to check the logs.\" )\n    RunNotifyUserIfServerCrashed( ycm, post_vim_message, {\n      'return_code': 3,\n      'expected_message': matches_regexp( message )\n    } )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_NotifyUserIfServerCrashed_MissingCore(\n      self, ycm, post_vim_message ):\n    message = ( \"The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). \"\n                \"YCM core library not detected; you need to compile YCM before \"\n                \"using it. Follow the instructions in the documentation.\" )\n    RunNotifyUserIfServerCrashed( ycm, post_vim_message, {\n      'return_code': 4,\n      'expected_message': equal_to( message )\n    } )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_NotifyUserIfServerCrashed_OutdatedCore(\n      self, ycm, post_vim_message ):\n    message = ( \"The ycmd server SHUT DOWN (restart with ':YcmRestartServer'). \"\n                \"YCM core library too old; PLEASE RECOMPILE by running the \"\n                \"install.py script. See the documentation for more details.\" )\n    RunNotifyUserIfServerCrashed( ycm, post_vim_message, {\n      'return_code': 7,\n      'expected_message': equal_to( message )\n    } )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_NotifyUserIfServerCrashed_UnexpectedExitCode(\n      self, ycm, post_vim_message ):\n    message = (\n      \"The ycmd server SHUT DOWN \\\\(restart with ':YcmRestartServer'\\\\). \"\n      \"Unexpected exit code 1. Type \"\n      \"':YcmToggleLogs ycmd_\\\\d+_stderr_.+.log' to check the logs.\" )\n    RunNotifyUserIfServerCrashed( ycm, post_vim_message, {\n      'return_code': 1,\n      'expected_message': matches_regexp( message )\n    } )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_extra_conf_vim_data': [ 'tempname()' ] } )\n  @patch( 'ycm.vimsupport.VimSupportsPopupWindows', return_value=True )\n  def test_YouCompleteMe_DebugInfo_ServerRunning( self, ycm, *args ):\n    dir_of_script = os.path.dirname( os.path.abspath( __file__ ) )\n    buf_name = os.path.join( dir_of_script, 'testdata', 'test.cpp' )\n    extra_conf = os.path.join( dir_of_script, 'testdata', '.ycm_extra_conf.py' )\n    _LoadExtraConfFile( extra_conf )\n\n    current_buffer = VimBuffer( buf_name, filetype = 'cpp' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      assert_that(\n        ycm.DebugInfo(),\n        matches_regexp(\n          'Client logfile: .+\\n'\n          'Server Python interpreter: .+\\n'\n          'Server Python version: .+\\n'\n          'Server has Clang support compiled in: (False|True)\\n'\n          'Clang version: .+\\n'\n          'Extra configuration file found and loaded\\n'\n          'Extra configuration path: .*testdata[/\\\\\\\\]\\\\.ycm_extra_conf\\\\.py\\n'\n          '[\\\\w\\\\W]*'\n          'Server running at: .+\\n'\n          'Server process ID: \\\\d+\\n'\n          'Server logfiles:\\n'\n          '  .+\\n'\n          '  .+' )\n      )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.VimSupportsPopupWindows', return_value=True )\n  def test_YouCompleteMe_DebugInfo_ServerNotRunning( self, ycm, *args ):\n    StopServer( ycm )\n\n    current_buffer = VimBuffer( 'current_buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      assert_that(\n        ycm.DebugInfo(),\n        matches_regexp(\n          'Client logfile: .+\\n'\n          'Server errored, no debug info from server\\n'\n          'Server running at: .+\\n'\n          'Server process ID: \\\\d+\\n'\n          'Server logfiles:\\n'\n          '  .+\\n'\n          '  .+' )\n      )\n\n\n  @YouCompleteMeInstance()\n  def test_YouCompleteMe_OnVimLeave_RemoveClientLogfileByDefault( self, ycm ):\n    client_logfile = ycm._client_logfile\n    assert_that( os.path.isfile( client_logfile ),\n                 f'Logfile { client_logfile } does not exist.' )\n    ycm.OnVimLeave()\n    assert_that( not os.path.isfile( client_logfile ),\n                 f'Logfile { client_logfile } was not removed.' )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_keep_logfiles': 1 } )\n  def test_YouCompleteMe_OnVimLeave_KeepClientLogfile( self, ycm ):\n    client_logfile = ycm._client_logfile\n    assert_that( os.path.isfile( client_logfile ),\n                 f'Logfile { client_logfile } does not exist.' )\n    ycm.OnVimLeave()\n    assert_that( os.path.isfile( client_logfile ),\n                 f'Logfile { client_logfile } was removed.' )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.CloseBuffersForFilename',\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.OpenFilename', new_callable = ExtendedMock )\n  def test_YouCompleteMe_ToggleLogs_WithParameters(\n      self, ycm, open_filename, close_buffers_for_filename ):\n    logfile_buffer = VimBuffer( ycm._client_logfile )\n    with MockVimBuffers( [ logfile_buffer ], [ logfile_buffer ] ):\n      ycm.ToggleLogs( 90,\n                      'botright vertical',\n                      os.path.basename( ycm._client_logfile ),\n                      'nonexisting_logfile',\n                      os.path.basename( ycm._server_stdout ) )\n\n      open_filename.assert_has_exact_calls( [\n        call( ycm._server_stdout, { 'size': 90,\n                                    'watch': True,\n                                    'fix': True,\n                                    'focus': False,\n                                    'position': 'end',\n                                    'mods': 'botright vertical' } )\n      ] )\n      close_buffers_for_filename.assert_has_exact_calls( [\n        call( ycm._client_logfile )\n      ] )\n\n\n  @YouCompleteMeInstance()\n  # Select the second item of the list which is the ycmd stderr logfile.\n  @patch( 'ycm.vimsupport.SelectFromList', return_value = 1 )\n  @patch( 'ycm.vimsupport.OpenFilename', new_callable = ExtendedMock )\n  def test_YouCompleteMe_ToggleLogs_WithoutParameters_SelectLogfileNotAlreadyOpen( # noqa\n    self, ycm, open_filename, *args ):\n\n    current_buffer = VimBuffer( 'current_buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      ycm.ToggleLogs( 0, '' )\n\n    open_filename.assert_has_exact_calls( [\n      call( ycm._server_stderr, { 'size': 12,\n                                  'watch': True,\n                                  'fix': True,\n                                  'focus': False,\n                                  'position': 'end',\n                                  'mods': '' } )\n    ] )\n\n\n  @YouCompleteMeInstance()\n  # Select the third item of the list which is the ycmd stdout logfile.\n  @patch( 'ycm.vimsupport.SelectFromList', return_value = 2 )\n  @patch( 'ycm.vimsupport.CloseBuffersForFilename',\n          new_callable = ExtendedMock )\n  def test_YouCompleteMe_ToggleLogs_WithoutParameters_SelectLogfileAlreadyOpen(\n    self, ycm, close_buffers_for_filename, *args ):\n\n    logfile_buffer = VimBuffer( ycm._server_stdout )\n    with MockVimBuffers( [ logfile_buffer ], [ logfile_buffer ] ):\n      ycm.ToggleLogs( 0, '' )\n\n    close_buffers_for_filename.assert_has_exact_calls( [\n      call( ycm._server_stdout )\n    ] )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.SelectFromList',\n          side_effect = RuntimeError( 'Error message' ) )\n  @patch( 'ycm.vimsupport.PostVimMessage' )\n  def test_YouCompleteMe_ToggleLogs_WithoutParameters_NoSelection(\n    self, ycm, post_vim_message, *args ):\n\n    current_buffer = VimBuffer( 'current_buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      ycm.ToggleLogs( 0, '' )\n\n    assert_that(\n      # Argument passed to PostVimMessage.\n      post_vim_message.call_args[ 0 ][ 0 ],\n      equal_to( 'Error message' )\n    )\n\n\n  @YouCompleteMeInstance()\n  def test_YouCompleteMe_GetDefinedSubcommands_ListFromServer( self, ycm ):\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.client.base_request._JsonFromFuture',\n                  return_value = [ 'SomeCommand', 'AnotherCommand' ] ):\n        assert_that(\n          ycm.GetDefinedSubcommands(),\n          contains_exactly(\n            'SomeCommand',\n            'AnotherCommand'\n          )\n        )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.client.base_request._logger', autospec = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_GetDefinedSubcommands_ErrorFromServer(\n      self, ycm, post_vim_message, logger ):\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.client.base_request._JsonFromFuture',\n                  side_effect = ServerError( 'Server error' ) ):\n        result = ycm.GetDefinedSubcommands()\n\n    logger.exception.assert_called_with(\n        'Error while handling server response' )\n    post_vim_message.assert_has_exact_calls( [\n      call( 'Server error', truncate = False )\n    ] )\n    assert_that( result, empty() )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_ShowDetailedDiagnostic_MessageFromServer(\n    self, ycm, post_vim_message ):\n\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.client.base_request._JsonFromFuture',\n                  return_value = { 'message': 'some_detailed_diagnostic' } ):\n        ycm.ShowDetailedDiagnostic( False ),\n\n    post_vim_message.assert_has_exact_calls( [\n      call( 'some_detailed_diagnostic', warning = False )\n    ] )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_ShowDetailedDiagnostic_Exception(\n    self, ycm, post_vim_message ):\n\n    current_buffer = VimBuffer( 'buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.client.base_request._JsonFromFuture',\n                  side_effect = RuntimeError( 'Some exception' ) ):\n        ycm.ShowDetailedDiagnostic( False ),\n\n    post_vim_message.assert_has_exact_calls( [\n      call( 'Some exception', truncate = False )\n    ] )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_ShowDiagnostics_FiletypeNotSupported(\n    self, ycm, post_vim_message ):\n\n    current_buffer = VimBuffer( 'buffer', filetype = 'not_supported' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      ycm.ShowDiagnostics()\n\n    post_vim_message.assert_called_once_with(\n      'Native filetype completion not supported for current file, '\n      'cannot force recompilation.', warning = False )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.SetLocationListForWindow',\n          new_callable = ExtendedMock )\n  def test_YouCompleteMe_ShowDiagnostics_NoDiagnosticsDetected(\n    self,\n    ycm,\n    set_location_list_for_window,\n    post_vim_message,\n    *args ):\n\n    current_buffer = VimBuffer( 'buffer', filetype = 'cpp' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.client.event_notification.EventNotification.Response',\n                  return_value = {} ):\n        ycm.ShowDiagnostics()\n        set_location_list_for_window.assert_called_once_with(\n          vim.current.window,\n          [],\n          1 )\n\n    post_vim_message.assert_has_exact_calls( [\n      call( 'Forcing compilation, this will block Vim until done.',\n            warning = False ),\n      call( 'Diagnostics refreshed', warning = False ),\n      call( 'No warnings or errors detected.', warning = False )\n    ] )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_log_level': 'debug',\n                            'g:ycm_keep_logfiles': 1,\n                            'g:ycm_open_loclist_on_ycm_diags': 0 } )\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.SetLocationListForWindow',\n          new_callable = ExtendedMock )\n  def test_YouCompleteMe_ShowDiagnostics_DiagnosticsFound_DoNotOpenLocationList(\n    self,\n    ycm,\n    set_location_list_for_window,\n    post_vim_message,\n    *args ):\n    diagnostic = {\n      'kind': 'ERROR',\n      'text': 'error text',\n      'location': {\n        'filepath': 'buffer',\n        'line_num': 19,\n        'column_num': 2\n      },\n      'location_extent': {\n        'start': {\n          'filepath': 'buffer',\n          'line_num': 19,\n          'column_num': 2\n        },\n        'end': {\n          'filepath': 'buffer',\n          'line_num': 19,\n          'column_num': 3\n        }\n      }\n    }\n\n    current_buffer = VimBuffer( 'buffer',\n                                filetype = 'cpp',\n                                number = 3 )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.client.event_notification.EventNotification.Response',\n                  return_value = [ diagnostic ] ):\n        ycm.ShowDiagnostics()\n        set_location_list_for_window.assert_called_once_with(\n          vim.current.window, [ {\n            'bufnr': 3,\n            'lnum': 19,\n            'col': 2,\n            'text': 'error text',\n            'type': 'E',\n            'valid': 1\n          } ], 0 )\n\n    post_vim_message.assert_has_exact_calls( [\n      call( 'Forcing compilation, this will block Vim until done.',\n            warning = False ),\n      call( 'Diagnostics refreshed', warning = False )\n    ] )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_open_loclist_on_ycm_diags': 1 } )\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.SetLocationListForWindow',\n          new_callable = ExtendedMock )\n  @patch( 'ycm.vimsupport.OpenLocationList', new_callable = ExtendedMock )\n  def test_YouCompleteMe_ShowDiagnostics_DiagnosticsFound_OpenLocationList(\n    self,\n    ycm,\n    open_location_list,\n    set_location_list_for_window,\n    post_vim_message,\n    *args ):\n\n    diagnostic = {\n      'kind': 'ERROR',\n      'text': 'error text',\n      'location': {\n        'filepath': 'buffer',\n        'line_num': 19,\n        'column_num': 2\n      },\n      'location_extent': {\n        'start': {\n          'filepath': 'buffer',\n          'line_num': 19,\n          'column_num': 2\n        },\n        'end': {\n          'filepath': 'buffer',\n          'line_num': 19,\n          'column_num': 2\n        }\n      }\n    }\n\n    current_buffer = VimBuffer( 'buffer',\n                                filetype = 'cpp',\n                                number = 3 )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      with patch( 'ycm.client.event_notification.EventNotification.Response',\n                  return_value = [ diagnostic ] ):\n        ycm.ShowDiagnostics()\n        set_location_list_for_window.assert_called_once_with(\n          vim.current.window, [ {\n            'bufnr': 3,\n            'lnum': 19,\n            'col': 2,\n            'text': 'error text',\n            'type': 'E',\n            'valid': 1\n          } ], 1 )\n\n    post_vim_message.assert_has_exact_calls( [\n      call( 'Forcing compilation, this will block Vim until done.',\n            warning = False ),\n      call( 'Diagnostics refreshed', warning = False )\n    ] )\n    open_location_list.assert_called_once_with( focus = True )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_echo_current_diagnostic': 1,\n                            'g:ycm_enable_diagnostic_signs': 1,\n                            'g:ycm_enable_diagnostic_highlighting': 1 } )\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.client.event_notification.EventNotification.Done',\n          return_value = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_UpdateDiagnosticInterface_OldVim(\n    self, ycm, post_vim_message, *args ):\n    YouCompleteMe_UpdateDiagnosticInterface( ycm, post_vim_message )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_echo_current_diagnostic': 1,\n                            'g:ycm_enable_diagnostic_signs': 1,\n                            'g:ycm_enable_diagnostic_highlighting': 1 } )\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.tests.test_utils.VIM_VERSION', Version( 8, 1, 614 ) )\n  @patch( 'ycm.client.event_notification.EventNotification.Done',\n          return_value = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_UpdateDiagnosticInterface_NewVim(\n    self, ycm, post_vim_message, *args ):\n    YouCompleteMe_UpdateDiagnosticInterface( ycm, post_vim_message )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_enable_diagnostic_highlighting': 1 } )\n  def test_YouCompleteMe_UpdateMatches_ClearDiagnosticMatchesInNewBuffer(\n      self, ycm ):\n    current_buffer = VimBuffer( 'buffer',\n                                filetype = 'c',\n                                contents = '\\n\\n\\n\\n',\n                                number = 5 )\n\n    test_utils.VIM_PROPS_FOR_BUFFER[ current_buffer.number ] = [\n      VimProp( 'YcmWarningProperty', 3, 5, 3, 7 ),\n      VimProp( 'YcmWarningProperty', 3, 3, 3, 9 ),\n      VimProp( 'YcmErrorProperty', 3, 8, 3, 9 )\n    ]\n\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      ycm.UpdateMatches()\n\n    assert_that( test_utils.VIM_PROPS_FOR_BUFFER[ current_buffer.number ],\n                 empty() )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_echo_current_diagnostic': 1,\n                            'g:ycm_always_populate_location_list': 1,\n                            'g:ycm_show_diagnostics_ui': 0,\n                            'g:ycm_enable_diagnostic_highlighting': 1 } )\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_AsyncDiagnosticUpdate_UserDisabled(\n      self,\n      ycm,\n      post_vim_message,\n      *args ):\n    diagnostics = [\n      {\n        'kind': 'ERROR',\n        'text': 'error text in current buffer',\n        'location': {\n          'filepath': '/current',\n          'line_num': 1,\n          'column_num': 1\n        },\n        'location_extent': {\n          'start': {\n            'filepath': '/current',\n            'line_num': 1,\n            'column_num': 1,\n          },\n          'end': {\n            'filepath': '/current',\n            'line_num': 1,\n            'column_num': 1,\n          }\n        },\n        'ranges': []\n      },\n    ]\n    current_buffer = VimBuffer( '/current',\n                                filetype = 'ycmtest',\n                                contents = [ 'current' ] * 10,\n                                number = 1 )\n    buffers = [ current_buffer ]\n    windows = [ current_buffer ]\n\n    # Register each buffer internally with YCM\n    for current in buffers:\n      with MockVimBuffers( buffers, [ current ] ):\n        ycm.OnFileReadyToParse()\n    with patch( 'ycm.vimsupport.SetLocationListForWindow',\n                new_callable = ExtendedMock ) as set_location_list_for_window:\n      with MockVimBuffers( buffers, windows ):\n        ycm.UpdateWithNewDiagnosticsForFile( '/current', diagnostics )\n\n    post_vim_message.assert_has_exact_calls( [] )\n    set_location_list_for_window.assert_has_exact_calls( [] )\n\n    assert_that(\n      test_utils.VIM_PROPS_FOR_BUFFER,\n      empty()\n    )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_echo_current_diagnostic': 1,\n                            'g:ycm_always_populate_location_list': 1,\n                            'g:ycm_enable_diagnostic_highlighting': 1 } )\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_AsyncDiagnosticUpdate_SingleFile(\n      self,\n      ycm,\n      post_vim_message,\n      *args ):\n\n    # This test simulates asynchronous diagnostic updates associated with a\n    # single file (e.g. Translation Unit), but where the actual errors refer to\n    # other open files and other non-open files. This is not strictly invalid,\n    # nor is it completely normal, but it is supported and does work.\n\n    # Contrast with the next test which sends the diagnostics filewise, which\n    # is what the language server protocol will do.\n\n    diagnostics = [\n      {\n        'kind': 'ERROR',\n        'text': 'error text in current buffer',\n        'location': {\n          'filepath': '/current',\n          'line_num': 1,\n          'column_num': 1\n        },\n        'location_extent': {\n          'start': {\n            'filepath': '/current',\n            'line_num': 1,\n            'column_num': 1,\n          },\n          'end': {\n            'filepath': '/current',\n            'line_num': 1,\n            'column_num': 1,\n          }\n        },\n        'ranges': []\n      },\n      {\n        'kind': 'ERROR',\n        'text': 'error text in hidden buffer',\n        'location': {\n          'filepath': '/has_diags',\n          'line_num': 4,\n          'column_num': 2\n        },\n        'location_extent': {\n          'start': {\n            'filepath': '/has_diags',\n            'line_num': 4,\n            'column_num': 2,\n          },\n          'end': {\n            'filepath': '/has_diags',\n            'line_num': 4,\n            'column_num': 2,\n          }\n        },\n        'ranges': []\n      },\n      {\n        'kind': 'ERROR',\n        'text': 'error text in buffer not open in Vim',\n        'location': {\n          'filepath': '/not_open',\n          'line_num': 8,\n          'column_num': 4\n        },\n        'location_extent': {\n          'start': {\n            'filepath': '/not_open',\n            'line_num': 8,\n            'column_num': 4,\n          },\n          'end': {\n            'filepath': '/not_open',\n            'line_num': 8,\n            'column_num': 4,\n          }\n        },\n        'ranges': []\n      }\n    ]\n\n    current_buffer = VimBuffer( '/current',\n                                filetype = 'ycmtest',\n                                contents = [ 'current' ] * 10,\n                                number = 1 )\n    no_diags_buffer = VimBuffer( '/no_diags',\n                                 filetype = 'ycmtest',\n                                 contents = [ 'nodiags' ] * 10,\n                                 number = 2 )\n    hidden_buffer = VimBuffer( '/has_diags',\n                               filetype = 'ycmtest',\n                               contents = [ 'hasdiags' ] * 10,\n                               number = 3 )\n\n    buffers = [ current_buffer, no_diags_buffer, hidden_buffer ]\n    windows = [ current_buffer, no_diags_buffer ]\n\n    # Register each buffer internally with YCM\n    for current in buffers:\n      with MockVimBuffers( buffers, [ current ] ):\n        ycm.OnFileReadyToParse()\n\n    with patch( 'ycm.vimsupport.SetLocationListForWindow',\n                new_callable = ExtendedMock ) as set_location_list_for_window:\n      with MockVimBuffers( buffers, windows ):\n        ycm.UpdateWithNewDiagnosticsForFile( '/current', diagnostics )\n        # Ensure we included all the diags though\n        set_location_list_for_window.assert_has_exact_calls( [\n          call( vim.current.window, [\n            {\n              'lnum': 1,\n              'col': 1,\n              'bufnr': 1,\n              'valid': 1,\n              'type': 'E',\n              'text': 'error text in current buffer',\n            },\n            {\n              'lnum': 4,\n              'col': 2,\n              'bufnr': 3,\n              'valid': 1,\n              'type': 'E',\n              'text': 'error text in hidden buffer',\n            },\n            {\n              'lnum': 8,\n              'col': 4,\n              'bufnr': -1, # sic: Our mocked bufnr function actually returns -1,\n                           # even though YCM is passing \"create if needed\".\n                           # FIXME? we shouldn't do that, and we should pass\n                           # filename instead\n              'valid': 1,\n              'type': 'E',\n              'text': 'error text in buffer not open in Vim'\n            }\n          ], False )\n        ] )\n\n\n    # We update the diagnostic on the current cursor position\n    post_vim_message.assert_has_exact_calls( [\n      call( \"error text in current buffer\", truncate = True, warning = False ),\n    ] )\n\n    assert_that(\n      test_utils.VIM_PROPS_FOR_BUFFER,\n      has_entries( {\n        1: contains_exactly(\n          VimProp( 'YcmErrorProperty', 1, 1, 1, 1 )\n        )\n      } )\n    )\n\n\n  @YouCompleteMeInstance( { 'g:ycm_echo_current_diagnostic': 1,\n                            'g:ycm_always_populate_location_list': 1,\n                            'g:ycm_enable_diagnostic_highlighting': 1 } )\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.vimsupport.PostVimMessage', new_callable = ExtendedMock )\n  def test_YouCompleteMe_AsyncDiagnosticUpdate_PerFile(\n      self,\n      ycm,\n      post_vim_message,\n      *args ):\n\n    # This test simulates asynchronous diagnostic updates which are delivered\n    # per file, including files which are open and files which are not.\n\n    # Ordered to ensure that the calls to update are deterministic\n    diagnostics_per_file = [\n      ( '/current', [ {\n          'kind': 'ERROR',\n          'text': 'error text in current buffer',\n          'location': {\n            'filepath': '/current',\n            'line_num': 1,\n            'column_num': 1\n          },\n          'location_extent': {\n            'start': {\n              'filepath': '/current',\n              'line_num': 1,\n              'column_num': 1,\n            },\n            'end': {\n              'filepath': '/current',\n              'line_num': 1,\n              'column_num': 1,\n            }\n          },\n          'ranges': [],\n        } ] ),\n      ( '/separate_window', [ {\n          'kind': 'ERROR',\n          'text': 'error text in a buffer open in a separate window',\n          'location': {\n            'filepath': '/separate_window',\n            'line_num': 3,\n            'column_num': 3\n          },\n          'location_extent': {\n            'start': {\n              'filepath': '/separate_window',\n              'line_num': 3,\n              'column_num': 3,\n            },\n            'end': {\n              'filepath': '/separate_window',\n              'line_num': 3,\n              'column_num': 3,\n            }\n          },\n          'ranges': []\n        } ] ),\n      ( '/hidden', [ {\n          'kind': 'ERROR',\n          'text': 'error text in hidden buffer',\n          'location': {\n            'filepath': '/hidden',\n            'line_num': 4,\n            'column_num': 2\n          },\n          'location_extent': {\n            'start': {\n              'filepath': '/hidden',\n              'line_num': 4,\n              'column_num': 2,\n            },\n            'end': {\n              'filepath': '/hidden',\n              'line_num': 4,\n              'column_num': 2,\n            }\n          },\n          'ranges': []\n        } ] ),\n      ( '/not_open', [ {\n          'kind': 'ERROR',\n          'text': 'error text in buffer not open in Vim',\n          'location': {\n            'filepath': '/not_open',\n            'line_num': 8,\n            'column_num': 4\n          },\n          'location_extent': {\n            'start': {\n              'filepath': '/not_open',\n              'line_num': 8,\n              'column_num': 4,\n            },\n            'end': {\n              'filepath': '/not_open',\n              'line_num': 8,\n              'column_num': 4,\n            }\n          },\n          'ranges': []\n        } ] )\n    ]\n\n    current_buffer = VimBuffer( '/current',\n                                filetype = 'ycmtest',\n                                contents = [ 'current' ] * 10,\n                                number = 1 )\n    no_diags_buffer = VimBuffer( '/no_diags',\n                                 filetype = 'ycmtest',\n                                 contents = [ 'no_diags' ] * 10,\n                                 number = 2 )\n    separate_window = VimBuffer( '/separate_window',\n                                 filetype = 'ycmtest',\n                                 contents = [ 'separate_window' ] * 10,\n                                 number = 3 )\n    hidden_buffer = VimBuffer( '/hidden',\n                               filetype = 'ycmtest',\n                               contents = [ 'hidden' ] * 10,\n                               number = 4 )\n    buffers = [\n      current_buffer,\n      no_diags_buffer,\n      separate_window,\n      hidden_buffer\n    ]\n    windows = [\n      current_buffer,\n      no_diags_buffer,\n      separate_window\n    ]\n\n    # Register each buffer internally with YCM\n    for current in buffers:\n      with MockVimBuffers( buffers, [ current ] ):\n        ycm.OnFileReadyToParse()\n\n    with patch( 'ycm.vimsupport.SetLocationListForWindow',\n                new_callable = ExtendedMock ) as set_location_list_for_window:\n      with MockVimBuffers( buffers, windows ):\n        for filename, diagnostics in diagnostics_per_file:\n          ycm.UpdateWithNewDiagnosticsForFile( filename, diagnostics )\n\n        # Ensure we included all the diags though\n        set_location_list_for_window.assert_has_exact_calls( [\n          call( vim.windows[ 0 ], [\n            {\n              'lnum': 1,\n              'col': 1,\n              'bufnr': 1,\n              'valid': 1,\n              'type': 'E',\n              'text': 'error text in current buffer',\n            },\n          ], False ),\n\n          call( vim.windows[ 2 ], [\n            {\n              'lnum': 3,\n              'col': 3,\n              'bufnr': 3,\n              'valid': 1,\n              'type': 'E',\n              'text': 'error text in a buffer open in a separate window',\n            },\n          ], False )\n        ] )\n\n\n    # We update the diagnostic on the current cursor position\n    post_vim_message.assert_has_exact_calls( [\n      call( \"error text in current buffer\", truncate = True, warning = False ),\n    ] )\n\n    assert_that(\n      test_utils.VIM_PROPS_FOR_BUFFER,\n      has_entries( {\n        1: contains_exactly(\n          VimProp( 'YcmErrorProperty', 1, 1, 1, 1 )\n        ),\n        3: contains_exactly(\n          VimProp( 'YcmErrorProperty', 3, 3, 3, 3 )\n        )\n      } )\n    )\n\n\n  @YouCompleteMeInstance()\n  def test_YouCompleteMe_OnPeriodicTick_ServerNotRunning( self, ycm ):\n    with patch.object( ycm, 'IsServerAlive', return_value = False ):\n      assert_that( ycm.OnPeriodicTick(), equal_to( False ) )\n\n\n  @YouCompleteMeInstance()\n  def test_YouCompleteMe_OnPeriodicTick_ServerNotReady( self, ycm ):\n    with patch.object( ycm, 'IsServerAlive', return_value = True ):\n      with patch.object( ycm, 'IsServerReady', return_value = False ):\n        assert_that( ycm.OnPeriodicTick(), equal_to( True ) )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.client.base_request._ValidateResponseObject',\n          return_value = True )\n  @patch( 'ycm.client.base_request.BaseRequest.PostDataToHandlerAsync' )\n  def test_YouCompleteMe_OnPeriodicTick_DontRetry(\n      self,\n      ycm,\n      post_data_to_handler_async,\n      *args ):\n\n    current_buffer = VimBuffer( '/current',\n                                filetype = 'ycmtest',\n                                number = 1 )\n\n    # Create the request and make the first poll; we expect no response\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 1 ) ):\n      assert_that( ycm.OnPeriodicTick(), equal_to( True ) )\n      post_data_to_handler_async.assert_called()\n\n    assert ycm._message_poll_requests[ 'ycmtest' ] is not None\n    post_data_to_handler_async.reset_mock()\n\n    # OK that sent the request, now poll to check if it is complete (say it is\n    # not)\n    with MockVimBuffers( [ current_buffer ],\n                         [ current_buffer ],\n                         ( 1, 1 ) ) as v:\n      mock_response = MockAsyncServerResponseInProgress()\n      with patch.dict( ycm._message_poll_requests, {} ):\n        ycm._message_poll_requests[ 'ycmtest' ] = MessagesPoll(\n                                                    v.current.buffer )\n        ycm._message_poll_requests[ 'ycmtest' ]._response_future = mock_response\n        mock_future = ycm._message_poll_requests[ 'ycmtest' ]._response_future\n        poll_again = ycm.OnPeriodicTick()\n        mock_future.done.assert_called()\n        mock_future.result.assert_not_called()\n        assert_that( poll_again, equal_to( True ) )\n\n    # Poll again, but return a response (telling us to stop polling)\n    with MockVimBuffers( [ current_buffer ],\n                         [ current_buffer ],\n                         ( 1, 1 ) ) as v:\n      mock_response = MockAsyncServerResponseDone( False )\n      with patch.dict( ycm._message_poll_requests, {} ):\n        ycm._message_poll_requests[ 'ycmtest' ] = MessagesPoll(\n                                                    v.current.buffer )\n        ycm._message_poll_requests[ 'ycmtest' ]._response_future = mock_response\n        mock_future = ycm._message_poll_requests[ 'ycmtest' ]._response_future\n        poll_again = ycm.OnPeriodicTick()\n        mock_future.done.assert_called()\n        mock_future.result.assert_called()\n        post_data_to_handler_async.assert_not_called()\n        # We reset and don't poll anymore\n        assert_that( ycm._message_poll_requests[ 'ycmtest' ] is None )\n        assert_that( poll_again, equal_to( False ) )\n\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.client.base_request._ValidateResponseObject',\n          return_value = True )\n  @patch( 'ycm.client.base_request.BaseRequest.PostDataToHandlerAsync' )\n  def test_YouCompleteMe_OnPeriodicTick_Exception(\n      self,\n      ycm,\n      post_data_to_handler_async,\n      *args ):\n\n    current_buffer = VimBuffer( '/current',\n                                filetype = 'ycmtest',\n                                number = 1 )\n\n    # Create the request and make the first poll; we expect no response\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 1 ) ):\n      assert_that( ycm.OnPeriodicTick(), equal_to( True ) )\n      post_data_to_handler_async.assert_called()\n\n    post_data_to_handler_async.reset_mock()\n\n    # Poll again, but return an exception response\n    with MockVimBuffers( [ current_buffer ],\n                         [ current_buffer ],\n                         ( 1, 1 ) ) as v:\n      mock_response = MockAsyncServerResponseException(\n                        RuntimeError( 'test' ) )\n      with patch.dict( ycm._message_poll_requests, {} ):\n        ycm._message_poll_requests[ 'ycmtest' ] = MessagesPoll(\n                                                    v.current.buffer )\n        ycm._message_poll_requests[ 'ycmtest' ]._response_future = mock_response\n        mock_future = ycm._message_poll_requests[ 'ycmtest' ]._response_future\n        assert_that( ycm.OnPeriodicTick(), equal_to( False ) )\n        mock_future.done.assert_called()\n        mock_future.result.assert_called()\n        post_data_to_handler_async.assert_not_called()\n        # We reset and don't poll anymore\n        assert_that( ycm._message_poll_requests[ 'ycmtest' ] is None )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.youcompleteme.YouCompleteMe.FiletypeCompleterExistsForFiletype',\n          return_value = True )\n  @patch( 'ycm.client.base_request._ValidateResponseObject',\n          return_value = True )\n  @patch( 'ycm.client.base_request.BaseRequest.PostDataToHandlerAsync' )\n  @patch( 'ycm.client.messages_request._HandlePollResponse' )\n  def test_YouCompleteMe_OnPeriodicTick_ValidResponse(\n      self, ycm, handle_poll_response, post_data_to_handler_async, *args ):\n\n    current_buffer = VimBuffer( '/current',\n                                filetype = 'ycmtest',\n                                number = 1 )\n\n    # Create the request and make the first poll; we expect no response\n    with MockVimBuffers( [ current_buffer ],\n                         [ current_buffer ],\n                         ( 1, 1 ) ):\n      assert_that( ycm.OnPeriodicTick(), equal_to( True ) )\n      post_data_to_handler_async.assert_called()\n\n    post_data_to_handler_async.reset_mock()\n\n    # Poll again, and return a _proper_ response (finally!).\n    # Note, _HandlePollResponse is tested independently (for simplicity)\n    with MockVimBuffers( [ current_buffer ],\n                         [ current_buffer ],\n                         ( 1, 1 ) ) as v:\n      mock_response = MockAsyncServerResponseDone( [] )\n      with patch.dict( ycm._message_poll_requests, {} ):\n        ycm._message_poll_requests[ 'ycmtest' ] = MessagesPoll(\n                                                    v.current.buffer )\n        ycm._message_poll_requests[ 'ycmtest' ]._response_future = mock_response\n        mock_future = ycm._message_poll_requests[ 'ycmtest' ]._response_future\n        assert_that( ycm.OnPeriodicTick(), equal_to( True ) )\n        handle_poll_response.assert_called()\n        mock_future.done.assert_called()\n        mock_future.result.assert_called()\n        post_data_to_handler_async.assert_called() # Poll again!\n        assert_that( ycm._message_poll_requests[ 'ycmtest' ] is not None )\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.client.completion_request.CompletionRequest.OnCompleteDone' )\n  def test_YouCompleteMe_OnCompleteDone_CompletionRequest(\n      self, ycm, on_complete_done ):\n    current_buffer = VimBuffer( 'current_buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ], ( 1, 1 ) ):\n      ycm.SendCompletionRequest()\n    ycm.OnCompleteDone()\n    on_complete_done.assert_called()\n\n\n  @YouCompleteMeInstance()\n  @patch( 'ycm.client.completion_request.CompletionRequest.OnCompleteDone' )\n  def test_YouCompleteMe_OnCompleteDone_NoCompletionRequest(\n      self, ycm, on_complete_done ):\n    ycm.OnCompleteDone()\n    on_complete_done.assert_not_called()\n\n\n  @YouCompleteMeInstance()\n  def test_YouCompleteMe_ShouldResendFileParseRequest_NoParseRequest(\n      self, ycm ):\n    current_buffer = VimBuffer( 'current_buffer' )\n    with MockVimBuffers( [ current_buffer ], [ current_buffer ] ):\n      assert_that( ycm.ShouldResendFileParseRequest(), equal_to( False ) )\n"
  },
  {
    "path": "python/ycm/text_properties.py",
    "content": "# Copyright (C) 2020, YouCompleteMe Contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\n\nfrom ycm import vimsupport\nfrom ycm.vimsupport import GetIntValue\nfrom ycmd import utils\n\nimport vim\nimport json\nimport typing\n\n\n# FIXME/TODO: Merge this with vimsupport funcitons, added after these were\n# written. It's not trivial, as those vimsupport functions are a bit fiddly.\n# They also support neovim, but we don't.\ndef AddTextPropertyType( name, **kwargs ):\n  props = {\n    'highlight': 'Ignore',\n    'combine': 0,\n    'override': 0,\n    'start_incl': 0,\n    'end_incl': 0,\n    'priority': 10\n  }\n  props.update( kwargs )\n\n  vim.eval( f\"prop_type_add( '{ vimsupport.EscapeForVim( name ) }', \"\n            f\"               { json.dumps( props ) } )\" )\n\n\ndef GetTextPropertyTypes( *args, **kwargs ):\n  return [ utils.ToUnicode( p ) for p in vim.eval( 'prop_type_list()' ) ]\n\n\ndef AddTextProperty( bufnr,\n                     prop_id,\n                     prop_type,\n                     range,\n                     extra_args: dict = None ):\n  props = {\n    'bufnr': bufnr,\n    'type': prop_type\n  }\n  if prop_id is not None:\n    props[ 'id' ] = prop_id\n  if extra_args:\n    props.update( extra_args )\n  if 'end' in range:\n    props.update( {\n      'end_lnum': range[ 'end' ][ 'line_num' ],\n      'end_col':  range[ 'end' ][ 'column_num' ],\n    } )\n  return vim.eval( f\"prop_add( { range[ 'start' ][ 'line_num' ] },\"\n                   f\"          { range[ 'start' ][ 'column_num' ] },\"\n                   f\"          { json.dumps( props ) } )\" )\n\n\ndef ClearTextProperties(\n  bufnr,\n  prop_id = None,\n  prop_types: typing.Union[ typing.List[ str ], str ] = None,\n  first_line = None,\n  last_line = None ):\n\n  props = {\n    'bufnr': bufnr,\n    'all': 1,\n  }\n  if prop_id is not None:\n    props[ 'id' ] = prop_id\n\n  if prop_id is not None and prop_types is not None:\n    props[ 'both' ] = 1\n\n  def prop_remove():\n    if last_line is not None:\n      return GetIntValue( f\"prop_remove( { json.dumps( props ) },\"\n                                      f\" { first_line },\"\n                                      f\" { last_line } )\" )\n    elif first_line is not None:\n      return GetIntValue( f\"prop_remove( { json.dumps( props ) },\"\n                                      f\" { first_line } )\" )\n    else:\n      return GetIntValue( f\"prop_remove( { json.dumps( props ) } )\" )\n\n  if prop_types is None:\n    return prop_remove()\n\n  if not isinstance( prop_types, list ):\n    prop_types = [ prop_types ]\n\n  props[ 'types' ] = prop_types\n  return prop_remove()\n"
  },
  {
    "path": "python/ycm/unsafe_thread_pool_executor.py",
    "content": "# Copyright 2009 Brian Quinlan. All Rights Reserved.\n#   Licensed to PSF under a Contributor Agreement.\n#\n# Copyright (C) 2013  Google Inc.\n#   Changes to this file are licensed under the same terms as the original file\n#   (the Python Software Foundation License).\n\n\nimport threading\nimport weakref\nimport sys\n\nfrom concurrent.futures import _base\n\ntry:\n  import queue\nexcept ImportError:\n  import Queue as queue\n\n\n# This file provides an UnsafeThreadPoolExecutor, which operates exactly like\n# the upstream Python version of ThreadPoolExecutor with one exception: it\n# doesn't wait for worker threads to finish before shutting down the Python\n# interpreter.\n#\n# This is dangerous for many workloads, but fine for some (like when threads\n# only send network requests). The YCM workload is one of those workloads where\n# it's safe (the aforementioned network requests case).\n\nclass _WorkItem:\n  def __init__( self, future, fn, args, kwargs ):\n    self.future = future\n    self.fn = fn\n    self.args = args\n    self.kwargs = kwargs\n\n  def run( self ):\n    if not self.future.set_running_or_notify_cancel():\n      return\n\n    try:\n      result = self.fn( *self.args, **self.kwargs )\n    except BaseException:\n      e = sys.exc_info()[ 1 ]\n      self.future.set_exception( e )\n    else:\n      self.future.set_result( result )\n\n\ndef _worker( executor_reference, work_queue ):\n  try:\n    while True:\n      work_item = work_queue.get( block=True )\n      if work_item is not None:\n        work_item.run()\n        # Delete references to object,\n        # whis allow remove object by GC without stuck on work_queue.get()\n        # on next cycle iteration. See GH-60488\n        del work_item\n        continue\n      executor = executor_reference()\n      # Exit if:\n      #   - The executor that owns the worker has been collected OR\n      #   - The executor that owns the worker has been shutdown.\n      if executor is None or executor._shutdown:\n        # Notice other workers\n        work_queue.put( None )\n        return\n      del executor\n  except BaseException:\n    _base.LOGGER.critical( 'Exception in worker', exc_info=True )\n\n\nclass UnsafeThreadPoolExecutor( _base.Executor ):\n  def __init__( self, max_workers ):\n    \"\"\"Initializes a new ThreadPoolExecutor instance.\n\n    Args:\n        max_workers: The maximum number of threads that can be used to\n            execute the given calls.\n    \"\"\"\n    self._max_workers = max_workers\n    self._work_queue = queue.Queue()\n    self._threads = set()\n    self._shutdown = False\n    self._shutdown_lock = threading.Lock()\n\n  def submit( self, fn, *args, **kwargs ):\n    with self._shutdown_lock:\n      if self._shutdown:\n        raise RuntimeError( 'cannot schedule new futures after shutdown' )\n\n      f = _base.Future()\n      w = _WorkItem( f, fn, args, kwargs )\n\n      self._work_queue.put( w )\n      self._adjust_thread_count()\n      return f\n  submit.__doc__ = _base.Executor.submit.__doc__\n\n  def _adjust_thread_count( self ):\n    # When the executor gets lost, the weakref callback will wake up\n    # the worker threads.\n    def weakref_cb( _, q=self._work_queue ):\n      q.put( None )\n    # TODO(bquinlan): Should avoid creating new threads if there are more\n    # idle threads than items in the work queue.\n    if len( self._threads ) < self._max_workers:\n      t = threading.Thread( target=_worker,\n                            args=( weakref.ref( self, weakref_cb ),\n                                   self._work_queue ) )\n      t.daemon = True\n      t.start()\n      self._threads.add( t )\n\n  def shutdown( self, wait=True ):\n    with self._shutdown_lock:\n      self._shutdown = True\n      self._work_queue.put( None )\n    if wait:\n      for t in self._threads:\n        t.join()\n  shutdown.__doc__ = _base.Executor.shutdown.__doc__\n"
  },
  {
    "path": "python/ycm/vimsupport.py",
    "content": "# Copyright (C) 2011-2018 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport vim\nimport os\nimport json\nimport re\nfrom collections import defaultdict, namedtuple\nfrom functools import lru_cache as memoize\nfrom ycmd.utils import ( ByteOffsetToCodepointOffset,\n                         GetCurrentDirectory,\n                         JoinLinesAsUnicode,\n                         OnMac,\n                         OnWindows,\n                         ToBytes,\n                         ToUnicode )\n\nBUFFER_COMMAND_MAP = { 'same-buffer'      : 'edit',\n                       'split'            : 'split',\n                       # These commands are obsolete. :vertical or :tab should\n                       # be used with the 'split' command instead.\n                       'horizontal-split' : 'split',\n                       'vertical-split'   : 'vsplit',\n                       'new-tab'          : 'tabedit' }\n\nFIXIT_OPENING_BUFFERS_MESSAGE_FORMAT = (\n    'The requested operation will apply changes to {0} files which are not '\n    'currently open. This will therefore open {0} new files in the hidden '\n    'buffers. The quickfix list can then be used to review the changes. No '\n    'files will be written to disk. Do you wish to continue?' )\n\nNO_SELECTION_MADE_MSG = \"No valid selection was made; aborting.\"\n\n# When we're in a buffer without a file name associated with it, we need to\n# invent a file name. We do so by the means of $CWD/$BUFNR.\n# However, that causes problems with diagnostics - we also need a way to map\n# those same file names back to their originating buffer numbers.\nMADEUP_FILENAME_TO_BUFFER_NUMBER = {}\n\nNO_COMPLETIONS = {\n  'line': -1,\n  'column': -1,\n  'completion_start_column': -1,\n  'completions': []\n}\n\nYCM_NEOVIM_NS_ID = vim.eval( 'g:ycm_neovim_ns_id' )\n\n\ndef CurrentLineAndColumn():\n  \"\"\"Returns the 0-based current line and 0-based current column.\"\"\"\n  # See the comment in CurrentColumn about the calculation for the line and\n  # column number\n  line, column = vim.current.window.cursor\n  line -= 1\n  return line, column\n\n\ndef SetCurrentLineAndColumn( line, column ):\n  \"\"\"Sets the cursor position to the 0-based line and 0-based column.\"\"\"\n  # Line from vim.current.window.cursor is 1-based.\n  vim.current.window.cursor = ( line + 1, column )\n\n\ndef CurrentColumn():\n  \"\"\"Returns the 0-based current column. Do NOT access the CurrentColumn in\n  vim.current.line. It doesn't exist yet when the cursor is at the end of the\n  line. Only the chars before the current column exist in vim.current.line.\"\"\"\n\n  # vim's columns are 1-based while vim.current.line columns are 0-based\n  # ... but vim.current.window.cursor (which returns a (line, column) tuple)\n  # columns are 0-based, while the line from that same tuple is 1-based.\n  # vim.buffers buffer objects OTOH have 0-based lines and columns.\n  # Pigs have wings and I'm a loopy purple duck. Everything makes sense now.\n  return vim.current.window.cursor[ 1 ]\n\n\ndef CurrentLineContents():\n  return ToUnicode( vim.current.line )\n\n\ndef CurrentLineContentsAndCodepointColumn():\n  \"\"\"Returns the line contents as a unicode string and the 0-based current\n  column as a codepoint offset. If the current column is outside the line,\n  returns the column position at the end of the line.\"\"\"\n  line = CurrentLineContents()\n  byte_column = CurrentColumn()\n  # ByteOffsetToCodepointOffset expects 1-based offset.\n  column = ByteOffsetToCodepointOffset( line, byte_column + 1 ) - 1\n  return line, column\n\n\ndef TextAfterCursor():\n  \"\"\"Returns the text after CurrentColumn.\"\"\"\n  return ToUnicode( vim.current.line[ CurrentColumn(): ] )\n\n\ndef TextBeforeCursor():\n  \"\"\"Returns the text before CurrentColumn.\"\"\"\n  return ToUnicode( vim.current.line[ :CurrentColumn() ] )\n\n\ndef BufferModified( buffer_object ):\n  return buffer_object.options[ 'mod' ]\n\n\ndef GetBufferData( buffer_object ):\n  return {\n    # Add a newline to match what gets saved to disk. See #1455 for details.\n    'contents': JoinLinesAsUnicode( buffer_object ) + '\\n',\n    'filetypes': FiletypesForBuffer( buffer_object )\n  }\n\n\ndef GetUnsavedAndSpecifiedBufferData( included_buffer, included_filepath ):\n  \"\"\"Build part of the request containing the contents and filetypes of all\n  dirty buffers as well as the buffer |included_buffer| with its filepath\n  |included_filepath|.\"\"\"\n  buffers_data = { included_filepath: GetBufferData( included_buffer ) }\n\n  for buffer_object in vim.buffers:\n    if not BufferModified( buffer_object ):\n      continue\n\n    filepath = GetBufferFilepath( buffer_object )\n    if filepath in buffers_data:\n      continue\n\n    buffers_data[ filepath ] = GetBufferData( buffer_object )\n\n  return buffers_data\n\n\ndef GetBufferNumberForFilename( filename, create_buffer_if_needed = False ):\n  realpath = os.path.realpath( filename )\n  return MADEUP_FILENAME_TO_BUFFER_NUMBER.get( realpath, GetIntValue(\n      f\"bufnr( '{ EscapeForVim( realpath ) }', \"\n             f\"{ int( create_buffer_if_needed ) } )\" ) )\n\n\ndef GetCurrentBufferFilepath():\n  return GetBufferFilepath( vim.current.buffer )\n\n\ndef BufferIsVisible( buffer_number ):\n  if buffer_number < 0:\n    return False\n  window_number = GetIntValue( f\"bufwinnr( { buffer_number } )\" )\n  return window_number != -1\n\n\ndef GetBufferFilepath( buffer_object ):\n  if buffer_object.name:\n    return os.path.abspath( ToUnicode( buffer_object.name ) )\n  # Buffers that have just been created by a command like :enew don't have any\n  # buffer name so we use the buffer number for that.\n  name = os.path.join( GetCurrentDirectory(), str( buffer_object.number ) )\n  MADEUP_FILENAME_TO_BUFFER_NUMBER[ name ] = buffer_object.number\n  return name\n\n\ndef GetCurrentBufferNumber():\n  return vim.current.buffer.number\n\n\ndef GetBufferChangedTick( bufnr ):\n  try:\n    return GetIntValue( f'getbufvar({ bufnr }, \"changedtick\")' )\n  except ValueError:\n    # For some reason, occasionally changedtick returns '' and causes an error.\n    # In that case, just return 0 rather than spamming an error to the console.\n    return 0\n\n\n# Returns a range covering the earliest and latest lines visible in the current\n# tab page for the supplied buffer number. By default this range is then\n# extended by half of the resulting range size\ndef RangeVisibleInBuffer( bufnr, grow_factor=0.5 ):\n  windows = [ w for w in vim.eval( f'win_findbuf( { bufnr } )' )\n              if GetIntValue( vim.eval( f'win_id2tabwin( { w } )[ 0 ]' ) ) ==\n                vim.current.tabpage.number ]\n\n  class Location:\n    line: int = None\n    col: int = None\n\n  class Range:\n    start: Location = Location()\n    end: Location = Location()\n\n  try:\n    buffer = vim.buffers[ bufnr ]\n  except KeyError:\n    return None\n\n  if not windows:\n    return None\n\n  r = Range()\n  # Note, for this we ignore horizontal scrolling\n  for winid in windows:\n    win_info = vim.eval( f'getwininfo( { winid } )[ 0 ]' )\n    if r.start.line is None or r.start.line > int( win_info[ 'topline' ] ):\n      r.start.line = int( win_info[ 'topline' ] )\n    if r.end.line is None or r.end.line < int( win_info[ 'botline' ] ):\n      r.end.line = int( win_info[ 'botline' ] )\n\n  # Extend the range by 1 factor, and calculate the columns\n  num_lines = r.end.line - r.start.line + 1\n  r.start.line = max( r.start.line - int( num_lines * grow_factor ), 1 )\n  r.start.col = 1\n  r.end.line = min( r.end.line + int( num_lines * grow_factor ), len( buffer ) )\n  r.end.col = len( buffer[ r.end.line - 1 ] )\n\n  filepath = GetBufferFilepath( buffer )\n  return {\n    'start': {\n      'line_num': r.start.line,\n      'column_num': r.start.col,\n      'filepath': filepath,\n    },\n    'end': {\n      'line_num': r.end.line,\n      'column_num': r.end.col,\n      'filepath': filepath,\n    }\n  }\n\n\ndef VisibleRangeOfBufferOverlaps( bufnr, expanded_range ):\n  visible_range = RangeVisibleInBuffer( bufnr, 0 )\n  # As above, we ignore horizontal scroll and only check lines\n  return (\n    expanded_range is not None and\n    visible_range is not None and\n    visible_range[ 'start' ][ 'line_num' ]\n      >= expanded_range[ 'start' ][ 'line_num' ] and\n    visible_range[ 'end' ][ 'line_num' ]\n      <= expanded_range[ 'end' ][ 'line_num' ]\n  )\n\n\ndef CaptureVimCommand( command ):\n  return vim.eval( f\"execute( '{ EscapeForVim( command ) }', 'silent!' )\" )\n\n\ndef GetSignsInBuffer( buffer_number ):\n  return vim.eval(\n      f'sign_getplaced( { buffer_number }, {{ \"group\": \"ycm_signs\" }} )'\n  )[ 0 ][ 'signs' ]\n\n\nclass DiagnosticProperty( namedtuple( 'DiagnosticProperty', [ 'id',\n                                                              'type',\n                                                              'line',\n                                                              'column',\n                                                              'length' ] ) ):\n  def __eq__( self, other ):\n    return ( self.type == other.type and\n             self.line == other.line and\n             self.column == other.column and\n             self.length == other.length )\n\n\ndef GetTextPropertyForDiag( buffer_number, line_number, diag ):\n  range = diag[ 'location_extent' ]\n  start = range[ 'start' ]\n  end = range[ 'end' ]\n  start_line = start[ 'line_num' ]\n  end_line = end[ 'line_num' ]\n  if start_line == end_line:\n    length = end[ 'column_num' ] - start[ 'column_num' ]\n    column = start[ 'column_num' ]\n  elif start_line == line_number:\n    # -1 switches to 0-based indexing.\n    current_line_len = len( vim.buffers[ buffer_number ][ line_number - 1 ] )\n    # +2 includes the start columnand accounts for properties at the end of line\n    # covering \\n as well.\n    length = current_line_len - start[ 'column_num' ] + 2\n    column = start[ 'column_num' ]\n  elif end_line == line_number:\n    length = end[ 'column_num' ] - 1\n    column = 1\n  else:\n    # -1 switches to 0-based indexing.\n    # +1 accounts for properties at the end of line covering \\n as well.\n    length = len( vim.buffers[ buffer_number ][ line_number - 1 ] ) + 1\n    column = 1\n  if diag[ 'kind' ] == 'ERROR':\n    property_name = 'YcmErrorProperty'\n  else:\n    property_name = 'YcmWarningProperty'\n  vim_props = vim.eval( f'prop_list( { line_number }, '\n                        f'{{ \"bufnr\": { buffer_number }, '\n                           f'\"types\": [ \"{ property_name }\" ] }} )' )\n  return next( filter(\n      lambda p: column == int( p[ 'col' ] ) and\n                length == int( p[ 'length' ] ),\n      vim_props ) )\n\n\ndef GetTextProperties( buffer_number ):\n  if not VimIsNeovim():\n    return [\n      DiagnosticProperty(\n          int( p[ 'id' ] ),\n          p[ 'type' ],\n          int( p[ 'lnum' ] ),\n          int( p[ 'col' ] ),\n          int( p[ 'length' ] ) )\n      for p in vim.eval(\n          f'prop_list( 1, '\n                       f'{{ \"bufnr\": { buffer_number }, '\n                           '\"end_lnum\": -1, '\n                           '\"types\": [ \"YcmErrorProperty\", '\n                                      '\"YcmWarningProperty\" ] } )' ) ]\n  else:\n    ext_marks = vim.eval(\n      f'nvim_buf_get_extmarks( { buffer_number }, '\n                             f'{ YCM_NEOVIM_NS_ID }, '\n                              '0, '\n                              '-1, '\n                              '{ \"details\": 1 } )' )\n    return [ DiagnosticProperty(\n               int( id ),\n               extra_args[ 'hl_group' ],\n               int( line ) + 1, # Neovim uses 0-based lines and columns\n               int( column ) + 1,\n               int( extra_args[ 'end_col' ] ) - int( column ) )\n             for id, line, column, extra_args in ext_marks ]\n\n\ndef AddTextProperty( buffer_number,\n                     line,\n                     column,\n                     prop_type,\n                     extra_args ):\n  if not VimIsNeovim():\n    extra_args.update( {\n      'type': prop_type,\n      'bufnr': buffer_number\n    } )\n    return GetIntValue( f'prop_add( { line }, '\n                                  f'{ column }, '\n                                  f'{ json.dumps( extra_args ) } )' )\n  else:\n    extra_args[ 'hl_group' ] = prop_type\n    # Neovim uses 0-based offsets\n    if 'end_lnum' in extra_args:\n      extra_args[ 'end_line' ] = extra_args.pop( 'end_lnum' ) - 1\n    if 'end_col' in extra_args:\n      extra_args[ 'end_col' ] = extra_args.pop( 'end_col' ) - 1\n    line -= 1\n    column -= 1\n    return GetIntValue( f'nvim_buf_set_extmark( { buffer_number }, '\n                                              f'{ YCM_NEOVIM_NS_ID }, '\n                                              f'{ line }, '\n                                              f'{ column }, '\n                                              f'{ extra_args } )' )\n\n\ndef RemoveDiagnosticProperty( buffer_number: int, prop: DiagnosticProperty ):\n  RemoveTextProperty( buffer_number,\n                      prop.line,\n                      prop.id,\n                      prop.type )\n\n\ndef RemoveTextProperty( buffer_number, line_num, prop_id, prop_type ):\n  if not VimIsNeovim():\n    p = {\n      'bufnr': buffer_number,\n      'id': prop_id,\n      'type': prop_type,\n      'both': 1,\n      'all': 1\n    }\n    vim.eval( f'prop_remove( { p }, { line_num } )' )\n  else:\n    vim.eval( f'nvim_buf_del_extmark( { buffer_number }, '\n                                    f'{ YCM_NEOVIM_NS_ID }, '\n                                    f'{ prop_id } )' )\n\n\n# Clamps the line and column numbers so that they are not past the contents of\n# the buffer. Numbers are 1-based byte offsets.\ndef LineAndColumnNumbersClamped( bufnr, line_num, column_num ):\n  vim_buffer = vim.buffers[ bufnr ]\n  line_num = max( min( line_num, len( vim_buffer ) ), 1 )\n  # Vim buffers are lists Unicode objects on Python 3.\n  max_column = len( ToBytes( vim_buffer[ line_num - 1 ] ) ) + 1\n\n  return line_num, max( min( column_num, max_column ), 1 )\n\n\ndef SetLocationList( diagnostics ):\n  \"\"\"Set the location list for the current window to the supplied diagnostics\"\"\"\n  SetLocationListForWindow( vim.current.window, diagnostics )\n\n\ndef GetWindowsForBufferNumber( buffer_number ):\n  \"\"\"Return the list of windows containing the buffer with number\n  |buffer_number| for the current tab page.\"\"\"\n  return [ window for window in vim.windows\n           if window.buffer.number == buffer_number ]\n\n\ndef SetLocationListsForBuffer( buffer_number,\n                               diagnostics,\n                               open_on_edit = False ):\n  \"\"\"Populate location lists for all windows containing the buffer with number\n  |buffer_number|. See SetLocationListForWindow for format of diagnostics.\"\"\"\n  for window in GetWindowsForBufferNumber( buffer_number ):\n    SetLocationListForWindow( window, diagnostics, open_on_edit )\n\n\ndef SetLocationListForWindow( window,\n                              diagnostics,\n                              open_on_edit = False ):\n  window_id = WinIDForWindow( window )\n  \"\"\"Populate the location list with diagnostics. Diagnostics should be in\n  qflist format; see \":h setqflist\" for details.\"\"\"\n  ycm_loc_id = window.vars.get( 'ycm_loc_id' )\n  # User may have made a bunch of `:lgrep` calls and we do not own the\n  # location list with the ID we remember any more.\n  if ( ycm_loc_id is not None and\n       vim.eval( f'getloclist( { window_id }, '\n                               f'{{ \"id\": { ycm_loc_id }, '\n                                '\"title\": 0 } ).title' ) == 'ycm_loc' ):\n    ycm_loc_id = None\n\n  if ycm_loc_id is None:\n    # Create new and populate\n    vim.eval( f'setloclist( { window_id }, '\n                           '[], '\n                           '\" \", '\n                           '{ \"title\": \"ycm_loc\", '\n                            f'\"items\": { json.dumps( diagnostics ) } }} )' )\n    window.vars[ 'ycm_loc_id' ] = GetIntValue(\n        f'getloclist( { window_id }, {{ \"nr\": \"$\", \"id\": 0 }} ).id' )\n  elif open_on_edit:\n    # Remove old and create new list\n    vim.eval( f'setloclist( { window_id }, '\n                           '[], '\n                           '\"r\", '\n                          f'{{ \"id\": { ycm_loc_id }, '\n                              '\"items\": [], \"title\": \"\" } )' )\n    vim.eval( f'setloclist( { window_id }, '\n                           '[], '\n                           '\" \", '\n                           '{ \"title\": \"ycm_loc\", '\n                            f'\"items\": { json.dumps( diagnostics ) } }} )' )\n    window.vars[ 'ycm_loc_id' ] = GetIntValue(\n        f'getloclist( { window_id }, {{ \"nr\": \"$\", \"id\": 0 }} ).id' )\n  else:\n    # Just populate the old one\n    vim.eval( f'setloclist( { window_id }, '\n                           '[], '\n                           '\"r\", '\n                          f'{{ \"id\": { ycm_loc_id }, '\n                             f'\"items\": { json.dumps( diagnostics ) } }} )' )\n\n\ndef OpenLocationList( focus = False, autoclose = False ):\n  \"\"\"Open the location list to the bottom of the current window with its\n  height automatically set to fit all entries. This behavior can be overridden\n  by using the YcmLocationOpened autocommand. When focus is set to True, the\n  location list window becomes the active window. When autoclose is set to True,\n  the location list window is automatically closed after an entry is\n  selected.\"\"\"\n  vim.command( 'lopen' )\n\n  SetFittingHeightForCurrentWindow()\n\n  if autoclose:\n    AutoCloseOnCurrentBuffer( 'ycmlocation' )\n\n  if VariableExists( '#User#YcmLocationOpened' ):\n    vim.command( 'doautocmd User YcmLocationOpened' )\n\n  if not focus:\n    JumpToPreviousWindow()\n\n\ndef SetQuickFixList( quickfix_list ):\n  \"\"\"Populate the quickfix list and open it. List should be in qflist format:\n  see \":h setqflist\" for details.\"\"\"\n  vim.eval( f'setqflist( { json.dumps( quickfix_list ) } )' )\n\n\ndef OpenQuickFixList( focus = False, autoclose = False ):\n  \"\"\"Open the quickfix list to full width at the bottom of the screen with its\n  height automatically set to fit all entries. This behavior can be overridden\n  by using the YcmQuickFixOpened autocommand.\n  See the OpenLocationList function for the focus and autoclose options.\"\"\"\n  vim.command( 'botright copen' )\n\n  SetFittingHeightForCurrentWindow()\n\n  if autoclose:\n    AutoCloseOnCurrentBuffer( 'ycmquickfix' )\n\n  if VariableExists( '#User#YcmQuickFixOpened' ):\n    vim.command( 'doautocmd User YcmQuickFixOpened' )\n\n  if not focus:\n    JumpToPreviousWindow()\n\n\ndef ComputeFittingHeightForCurrentWindow():\n  current_window = vim.current.window\n  if not current_window.options[ 'wrap' ]:\n    return len( vim.current.buffer )\n\n  window_width = current_window.width\n  fitting_height = 0\n  for line in vim.current.buffer:\n    fitting_height += len( line ) // window_width + 1\n  return fitting_height\n\n\ndef SetFittingHeightForCurrentWindow():\n  if int( vim.current.buffer.vars.get( 'ycm_no_resize', 0 ) ):\n    return\n\n  vim.command( f'{ ComputeFittingHeightForCurrentWindow() }wincmd _' )\n\n\ndef ConvertDiagnosticsToQfList( diagnostics ):\n  def ConvertDiagnosticToQfFormat( diagnostic ):\n    # See :h getqflist for a description of the dictionary fields.\n    # Note that, as usual, Vim is completely inconsistent about whether\n    # line/column numbers are 1 or 0 based in its various APIs. Here, it wants\n    # them to be 1-based. The documentation states quite clearly that it\n    # expects a byte offset, by which it means \"1-based column number\" as\n    # described in :h getqflist (\"the first column is 1\").\n    location = diagnostic[ 'location' ]\n    line_num = location[ 'line_num' ]\n\n    # libclang can give us diagnostics that point \"outside\" the file; Vim borks\n    # on these.\n    if line_num < 1:\n      line_num = 1\n\n    text = diagnostic[ 'text' ]\n    if diagnostic.get( 'fixit_available', False ):\n      text += ' (FixIt available)'\n\n    return {\n      'bufnr' : GetBufferNumberForFilename( location[ 'filepath' ],\n                                            create_buffer_if_needed = True ),\n      'lnum'  : line_num,\n      'col'   : location[ 'column_num' ],\n      'text'  : text,\n      'type'  : diagnostic[ 'kind' ][ 0 ],\n      'valid' : 1\n    }\n\n  return [ ConvertDiagnosticToQfFormat( x ) for x in diagnostics ]\n\n\ndef GetVimGlobalsKeys():\n  return vim.eval( 'keys( g: )' )\n\n\ndef VimExpressionToPythonType( vim_expression ):\n  \"\"\"Returns a Python type from the return value of the supplied Vim expression.\n  If the expression returns a list, dict or other non-string type, then it is\n  returned unmodified. If the string return can be converted to an\n  integer, returns an integer, otherwise returns the result converted to a\n  Unicode string.\"\"\"\n\n  result = vim.eval( vim_expression )\n  if not ( isinstance( result, str ) or isinstance( result, bytes ) ):\n    return result\n\n  try:\n    return int( result )\n  except ValueError:\n    return ToUnicode( result )\n\n\ndef HiddenEnabled( buffer_object ):\n  if buffer_object.options[ 'bh' ] == \"hide\":\n    return True\n  return GetBoolValue( '&hidden' )\n\n\ndef BufferIsUsable( buffer_object ):\n  return not BufferModified( buffer_object ) or HiddenEnabled( buffer_object )\n\n\ndef EscapeFilepathForVimCommand( filepath ):\n  return GetVariableValue( f\"fnameescape('{ EscapeForVim( filepath ) }')\" )\n\n\ndef ComparePaths( path1, path2 ):\n  # Assume that the file system is case-insensitive on Windows and macOS and\n  # case-sensitive on other platforms. While this is not necessarily true, being\n  # completely correct here is not worth the trouble as this assumption\n  # represents the overwhelming use case and detecting the case sensitivity of a\n  # file system is tricky.\n  if OnWindows() or OnMac():\n    return path1.lower() == path2.lower()\n  return path1 == path2\n\n\n# Both |line| and |column| need to be 1-based\ndef TryJumpLocationInTab( tab, filename, line, column ):\n  for win in tab.windows:\n    if ComparePaths( GetBufferFilepath( win.buffer ), filename ):\n      vim.current.tabpage = tab\n      vim.current.window = win\n      if line is not None and column is not None:\n        vim.current.window.cursor = ( line, column - 1 )\n        # Open possible folding at location\n        vim.command( 'normal! zv' )\n        # Center the screen on the jumped-to location\n        vim.command( 'normal! zz' )\n\n      return True\n  # 'filename' is not opened in this tab page\n  return False\n\n\n# Both |line| and |column| need to be 1-based\ndef TryJumpLocationInTabs( filename, line, column ):\n  for tab in vim.tabpages:\n    if TryJumpLocationInTab( tab, filename, line, column ):\n      return True\n  # 'filename' is not opened in any tab pages\n  return False\n\n\n# Maps User command to vim command\ndef GetVimCommand( user_command, default = 'edit' ):\n  vim_command = BUFFER_COMMAND_MAP.get( user_command, default )\n  if vim_command == 'edit' and not BufferIsUsable( vim.current.buffer ):\n    vim_command = 'split'\n  return vim_command\n\n\ndef JumpToFile( filename, command, modifiers ):\n  vim_command = GetVimCommand( command )\n  try:\n    escaped_filename = EscapeFilepathForVimCommand( filename )\n    vim.command(\n        f'keepjumps { modifiers } { vim_command } { escaped_filename }' )\n  # When the file we are trying to jump to has a swap file\n  # Vim opens swap-exists-choices dialog and throws vim.error with E325 error,\n  # or KeyboardInterrupt after user selects one of the options.\n  except vim.error as e:\n    if 'E325' not in str( e ):\n      raise\n    # Do nothing if the target file is still not opened (user chose (Q)uit).\n    if filename != GetCurrentBufferFilepath():\n      return False\n  # Thrown when user chooses (A)bort in .swp message box.\n  except KeyboardInterrupt:\n    return False\n  return True\n\n\n# Both |line| and |column| need to be 1-based\ndef JumpToLocation( filename, line, column, modifiers, command ):\n  # Add an entry to the jumplist\n  vim.command( \"normal! m'\" )\n\n  if filename != GetCurrentBufferFilepath():\n    # We prefix the command with 'keepjumps' so that opening the file is not\n    # recorded in the jumplist. So when we open the file and move the cursor to\n    # a location in it, the user can use CTRL-O to jump back to the original\n    # location, not to the start of the newly opened file.\n    # Sadly this fails on random occasions and the undesired jump remains in the\n    # jumplist.\n    if command == 'split-or-existing-window':\n      if 'tab' in modifiers:\n        if TryJumpLocationInTabs( filename, line, column ):\n          return\n      elif TryJumpLocationInTab( vim.current.tabpage, filename, line, column ):\n        return\n      command = 'split'\n\n    # This command is kept for backward compatibility. :tab should be used with\n    # the 'split-or-existing-window' command instead.\n    if command == 'new-or-existing-tab':\n      if TryJumpLocationInTabs( filename, line, column ):\n        return\n      command = 'new-tab'\n\n    if not JumpToFile( filename, command, modifiers ):\n      return\n\n  if line is not None and column is not None:\n    vim.current.window.cursor = ( line, column - 1 )\n\n    # Open possible folding at location\n    vim.command( 'normal! zv' )\n    # Center the screen on the jumped-to location\n    vim.command( 'normal! zz' )\n\n\ndef NumLinesInBuffer( buffer_object ):\n  # This is actually less than obvious, that's why it's wrapped in a function\n  return len( buffer_object )\n\n\n# Calling this function from the non-GUI thread will sometimes crash Vim. At\n# the time of writing, YCM only uses the GUI thread inside Vim (this used to\n# not be the case).\ndef PostVimMessage( message, warning = True, truncate = False ):\n  \"\"\"Display a message on the Vim status line. By default, the message is\n  highlighted and logged to Vim command-line history (see :h history).\n  Unset the |warning| parameter to disable this behavior. Set the |truncate|\n  parameter to avoid hit-enter prompts (see :h hit-enter) when the message is\n  longer than the window width.\"\"\"\n  echo_command = 'echom' if warning else 'echo'\n\n  # Displaying a new message while previous ones are still on the status line\n  # might lead to a hit-enter prompt or the message appearing without a\n  # newline so we do a redraw first.\n  vim.command( 'redraw' )\n\n  if warning:\n    vim.command( 'echohl WarningMsg' )\n\n  message = ToUnicode( message )\n\n  if truncate:\n    vim_width = GetIntValue( '&columns' )\n\n    message = message.replace( '\\n', ' ' )\n    message = message.replace( '\\t', ' ' )\n    if len( message ) >= vim_width:\n      message = message[ : vim_width - 4 ] + '...'\n\n    old_ruler = GetIntValue( '&ruler' )\n    old_showcmd = GetIntValue( '&showcmd' )\n    vim.command( 'set noruler noshowcmd' )\n\n    vim.command( f\"{ echo_command } '{ EscapeForVim( message ) }'\" )\n\n    SetVariableValue( '&ruler', old_ruler )\n    SetVariableValue( '&showcmd', old_showcmd )\n  else:\n    for line in message.split( '\\n' ):\n      vim.command( f\"{ echo_command } '{ EscapeForVim( line ) }'\" )\n\n  if warning:\n    vim.command( 'echohl None' )\n\n\ndef PresentDialog( message, choices, default_choice_index = 0 ):\n  \"\"\"Presents the user with a dialog where a choice can be made.\n  This will be a dialog for gvim users or a question in the message buffer\n  for vim users or if `set guioptions+=c` was used.\n\n  choices is list of alternatives.\n  default_choice_index is the 0-based index of the default element\n  that will get choosen if the user hits <CR>. Use -1 for no default.\n\n  PresentDialog will return a 0-based index into the list\n  or -1 if the dialog was dismissed by using <Esc>, Ctrl-C, etc.\n\n  If you are presenting a list of options for the user to choose from, such as\n  a list of imports, or lines to insert (etc.), SelectFromList is a better\n  option.\n\n  See also:\n    :help confirm() in vim (Note that vim uses 1-based indexes)\n\n  Example call:\n    PresentDialog(\"Is this a nice example?\", [\"Yes\", \"No\", \"May&be\"])\n      Is this a nice example?\n      [Y]es, (N)o, May(b)e:\"\"\"\n  message = EscapeForVim( ToUnicode( message ) )\n  choices = EscapeForVim( ToUnicode( '\\n'.join( choices ) ) )\n  to_eval = ( f\"confirm( '{ message }', \"\n                       f\"'{ choices }', \"\n                       f\"{ default_choice_index + 1 } )\" )\n  try:\n    return GetIntValue( to_eval ) - 1\n  except KeyboardInterrupt:\n    return -1\n\n\ndef Confirm( message ):\n  \"\"\"Display |message| with Ok/Cancel operations. Returns True if the user\n  selects Ok\"\"\"\n  return bool( PresentDialog( message, [ \"Ok\", \"Cancel\" ] ) == 0 )\n\n\ndef SelectFromList( prompt, items ):\n  \"\"\"Ask the user to select an item from the list |items|.\n\n  Presents the user with |prompt| followed by a numbered list of |items|,\n  from which they select one. The user is asked to enter the number of an\n  item or click it.\n\n  |items| should not contain leading ordinals: they are added automatically.\n\n  Returns the 0-based index in the list |items| that the user selected, or an\n  exception if no valid item was selected.\n\n  See also :help inputlist().\"\"\"\n\n  vim_items = [ prompt ]\n  vim_items.extend( [ f\"{ i + 1 }: { item }\"\n                      for i, item in enumerate( items ) ] )\n\n  # The vim documentation warns not to present lists larger than the number of\n  # lines of display. This is sound advice, but there really isn't any sensible\n  # thing we can do in that scenario. Testing shows that Vim just pages the\n  # message; that behaviour is as good as any, so we don't manipulate the list,\n  # or attempt to page it.\n\n  # For an explanation of the purpose of inputsave() / inputrestore(),\n  # see :help input(). Briefly, it makes inputlist() work as part of a mapping.\n  vim.eval( 'inputsave()' )\n  try:\n    # Vim returns the number the user entered, or the line number the user\n    # clicked. This may be wildly out of range for our list. It might even be\n    # negative.\n    #\n    # The first item is index 0, and this maps to our \"prompt\", so we subtract 1\n    # from the result and return that, assuming it is within the range of the\n    # supplied list. If not, we return negative.\n    #\n    # See :help input() for explanation of the use of inputsave() and inpput\n    # restore(). It is done in try/finally in case vim.eval ever throws an\n    # exception (such as KeyboardInterrupt)\n    selected = GetIntValue( \"inputlist( \" + json.dumps( vim_items ) + \" )\" ) - 1\n  except KeyboardInterrupt:\n    selected = -1\n  finally:\n    vim.eval( 'inputrestore()' )\n\n  if selected < 0 or selected >= len( items ):\n    # User selected something outside of the range\n    raise RuntimeError( NO_SELECTION_MADE_MSG )\n\n  return selected\n\n\ndef EscapeForVim( text ):\n  return ToUnicode( text.replace( \"'\", \"''\" ) )\n\n\ndef AllOpenedFiletypes():\n  \"\"\"Returns a dict mapping filetype to list of buffer numbers for all open\n  buffers\"\"\"\n  filetypes = defaultdict( list )\n  for buffer in vim.buffers:\n    for filetype in FiletypesForBuffer( buffer ):\n      filetypes[ filetype ].append( buffer.number )\n  return filetypes\n\n\ndef CurrentFiletypes():\n  filetypes = vim.eval( \"&filetype\" )\n  if not filetypes:\n    filetypes = 'ycm_nofiletype'\n  return ToUnicode( filetypes ).split( '.' )\n\n\ndef CurrentFiletypesEnabled( disabled_filetypes ):\n  \"\"\"Return False if one of the current filetypes is disabled, True otherwise.\n  |disabled_filetypes| must be a dictionary where keys are the disabled\n  filetypes and values are unimportant. The special key '*' matches all\n  filetypes.\"\"\"\n  return ( '*' not in disabled_filetypes and\n           not any( x in disabled_filetypes for x in CurrentFiletypes() ) )\n\n\ndef GetBufferFiletypes( bufnr ):\n  command = f'getbufvar({ bufnr }, \"&ft\")'\n  filetypes = vim.eval( command )\n  if not filetypes:\n    filetypes = 'ycm_nofiletype'\n  return ToUnicode( filetypes ).split( '.' )\n\n\ndef FiletypesForBuffer( buffer_object ):\n  # NOTE: Getting &ft for other buffers only works when the buffer has been\n  # visited by the user at least once, which is true for modified buffers\n\n  # We don't use\n  #\n  #   buffer_object.options[ 'ft' ]\n  #\n  # to get the filetypes because this causes annoying flickering when the buffer\n  # is hidden.\n  return GetBufferFiletypes( buffer_object.number )\n\n\ndef VariableExists( variable ):\n  return GetBoolValue( f\"exists( '{ EscapeForVim( variable ) }' )\" )\n\n\ndef SetVariableValue( variable, value ):\n  vim.command( f\"let { variable } = { json.dumps( value ) }\" )\n\n\ndef GetVariableValue( variable ):\n  return vim.eval( variable )\n\n\ndef GetBoolValue( variable ):\n  return bool( int( vim.eval( variable ) ) )\n\n\ndef GetIntValue( variable ):\n  return int( vim.eval( variable ) or 0 )\n\n\ndef _SortChunksByFile( chunks ):\n  \"\"\"Sort the members of the list |chunks| (which must be a list of dictionaries\n  conforming to ycmd.responses.FixItChunk) by their filepath. Returns a new\n  list in arbitrary order.\"\"\"\n\n  chunks_by_file = defaultdict( list )\n\n  for chunk in chunks:\n    filepath = chunk[ 'range' ][ 'start' ][ 'filepath' ]\n    chunks_by_file[ filepath ].append( chunk )\n\n  return chunks_by_file\n\n\ndef _GetNumNonVisibleFiles( file_list ):\n  \"\"\"Returns the number of file in the iterable list of files |file_list| which\n  are not curerntly open in visible windows\"\"\"\n  return len(\n      [ f for f in file_list\n        if not BufferIsVisible( GetBufferNumberForFilename( f ) ) ] )\n\n\ndef _OpenFileInSplitIfNeeded( filepath ):\n  \"\"\"Ensure that the supplied filepath is open in a visible window, opening a\n  new split if required. Returns the buffer number of the file and an indication\n  of whether or not a new split was opened.\n\n  If the supplied filename is already open in a visible window, return just\n  return its buffer number. If the supplied file is not visible in a window\n  in the current tab, opens it in a new vertical split.\n\n  Returns a tuple of ( buffer_num, split_was_opened ) indicating the buffer\n  number and whether or not this method created a new split. If the user opts\n  not to open a file, or if opening fails, this method raises RuntimeError,\n  otherwise, guarantees to return a visible buffer number in buffer_num.\"\"\"\n\n  buffer_num = GetBufferNumberForFilename( filepath )\n\n  # We only apply changes in the current tab page (i.e. \"visible\" windows).\n  # Applying changes in tabs does not lead to a better user experience, as the\n  # quickfix list no longer works as you might expect (doesn't jump into other\n  # tabs), and the complexity of choosing where to apply edits is significant.\n  if BufferIsVisible( buffer_num ):\n    # file is already open and visible, just return that buffer number (and an\n    # idicator that we *didn't* open a split)\n    return ( buffer_num, False )\n\n  # The file is not open in a visible window, so we open it in a split.\n  # We open the file with a small, fixed height. This means that we don't\n  # make the current buffer the smallest after a series of splits.\n  OpenFilename( filepath, {\n    'focus': True,\n    'fix': True,\n    'size': GetIntValue( '&previewheight' ),\n  } )\n\n  # OpenFilename returns us to the original cursor location. This is what we\n  # want, because we don't want to disorientate the user, but we do need to\n  # know the (now open) buffer number for the filename\n  buffer_num = GetBufferNumberForFilename( filepath )\n  if not BufferIsVisible( buffer_num ):\n    # This happens, for example, if there is a swap file and the user\n    # selects the \"Quit\" or \"Abort\" options. We just raise an exception to\n    # make it clear to the user that the abort has left potentially\n    # partially-applied changes.\n    raise RuntimeError(\n        f'Unable to open file: { filepath }\\nFixIt/Refactor operation '\n        'aborted prior to completion. Your files have not been '\n        'fully updated. Please use undo commands to revert the '\n        'applied changes.' )\n\n  # We opened this file in a split\n  return ( buffer_num, True )\n\n\ndef ReplaceChunks( chunks, silent=False ):\n  \"\"\"Apply the source file deltas supplied in |chunks| to arbitrary files.\n  |chunks| is a list of changes defined by ycmd.responses.FixItChunk,\n  which may apply arbitrary modifications to arbitrary files.\n\n  If a file specified in a particular chunk is not currently open in a visible\n  buffer (i.e., one in a window visible in the current tab), we:\n    - issue a warning to the user that we're going to open new files (and offer\n      her the option to abort cleanly)\n    - open the file in a new split, make the changes, then hide the buffer.\n\n  If for some reason a file could not be opened or changed, raises RuntimeError.\n  Otherwise, returns no meaningful value.\"\"\"\n\n  # We apply the edits file-wise for efficiency.\n  chunks_by_file = _SortChunksByFile( chunks )\n\n  # We sort the file list simply to enable repeatable testing.\n  sorted_file_list = sorted( chunks_by_file.keys() )\n\n  if not silent:\n    # Make sure the user is prepared to have her screen mutilated by the new\n    # buffers.\n    num_files_to_open = _GetNumNonVisibleFiles( sorted_file_list )\n\n    if num_files_to_open > 0:\n      if not Confirm(\n            FIXIT_OPENING_BUFFERS_MESSAGE_FORMAT.format( num_files_to_open ) ):\n        return\n\n  # Store the list of locations where we applied changes. We use this to display\n  # the quickfix window showing the user where we applied changes.\n  locations = []\n\n  for filepath in sorted_file_list:\n    buffer_num, close_window = _OpenFileInSplitIfNeeded( filepath )\n\n    locations.extend( ReplaceChunksInBuffer( chunks_by_file[ filepath ],\n                                             vim.buffers[ buffer_num ] ) )\n\n    # When opening tons of files, we don't want to have a split for each new\n    # file, as this simply does not scale, so we open the window, make the\n    # edits, then hide the window.\n    if close_window:\n      # Some plugins (I'm looking at you, syntastic) might open a location list\n      # for the window we just opened. We don't want that location list hanging\n      # around, so we close it. lclose is a no-op if there is no location list.\n      vim.command( 'lclose' )\n\n      # Note that this doesn't lose our changes. It simply \"hides\" the buffer,\n      # which can later be re-accessed via the quickfix list or `:ls`\n      vim.command( 'hide' )\n\n  # Open the quickfix list, populated with entries for each location we changed.\n  if not silent:\n    if locations:\n      SetQuickFixList( locations )\n\n    PostVimMessage( f'Applied { len( chunks ) } changes', warning = False )\n\n\ndef ReplaceChunksInBuffer( chunks, vim_buffer ):\n  \"\"\"Apply changes in |chunks| to the buffer-like object |buffer| and return the\n  locations for that buffer.\"\"\"\n\n  # We apply the chunks from the bottom to the top of the buffer so that we\n  # don't need to adjust the position of the remaining chunks due to text\n  # changes. This assumes that chunks are not overlapping. However, we still\n  # allow multiple chunks to share the same starting position (because of the\n  # language server protocol specs). These chunks must be applied in their order\n  # of appareance. Since Python sorting is stable, if we sort the whole list in\n  # reverse order of location, these chunks will be reversed. Therefore, we\n  # need to fully reverse the list then sort it on the starting position in\n  # reverse order.\n  chunks.reverse()\n  chunks.sort( key = lambda chunk: (\n    chunk[ 'range' ][ 'start' ][ 'line_num' ],\n    chunk[ 'range' ][ 'start' ][ 'column_num' ]\n  ), reverse = True )\n\n  # However, we still want to display the locations from the top of the buffer\n  # to its bottom.\n  return reversed( [ ReplaceChunk( chunk[ 'range' ][ 'start' ],\n                                   chunk[ 'range' ][ 'end' ],\n                                   chunk[ 'replacement_text' ],\n                                   vim_buffer )\n                     for chunk in chunks ] )\n\n\ndef SplitLines( contents ):\n  \"\"\"Return a list of each of the lines in the byte string |contents|.\n  Behavior is equivalent to str.splitlines with the following exceptions:\n   - empty strings are returned as [ '' ];\n   - a trailing newline is not ignored (i.e. SplitLines( '\\n' )\n     returns [ '', '' ], not [ '' ] ).\"\"\"\n  if contents == b'':\n    return [ b'' ]\n\n  lines = contents.splitlines()\n\n  if contents.endswith( b'\\r' ) or contents.endswith( b'\\n' ):\n    lines.append( b'' )\n\n  return lines\n\n\n# Replace the chunk of text specified by a contiguous range with the supplied\n# text and return the location.\n# * start and end are objects with line_num and column_num properties\n# * the range is inclusive\n# * indices are all 1-based\n#\n# NOTE: Works exclusively with bytes() instances and byte offsets as returned\n# by ycmd and used within the Vim buffers\ndef ReplaceChunk( start, end, replacement_text, vim_buffer ):\n  # ycmd's results are all 1-based, but vim's/python's are all 0-based\n  # (so we do -1 on all of the values)\n  start_line = start[ 'line_num' ] - 1\n  end_line = end[ 'line_num' ] - 1\n\n  start_column = start[ 'column_num' ] - 1\n  end_column = end[ 'column_num' ] - 1\n\n  # When sending a request to the server, a newline is added to the buffer\n  # contents to match what gets saved to disk. If the server generates a chunk\n  # containing that newline, this chunk goes past the Vim buffer contents since\n  # there is actually no new line. When this happens, recompute the end position\n  # of where the chunk is applied and remove all trailing characters in the\n  # chunk.\n  if end_line >= len( vim_buffer ):\n    end_column = len( ToBytes( vim_buffer[ -1 ] ) )\n    end_line = len( vim_buffer ) - 1\n    replacement_text = replacement_text.rstrip()\n\n  # NOTE: replacement_text is unicode, but all our offsets are byte offsets,\n  # so we convert to bytes\n  replacement_lines = SplitLines( ToBytes( replacement_text ) )\n\n  # NOTE: Vim buffers are a list of unicode objects on Python 3.\n  start_existing_text = ToBytes( vim_buffer[ start_line ] )[ : start_column ]\n  end_line_text = ToBytes( vim_buffer[ end_line ] )\n  end_existing_text = end_line_text[ end_column : ]\n\n  replacement_lines[ 0 ] = start_existing_text + replacement_lines[ 0 ]\n  replacement_lines[ -1 ] = replacement_lines[ -1 ] + end_existing_text\n\n  cursor_line, cursor_column = CurrentLineAndColumn()\n\n  vim_buffer[ start_line : end_line + 1 ] = replacement_lines[ : ]\n\n  # When the cursor position is on the last line in the replaced area, and ends\n  # up somewhere after the end of the new text, we need to reset the cursor\n  # position. This is because Vim doesn't know where to put it, and guesses\n  # badly. We put it at the end of the new text.\n  if cursor_line == end_line and cursor_column >= end_column:\n    cursor_line = start_line + len( replacement_lines ) - 1\n    cursor_column += len( replacement_lines[ - 1 ] ) - len( end_line_text )\n    SetCurrentLineAndColumn( cursor_line, cursor_column )\n\n  return {\n    'bufnr': vim_buffer.number,\n    'filename': vim_buffer.name,\n    # line and column numbers are 1-based in qflist\n    'lnum': start_line + 1,\n    'col': start_column + 1,\n    'text': replacement_text,\n    'type': 'F',\n  }\n\n\ndef InsertNamespace( namespace ):\n  if VariableExists( 'g:ycm_csharp_insert_namespace_expr' ):\n    expr = GetVariableValue( 'g:ycm_csharp_insert_namespace_expr' )\n    if expr:\n      SetVariableValue( \"g:ycm_namespace_to_insert\", namespace )\n      vim.eval( expr )\n      return\n\n  pattern = r'^\\s*using\\(\\s\\+[a-zA-Z0-9]\\+\\s\\+=\\)\\?\\s\\+[a-zA-Z0-9.]\\+\\s*;\\s*'\n  existing_indent = ''\n  line = SearchInCurrentBuffer( pattern )\n  if line:\n    existing_line = LineTextInCurrentBuffer( line )\n    existing_indent = re.sub( r'\\S.*', '', existing_line )\n  new_line = f'{ existing_indent }using { namespace };\\n'\n  replace_pos = { 'line_num': line + 1, 'column_num': 1 }\n  ReplaceChunk( replace_pos, replace_pos, new_line, vim.current.buffer )\n  PostVimMessage( f'Add namespace: { namespace }', warning = False )\n\n\ndef SearchInCurrentBuffer( pattern ):\n  \"\"\" Returns the 1-indexed line on which the pattern matches\n  (going UP from the current position) or 0 if not found \"\"\"\n  return GetIntValue( f\"search('{ EscapeForVim( pattern ) }', 'Wcnb')\" )\n\n\ndef LineTextInCurrentBuffer( line_number ):\n  \"\"\" Returns the text on the 1-indexed line (NOT 0-indexed) \"\"\"\n  return vim.current.buffer[ line_number - 1 ]\n\n\ndef ClosePreviewWindow():\n  \"\"\" Close the preview window if it is present, otherwise do nothing \"\"\"\n  vim.command( 'silent! pclose!' )\n\n\ndef JumpToPreviewWindow():\n  \"\"\" Jump the vim cursor to the preview window, which must be active. Returns\n  boolean indicating if the cursor ended up in the preview window \"\"\"\n  vim.command( 'silent! wincmd P' )\n  return vim.current.window.options[ 'previewwindow' ]\n\n\ndef JumpToPreviousWindow():\n  \"\"\" Jump the vim cursor to its previous window position \"\"\"\n  vim.command( 'silent! wincmd p' )\n\n\ndef JumpToTab( tab_number ):\n  \"\"\"Jump to Vim tab with corresponding number \"\"\"\n  vim.command( f'silent! tabn { tab_number }' )\n\n\ndef OpenFileInPreviewWindow( filename, modifiers ):\n  \"\"\" Open the supplied filename in the preview window \"\"\"\n  if modifiers:\n    modifiers = ' ' + modifiers\n  vim.command( f'silent!{ modifiers } pedit! { filename }' )\n\n\ndef WriteToPreviewWindow( message, modifiers ):\n  \"\"\" Display the supplied message in the preview window \"\"\"\n\n  # This isn't something that comes naturally to Vim. Vim only wants to show\n  # tags and/or actual files in the preview window, so we have to hack it a\n  # little bit. We generate a temporary file name and \"open\" that, then write\n  # the data to it. We make sure the buffer can't be edited or saved. Other\n  # approaches include simply opening a split, but we want to take advantage of\n  # the existing Vim options for preview window height, etc.\n\n  ClosePreviewWindow()\n\n  OpenFileInPreviewWindow( vim.eval( 'tempname()' ), modifiers )\n\n  if JumpToPreviewWindow():\n    # We actually got to the preview window. By default the preview window can't\n    # be changed, so we make it writable, write to it, then make it read only\n    # again.\n    vim.current.buffer.options[ 'modifiable' ] = True\n    vim.current.buffer.options[ 'readonly' ]   = False\n\n    vim.current.buffer[ : ] = message.splitlines()\n\n    vim.current.buffer.options[ 'buftype' ]    = 'nofile'\n    vim.current.buffer.options[ 'bufhidden' ]  = 'wipe'\n    vim.current.buffer.options[ 'buflisted' ]  = False\n    vim.current.buffer.options[ 'swapfile' ]   = False\n    vim.current.buffer.options[ 'modifiable' ] = False\n    vim.current.buffer.options[ 'readonly' ]   = True\n\n    # We need to prevent closing the window causing a warning about unsaved\n    # file, so we pretend to Vim that the buffer has not been changed.\n    vim.current.buffer.options[ 'modified' ]   = False\n\n    JumpToPreviousWindow()\n  else:\n    # We couldn't get to the preview window, but we still want to give the user\n    # the information we have. The only remaining option is to echo to the\n    # status area.\n    PostVimMessage( message, warning = False )\n\n\ndef BufferIsVisibleForFilename( filename ):\n  \"\"\"Check if a buffer exists for a specific file.\"\"\"\n  buffer_number = GetBufferNumberForFilename( filename )\n  return BufferIsVisible( buffer_number )\n\n\ndef CloseBuffersForFilename( filename ):\n  \"\"\"Close all buffers for a specific file.\"\"\"\n  buffer_number = GetBufferNumberForFilename( filename )\n  while buffer_number != -1:\n    vim.command( f'silent! bwipeout! { buffer_number }' )\n    new_buffer_number = GetBufferNumberForFilename( filename )\n    if buffer_number == new_buffer_number:\n      raise RuntimeError( f\"Buffer { buffer_number } for filename \"\n                          f\"'{ filename }' should already be wiped out.\" )\n    buffer_number = new_buffer_number\n\n\ndef OpenFilename( filename, options = {} ):\n  \"\"\"Open a file in Vim. Following options are available:\n  - command: specify which Vim command is used to open the file. Choices\n  are same-buffer, horizontal-split, vertical-split, and new-tab (default:\n  horizontal-split);\n  - size: set the height of the window for a horizontal split or the width for\n  a vertical one (default: '');\n  - fix: set the winfixheight option for a horizontal split or winfixwidth for\n  a vertical one (default: False). See :h winfix for details;\n  - focus: focus the opened file (default: False);\n  - watch: automatically watch for changes (default: False). This is useful\n  for logs;\n  - position: set the position where the file is opened (default: start).\n  Choices are 'start' and 'end'.\n  - mods: The vim <mods> for the command, such as :vertical\"\"\"\n\n  # Set the options.\n  command = GetVimCommand( options.get( 'command', 'horizontal-split' ),\n                           'horizontal-split' )\n  size = ( options.get( 'size', '' ) if command in [ 'split', 'vsplit' ] else\n           '' )\n  focus = options.get( 'focus', False )\n\n  # There is no command in Vim to return to the previous tab so we need to\n  # remember the current tab if needed.\n  if not focus and command == 'tabedit':\n    previous_tab = GetIntValue( 'tabpagenr()' )\n  else:\n    previous_tab = None\n\n  # Open the file.\n  try:\n    vim.command( f'{ options.get( \"mods\", \"\" ) }'\n                 f'{ size }'\n                 f'{ command } '\n                 f'{ filename }' )\n  # When the file we are trying to jump to has a swap file,\n  # Vim opens swap-exists-choices dialog and throws vim.error with E325 error,\n  # or KeyboardInterrupt after user selects one of the options which actually\n  # opens the file (Open read-only/Edit anyway).\n  except vim.error as e:\n    if 'E325' not in str( e ):\n      raise\n\n    # Otherwise, the user might have chosen Quit. This is detectable by the\n    # current file not being the target file\n    if filename != GetCurrentBufferFilepath():\n      return\n  except KeyboardInterrupt:\n    # Raised when the user selects \"Abort\" after swap-exists-choices\n    return\n\n  _SetUpLoadedBuffer( command,\n                      filename,\n                      options.get( 'fix', False ),\n                      options.get( 'position', 'start' ),\n                      options.get( 'watch', False ) )\n\n  # Vim automatically set the focus to the opened file so we need to get the\n  # focus back (if the focus option is disabled) when opening a new tab or\n  # window.\n  if not focus:\n    if command == 'tabedit':\n      JumpToTab( previous_tab )\n    if command in [ 'split', 'vsplit' ]:\n      JumpToPreviousWindow()\n\n\ndef _SetUpLoadedBuffer( command, filename, fix, position, watch ):\n  \"\"\"After opening a buffer, configure it according to the supplied options,\n  which are as defined by the OpenFilename method.\"\"\"\n\n  if command == 'split':\n    vim.current.window.options[ 'winfixheight' ] = fix\n  if command == 'vsplit':\n    vim.current.window.options[ 'winfixwidth' ] = fix\n\n  if watch:\n    vim.current.buffer.options[ 'autoread' ] = True\n    vim.command( \"exec 'au BufEnter <buffer> :silent! checktime {0}'\"\n                 .format( filename ) )\n\n  if position == 'end':\n    vim.command( 'silent! normal! Gzz' )\n\n\ndef BuildRange( start_line, end_line ):\n  # Vim only returns the starting and ending lines of the range of a command.\n  # Check if those lines correspond to a previous visual selection and if they\n  # do, use the columns of that selection to build the range.\n  start = vim.current.buffer.mark( '<' )\n  end = vim.current.buffer.mark( '>' )\n  if not start or not end or start_line != start[ 0 ] or end_line != end[ 0 ]:\n    start = [ start_line, 0 ]\n    end = [ end_line, len( vim.current.buffer[ end_line - 1 ] ) ]\n  # Vim Python API returns 1-based lines and 0-based columns while ycmd expects\n  # 1-based lines and columns.\n  return {\n    'range': {\n      'start': {\n        'line_num': start[ 0 ],\n        'column_num': start[ 1 ] + 1\n      },\n      'end': {\n        'line_num': end[ 0 ],\n        # Vim returns the maximum 32-bit integer value when a whole line is\n        # selected. Use the end of line instead.\n        'column_num': min( end[ 1 ],\n                           len( vim.current.buffer[ end[ 0 ] - 1 ] ) ) + 1\n      }\n    }\n  }\n\n\n# Expects version_string in 'MAJOR.MINOR.PATCH' format, e.g. '8.1.278'\ndef VimVersionAtLeast( version_string ):\n  major, minor, patch = ( int( x ) for x in version_string.split( '.' ) )\n\n  # For Vim 8.1.278, v:version is '801'\n  actual_major_and_minor = GetIntValue( 'v:version' )\n  matching_major_and_minor = major * 100 + minor\n  if actual_major_and_minor != matching_major_and_minor:\n    return actual_major_and_minor > matching_major_and_minor\n\n  return GetBoolValue( f\"has( 'patch{ patch }' )\" )\n\n\ndef AutoCloseOnCurrentBuffer( name ):\n  \"\"\"Create an autocommand group with name |name| on the current buffer that\n  automatically closes it when leaving its window.\"\"\"\n  vim.command( f'augroup { name }' )\n  vim.command( 'autocmd! * <buffer>' )\n  vim.command( 'autocmd WinLeave <buffer> '\n               'if bufnr( \"%\" ) == expand( \"<abuf>\" ) | q | endif '\n               f'| autocmd! { name }' )\n  vim.command( 'augroup END' )\n\n\n@memoize()\ndef VimIsNeovim():\n  return GetBoolValue( 'has( \"nvim\" )' )\n\n\n@memoize()\ndef VimSupportsPopupWindows():\n  return VimHasFunctions( 'popup_create',\n                          'popup_atcursor',\n                          'popup_move',\n                          'popup_hide',\n                          'popup_settext',\n                          'popup_show',\n                          'popup_close' )\n\n\n@memoize()\ndef VimHasFunction( func ):\n  return bool( GetIntValue( f\"exists( '*{ EscapeForVim( func ) }' )\" ) )\n\n\ndef VimHasFunctions( *functions ):\n  return all( VimHasFunction( f ) for f in functions )\n\n\ndef WinIDForWindow( window ):\n  return GetIntValue( f'win_getid( { window.number }, '\n                                 f'{ window.tabpage.number } )' )\n\n\ndef ScreenPositionForLineColumnInWindow( window, line, column ):\n  return vim.eval( f'screenpos( { WinIDForWindow( window ) }, '\n                              f'{ line }, '\n                              f'{ column } )' )\n\n\ndef UsingPreviewPopup():\n  return 'popup' in ToUnicode( vim.options[ 'completeopt' ] ).split( ',' )\n\n\ndef DisplayWidth():\n  return GetIntValue( '&columns' )\n\n\ndef DisplayWidthOfString( s ):\n  return GetIntValue( f\"strdisplaywidth( '{ EscapeForVim( s ) }' )\" )\n\n\ndef BuildQfListItem( goto_data_item ):\n  qf_item = {}\n  if 'filepath' in goto_data_item:\n    qf_item[ 'filename' ] = ToUnicode( goto_data_item[ 'filepath' ] )\n  if 'description' in goto_data_item:\n    qf_item[ 'text' ] = ToUnicode( goto_data_item[ 'description' ] )\n  if 'line_num' in goto_data_item:\n    qf_item[ 'lnum' ] = goto_data_item[ 'line_num' ]\n  if 'column_num' in goto_data_item:\n    # ycmd returns columns 1-based, and QuickFix lists require \"byte offsets\".\n    # See :help getqflist and equivalent comment in\n    # vimsupport.ConvertDiagnosticsToQfList.\n    #\n    # When the Vim help says \"byte index\", it really means \"1-based column\n    # number\" (which is somewhat confusing). :help getqflist states \"first\n    # column is 1\".\n    qf_item[ 'col' ] = goto_data_item[ 'column_num' ]\n\n  return qf_item\n"
  },
  {
    "path": "python/ycm/youcompleteme.py",
    "content": "# Copyright (C) 2011-2024 YouCompleteMe contributors\n#\n# This file is part of YouCompleteMe.\n#\n# YouCompleteMe is free software: you can redistribute it and/or modify\n# it under the terms of the GNU General Public License as published by\n# the Free Software Foundation, either version 3 of the License, or\n# (at your option) any later version.\n#\n# YouCompleteMe is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY; without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You should have received a copy of the GNU General Public License\n# along with YouCompleteMe.  If not, see <http://www.gnu.org/licenses/>.\n\nimport base64\nimport json\nimport logging\nimport os\nimport signal\nimport vim\nfrom subprocess import PIPE\nfrom tempfile import NamedTemporaryFile\nfrom ycm import base, paths, signature_help, vimsupport\nfrom ycm.buffer import BufferDict\nfrom ycmd import utils\nfrom ycmd.request_wrap import RequestWrap\nfrom ycm.omni_completer import OmniCompleter\nfrom ycm import syntax_parse\nfrom ycm.hierarchy_tree import HierarchyTree\nfrom ycm.client.ycmd_keepalive import YcmdKeepalive\nfrom ycm.client.base_request import BaseRequest, BuildRequestData\nfrom ycm.client.completer_available_request import SendCompleterAvailableRequest\nfrom ycm.client.command_request import ( SendCommandRequest,\n                                         SendCommandRequestAsync,\n                                         GetCommandResponse,\n                                         GetRawCommandResponse )\nfrom ycm.client.completion_request import CompletionRequest\nfrom ycm.client.resolve_completion_request import ResolveCompletionItem\nfrom ycm.client.signature_help_request import ( SignatureHelpRequest,\n                                                SigHelpAvailableByFileType )\nfrom ycm.client.debug_info_request import ( SendDebugInfoRequest,\n                                            FormatDebugInfoResponse )\nfrom ycm.client.omni_completion_request import OmniCompletionRequest\nfrom ycm.client.event_notification import SendEventNotificationAsync\nfrom ycm.client.shutdown_request import SendShutdownRequest\nfrom ycm.client.messages_request import MessagesPoll\n\n\ndef PatchNoProxy():\n  current_value = os.environ.get( 'no_proxy', '' )\n  additions = '127.0.0.1,localhost'\n  os.environ[ 'no_proxy' ] = ( additions if not current_value\n                               else current_value + ',' + additions )\n\n\n# We need this so that Requests doesn't end up using the local HTTP proxy when\n# talking to ycmd. Users should actually be setting this themselves when\n# configuring a proxy server on their machine, but most don't know they need to\n# or how to do it, so we do it for them.\n# Relevant issues:\n#  https://github.com/Valloric/YouCompleteMe/issues/641\n#  https://github.com/kennethreitz/requests/issues/879\nPatchNoProxy()\n\n# Force the Python interpreter embedded in Vim (in which we are running) to\n# ignore the SIGINT signal. This helps reduce the fallout of a user pressing\n# Ctrl-C in Vim.\nsignal.signal( signal.SIGINT, signal.SIG_IGN )\n\nHMAC_SECRET_LENGTH = 16\nSERVER_SHUTDOWN_MESSAGE = (\n  \"The ycmd server SHUT DOWN (restart with ':YcmRestartServer').\" )\nEXIT_CODE_UNEXPECTED_MESSAGE = (\n  \"Unexpected exit code {code}. \"\n  \"Type ':YcmToggleLogs {logfile}' to check the logs.\" )\nCORE_UNEXPECTED_MESSAGE = (\n  \"Unexpected error while loading the YCM core library. \"\n  \"Type ':YcmToggleLogs {logfile}' to check the logs.\" )\nCORE_MISSING_MESSAGE = (\n  'YCM core library not detected; you need to compile YCM before using it. '\n  'Follow the instructions in the documentation.' )\nCORE_OUTDATED_MESSAGE = (\n  'YCM core library too old; PLEASE RECOMPILE by running the install.py '\n  'script. See the documentation for more details.' )\nPYTHON_TOO_OLD_MESSAGE = (\n  'Your python is too old to run YCM server. '\n  'Please see troubleshooting guide on YCM GitHub wiki.'\n)\nSERVER_IDLE_SUICIDE_SECONDS = 1800  # 30 minutes\nCLIENT_LOGFILE_FORMAT = 'ycm_'\nSERVER_LOGFILE_FORMAT = 'ycmd_{port}_{std}_'\n\n# Flag to set a file handle inheritable by child processes on Windows. See\n# https://msdn.microsoft.com/en-us/library/ms724935.aspx\nHANDLE_FLAG_INHERIT = 0x00000001\n\n\nclass YouCompleteMe:\n  def __init__( self, default_options = {} ):\n    self._logger = logging.getLogger( 'ycm' )\n    self._client_logfile = None\n    self._server_stdout = None\n    self._server_stderr = None\n    self._server_popen = None\n    self._default_options = default_options\n    self._ycmd_keepalive = YcmdKeepalive()\n    self._SetUpLogging()\n    self._SetUpServer()\n    self._ycmd_keepalive.Start()\n    self._current_hierarchy = HierarchyTree()\n\n\n  def InitializeCurrentHierarchy( self, items, kind ):\n    return self._current_hierarchy.SetRootNode( items, kind )\n\n\n  def UpdateCurrentHierarchy( self, handle : int, direction : str ):\n    if not self._current_hierarchy.UpdateChangesRoot( handle, direction ):\n      items = self._ResolveHierarchyItem( handle, direction )\n      self._current_hierarchy.UpdateHierarchy( handle, items, direction )\n\n      if items is not None and direction == 'up':\n        offset = sum( len( item[ 'locations' ] ) for item in items )\n      else:\n        offset = 0\n\n      return self._current_hierarchy.HierarchyToLines(), offset\n    else:\n      location = self._current_hierarchy.HandleToRootLocation( handle )\n      kind = self._current_hierarchy._kind\n      self._current_hierarchy.Reset()\n      items = GetRawCommandResponse(\n        [ f'{ kind.title() }Hierarchy' ],\n        silent = False,\n        location = location\n      )\n      # [ 0 ] chooses the data for the 1st (and only) line.\n      # [ 1 ] chooses only the handle\n      handle = self.InitializeCurrentHierarchy( items, kind )[ 0 ][ 1 ]\n      return self.UpdateCurrentHierarchy( handle, direction )\n\n\n  def _ResolveHierarchyItem( self, handle : int, direction : str ):\n    return GetRawCommandResponse(\n      self._current_hierarchy.ResolveArguments( handle, direction ),\n      silent = False\n    )\n\n\n  def ShouldResolveItem( self, handle : int, direction : str ):\n    return self._current_hierarchy.ShouldResolveItem( handle, direction )\n\n\n  def ResetCurrentHierarchy( self ):\n    self._current_hierarchy.Reset()\n\n\n  def JumpToHierarchyItem( self, handle ):\n    self._current_hierarchy.JumpToItem(\n        handle,\n        self._user_options[ 'goto_buffer_command' ] )\n\n\n  def _SetUpServer( self ):\n    self._available_completers = {}\n    self._user_notified_about_crash = False\n    self._filetypes_with_keywords_loaded = set()\n    self._server_is_ready_with_cache = False\n    self._message_poll_requests = {}\n\n    self._latest_completion_request = None\n    self._latest_signature_help_request = None\n    self._signature_help_available_requests = SigHelpAvailableByFileType()\n    self._command_requests = {}\n    self._next_command_request_id = 0\n\n    self._signature_help_state = signature_help.SignatureHelpState()\n    self._user_options = base.GetUserOptions( self._default_options )\n    self._omnicomp = OmniCompleter( self._user_options )\n    self._buffers = BufferDict( self._user_options )\n\n    self._SetLogLevel()\n\n    hmac_secret = os.urandom( HMAC_SECRET_LENGTH )\n    options_dict = dict( self._user_options )\n    options_dict[ 'hmac_secret' ] = utils.ToUnicode(\n      base64.b64encode( hmac_secret ) )\n    options_dict[ 'server_keep_logfiles' ] = self._user_options[\n      'keep_logfiles' ]\n\n    # The temp options file is deleted by ycmd during startup.\n    with NamedTemporaryFile( delete = False, mode = 'w+' ) as options_file:\n      json.dump( options_dict, options_file )\n\n    server_port = utils.GetUnusedLocalhostPort()\n\n    BaseRequest.server_location = 'http://127.0.0.1:' + str( server_port )\n    BaseRequest.hmac_secret = hmac_secret\n\n    try:\n      python_interpreter = paths.PathToPythonInterpreter()\n    except RuntimeError as error:\n      error_message = (\n        f\"Unable to start the ycmd server. { str( error ).rstrip( '.' ) }. \"\n        \"Correct the error then restart the server \"\n        \"with ':YcmRestartServer'.\" )\n      self._logger.exception( error_message )\n      vimsupport.PostVimMessage( error_message )\n      return\n\n    args = [ python_interpreter,\n             paths.PathToServerScript(),\n             f'--port={ server_port }',\n             f'--options_file={ options_file.name }',\n             f'--log={ self._user_options[ \"log_level\" ] }',\n             f'--idle_suicide_seconds={ SERVER_IDLE_SUICIDE_SECONDS }' ]\n\n    self._server_stdout = utils.CreateLogfile(\n        SERVER_LOGFILE_FORMAT.format( port = server_port, std = 'stdout' ) )\n    self._server_stderr = utils.CreateLogfile(\n        SERVER_LOGFILE_FORMAT.format( port = server_port, std = 'stderr' ) )\n    args.append( f'--stdout={ self._server_stdout }' )\n    args.append( f'--stderr={ self._server_stderr }' )\n\n    if self._user_options[ 'keep_logfiles' ]:\n      args.append( '--keep_logfiles' )\n\n    self._server_popen = utils.SafePopen( args, stdin_windows = PIPE,\n                                          stdout = PIPE, stderr = PIPE )\n\n\n  def _SetUpLogging( self ):\n    def FreeFileFromOtherProcesses( file_object ):\n      if utils.OnWindows():\n        from ctypes import windll\n        import msvcrt\n\n        file_handle = msvcrt.get_osfhandle( file_object.fileno() )\n        windll.kernel32.SetHandleInformation( file_handle,\n                                              HANDLE_FLAG_INHERIT,\n                                              0 )\n\n    self._client_logfile = utils.CreateLogfile( CLIENT_LOGFILE_FORMAT )\n\n    handler = logging.FileHandler( self._client_logfile )\n\n    # On Windows and Python prior to 3.4, file handles are inherited by child\n    # processes started with at least one replaced standard stream, which is the\n    # case when we start the ycmd server (we are redirecting all standard\n    # outputs into a pipe). These files cannot be removed while the child\n    # processes are still up. This is not desirable for a logfile because we\n    # want to remove it at Vim exit without having to wait for the ycmd server\n    # to be completely shut down. We need to make the logfile handle\n    # non-inheritable. See https://www.python.org/dev/peps/pep-0446 for more\n    # details.\n    FreeFileFromOtherProcesses( handler.stream )\n\n    formatter = logging.Formatter( '%(asctime)s - %(levelname)s - %(message)s' )\n    handler.setFormatter( formatter )\n\n    self._logger.addHandler( handler )\n\n\n  def _SetLogLevel( self ):\n    log_level = self._user_options[ 'log_level' ]\n    numeric_level = getattr( logging, log_level.upper(), None )\n    if not isinstance( numeric_level, int ):\n      raise ValueError( f'Invalid log level: { log_level }' )\n    self._logger.setLevel( numeric_level )\n\n\n  def IsServerAlive( self ):\n    # When the process hasn't finished yet, poll() returns None.\n    return bool( self._server_popen ) and self._server_popen.poll() is None\n\n\n  def CheckIfServerIsReady( self ):\n    if not self._server_is_ready_with_cache and self.IsServerAlive():\n      self._server_is_ready_with_cache = BaseRequest().GetDataFromHandler(\n          'ready', display_message = False )\n    return self._server_is_ready_with_cache\n\n\n  def IsServerReady( self ):\n    return self._server_is_ready_with_cache\n\n\n  def NotifyUserIfServerCrashed( self ):\n    if ( not self._server_popen or self._user_notified_about_crash or\n         self.IsServerAlive() ):\n      return\n    self._user_notified_about_crash = True\n\n    return_code = self._server_popen.poll()\n    logfile = os.path.basename( self._server_stderr )\n    # See https://github.com/Valloric/ycmd#exit-codes for the list of exit\n    # codes.\n    if return_code == 3:\n      error_message = CORE_UNEXPECTED_MESSAGE.format( logfile = logfile )\n    elif return_code == 4:\n      error_message = CORE_MISSING_MESSAGE\n    elif return_code == 7:\n      error_message = CORE_OUTDATED_MESSAGE\n    elif return_code == 8:\n      # TODO: here we could retry but discard g:ycm_server_python_interpreter\n      error_message = PYTHON_TOO_OLD_MESSAGE\n    else:\n      error_message = EXIT_CODE_UNEXPECTED_MESSAGE.format( code = return_code,\n                                                           logfile = logfile )\n\n    if return_code != 8:\n      error_message = SERVER_SHUTDOWN_MESSAGE + ' ' + error_message\n    self._logger.error( error_message )\n    vimsupport.PostVimMessage( error_message )\n\n\n  def ServerPid( self ):\n    if not self._server_popen:\n      return -1\n    return self._server_popen.pid\n\n\n  def _ShutdownServer( self ):\n    SendShutdownRequest()\n\n\n  def RestartServer( self ):\n    vimsupport.PostVimMessage( 'Restarting ycmd server...' )\n    self._ShutdownServer()\n    self._SetUpServer()\n\n\n  def SendCompletionRequest( self, force_semantic = False ):\n    request_data = BuildRequestData()\n    request_data[ 'force_semantic' ] = force_semantic\n\n    if not self.NativeFiletypeCompletionUsable():\n      wrapped_request_data = RequestWrap( request_data )\n      if self._omnicomp.ShouldUseNow( wrapped_request_data ):\n        self._latest_completion_request = OmniCompletionRequest(\n            self._omnicomp, wrapped_request_data )\n        self._latest_completion_request.Start()\n        return\n\n    self._AddExtraConfDataIfNeeded( request_data )\n    self._latest_completion_request = CompletionRequest( request_data )\n    self._latest_completion_request.Start()\n\n\n  def CompletionRequestReady( self ):\n    return bool( self._latest_completion_request and\n                 self._latest_completion_request.Done() )\n\n\n  def GetCompletionResponse( self ):\n    return self._latest_completion_request.Response()\n\n\n  def SignatureHelpAvailableRequestComplete( self, filetype, send_new=True ):\n    \"\"\"Triggers or polls signature help available request. Returns whether or\n    not the request is complete. When send_new is False, won't send a new\n    request, only return the current status (This is used by the tests)\"\"\"\n    if not send_new and filetype not in self._signature_help_available_requests:\n      return False\n\n    return self._signature_help_available_requests[ filetype ].Done()\n\n\n  def SendSignatureHelpRequest( self ):\n    \"\"\"Send a signature help request, if we're ready to. Return whether or not a\n    request was sent (and should be checked later)\"\"\"\n    if not self.NativeFiletypeCompletionUsable():\n      return False\n\n    for filetype in vimsupport.CurrentFiletypes():\n      if not self.SignatureHelpAvailableRequestComplete( filetype ):\n        continue\n\n      sig_help_available = self._signature_help_available_requests[\n          filetype ].Response()\n      if sig_help_available == 'NO':\n        continue\n\n      if sig_help_available == 'PENDING':\n        # Send another /signature_help_available request\n        self._signature_help_available_requests[ filetype ].Start( filetype )\n        continue\n\n      if not self._latest_completion_request:\n        return False\n\n      request_data = self._latest_completion_request.request_data.copy()\n      request_data[ 'signature_help_state' ] = (\n          self._signature_help_state.IsActive()\n      )\n\n      self._AddExtraConfDataIfNeeded( request_data )\n\n      self._latest_signature_help_request = SignatureHelpRequest( request_data )\n      self._latest_signature_help_request.Start()\n      return True\n\n    return False\n\n\n  def SignatureHelpRequestReady( self ):\n    return bool( self._latest_signature_help_request and\n                 self._latest_signature_help_request.Done() )\n\n\n  def GetSignatureHelpResponse( self ):\n    return self._latest_signature_help_request.Response()\n\n\n  def ClearSignatureHelp( self ):\n    self.UpdateSignatureHelp( {} )\n    if self._latest_signature_help_request:\n      self._latest_signature_help_request.Reset()\n\n\n  def UpdateSignatureHelp( self, signature_info ):\n    self._signature_help_state = signature_help.UpdateSignatureHelp(\n      self._signature_help_state,\n      signature_info )\n\n\n  def _GetCommandRequestArguments( self,\n                                   arguments,\n                                   has_range,\n                                   start_line,\n                                   end_line ):\n    extra_data = {\n      'options': {\n        'tab_size': vimsupport.GetIntValue( 'shiftwidth()' ),\n        'insert_spaces': vimsupport.GetBoolValue( '&expandtab' )\n      }\n    }\n\n    final_arguments = []\n    for argument in arguments:\n      if argument.startswith( 'ft=' ):\n        extra_data[ 'completer_target' ] = argument[ 3: ]\n        continue\n      elif argument.startswith( '--bufnr=' ):\n        extra_data[ 'bufnr' ] = int( argument[ len( '--bufnr=' ): ] )\n        continue\n\n      final_arguments.append( argument )\n\n    if has_range:\n      extra_data.update( vimsupport.BuildRange( start_line, end_line ) )\n    self._AddExtraConfDataIfNeeded( extra_data )\n\n    return final_arguments, extra_data\n\n\n\n  def SendCommandRequest( self,\n                          arguments,\n                          modifiers,\n                          has_range,\n                          start_line,\n                          end_line ):\n    final_arguments, extra_data = self._GetCommandRequestArguments(\n      arguments,\n      has_range,\n      start_line,\n      end_line )\n    return SendCommandRequest(\n      final_arguments,\n      modifiers,\n      self._user_options[ 'goto_buffer_command' ],\n      extra_data )\n\n\n  def GetCommandResponse( self, arguments ):\n    final_arguments, extra_data = self._GetCommandRequestArguments(\n      arguments,\n      False,\n      0,\n      0 )\n    return GetCommandResponse( final_arguments, extra_data )\n\n\n  def SendCommandRequestAsync( self,\n                               arguments,\n                               silent = True,\n                               location = None ):\n    final_arguments, extra_data = self._GetCommandRequestArguments(\n      arguments,\n      False,\n      0,\n      0 )\n\n    request_id = self._next_command_request_id\n    self._next_command_request_id += 1\n    self._command_requests[ request_id ] = SendCommandRequestAsync(\n      final_arguments,\n      extra_data,\n      silent,\n      location = location )\n    return request_id\n\n\n  def GetCommandRequest( self, request_id ):\n    return self._command_requests.get( request_id )\n\n\n  def FlushCommandRequest( self, request_id ):\n    self._command_requests.pop( request_id, None )\n\n\n  def GetDefinedSubcommands( self ):\n    request = BaseRequest()\n    subcommands = request.PostDataToHandler( BuildRequestData(),\n                                             'defined_subcommands' )\n    return subcommands if subcommands else []\n\n\n  def GetCurrentCompletionRequest( self ):\n    return self._latest_completion_request\n\n\n  def GetOmniCompleter( self ):\n    return self._omnicomp\n\n\n  def FiletypeCompleterExistsForFiletype( self, filetype ):\n    try:\n      return self._available_completers[ filetype ]\n    except KeyError:\n      pass\n\n    exists_completer = SendCompleterAvailableRequest( filetype )\n    if exists_completer is None:\n      return False\n\n    self._available_completers[ filetype ] = exists_completer\n    return exists_completer\n\n\n  def NativeFiletypeCompletionAvailable( self ):\n    return any( self.FiletypeCompleterExistsForFiletype( x ) for x in\n                vimsupport.CurrentFiletypes() )\n\n\n  def NativeFiletypeCompletionUsable( self ):\n    disabled_filetypes = self._user_options[\n      'filetype_specific_completion_to_disable' ]\n    return ( vimsupport.CurrentFiletypesEnabled( disabled_filetypes ) and\n             self.NativeFiletypeCompletionAvailable() )\n\n\n  def NeedsReparse( self ):\n    return self.CurrentBuffer().NeedsReparse()\n\n\n  def UpdateWithNewDiagnosticsForFile( self, filepath, diagnostics ):\n    if not self._user_options[ 'show_diagnostics_ui' ]:\n      return\n\n    bufnr = vimsupport.GetBufferNumberForFilename( filepath )\n    if bufnr in self._buffers and vimsupport.BufferIsVisible( bufnr ):\n      # Note: We only update location lists, etc. for visible buffers, because\n      # otherwise we default to using the current location list and the results\n      # are that non-visible buffer errors clobber visible ones.\n      self._buffers[ bufnr ].UpdateWithNewDiagnostics( diagnostics, True )\n    else:\n      # The project contains errors in file \"filepath\", but that file is not\n      # open in any buffer. This happens for Language Server Protocol-based\n      # completers, as they return diagnostics for the entire \"project\"\n      # asynchronously (rather than per-file in the response to the parse\n      # request).\n      #\n      # There are a number of possible approaches for\n      # this, but for now we simply ignore them. Other options include:\n      # - Use the QuickFix list to report project errors?\n      # - Use a special buffer for project errors\n      # - Put them in the location list of whatever the \"current\" buffer is\n      # - Store them in case the buffer is opened later\n      # - add a :YcmProjectDiags command\n      # - Add them to errror/warning _counts_ but not any actual location list\n      #   or other\n      # - etc.\n      #\n      # However, none of those options are great, and lead to their own\n      # complexities. So for now, we just ignore these diagnostics for files not\n      # open in any buffer.\n      pass\n\n\n  def OnPeriodicTick( self ):\n    if not self.IsServerAlive():\n      # Server has died. We'll reset when the server is started again.\n      return False\n    elif not self.IsServerReady():\n      # Try again in a jiffy\n      return True\n\n    for w in vim.windows:\n      for filetype in vimsupport.FiletypesForBuffer( w.buffer ):\n        if filetype not in self._message_poll_requests:\n          self._message_poll_requests[ filetype ] = MessagesPoll( w.buffer )\n\n        # None means don't poll this filetype\n        if ( self._message_poll_requests[ filetype ] and\n             not self._message_poll_requests[ filetype ].Poll( self ) ):\n          self._message_poll_requests[ filetype ] = None\n\n    return any( self._message_poll_requests.values() )\n\n\n  def OnFileReadyToParse( self ):\n    if not self.IsServerAlive():\n      self.NotifyUserIfServerCrashed()\n      return\n\n    if not self.IsServerReady():\n      return\n\n    extra_data = {}\n    self._AddTagsFilesIfNeeded( extra_data )\n    self._AddSyntaxDataIfNeeded( extra_data )\n    self._AddExtraConfDataIfNeeded( extra_data )\n\n    self.CurrentBuffer().SendParseRequest( extra_data )\n\n\n  def OnFileSave( self, saved_buffer_number ):\n    SendEventNotificationAsync( 'FileSave', saved_buffer_number )\n\n\n  def OnBufferUnload( self, deleted_buffer_number ):\n    SendEventNotificationAsync( 'BufferUnload', deleted_buffer_number )\n\n\n  def UpdateMatches( self ):\n    self.CurrentBuffer().UpdateMatches()\n\n\n  def OnFileTypeSet( self ):\n    buffer_number = vimsupport.GetCurrentBufferNumber()\n    filetypes = vimsupport.CurrentFiletypes()\n    self._buffers[ buffer_number ].UpdateFromFileTypes( filetypes )\n    self.OnBufferVisit()\n\n\n  def OnBufferVisit( self ):\n    for filetype in vimsupport.CurrentFiletypes():\n      # Send the signature help available request for these filetypes if we need\n      # to (as a side effect of checking if it is complete)\n      self.SignatureHelpAvailableRequestComplete( filetype, True )\n\n    extra_data = {}\n    self._AddUltiSnipsDataIfNeeded( extra_data )\n    SendEventNotificationAsync( 'BufferVisit', extra_data = extra_data )\n\n\n  def CurrentBuffer( self ):\n    return self.Buffer( vimsupport.GetCurrentBufferNumber() )\n\n\n  def Buffer( self, bufnr ):\n    return self._buffers[ bufnr ]\n\n\n  def OnInsertEnter( self ):\n    if not self._user_options[ 'update_diagnostics_in_insert_mode' ]:\n      self.CurrentBuffer().ClearDiagnosticsUI()\n\n\n  def OnInsertLeave( self ):\n    async_diags = any( self._message_poll_requests.get( filetype )\n                      for filetype in vimsupport.CurrentFiletypes() )\n    if ( not self._user_options[ 'update_diagnostics_in_insert_mode' ] and\n         ( async_diags or not self.CurrentBuffer().ParseRequestPending() ) ):\n      self.CurrentBuffer().RefreshDiagnosticsUI()\n    SendEventNotificationAsync( 'InsertLeave' )\n\n\n  def OnCursorMoved( self ):\n    self.CurrentBuffer().OnCursorMoved()\n\n\n  def _CleanLogfile( self ):\n    logging.shutdown()\n    if not self._user_options[ 'keep_logfiles' ]:\n      if self._client_logfile:\n        utils.RemoveIfExists( self._client_logfile )\n\n\n  def OnVimLeave( self ):\n    self._ShutdownServer()\n    self._CleanLogfile()\n\n\n  def OnCurrentIdentifierFinished( self ):\n    SendEventNotificationAsync( 'CurrentIdentifierFinished' )\n\n\n  def OnCompleteDone( self ):\n    completion_request = self.GetCurrentCompletionRequest()\n    if completion_request:\n      completion_request.OnCompleteDone()\n\n\n  def ResolveCompletionItem( self, item ):\n    # Note: As mentioned elsewhere, we replace the current completion request\n    # with a resolve request. It's not valid to have simultaneous resolve and\n    # completion requests, because the resolve request uses the request data\n    # from the last completion request and is therefore dependent on it not\n    # having changed.\n    #\n    # The result of this is that self.GetCurrentCompletionRequest() might return\n    # either a completion request of a resolve request and it's the\n    # responsibility of the vimscript code to ensure that it only does one at a\n    # time. This is handled by re-using the same poller for completions and\n    # resolves.\n    completion_request = self.GetCurrentCompletionRequest()\n    if not completion_request:\n      return False\n\n    request  = ResolveCompletionItem( completion_request, item )\n    if not request:\n      return False\n\n    self._latest_completion_request = request\n    return True\n\n\n  def GetErrorCount( self ):\n    return self.CurrentBuffer().GetErrorCount()\n\n\n  def GetWarningCount( self ):\n    return self.CurrentBuffer().GetWarningCount()\n\n\n  def _PopulateLocationListWithLatestDiagnostics( self ):\n    return self.CurrentBuffer().PopulateLocationList(\n        self._user_options[ 'open_loclist_on_ycm_diags' ] )\n\n\n  def FileParseRequestReady( self ):\n    # Return True if server is not ready yet, to stop repeating check timer.\n    return ( not self.IsServerReady() or\n             self.CurrentBuffer().FileParseRequestReady() )\n\n\n  def HandleFileParseRequest( self, block = False ):\n    if not self.IsServerReady():\n      return\n\n    current_buffer = self.CurrentBuffer()\n    # Order is important here:\n    # FileParseRequestReady has a low cost, while\n    # NativeFiletypeCompletionUsable is a blocking server request\n    if ( not current_buffer.IsResponseHandled() and\n         current_buffer.FileParseRequestReady( block ) and\n         self.NativeFiletypeCompletionUsable() ):\n\n      if self._user_options[ 'show_diagnostics_ui' ]:\n        # Forcefuly update the location list, etc. from the parse request when\n        # doing something like :YcmDiags\n        async_diags = any( self._message_poll_requests.get( filetype )\n                           for filetype in vimsupport.CurrentFiletypes() )\n        current_buffer.UpdateDiagnostics( block or not async_diags )\n      else:\n        # If the user disabled diagnostics, we just want to check\n        # the _latest_file_parse_request for any exception or UnknownExtraConf\n        # response, to allow the server to raise configuration warnings, etc.\n        # to the user. We ignore any other supplied data.\n        current_buffer.GetResponse()\n\n      # We set the file parse request as handled because we want to prevent\n      # repeated issuing of the same warnings/errors/prompts. Setting this\n      # makes IsRequestHandled return True until the next request is created.\n      #\n      # Note: it is the server's responsibility to determine the frequency of\n      # error/warning/prompts when receiving a FileReadyToParse event, but\n      # it is our responsibility to ensure that we only apply the\n      # warning/error/prompt received once (for each event).\n      current_buffer.MarkResponseHandled()\n\n\n  def ShouldResendFileParseRequest( self ):\n    return self.CurrentBuffer().ShouldResendParseRequest()\n\n\n  def DebugInfo( self ):\n    debug_info = ''\n    if self._client_logfile:\n      debug_info += f'Client logfile: { self._client_logfile }\\n'\n    extra_data = {}\n    self._AddExtraConfDataIfNeeded( extra_data )\n    debug_info += FormatDebugInfoResponse( SendDebugInfoRequest( extra_data ) )\n    debug_info += f'Server running at: { BaseRequest.server_location }\\n'\n    if self._server_popen:\n      debug_info += f'Server process ID: { self._server_popen.pid }\\n'\n    if self._server_stdout and self._server_stderr:\n      debug_info += ( 'Server logfiles:\\n'\n                      f'  { self._server_stdout }\\n'\n                      f'  { self._server_stderr }' )\n    debug_info += ( '\\nSemantic highlighting supported: ' +\n                    str( not vimsupport.VimIsNeovim() ) )\n    debug_info += ( '\\nVirtual text supported: ' +\n                    str( not vimsupport.VimIsNeovim() ) )\n    debug_info += ( '\\nPopup windows supported: ' +\n                    str( vimsupport.VimSupportsPopupWindows() ) )\n    return debug_info\n\n\n  def GetLogfiles( self ):\n    logfiles_list = [ self._client_logfile,\n                      self._server_stdout,\n                      self._server_stderr ]\n\n    extra_data = {}\n    self._AddExtraConfDataIfNeeded( extra_data )\n    debug_info = SendDebugInfoRequest( extra_data )\n    if debug_info:\n      completer = debug_info[ 'completer' ]\n      if completer:\n        for server in completer[ 'servers' ]:\n          logfiles_list.extend( server[ 'logfiles' ] )\n\n    logfiles = {}\n    for logfile in logfiles_list:\n      logfiles[ os.path.basename( logfile ) ] = logfile\n    return logfiles\n\n\n  def _OpenLogfile( self, size, mods, logfile ):\n    # Open log files in a horizontal window with the same behavior as the\n    # preview window (same height and winfixheight enabled). Automatically\n    # watch for changes. Set the cursor position at the end of the file.\n    if not size:\n      size = vimsupport.GetIntValue( '&previewheight' )\n\n    options = {\n      'size': size,\n      'fix': True,\n      'focus': False,\n      'watch': True,\n      'position': 'end',\n      'mods': mods\n    }\n\n    vimsupport.OpenFilename( logfile, options )\n\n\n  def _CloseLogfile( self, logfile ):\n    vimsupport.CloseBuffersForFilename( logfile )\n\n\n  def ToggleLogs( self, size, mods, *filenames ):\n    logfiles = self.GetLogfiles()\n    if not filenames:\n      sorted_logfiles = sorted( logfiles )\n      try:\n        logfile_index = vimsupport.SelectFromList(\n          'Which logfile do you wish to open (or close if already open)?',\n          sorted_logfiles )\n      except RuntimeError as e:\n        vimsupport.PostVimMessage( str( e ) )\n        return\n\n      logfile = logfiles[ sorted_logfiles[ logfile_index ] ]\n      if not vimsupport.BufferIsVisibleForFilename( logfile ):\n        self._OpenLogfile( size, mods, logfile )\n      else:\n        self._CloseLogfile( logfile )\n      return\n\n    for filename in set( filenames ):\n      if filename not in logfiles:\n        continue\n\n      logfile = logfiles[ filename ]\n\n      if not vimsupport.BufferIsVisibleForFilename( logfile ):\n        self._OpenLogfile( size, mods, logfile )\n        continue\n\n      self._CloseLogfile( logfile )\n\n\n  def ShowDetailedDiagnostic( self, message_in_popup ):\n    detailed_diagnostic = BaseRequest().PostDataToHandler(\n        BuildRequestData(), 'detailed_diagnostic' )\n    if detailed_diagnostic and 'message' in detailed_diagnostic:\n      message = detailed_diagnostic[ 'message' ]\n      if message_in_popup and vimsupport.VimSupportsPopupWindows():\n        window = vim.current.window\n        buffer_number = vimsupport.GetCurrentBufferNumber()\n        diags_on_this_line = self._buffers[ buffer_number ].DiagnosticsForLine(\n            window.cursor[ 0 ] )\n\n        lines = message.split( '\\n' )\n        available_columns = vimsupport.GetIntValue( '&columns' )\n        col = window.cursor[ 1 ] + 1\n        if col > available_columns - 2: # -2 accounts for padding.\n          col = 0\n        options = {\n          'col': col,\n          'padding': [ 0, 1, 0, 1 ],\n          'maxwidth': available_columns,\n          'close': 'click',\n          'fixed': 0,\n          'highlight': 'YcmErrorPopup',\n          'border': [ 1, 1, 1, 1 ],\n          # Close when moving cursor\n          'moved': 'expr',\n        }\n        popup_func = 'popup_atcursor'\n        for diag in diags_on_this_line:\n          if message == diag[ 'text' ]:\n            popup_func = 'popup_create'\n            prop = vimsupport.GetTextPropertyForDiag( buffer_number,\n                                                      window.cursor[ 0 ],\n                                                      diag )\n            options.update( {\n              'textpropid': prop[ 'id' ],\n              'textprop': prop[ 'type' ],\n            } )\n            options.pop( 'col' )\n            break\n        vim.eval( f'{ popup_func }( { json.dumps( lines ) }, '\n                                  f'{ json.dumps( options ) } )' )\n      else:\n        vimsupport.PostVimMessage( message, warning = False )\n\n\n  def ForceCompileAndDiagnostics( self ):\n    if not self.NativeFiletypeCompletionUsable():\n      vimsupport.PostVimMessage(\n          'Native filetype completion not supported for current file, '\n          'cannot force recompilation.', warning = False )\n      return False\n    vimsupport.PostVimMessage(\n        'Forcing compilation, this will block Vim until done.',\n        warning = False )\n    self.OnFileReadyToParse()\n    self.HandleFileParseRequest( block = True )\n    vimsupport.PostVimMessage( 'Diagnostics refreshed', warning = False )\n    return True\n\n\n  def ShowDiagnostics( self ):\n    if not self.ForceCompileAndDiagnostics():\n      return\n\n    if not self._PopulateLocationListWithLatestDiagnostics():\n      vimsupport.PostVimMessage( 'No warnings or errors detected.',\n                                 warning = False )\n      return\n\n    if self._user_options[ 'open_loclist_on_ycm_diags' ]:\n      vimsupport.OpenLocationList( focus = True )\n\n\n  def FilterAndSortItems( self,\n                          items,\n                          sort_property,\n                          query,\n                          max_items = 0 ):\n    return BaseRequest().PostDataToHandler( {\n      'candidates': items,\n      'sort_property': sort_property,\n      'max_num_candidates': max_items,\n      'query': vimsupport.ToUnicode( query )\n    }, 'filter_and_sort_candidates' )\n\n\n  def ToggleSignatureHelp( self ):\n    self._signature_help_state.ToggleVisibility()\n\n\n  def _AddSyntaxDataIfNeeded( self, extra_data ):\n    if not self._user_options[ 'seed_identifiers_with_syntax' ]:\n      return\n    filetype = vimsupport.CurrentFiletypes()[ 0 ]\n    if filetype in self._filetypes_with_keywords_loaded:\n      return\n\n    if self.IsServerReady():\n      self._filetypes_with_keywords_loaded.add( filetype )\n    extra_data[ 'syntax_keywords' ] = list(\n       syntax_parse.SyntaxKeywordsForCurrentBuffer() )\n\n\n  def _AddTagsFilesIfNeeded( self, extra_data ):\n    def GetTagFiles():\n      tag_files = vim.eval( 'tagfiles()' )\n      return [ ( os.path.join( utils.GetCurrentDirectory(), tag_file )\n                 if not os.path.isabs( tag_file ) else tag_file )\n               for tag_file in tag_files ]\n\n    if not self._user_options[ 'collect_identifiers_from_tags_files' ]:\n      return\n    extra_data[ 'tag_files' ] = GetTagFiles()\n\n\n  def _AddExtraConfDataIfNeeded( self, extra_data ):\n    def BuildExtraConfData( extra_conf_vim_data ):\n      extra_conf_data = {}\n      for expr in extra_conf_vim_data:\n        try:\n          extra_conf_data[ expr ] = vimsupport.VimExpressionToPythonType( expr )\n        except vim.error:\n          message = (\n            f\"Error evaluating '{ expr }' in the 'g:ycm_extra_conf_vim_data' \"\n            \"option.\" )\n          vimsupport.PostVimMessage( message, truncate = True )\n          self._logger.exception( message )\n      return extra_conf_data\n\n    extra_conf_vim_data = self._user_options[ 'extra_conf_vim_data' ]\n    if extra_conf_vim_data:\n      extra_data[ 'extra_conf_data' ] = BuildExtraConfData(\n        extra_conf_vim_data )\n\n\n  def _AddUltiSnipsDataIfNeeded( self, extra_data ):\n    # See :h UltiSnips#SnippetsInCurrentScope.\n    try:\n      vim.eval( 'UltiSnips#SnippetsInCurrentScope( 1 )' )\n    except vim.error:\n      return\n\n    snippets = vimsupport.GetVariableValue( 'g:current_ulti_dict_info' )\n    extra_data[ 'ultisnips_snippets' ] = [\n      { 'trigger': trigger,\n        'description': snippet[ 'description' ] }\n      for trigger, snippet in snippets.items()\n    ]\n"
  },
  {
    "path": "run_tests.py",
    "content": "#!/usr/bin/env python3\n\nimport argparse\nimport glob\nimport os\nimport os.path as p\nimport subprocess\nimport sys\n\nDIR_OF_THIS_SCRIPT = p.dirname( p.abspath( __file__ ) )\nDIR_OF_THIRD_PARTY = p.join( DIR_OF_THIS_SCRIPT, 'third_party' )\n\n# We don't include python-future (not to be confused with pythonfutures) because\n# it needs to be inserted in sys.path AFTER the standard library imports but we\n# can't do that with PYTHONPATH because the std lib paths are always appended to\n# PYTHONPATH. We do it correctly inside Vim because we have access to the right\n# sys.path. So for dev, we rely on python-future being installed correctly with\n#\n#   pip install -r python/test_requirements.txt\n#\n# Pip knows how to install this correctly so that it doesn't matter where in\n# sys.path the path is.\npython_path = [ p.join( DIR_OF_THIS_SCRIPT, 'python' ),\n                p.join( DIR_OF_THIRD_PARTY, 'ycmd' ) ]\nif os.environ.get( 'PYTHONPATH' ):\n  python_path.append( os.environ[ 'PYTHONPATH' ] )\nos.environ[ 'PYTHONPATH' ] = os.pathsep.join( python_path )\n\n\ndef RunFlake8():\n  print( 'Running flake8' )\n  args = [ sys.executable,\n           '-m',\n           'flake8',\n           p.join( DIR_OF_THIS_SCRIPT, 'python' ) ]\n  root_dir_scripts = glob.glob( p.join( DIR_OF_THIS_SCRIPT, '*.py' ) )\n  args.extend( root_dir_scripts )\n  subprocess.check_call( args )\n\n\ndef ParseArguments():\n  parser = argparse.ArgumentParser()\n  parser.add_argument( '--skip-build', action = 'store_true',\n                       help = 'Do not build ycmd before testing' )\n  parser.add_argument( '--coverage', action = 'store_true',\n                       help = 'Enable coverage report' )\n  parser.add_argument( '--no-flake8', action = 'store_true',\n                       help = 'Do not run flake8' )\n  parser.add_argument( '--dump-path', action = 'store_true',\n                       help = 'Dump the PYTHONPATH required to run tests '\n                              'manually, then exit.' )\n\n  parsed_args, unittest_args = parser.parse_known_args()\n\n  if 'COVERAGE' in os.environ:\n    parsed_args.coverage = ( os.environ[ 'COVERAGE' ] == 'true' )\n\n  return parsed_args, unittest_args\n\n\ndef BuildYcmdLibs( args ):\n  if not args.skip_build:\n    subprocess.check_call( [\n      sys.executable,\n      p.join( DIR_OF_THIS_SCRIPT, 'third_party', 'ycmd', 'build.py' ),\n      '--quiet'\n    ] )\n\n\ndef UnittestTests( parsed_args, extra_unittest_args ):\n  # if any extra arg is a specific file, or the '--' token, then assume the\n  # arguments are unittest-aware test selection:\n  #  - don't use discover\n  #  - don't set the pattern to search for\n  unittest_args = [ '-cb' ]\n  prefer_regular = any( arg == '--' or p.isfile( arg )\n                        for arg in extra_unittest_args )\n  if not prefer_regular:\n    unittest_args += [ '-p', '*_test.py' ]\n\n  if extra_unittest_args:\n    unittest_args.extend( extra_unittest_args )\n  if not ( prefer_regular and extra_unittest_args ):\n    unittest_args.append( '-s' )\n    test_directory = p.join( DIR_OF_THIS_SCRIPT, 'python', 'ycm', 'tests' )\n    unittest_args.append( test_directory )\n\n  if parsed_args.coverage:\n    executable = [ sys.executable,\n                   '-m',\n                   'coverage',\n                   'run' ]\n  else:\n    executable = [ sys.executable, '-We' ]\n\n  unittest = [ '-m', 'unittest' ]\n  if not prefer_regular:\n    unittest.append( 'discover' )\n  subprocess.check_call( executable + unittest + unittest_args )\n\n\ndef Main():\n  ( parsed_args, unittest_args ) = ParseArguments()\n  if parsed_args.dump_path:\n    print( os.environ[ 'PYTHONPATH' ] )\n    sys.exit()\n\n  if not parsed_args.no_flake8:\n    RunFlake8()\n\n  BuildYcmdLibs( parsed_args )\n  UnittestTests( parsed_args, unittest_args )\n\n\nif __name__ == \"__main__\":\n  Main()\n"
  },
  {
    "path": "test/.gitignore",
    "content": "Xtest*\ndebuglog\nmessages\ntest.log\n*.res\n*.log\n.coverage.*\n.vim_profile\nlogs/\n"
  },
  {
    "path": "test/.vimspector.json",
    "content": "{\n  \"$schema\": \"https://puremourning.github.io/vimspector/schema/vimspector.schema.json\",\n  \"configurations\": {\n    \"Run vim test\": {\n      \"adapter\": \"vim-debug-adapter\",\n      \"configuration\": {\n        \"request\": \"launch\",\n        \"cwd\": \"${workspaceRoot}\",\n        \"args\": [\n          \"--clean\",\n          \"--not-a-term\",\n          \"-S\", \"lib/run_test.vim\",\n          \"${TestScriptName}\",\n          \"${TestFunction}\"\n        ]\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "test/Makefile",
    "content": ".phony: test clean\n\ntest:\n\t./run_vim_tests ${TEST}\n\nclean:\n\trm -f *.log\n\trm -f *.res\n\trm -f debuglog\n\trm -f messages\n\trm -f Xtest*\n\trm -f .coverage.*\n\trm -f .vim_profile\n\trm -rf logs/\n"
  },
  {
    "path": "test/README.md",
    "content": "# Quick Start\n\n## Running the tests in docker\n\nTo run the tests in the almost exactly the same environment as CI, use docker.\nThis is recommended to ensure that the tests pass in CI, rather than just on\nyour machine.\n\n* Make sure you have docker installed (duh)\n* Run `./docker/manual/run`.\n* You should now be in the container. Your YCM checkout is now mounted in\n  `$HOME/YouCompleteMe`\n* Run the following setup:\n  * `cd YouCompleteMe`\n  * `python3 install.py --ts-completer --clangd-completer --java-completer`\n  * `sudo -H pip3 install -r python/test_requirements.txt`\n* Run the tests:\n  * `./test/run_vim_tests`\n\n## Running the tests locally\n\nThe CI tests run in [the container](#running-the-tests-in-docker), so it's\nprobably best to run your tests there too, but not strictly required.\n\nTo run locally, you have to be on MacOS or Linux. Sorry, Windows testing is\nnot supported. However, there is a [docker image](#running-the-tests-in-docker)\nin which you can run the tests.\n\n* Ensure you have at least the Vim version in YCM_VIM_VERSION (in\n  `test/docker/ci/image/Dockerfile`)\n* Ensure ycmd is compiled ***with python3*** and clangd is enabled\n  `python3 install.py --ts-completer --clangd-completer --java-completer`\n* Install the test python deps (`pip install -r python/test_requirements.txt`)\n* Run `./test/run_vim_tests`\n\n## Running the tests in Windows (WSL)\n\nNOTE: This environment isn't officially supported, and the preferred mechanism to run the tests is to use docker.\n\n* Install Ubuntu 20.04 WSL from Windows Store and launch it\n* `sudo apt-get update && sudo apt-get dist-upgrade`\n* `sudo apt-get install build-essential default-jdk vim-nox cmake python3-dev nodejs python3-pip npm`\n* clone the plugin, and build ycmd, e.g.\n\n```\ngit clone --recursive https://github.com/ycm-core/YouCompleteMe\ncd YouCompleteMe\npython3 install.py --ts-completer --clangd-completer --java-completer\n```\n\n* Install the test python deps: `pip3 install --user -r python/test_requirements.txt`\n* Run `./test/run_vim_tests`\n\n# Overview\n\nThe test framework is based on the \"new style\" Vim tests. These are the tests\nthat are used to test Vim itself. There is good info on this in `:help testing`.\n\nThere's also some useful info in Vim's test\n[readme](https://github.com/vim/vim/blob/master/src/testdir/README.txt#L29).\n\nIn short, the test framework runs Vim, sources the test script, then executes\nall of the test functions. This is done as follows :\n\n```\nvim --clean --not-a-term -S lib/run_test.vim <test script>.test.vim\n```\n\nThe important thing to know is that `run_test.vim` is sourced and it in turn\nsources the test script, which contains the test functions, which are named\n`Test_*`.\n\nTest functions should use the vim built-in `assert` functions to report errors\n(see `:help new-style-testing`) and should attempt to reset any changes they\nmake at the end of the function.\n\nYou can add set-up and tear-down functions, and can skip tests by throwing a\nmessage starting with the word 'Skipped' (e.g. `throw \"SKipped: <message>\"`).\n\n# Test Framework\n\nThe test framework has the following components:\n\n* A vim 'plugin' (in `test/lib`) containing the framework itself, comprising:\n  * `run_test.vim`, which wraps the test functions and executes them, reporting\n    failures.\n  * Some basic support functions in `plugin/shared.vim` (from Vim)\n  * Some screendump support functions in `plugin/screendump.vim` (from Vim)\n  * Some YCM-specific autoloaded functions in `autoload/youcompleteme/test/*`\n* A script to run the tests, including specific test script and function\n* The actual test scripts in `test/*.test.vim`\n* CI integration for azure.\n\n# Test Scripts\n\nThe basic structure of a test is as follows:\n\n```viml\nfunction! SetUp()\n  \" ... set g:ycm_* options here...\n  call youcompleteme#test#setup#SetUp()\nendfunction\n\nfunction! TearDown()\n  call youcompleteme#test#setup#CleanUp()\nendfunction\n\nfunction! Test_MyTest()\n  \" test goes here, e.g.\n  aseert_true( pyxeval( 'ycm_state.ServerIsHealthy()' ) )\nendfunction\n\n\" Optional per-test setup/teardown\nfunction! SetUp_Test_MyOtherTest()\n  let s:old_ycm_use_clangd = g:ycm_use_clangd\n  let g:ycm_use_clangd=1\nendfunction\n\nfunction! TearDown_Test_MyOtherTest()\n  let g:ycm_use_clangd=s:old_ycm_use_clangd\nendfunction\n\nfunction! Test_MyOtherTest()\n  assert_false( 0 )\nendfunction\n```\n\nTest scripts are placed in `src/test` and are named `*.test.vim`. Each\ntest script can contain any number of individual tests, each of which is\na Vim function named `Test_<test name>`. Test functions are run in\narbitrary order, so must not rely on each other.\n\nEach test script is a fixture, but setup and teardown is done for each and every\ntest. Global (one-time) setup can be done at script level, but this is not\nrecommended.\n\nSet up and tear down functions are run before and after tests. You can\ndefine one for the whole script, which is run before every test, and a\nper-test setup/tear down function which is run before both the global\nsetup function and the test function. \n\nTo explain, for each function in the script named `Test_<test name>`,\n`run_test.vim` does the following:\n\n* If there is a function named `SetUp_Test_<test name>`, call it\n* If there is a function named `SetUp`, call it\n* Call `Test_<test name>`\n* If there is a function named `TearDown`, call it\n* If there is a function named `TearDown_Test_<test name>`, call it\n\nIf the `v:errors` list is non-empty at the end of the tests, the test\n`test name` is marked as failed.\n\nIf any of these functions raises an exception, it is added to `v:errors`, unless\nthe test is called `Test_nocatch_<test name>`, in which case exceptions are not\ncaught be the test and should be handled by the test function itself.\n\nIf a test fails, `run_test.vim` attempts to print out all of the log files that\nYCM's `ycm_state` object knows about.\n\n# The test plugin\n\nThe \"plugin\" provides a handful of things, some of which were simply ported from\nVim's test framework, and some were written specifically for YCM.\n\n## Ported from Vim\n\nThese are general purpose functions which are commonly used:\n\n* `WaitForAssert`: This one is the most useful. It takes a callable (usually a\n  lambda) and waits for it to return 0, but allows the Vim event loop to run in\n  between calls. This is key to ensuring that the YCM code can execute while the\n  script is actively trying to test it. **NOTE**: It waits for the _function to\n  return 0_, **NOT** for the assert to be true/v:errors to be empty!\n\n## YCM-specific\n\nThe autoload functions perform some useful common YCM-specific stuff such as\nsetup and teardown, and will likely be built out over time as the suite\nincreases in size and complexity.\n\n# Tips and tricks\n\nThings that you need to know to write tests effectively:\n\n* Don't forget to `:%bwipeout!` at the end of each test function.\n\n* Understand the arguments to `feedkeys`. Importantly, if you want it to behave\n  the way you think it should, use `feedkey( \"...\", 'xt' )`. This makes it wait\n  for the input to be actually read before returning, which is important for\n  tests. See `:help feedkeys` for the other options.\n\n* Remember that test scripts a vim functions. I know that sounds obvious, but\n  things like \"insert mode completions\" are hard to test with functions which\n  are typically *not* invoked in insert mode. In order to actually do anything\n  in insert mode, you need to do the following:\n\n  * If you want `TextChangedI` to fire,\n    [call `test_override( 'char_avail', 1)`](https://github.com/vim/vim/issues/4665#event-2480928194)\n\n  * Normally, `feedkeys` would exit insert mode if you enter it. Tell it not to\n    by passing the `!` flag. \n\n  * Now that you've left Vim in insert mode, your test will hang forever unless\n    you exit insert mode, so define a function and call it via a timer\n    or other async callback which performs the actual asserts, and ends by\n    calling `feedkeys( \"\\<ESC>\" )` to exit insert mode.\n\n  * Check `completion.test.vim` for an example.\n\n* Remember that the `assert*` functions don't throw exceptions. They return `0`\n  on success, and return nonzero on failure, populating `v:errors`. \n\n* Throwing exceptions in tests does fail the test, but this is not recommended\n  because it skips the (local) teardown code.\n\n* If you're writing a test function, it needs to conform as follows:\n  * Only adding to `v:errors` (e.g. `call add(v:errors, 'test')`) will cause the\n    test to fail.\n  * Don't throw exceptions. This will cause fiddly issues.\n  * Return `0` on success and `1` on failure. This allows it to be used with\n    `WaitForAssert`\n\n# Restricting what is run\n\n`run_vim_tests` takes arguments of the form `<test script>:<test function filter>`.\n\nFor example to just run the \"MyOtherTest\" test in the `mytests.test.vim`:\n\n```\n$ run_vim_tests mytests.test.vim:MyOtherTest\n```\n\nThe filter is a Vim regexp. The same script file can be listed multiple times,\nas in:\n\n```\n$ run_vim_tests 'mytests.test.vim:MyTest' 'mytests.test.vim:MyOtherTest'\n```\n\n# Coverage\n\nThe test suite supports `covimerage` coverage testing. Just set the `COVERAGE`\nenvironment variable when running `run_vim_tests`.\n\nThis generates coverage for both the python code and the vimscript code.\n\nFor python, there is some initialisation code in `run_test.vim` which starts up\n`coverage` and saves the result to `.coverage.python`.\n\nFor vim script, we use `covimerage` which takes the vim `:profile` data (also\ninitialised in `run_test.vim`) and converts it to `coverage`-style data in\n`.coverage.vim` (this is done by `run_vim_tests` after running all the tests).\n\nFinally, we upload that data to `codecov`. This combines `.coverage.python` and\n`.coverage.vim` into `.coverage` and uploads it.\n\nTo get a local summary:\n\n* `pip install --user -r python/test_requirements.txt`\n* `COVERAGE=true ./test/run_vim_tests`\n* `coverage combine -a`\n* `coverage report` or `coverage html`\n\n# Docker\n\nWe generate and push 2 containers:\n\n* `youcompleteme/ycm-vim-py3:test` and `youcompleteme/ycm-vim-py3:manual`\n\nThe `:test` tags are the containers that are used by Azure pipelines to run the\ntests and contains essentially Ubuntu LTS + the YCM dependencies and a build of\nVim at a specific version built with python3 (`-py3`) support.\n\nThe `:manual` tags extend the `:test` tags with a user account that largely\nmatches the one created by Azure to run our tests. It also installs a basic\n`vimrc` so that you can do manual testing too.\n\n## Building\n\nTo rebuild and push all of the containers: \n\n* `cd test/docker`\n* `./rebuild_all`\n\nThis script essentially runs `./rebuild` and `./push` in each of the `ci` and\n`manual` directories (corresponding to the `:test` and `:manual` tags\nrespectively). \n\nThose scripts are just simple wrappers for `docker build` and `docker push`\nbecause it's easy to forget the exact syntax.\n"
  },
  {
    "path": "test/commands.test.vim",
    "content": "function! SetUp()\n  let g:ycm_use_clangd = 1\n  let g:ycm_keep_logfiles = 1\n  let g:ycm_log_level = 'DEBUG'\n  call youcompleteme#test#setup#SetUp()\nendfunction\n\nfunction! Test_ToggleLogs()\n  let log_files = pyxeval( 'ycm_state.GetLogfiles()' )\n  let bcount = len( getbufinfo() )\n\n  \" default - show\n  silent exe 'YcmToggleLogs' keys( log_files )[ 0 ]\n  call assert_equal( bcount + 1, len( getbufinfo() ) )\n  let win = getbufinfo( keys( log_files )[ 0 ] )[ 0 ].windows[ 0 ]\n  call assert_equal( &previewheight, winheight( win_id2win( win ) ) )\n\n  \" default - hide\n  silent exe 'YcmToggleLogs' keys( log_files )[ 0 ]\n  \" buffer is wiped out\n  call assert_equal( bcount, len( getbufinfo() ) )\n  call assert_equal( [], getbufinfo( keys( log_files )[ 0 ] ) )\n\n  \" show - 10 lines\n  silent exe '10YcmToggleLogs' keys( log_files )[ 0 ]\n  call assert_equal( bcount + 1, len( getbufinfo() ) )\n  let win = getbufinfo( keys( log_files )[ 0 ] )[ 0 ].windows[ 0 ]\n  call assert_equal( 10, winheight( win_id2win( win ) ) )\n\n  \" hide\n  silent exe '10YcmToggleLogs' keys( log_files )[ 0 ]\n  call assert_equal( bcount, len( getbufinfo() ) )\n  call assert_equal( [], getbufinfo( keys( log_files )[ 0 ] ) )\n\n  \" show - 15 cols\n  silent exe 'vertical 15YcmToggleLogs' keys( log_files )[ 0 ]\n  call assert_equal( bcount + 1, len( getbufinfo() ) )\n  let win = getbufinfo( keys( log_files )[ 0 ] )[ 0 ].windows[ 0 ]\n  call assert_equal( 15, winwidth( win_id2win( win ) ) )\n\n  \" hide\n  silent exe 'YcmToggleLogs' keys( log_files )[ 0 ]\n  call assert_equal( bcount, len( getbufinfo() ) )\n  call assert_equal( [], getbufinfo( keys( log_files )[ 0 ] ) )\n\n\nendfunction\n\nfunction! Test_GetCommandResponse()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n\n  \" detailed_info\n  call setpos( '.', [ 0, 12, 3 ] )\n  call assert_equal( \"Test_OneLine()\\n\\nThis is the one line output.\",\n                   \\ youcompleteme#GetCommandResponse( 'GetDoc' ) )\n\n  call setpos( '.', [ 0, 13, 7 ] )\n  call assert_equal( \"Test_MultiLine()\\n\\nThis is the one line output.\\n\"\n                   \\ . \"This is second line.\",\n                   \\ youcompleteme#GetCommandResponse( 'GetDoc' ) )\n\n  \" display message\n  call setpos( '.', [ 0, 12, 10 ] )\n  call assert_equal( 'def Test_OneLine()',\n                   \\ youcompleteme#GetCommandResponse( 'GetType' ) )\n\n  \" Location\n  call setpos( '.', [ 0, 12, 10 ] )\n  call assert_equal( '',\n                   \\ youcompleteme#GetCommandResponse( 'GoTo' ) )\n\n  \" Error\n  call setpos( '.', [ 0, 12, 10 ] )\n  call assert_equal( '',\n                   \\ youcompleteme#GetCommandResponse( 'NotACommand', 'arg' ) )\n\n  \" Specify completer\n  call setpos( '.', [ 0, 13, 7 ] )\n  call assert_equal( \"Test_MultiLine()\\n\\nThis is the one line output.\\n\"\n                   \\ . \"This is second line.\",\n                   \\ youcompleteme#GetCommandResponse( 'ft=python', 'GetDoc' ) )\n\n  \" on a command, no error\n  call setpos( '.', [ 0, 1, 3 ] )\n  call assert_equal( '', youcompleteme#GetCommandResponse( 'GetDoc' ) )\n\nendfunction\n\n\nfunction! Test_GetCommandResponse_FixIt()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/cpp/fixit.c', {} )\n\n  \" fixit returns empty\n  call setpos( '.', [ 0, 3, 4 ] )\n  call assert_equal( '',\n                   \\ youcompleteme#GetCommandResponse( 'FixIt' ) )\n\nendfunction\n\nfunction! Test_GetDefinedSubcommands_Native()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/cpp/fixit.c', {} )\n  call assert_equal( 1, count( youcompleteme#GetDefinedSubcommands(),\n                             \\ 'GetDoc' ) )\nendfunction\n\nfunction! Test_GetDefinedSubcommands_NoNative()\n  enew\n  setf not_a_filetype\n  call assert_equal( [], youcompleteme#GetDefinedSubcommands() )\n\n  \" The above call prints ValueError: No semantic completer ....\"\n  messages clear\nendfunction\n"
  },
  {
    "path": "test/completion.common.vim",
    "content": "scriptencoding utf-8\n\nfunction! Test_Compl_After_Trigger()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/clangd/testdata/basic.cpp', {} )\n\n  call setpos( '.', [ 0, 11, 6 ] )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  \" Must do the checks in a timer callback because we need to stay in insert\n  \" mode until done.\n  function! Check( id ) closure\n    call WaitForCompletion()\n    call feedkeys( \"\\<ESC>\" )\n  endfunction\n\n  call FeedAndCheckMain( 'cl.', funcref( 'Check' ) )\n  \" Checks run in insert mode, then exit insert mode.\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call test_override( 'ALL', 0 )\nendfunction\n\nfunction! Test_Force_Semantic_TopLevel()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/clangd/testdata/basic.cpp', {} )\n\n  call setpos( '.', [ 0, 17, 5 ] )\n\n  function! Check( id )\n    cal WaitForCompletion()\n    let items = complete_info( [ 'items' ] )[ 'items' ]\n    call assert_equal( 1, len( filter( items, 'v:val.abbr ==# \"Foo\"' ) ),\n          \\ 'Foo should be in the suggestions' )\n\n    let items = complete_info( [ 'items' ] )[ 'items' ]\n    call assert_equal( 1,\n          \\ len( filter( items, 'v:val.word ==# \"__FUNCTION__\"' ) ),\n          \\ '__FUNCTION__ should be in the suggestions' )\n\n    call feedkeys( \"\\<ESC>\" )\n  endfunction\n\n  call FeedAndCheckMain( \"i\\<C-Space>\", funcref( 'Check' ) )\n  \" Checks run in insert mode, then exit insert mode.\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call test_override( 'ALL', 0 )\nendfunction\n\nfunction! Test_Select_Next_Previous()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/clangd/testdata/basic.cpp', {} )\n\n  call setpos( '.', [ 0, 11, 6 ] )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check( id )\n    call WaitForCompletion()\n\n    call CheckCurrentLine( '  foo.' )\n    call CheckCompletionItemsContainsExactly( [ 'c', 'x', 'y' ] )\n\n    call FeedAndCheckAgain( \"\\<Tab>\", funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( '  foo.c' )\n    call CheckCompletionItemsContainsExactly( [ 'c', 'x', 'y' ] )\n\n    call FeedAndCheckAgain( \"\\<Tab>\", funcref( 'Check3' ) )\n  endfunction\n\n  function! Check3( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( '  foo.x' )\n    call CheckCompletionItemsContainsExactly( [ 'c', 'x', 'y' ] )\n\n    call FeedAndCheckAgain( \"\\<BS>y\", funcref( 'Check4' ) )\n  endfunction\n\n  function! Check4( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( '  foo.y' )\n    call CheckCompletionItemsContainsExactly( [ 'y' ] )\n    call feedkeys( \"\\<ESC>\" )\n  endfunction\n\n  call FeedAndCheckMain( 'cl.', funcref( 'Check' ) )\n  \" Checks run in insert mode, then exit insert mode.\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call test_override( 'ALL', 0 )\nendfunction\n\nfunction! Test_Enter_Delete_Chars_Updates_Filter()\n  call youcompleteme#test#setup#OpenFile(\n        \\ 'test/testdata/cpp/completion.cc', {} )\n\n  call setpos( '.', [ 0, 23, 31 ] )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check1( id )\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'colourOfLine', 'lengthOfLine' ] )\n    call FeedAndCheckAgain( \"\\<BS>\", funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [\n          \\ 'operator=(…)',\n          \\ 'colourOfLine',\n          \\ 'lengthOfLine',\n          \\ 'RED_AND_YELLOW' ] )\n    call FeedAndCheckAgain( 'w', funcref( 'Check3' ) )\n  endfunction\n\n  function! Check3( id )\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'RED_AND_YELLOW' ] )\n    \" now type something that doesnt match\n    call FeedAndCheckAgain( 'this_does_not_match', funcref( 'Check4' ) )\n  endfunction\n\n  function! Check4( id )\n    call WaitForAssert( { -> assert_false( pumvisible() ) } )\n    call CheckCurrentLine(\n          \\ '  p->line.colourOfLine = Line::owthis_does_not_match' )\n    call CheckCompletionItemsContainsExactly( [] )\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call FeedAndCheckMain( 'cl:ol', funcref( 'Check1' ) )\n  \" Checks run in insert mode, then exit insert mode.\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call test_override( 'ALL', 0 )\nendfunction\n\nfunction! SetUp_Test_Compl_No_Filetype()\n  call youcompleteme#test#setup#PushGlobal( 'ycm_filetype_whitelist', {\n        \\ '*': 1,\n        \\ 'ycm_nofiletype': 1\n        \\ } )\n  call youcompleteme#test#setup#PushGlobal( 'ycm_filetype_blacklist', {} )\nendfunction\n\nfunction! Test_Compl_No_Filetype()\n  call assert_false( has_key( g:ycm_filetype_blacklist, 'ycm_nofiletype' ) )\n  enew\n  call setline( '.', 'hello this is some text ' )\n\n  \" Even when fileytpe is set to '', the filetype autocommand is triggered, but\n  \" apparently, _not_ within this function.\n  doautocmd FileType\n  call assert_equal( 1, b:ycm_completing )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  \" Must do the checks in a timer callback because we need to stay in insert\n  \" mode until done.\n  function! Check( id ) closure\n    call assert_equal( getline( '2' ), 'hell' )\n    call WaitForCompletion()\n    let items = complete_info().items\n    call map( items, {index, value -> value.word} )\n    call assert_equal( [ 'hello' ], items )\n    call feedkeys( \"\\<ESC>\" )\n  endfunction\n\n  call FeedAndCheckMain( 'ohell', funcref( 'Check' ) )\n  \" Checks run in insert mode, then exit insert mode.\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call test_override( 'ALL', 0 )\n  delfunc! Check\nendfunction\n\nfunction! TearDown_Test_Compl_No_Filetype()\n  call youcompleteme#test#setup#PopGlobal( 'ycm_filetype_whitelist' )\n  call youcompleteme#test#setup#PopGlobal( 'ycm_filetype_blacklist' )\nendfunction\n\nfunction! Test_Compl_No_Filetype_Blacklisted()\n  call assert_true( has_key( g:ycm_filetype_blacklist, 'ycm_nofiletype' ) )\n\n  enew\n  call setline( '.', 'hello this is some text ' )\n\n  \" Even when fileytpe is set to '', the filetype autocommand is triggered, but\n  \" apparently, _not_ within this function.\n  doautocmd FileType\n  call assert_false( exists( 'b:ycm_completing' ) )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  \" Must do the checks in a timer callback because we need to stay in insert\n  \" mode until done.\n  function! Check( id ) closure\n    call assert_false( pumvisible() )\n    call feedkeys( \"\\<ESC>\" )\n  endfunction\n\n  call FeedAndCheckMain( 'ohell', funcref( 'Check' ) )\n  \" Checks run in insert mode, then exit insert mode.\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call test_override( 'ALL', 0 )\n  delfunc! Check\nendfunction\n\nfunction! OmniFuncTester( findstart, query )\n  if a:findstart\n    return s:omnifunc_start_col\n  endif\n  return s:omnifunc_items\nendfunction\n\nfunction! SetUp_Test_OmniComplete_Filter()\n  call youcompleteme#test#setup#PushGlobal( 'ycm_semantic_triggers', {\n        \\ 'omnifunc_test': [ ':', '.' ]\n        \\ } )\nendfunction\n\nfunction! Test_OmniComplete_Filter()\n  enew\n  setf omnifunc_test\n  set omnifunc=OmniFuncTester\n\n  let s:omnifunc_start_col = 3\n  let s:omnifunc_items = [ 'test', 'testing', 'testy' ]\n\n  function! Check1( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( 'te:te' )\n    call CheckCompletionItemsContainsExactly( [ 'test', 'testy', 'testing' ],\n                                            \\ 'word' )\n    call FeedAndCheckAgain( 'y', funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( 'te:tey' )\n    call CheckCompletionItemsContainsExactly( [ 'testy' ], 'word' )\n    call FeedAndCheckAgain( \"\\<C-n>\", funcref( 'Check3' ) )\n  endfunction\n\n  function! Check3( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( 'te:testy' )\n    call CheckCompletionItemsContainsExactly( [ 'testy' ], 'word' )\n    call FeedAndCheckAgain( \"\\<C-p>\", funcref( 'Check4' ) )\n  endfunction\n\n  function! Check4( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( 'te:tey' )\n    call CheckCompletionItemsContainsExactly( [ 'testy' ], 'word' )\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call setline(1, 'te:' )\n  call setpos( '.', [ 0, 1, 3 ] )\n  call FeedAndCheckMain( 'ate', 'Check1' )\nendfunction\n\nfunction! TearDown_Test_OmniComplete_Filter()\n  call youcompleteme#test#setup#PopGlobal( 'ycm_semantic_triggers' )\nendfunction\n\nfunction! Test_OmniComplete_Force()\n  enew\n  setf omnifunc_test\n  set omnifunc=OmniFuncTester\n\n  let s:omnifunc_start_col = 0\n  let s:omnifunc_items = [ 'test', 'testing', 'testy' ]\n\n  function! Check1( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( 'te' )\n    call CheckCompletionItemsContainsExactly( [ 'test', 'testy', 'testing' ],\n                                            \\ 'word' )\n    call FeedAndCheckAgain( 'y', funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( 'tey' )\n    call CheckCompletionItemsContainsExactly( [ 'testy' ], 'word' )\n    call FeedAndCheckAgain( \"\\<C-n>\", funcref( 'Check3' ) )\n  endfunction\n\n  function! Check3( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( 'testy' )\n    call CheckCompletionItemsContainsExactly( [ 'testy' ], 'word' )\n    call FeedAndCheckAgain( \"\\<C-p>\", funcref( 'Check4' ) )\n  endfunction\n\n  function! Check4( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( 'tey' )\n    call CheckCompletionItemsContainsExactly( [ 'testy' ], 'word' )\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call setline(1, 'te' )\n  call setpos( '.', [ 0, 1, 3 ] )\n  call FeedAndCheckMain( \"a\\<C-Space>\", 'Check1' )\nendfunction\n\nfunction! Test_Completion_FixIt()\n  \" There's a bug in clangd where you have to open a file which includes the\n  \" file you want to auto-include before it will actually auto-include that\n  \" file, auto_include_workaround #includes auto_include.h, so that clangd knows\n  \" about it\n  call youcompleteme#test#setup#OpenFile(\n        \\ 'test/testdata/cpp/auto_include_workaround.cc', {} )\n\n  call youcompleteme#test#setup#OpenFile(\n        \\ 'test/testdata/cpp/auto_include.cc', {} )\n\n  function! Check1( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( 'do_a' )\n    call CheckCompletionItemsHasItems( [ 'do_a_thing(Thing thing)',\n                                       \\ 'do_another_thing()' ] )\n    call FeedAndCheckAgain( \"\\<Tab>\" , funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( 'do_a_thing' )\n    call CheckCompletionItemsHasItems( [ 'do_a_thing(Thing thing)',\n                                       \\ 'do_another_thing()' ] )\n    call FeedAndCheckAgain( '(' , funcref( 'Check3' ) )\n  endfunction\n\n\n  function! Check3( id )\n    call WaitForAssert( {-> assert_false( pumvisible(), 'pumvisible()' ) } )\n    call CheckCurrentLine( 'do_a_thing(' )\n    call assert_equal( '#include \"auto_include.h\"', getline( 1 ) )\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call setpos( '.', [ 0, 3, 1 ] )\n  call FeedAndCheckMain( \"Ado_a\\<C-Space>\", funcref( 'Check1' ) )\nendfunction\n\nfunction! Test_Select_Next_Previous_InsertModeMapping()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/clangd/testdata/basic.cpp', {} )\n\n  call setpos( '.', [ 0, 11, 6 ] )\n\n  inoremap <C-n> <Down>\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check( id )\n    call WaitForCompletion()\n\n    call CheckCurrentLine( '  foo.' )\n    call CheckCompletionItemsContainsExactly( [ 'c', 'x', 'y' ] )\n\n    call FeedAndCheckAgain( \"\\<C-n>\", funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( '  foo.c' )\n    call CheckCompletionItemsContainsExactly( [ 'c', 'x', 'y' ] )\n\n    call FeedAndCheckAgain( \"\\<C-n>\", funcref( 'Check3' ) )\n  endfunction\n\n  function! Check3( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( '  foo.x' )\n    call CheckCompletionItemsContainsExactly( [ 'c', 'x', 'y' ] )\n\n    call FeedAndCheckAgain( \"\\<BS>a\", funcref( 'Check4' ) )\n  endfunction\n\n  function! Check4( id )\n    call CheckCurrentLine( '  foo.a' )\n    call CheckCompletionItemsContainsExactly( [] )\n    call FeedAndCheckAgain( \"\\<C-n>\", funcref( 'Check5' ) )\n  endfunction\n\n  function! Check5( id )\n    \" The last ctrl-n moved to the next line\n    call CheckCurrentLine( '}' )\n    call assert_equal( [ 0, 12, 2, 0 ], getpos( '.' ) )\n    call CheckCompletionItemsContainsExactly( [] )\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n\n  call FeedAndCheckMain( 'cl.', funcref( 'Check' ) )\n  \" Checks run in insert mode, then exit insert mode.\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call test_override( 'ALL', 0 )\n  iunmap <C-n>\nendfunction\n\nfunction! Test_Completion_WorksWithoutMovingCursor()\n  call youcompleteme#test#setup#OpenFile(\n        \\ 'test/testdata/cpp/auto_include_workaround.cc', {} )\n\n  function! Check( id )\n    call WaitForCompletion() \" We don't care about completion\n                             \" items, just that we didn't error\n                             \" while opening the completion pum\n                             \" without typing anything first.\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call setpos( '.', [ 0, 3, 1 ] )\n  call FeedAndCheckMain( \"i\\<C-Space>\", funcref( 'Check' ) )\nendfunction\n\nfunction! SetUp_Test_Manual_Trigger()\n  call youcompleteme#test#setup#PushGlobal( 'ycm_auto_trigger', 0 )\nendfunction\n\nfunction! Test_Manual_Trigger()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/clangd/testdata/basic.cpp', {} )\n\n  call setpos( '.', [ 0, 11, 6 ] )\n\n  imap <C-d> <plug>(YCMComplete)\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check( id )\n    call WaitForCompletion()\n\n    call CheckCurrentLine( '  tfthne' )\n    call CheckCompletionItemsContainsExactly( [\n          \\ 'test_function_that_has_no_errors' ], 'word' )\n\n    call FeedAndCheckAgain( \"\\<BS>\", funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n\n    call CheckCurrentLine( '  tfthn' )\n    call CheckCompletionItemsContainsExactly( [\n          \\ 'test_function_that_has_no_errors' ], 'word' )\n\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call FeedAndCheckMain( \"Otfthne\\<C-d>\", funcref( 'Check' ) )\n  \" Checks run in insert mode, then exit insert mode.\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call test_override( 'ALL', 0 )\n  iunmap <C-d>\nendfunction\n\nfunction! TearDown_Test_Manual_Trigger()\n  call youcompleteme#test#setup#PopGlobal( 'ycm_auto_trigger' )\nendfunction\n\nfunction! SetUp_Test_Manual_Trigger_CompleteFunc()\n  call youcompleteme#test#setup#PushGlobal( 'ycm_auto_trigger', 0 )\nendfunction\n\nfunction! Test_Manual_Trigger_CompleteFunc()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/clangd/testdata/basic.cpp', {} )\n\n  call setpos( '.', [ 0, 11, 6 ] )\n  set completefunc=youcompleteme#CompleteFunc\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check( id )\n    call WaitForCompletion()\n\n    call CheckCurrentLine( '  tfthne' )\n    call CheckCompletionItemsContainsExactly( [\n          \\ 'test_function_that_has_no_errors' ], 'word' )\n\n    call FeedAndCheckAgain( \"\\<BS>\", funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n\n    call CheckCurrentLine( '  tfthn' )\n    call CheckCompletionItemsContainsExactly( [\n          \\ 'test_function_that_has_no_errors' ], 'word' )\n\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call FeedAndCheckMain( \"Otfthne\\<C-x>\\<C-u>\", funcref( 'Check' ) )\n  \" Checks run in insert mode, then exit insert mode.\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call test_override( 'ALL', 0 )\n  set completefunc=\nendfunction\n\nfunction! TearDown_Test_Manual_Trigger_CompleteFunc()\n  call youcompleteme#test#setup#PopGlobal( 'ycm_auto_trigger' )\nendfunction\n"
  },
  {
    "path": "test/completion.test.vim",
    "content": "function! SetUp()\n  let g:ycm_use_clangd = 1\n  let g:ycm_confirm_extra_conf = 0\n  let g:ycm_auto_trigger = 1\n  let g:ycm_keep_logfiles = 1\n  let g:ycm_log_level = 'DEBUG'\n\n  let g:ycm_add_preview_to_completeopt = 1\n  let g:ycm_enable_semantic_highlighting = 1\n\n  call youcompleteme#test#setup#SetUp()\nendfunction\n\nfunction! TearDown()\n  call youcompleteme#test#setup#CleanUp()\nendfunction\n\nexe 'source' expand( \"<sfile>:p:h\" ) .. '/completion.common.vim'\n\nfunction! Test_Using_Upfront_Resolve()\n  let debug_info = split( execute( 'YcmDebugInfo' ), \"\\n\" )\n  enew\n  setf cpp\n\n  call assert_equal( '', &completefunc )\n\n  for line in debug_info\n    if line =~# \"^-- Resolve completions: \"\n      let ver = substitute( line, \"^-- Resolve completions: \", \"\", \"\" )\n      call assert_equal( 'Up front', ver, 'API version' )\n      return\n    endif\n  endfor\n\n  call assert_report( \"Didn't find the resolve type in the YcmDebugInfo\" )\nendfunction\n"
  },
  {
    "path": "test/completion_info.test.vim",
    "content": "function! s:AssertInfoPopupNotVisible()\n  call WaitForAssert( {-> assert_true(\n        \\ popup_findinfo() == 0 ||\n        \\ !popup_getpos( popup_findinfo() ).visible ) } )\nendfunction\n\nfunction! s:AssertInfoPopupVisible()\n  call WaitForAssert( {-> assert_true(\n        \\ popup_findinfo() != 0 &&\n        \\ !empty( popup_getpos( popup_findinfo() ) ) &&\n        \\ popup_getpos( popup_findinfo() ).visible ) } )\nendfunction\n\nfunction! SetUp()\n  let g:ycm_use_clangd = 1\n  let g:ycm_confirm_extra_conf = 0\n  let g:ycm_auto_trigger = 1\n  let g:ycm_keep_logfiles = 1\n  let g:ycm_log_level = 'DEBUG'\n\n  let g:ycm_add_preview_to_completeopt = 'popup'\n  let g:ycm_enable_semantic_highlighting = 1\n\n  call youcompleteme#test#setup#SetUp()\nendfunction\n\nfunction! TearDown()\n  call youcompleteme#test#setup#CleanUp()\nendfunction\n\nexe 'source' expand( \"<sfile>:p:h\" ) .. '/completion.common.vim'\n\nfunction! Test_Using_Ondemand_Resolve()\n  let debug_info = split( execute( 'YcmDebugInfo' ), \"\\n\" )\n  enew\n  setf cpp\n\n  call assert_equal( '', &completefunc )\n\n  for line in debug_info\n    if line =~# \"^-- Resolve completions: \"\n      let ver = substitute( line, \"^-- Resolve completions: \", \"\", \"\" )\n      call assert_equal( 'On demand', ver, 'API version' )\n      return\n    endif\n  endfor\n\n  call assert_report( \"Didn't find the resolve type in the YcmDebugInfo\" )\n\nendfunction\n\nfunction! Test_ResolveCompletion_OnChange()\n  call SkipIf( !exists( '*popup_findinfo' ), 'no popup_findinfo' )\n\n  \" Only the java completer actually uses the completion resolve\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/java/testdata/simple_eclipse_project' .\n        \\ '/src/com/test/TestWithDocumentation.java', { 'delay': 15 } )\n\n  call setpos( '.', [ 0, 6, 21 ] )\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check1( id )\n    call WaitForCompletion()\n    call s:AssertInfoPopupNotVisible()\n    call FeedAndCheckAgain( \"\\<Tab>\", funcref( 'Check2', [ 0 ] ) )\n  endfunction\n\n  let found_getAString = 0\n\n  function! Check2( counter, id ) closure\n    call WaitForCompletion()\n    call s:AssertInfoPopupVisible()\n    let info_popup_id = popup_findinfo()\n\n    let compl = complete_info()\n    let selected = compl.items[ compl.selected ]\n\n    \" All items should be resolved\n    \" NOTE: Even after resolving the item still has this as there's no way to\n    \" update the user data of the item at this point (need a vim change to do\n    \" that)\n    call assert_true( has_key( json_decode( selected.user_data ),\n          \\ 'resolve' ) )\n\n    if selected.word ==# 'getAString'\n      \" It's line 5 because we truncated the signature to fit it in\n      call WaitForAssert( { ->\n            \\ assert_equal( [ 'MethodsWithDocumentation.getAString() : String',\n                            \\ '',\n                            \\ 'getAString() : String',\n                            \\ '',\n                            \\ 'Single line description.',\n                            \\ ],\n            \\               getbufline( winbufnr( info_popup_id ), '1', '5' ) )\n            \\ } )\n      let found_getAString += 1\n    endif\n\n    if a:counter < 10\n      call FeedAndCheckAgain( \"\\<Tab>\", funcref( 'Check2', [ a:counter + 1 ] ) )\n    else\n      call feedkeys( \"\\<Esc>\" )\n    endif\n  endfunction\n\n  call FeedAndCheckMain( 'cw', funcref( 'Check1' ) )\n\n  call assert_false( pumvisible(), 'pumvisible()' )\n  call assert_equal( 1, found_getAString )\n\n  call test_override( 'ALL', 0 )\nendfunction\n\nfunction! Test_Resolve_FixIt()\n  call SkipIf( !exists( '*popup_findinfo' ), 'no popup_findinfo' )\n\n  \" Only the java completer actually uses the completion resolve\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/java/testdata/simple_eclipse_project' .\n        \\ '/src/com/test/TestWithDocumentation.java', { 'delay': 15 } )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check1( id )\n    call WaitForCompletion()\n    call CheckCurrentLine( '    Tes' )\n    call CheckCompletionItemsHasItems( [ 'Test - com.youcompleteme' ] )\n    let tabs = IndexOfCompletionItemInList( 'Test - com.youcompleteme' ) + 1\n    let tabs = repeat( \"\\<Tab>\", tabs )\n    call FeedAndCheckAgain( tabs, funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n    call CheckCompletionItemsHasItems( [ 'Test - com.youcompleteme' ] )\n    call CheckCurrentLine( '    Test' )\n    call FeedAndCheckAgain( \"\\<C-y>\", funcref( 'Check3' ) )\n  endfunction\n\n  function! Check3( id )\n    call WaitForAssert( {-> assert_false( pumvisible(), 'pumvisible()' ) } )\n    call CheckCurrentLine( '    Test' )\n    call assert_equal( 'import com.youcompleteme.Test;', getline( 3 ) )\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call setpos( '.', [ 0, 7, 1 ] )\n  call FeedAndCheckMain( \"oTes\\<C-space>\", funcref( 'Check1' ) )\n\n  call test_override( 'ALL', 0 )\nendfunction\n\nfunction! Test_DontResolveCompletion_AlreadyResolved()\n  call SkipIf( !exists( '*popup_findinfo' ), 'no popup_findinfo' )\n\n  \" Only the java completer actually uses the completion resolve\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/java/testdata/simple_eclipse_project' .\n        \\ '/src/com/test/TestWithDocumentation.java', { 'delay': 15 } )\n\n  call setpos( '.', [ 0, 7, 12 ] )\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check1( id )\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'hashCode' ], 'word' )\n    call s:AssertInfoPopupNotVisible()\n    call assert_equal( -1, complete_info().selected )\n\n    let compl = complete_info()\n    let hashCode = compl.items[ 0 ]\n    call assert_equal( 1, len( compl.items ) )\n    call assert_equal( 'hashCode', hashCode.word )\n    call assert_false( has_key( json_decode( hashCode.user_data ),\n          \\ 'resolve' ) )\n\n    call FeedAndCheckAgain( \"\\<Tab>\", funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n    call s:AssertInfoPopupVisible()\n\n    let compl = complete_info()\n    let selected = compl.items[ 0 ]\n    call assert_equal( 1, len( compl.items ) )\n    call assert_equal( 'hashCode', selected.word )\n    call assert_false( has_key( json_decode( selected.user_data ),\n          \\ 'resolve' ) )\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call FeedAndCheckMain( 'C', funcref( 'Check1' ) )\n\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call test_override( 'ALL', 0 )\nendfunction\n\nfunction! Test_SwitchingToSemanticCompletionAfterSelectingIdentifierCandidate()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/cpp/identifier_semantic_switch.cpp', {} )\n  call setpos( '.', [ 0, 3, 0 ] )\n  call test_override( 'char_avail', 1 )\n\n  function! Check1( id )\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'ZbCdE' ], 'word' )\n    let compl = complete_info()\n    call assert_equal( -1, compl.selected )\n    call assert_equal( 1, len( compl.items ) )\n    let ZbCdE = compl.items[ 0 ]\n    call assert_equal( 'ZbCdE', ZbCdE.word )\n    call assert_equal( '[ID]', ZbCdE.menu )\n    call assert_equal( '', ZbCdE.kind )\n    call FeedAndCheckAgain( \"\\<Tab>\", funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( id )\n    call WaitForCompletion()\n    call assert_match( 'ZbCdE', getline( '.' ) )\n    call FeedAndCheckAgain( \"\\<C-Space>\", funcref( 'Check3' ) )\n  endfunction\n\n  function! Check3( id )\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'ZbCdE' ], 'word' )\n    let compl = complete_info()\n    call assert_equal( -1, compl.selected )\n    call assert_match( 'ZbCdE', getline( '.' ) )\n    call assert_equal( 1, len( compl.items ) )\n    let ZbCdE = compl.items[ 0 ]\n    call assert_equal( 'ZbCdE', ZbCdE.word )\n    call assert_equal( 'void', ZbCdE.menu )\n    call assert_equal( 'f', ZbCdE.kind )\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n\n  call FeedAndCheckMain( 'ZCE', funcref( 'Check1' ) )\n  call assert_false( pumvisible(), 'pumvisible()' )\n  call test_override( 'ALL', 0 )\nendfunction\n"
  },
  {
    "path": "test/completion_noresolve.test.vim",
    "content": "function! SetUp()\n  let g:ycm_use_clangd = 1\n  let g:ycm_confirm_extra_conf = 0\n  let g:ycm_auto_trigger = 1\n  let g:ycm_keep_logfiles = 1\n  let g:ycm_log_level = 'DEBUG'\n  let g:ycm_enable_semantic_highlighting = 1\n\n  set completeopt-=preview\n\n  call youcompleteme#test#setup#SetUp()\nendfunction\n\nfunction! TearDown()\n  call youcompleteme#test#setup#CleanUp()\nendfunction\n\nexe 'source' expand( \"<sfile>:p:h\" ) .. '/completion.common.vim'\n\nfunction! Test_No_Resolve()\n  let debug_info = split( execute( 'YcmDebugInfo' ), \"\\n\" )\n  enew\n  setf cpp\n\n  call assert_equal( '', &completefunc )\n\n  for line in debug_info\n    if line =~# \"^-- Resolve completions: \"\n      let ver = substitute( line, \"^-- Resolve completions: \", \"\", \"\" )\n      call assert_equal( 'Never', ver, 'API version' )\n      return\n    endif\n  endfor\n\n  call assert_report( \"Didn't find the resolve type in the YcmDebugInfo\" )\nendfunction\n"
  },
  {
    "path": "test/diagnostics.test.vim",
    "content": "function! SetUp()\n  let g:ycm_use_clangd = 1\n  let g:ycm_confirm_extra_conf = 0\n  let g:ycm_auto_trigger = 1\n  let g:ycm_keep_logfiles = 1\n  let g:ycm_log_level = 'DEBUG'\n  let g:ycm_always_populate_location_list = 1\n  let g:ycm_enable_semantic_highlighting = 1\n  let g:ycm_auto_hover = ''\n\n  \" diagnostics take ages\n  let g:ycm_test_min_delay = 7\n  call youcompleteme#test#setup#SetUp()\nendfunction\n\nfunction! TearDown()\n  call youcompleteme#test#setup#CleanUp()\nendfunction\n\nfunction! Test_Diagnostics_Update_In_Insert_Mode()\n  call youcompleteme#test#setup#OpenFile(\n    \\ '/test/testdata/cpp/new_file.cpp', {} )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  \" Must do the checks in a timer callback because we need to stay in insert\n  \" mode until done.\n  function! Check( id ) closure\n    call WaitForAssert( {-> assert_true( len( sign_getplaced(\n                           \\ '%',\n                           \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) ) } )\n    call feedkeys( \"\\<ESC>\" )\n  endfunction\n\n  call FeedAndCheckMain( 'imain(', funcref( 'Check' ) )\n  call test_override( 'ALL', 0 )\nendfunction\n\nfunction! SetUp_Test_Disable_Diagnostics_Update_In_insert_Mode()\n  call youcompleteme#test#setup#PushGlobal( \n    \\ 'ycm_update_diagnostics_in_insert_mode', 0 )\nendfunction\n\nfunction! Test_Disable_Diagnostics_Update_In_insert_Mode()\n  call youcompleteme#test#setup#OpenFile(\n    \\ '/test/testdata/cpp/new_file.cpp', {} )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  \" Must do the checks in a timer callback because we need to stay in insert\n  \" mode until done.\n  function! CheckNoDiagUIAfterOpenParenthesis( id ) closure\n    call WaitForAssert( {->\n      \\ assert_true(\n        \\ py3eval(\n           \\ 'len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'\n      \\ ) ) } )\n    call WaitForAssert( {-> assert_false( len( sign_getplaced(\n                           \\ '%',\n                           \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) ) } )\n\n    call FeedAndCheckAgain( \"   \\<BS>\\<BS>\\<BS>)\",\n      \\ funcref( 'CheckNoDiagUIAfterClosingPatenthesis' ) )\n  endfunction\n\n  function! CheckNoDiagUIAfterClosingPatenthesis( id ) closure\n    call WaitForAssert( {->\n      \\ assert_true(\n        \\ py3eval(\n           \\ 'len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'\n      \\ ) ) } )\n    call WaitForAssert( {-> assert_false( len( sign_getplaced(\n                           \\ '%',\n                           \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) ) } )\n\n    call feedkeys( \"\\<ESC>\" )\n    call FeedAndCheckAgain( \"\\<ESC>\",\n      \\ funcref( 'CheckDiagUIRefreshedAfterLeavingInsertMode' ) )\n  endfunction\n\n  function! CheckDiagUIRefreshedAfterLeavingInsertMode( id ) closure\n    call WaitForAssert( {->\n      \\ assert_true(\n        \\ py3eval(\n           \\ 'len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'\n      \\ ) ) } )\n    call WaitForAssert( {-> assert_true( len( sign_getplaced(\n                           \\ '%',\n                           \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) ) } )\n    call FeedAndCheckAgain( \"A\\<CR>\", funcref( 'CheckNoPropsAfterNewLine' ) )\n  endfunction\n\n  function! CheckNoPropsAfterNewLine( id ) closure\n    call WaitForAssert( {->\n      \\ assert_true(\n        \\ py3eval(\n           \\ 'len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'\n      \\ ) ) } )\n    call WaitForAssert( {-> assert_false( len( prop_list(\n                           \\ 1, { 'end_lnum': -1,\n                                \\ 'types': [ 'YcmVirtDiagWarning',\n                                           \\ 'YcmVirtDiagError',\n                                           \\ 'YcmVirtDiagPadding' ] } ) ) ) } )\n  endfunction\n\n  call FeedAndCheckMain( 'imain(',\n      \\ funcref( 'CheckNoDiagUIAfterOpenParenthesis' ) )\n  call test_override( 'ALL', 0 )\nendfunction\n\nfunction! TearDown_Test_Disable_Diagnostics_Update_In_insert_Mode()\n  call youcompleteme#test#setup#PopGlobal(\n    \\ 'ycm_update_diagnostics_in_insert_mode' )\nendfunction\n\nfunction! Test_Changing_Filetype_Refreshes_Diagnostics()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/test/testdata/diagnostics/foo.xml',\n        \\ { 'native_ft': 0 } )\n\n  call assert_equal( 'xml', &filetype )\n  call assert_false(\n    \\ pyxeval( 'ycm_state._buffers[' . bufnr( '%' ) . ']._async_diags' ) )\n  call assert_true( empty( sign_getplaced(\n                        \\ '%',\n                        \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) )\n  setf typescript\n  call assert_equal( 'typescript', &filetype )\n  call assert_false(\n    \\ pyxeval( 'ycm_state._buffers[' . bufnr( '%' ) . ']._async_diags' ) )\n  \" Diagnostics are async, so wait for the assert to return 0 for a while.\n  call WaitForAssert( {-> assert_equal( 1, len( sign_getplaced(\n                        \\ '%',\n                        \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) ) } )\n  call assert_equal( 1, len( sign_getplaced(\n                        \\ '%',\n                        \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) )\n  call assert_equal(\n    \\ 'YcmError',\n    \\ sign_getplaced(\n      \\ '%',\n      \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ][ 0 ][ 'name' ] )\n  call assert_false( empty( getloclist( 0 ) ) )\nendfunction\n\nfunction! Test_MessagePoll_After_LocationList()\n  call youcompleteme#test#setup#OpenFile(\n    \\ '/test/testdata/diagnostics/foo.cpp', {} )\n\n  setf cpp\n  call assert_equal( 'cpp', &filetype )\n  call WaitForAssert( {-> assert_equal( 2, len( sign_getplaced(\n                        \\ '%',\n                        \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) ) } )\n  call setline( 1, '' )\n  \" Wait for the parse request to be complete otherwise we won't send another\n  \" one when the TextChanged event fires\n  call WaitFor( {-> pyxeval( 'ycm_state.FileParseRequestReady()' ) } )\n  doautocmd TextChanged\n  call WaitForAssert( {-> assert_true( empty( sign_getplaced(\n                        \\ '%',\n                        \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) ) } )\n  call assert_true( empty( getloclist( 0 ) ) )\nendfunction\n\nfunction! Test_MessagePoll_Multiple_Filetypes()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/java/testdata/simple_eclipse_project' .\n        \\ '/src/com/test/TestLauncher.java', {} )\n  call WaitForAssert( {->\n      \\ assert_true( len( sign_getplaced(\n                            \\ '%',\n                            \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) ) } )\n  let java_signs = sign_getplaced(\n                     \\ '%',\n                     \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ]\n  silent vsplit testdata/diagnostics/foo.cpp\n  \" Make sure we've left the java buffer\n  call assert_equal( java_signs,\n      \\ sign_getplaced( '#', { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] )\n  \" Clangd emits two diagnostics for foo.cpp.\n  call WaitForAssert( {->\n      \\ assert_equal(\n          \\ 2,\n          \\ len( sign_getplaced(\n              \\ '%',\n              \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) ) } )\n  let cpp_signs = sign_getplaced( '%',\n      \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ]\n  call assert_false( java_signs == cpp_signs )\nendfunction\n\nfunction! Test_BufferWithoutAssociatedFile_HighlightingWorks()\n  enew\n  call setbufline( '%', 1, 'iiii' )\n  setf c\n  call WaitForAssert( {->\n    \\ assert_true( len( sign_getplaced(\n                        \\ '%',\n                        \\ { 'group': 'ycm_signs' } )[ 0 ][ 'signs' ] ) ) } )\n  let expected_properties = [\n    \\ { 'id': 4,\n    \\   'col': 1,\n    \\   'end': 1,\n    \\   'type': 'YcmErrorProperty',\n    \\   'length': 0,\n    \\   'start': 1 },\n    \\ { 'id': 3,\n    \\   'col': 1,\n    \\   'end': 1,\n    \\   'type': 'YcmErrorProperty',\n    \\   'length': 0,\n    \\   'start': 1 },\n    \\ { 'id': 2,\n    \\    'col': 1,\n    \\    'end': 1,\n    \\    'type': 'YcmErrorProperty',\n    \\    'length': 4,\n    \\    'start': 1 },\n    \\ { 'id': 1,\n    \\    'col': 1,\n    \\    'end': 1,\n    \\    'type': 'YcmErrorProperty',\n    \\    'length': 4,\n    \\    'start': 1 } ]\n\n  call CheckListOfDicts( prop_list( 1 ), expected_properties )\nendfunction\n\nfunction! Test_ThirdPartyDeletesItsTextProperty()\n  enew\n  call prop_type_add( 'ThirdPartyProperty', { 'highlight': 'Error' } )\n  call prop_add( 1, 1, { 'type': 'ThirdPartyProperty', 'bufnr': bufnr('%'), 'id': 42 } )\n  call prop_type_delete( 'ThirdPartyProperty' )\n\n  py3 from ycm.vimsupport import GetTextProperties, GetIntValue\n  call assert_equal( [], py3eval( 'GetTextProperties( GetIntValue( \"\"\"bufnr( \"%\" )\"\"\" ) )' ) )\nendfunction\n\nfunction! Test_ShowDetailedDiagnostic_CmdLine()\n  call youcompleteme#test#setup#OpenFile(\n    \\ '/test/testdata/cpp/fixit.cpp', {} )\n\n  call cursor( [ 3, 1 ] )\n  redir => output\n  YcmShowDetailedDiagnostic\n  redir END\n\n  call assert_equal(\n        \\ \"Format specifies type 'char *' but the argument has type 'int' \"\n        \\ . '(fix available) [-Wformat]',\n        \\ trim( output ) )\n\n  %bwipe!\nendfunction\n\nfunction! Test_ShowDetailedDiagnostic_PopupAtCursor()\n  call youcompleteme#test#setup#OpenFile(\n    \\ '/test/testdata/cpp/fixit.cpp', {} )\n\n  call cursor( [ 3, 1 ] )\n  YcmShowDetailedDiagnostic popup\n\n  let id = popup_locate( 4, 16 )\n  call assert_notequal(\n        \\ 0,\n        \\ id,\n        \\ \"Couldn't find popup! \" .. youcompleteme#test#popup#DumpPopups() )\n\n  if exists( '*popup_list' )\n    let popups = popup_list()\n    call assert_equal( 1, len( popups ) )\n  endif\n\n  call youcompleteme#test#popup#CheckPopupPosition( id, {\n        \\ 'visible': 1,\n        \\ 'col': 16,\n        \\ 'line': 4,\n        \\ } )\n  call assert_equal(\n        \\ [\n        \\   \"Format specifies type 'char *' but the argument has type 'int' \"\n        \\   . '(fix available) [-Wformat]',\n        \\ ],\n        \\ getbufline( winbufnr(id), 1, '$' ) )\n\n  \" From vim's test_popupwin.vim\n  \" trigger the check for last_cursormoved by going into insert mode\n  call test_override( 'char_avail', 1 )\n  call feedkeys( \"ji\\<Esc>\", 'xt' )\n  call assert_equal( {}, popup_getpos( id ) )\n  call test_override( 'ALL', 0 )\n\n  %bwipe!\nendfunction\n\nfunction! Test_ShowDetailedDiagnostic_Popup_WithCharacters()\n  let f = tempname() . '.cc'\n  execut 'edit' f\n  call setline( 1, [\n        \\   'struct Foo {};',\n        \\   'template<char...> Foo operator\"\"_foo() { return {}; }',\n        \\   'int main() {',\n        \\       '\"\"_foo',\n        \\   '}',\n        \\ ] )\n  call youcompleteme#test#setup#WaitForInitialParse( {} )\n\n  call WaitForAssert( {->\n    \\ assert_true(\n      \\ py3eval(\n         \\ 'len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'\n    \\ ) ) } )\n\n  call cursor( [ 4, 1 ] )\n  YcmShowDetailedDiagnostic popup\n\n  let id = popup_locate( 5, 7 )\n  call assert_notequal(\n        \\ 0,\n        \\ id,\n        \\ \"Couldn't find popup! \" .. youcompleteme#test#popup#DumpPopups() )\n\n  if exists( '*popup_list' )\n    let popups = popup_list()\n    call assert_equal( 1, len( popups ) )\n  endif\n\n  call youcompleteme#test#popup#CheckPopupPosition( id, {\n        \\ 'visible': 1,\n        \\ 'col': 7,\n        \\ 'line': 5,\n        \\ } )\n  call assert_match(\n        \\ \"^No matching literal operator for call to 'operator\\\"\\\"_foo'.*\",\n        \\ getbufline( winbufnr(id), 1, '$' )[ 0 ] )\n\n  \" From vim's test_popupwin.vim\n  \" trigger the check for last_cursormoved by going into insert mode\n  call test_override( 'char_avail', 1 )\n  call feedkeys( \"ji\\<Esc>\", 'xt' )\n  call assert_equal( {}, popup_getpos( id ) )\n  call test_override( 'ALL', 0 )\n\n  %bwipe!\nendfunction\n\nfunction! Test_ShowDetailedDiagnostic_Popup_MultilineDiagNotFromStartOfLine()\n  let f = tempname() . '.cc'\n  execut 'edit' f\n  call setline( 1, [\n        \\   'int main () {',\n        \\   '  int a \\',\n        \\   '=\\',\n        \\   '=',\n        \\   '3;',\n        \\   '}',\n        \\ ] )\n  call youcompleteme#test#setup#WaitForInitialParse( {} )\n\n  call WaitForAssert( {->\n    \\ assert_true(\n      \\ py3eval(\n         \\ 'len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'\n    \\ ) ) } )\n\n  call test_override( 'char_avail', 1 )\n\n  for cursor_pos in [ [ 2, 9 ], [ 3, 1], [ 4, 1 ] ]\n    call cursor( cursor_pos )\n    YcmShowDetailedDiagnostic popup\n\n    call assert_equal( len( popup_list() ), 1 )\n    let id = popup_list()[ 0 ]\n    call assert_notequal( 0, id, \"Couldn't find popup!\" )\n    call assert_equal( [ 3, 10 ], win_screenpos( id ) )\n\n    call youcompleteme#test#popup#CheckPopupPosition( id, {\n          \\ 'visible': 1,\n          \\ 'col': 10,\n          \\ 'line': 3,\n          \\ } )\n    call assert_match(\n          \\ \"^Invalid '==' at end of declaration; did you mean '='?.*\",\n          \\ getbufline( winbufnr(id), 1, '$' )[ 0 ] )\n    \" From vim's test_popupwin.vim\n    \" trigger the check for last_cursormoved by going into insert mode\n    call feedkeys( \"ji\\<Esc>\", 'xt' )\n    call assert_equal( {}, popup_getpos( id ) )\n  endfor\n\n  call test_override( 'ALL', 0 )\n\n  %bwipe!\nendfunction\n\nfunction! Test_ShowDetailedDiagnostic_Popup_MultilineDiagFromStartOfLine()\n  let f = tempname() . '.cc'\n  execut 'edit' f\n  call setline( 1, [\n        \\   'int main () {',\n        \\   'const int &&',\n        \\   '        /* */',\n        \\   '    rd = 1;',\n        \\   'rd = 4;',\n        \\   '}',\n        \\ ] )\n  call youcompleteme#test#setup#WaitForInitialParse( {} )\n\n  call WaitForAssert( {->\n    \\ assert_true(\n      \\ py3eval(\n         \\ 'len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'\n    \\ ) ) } )\n\n  call test_override( 'char_avail', 1 )\n\n  for cursor_pos in [ [ 2, 1 ], [ 3, 9 ], [ 4, 5 ] ]\n    call cursor( cursor_pos )\n    YcmShowDetailedDiagnostic popup\n\n    call assert_equal( 1, len( popup_list() ) )\n    let id = popup_list()[ 0 ]\n    call assert_notequal( 0, id, \"Couldn't find popup!\" )\n    call assert_equal( [ 3, 13 ], win_screenpos( id ) )\n\n    call youcompleteme#test#popup#CheckPopupPosition( id, {\n          \\ 'visible': 1,\n          \\ 'col': 13,\n          \\ 'line': 3,\n          \\ } )\n    call assert_match(\n          \\ \"^Variable 'rd' declared const here.*\",\n          \\ getbufline( winbufnr(id), 1, '$' )[ 0 ] )\n    \" From vim's test_popupwin.vim\n    \" trigger the check for last_cursormoved by going into insert mode\n    call feedkeys( \"ji\\<Esc>ki\\<Esc>\", 'xt' )\n    call assert_equal( {}, popup_getpos( id ) )\n  endfor\n\n  call test_override( 'ALL', 0 )\n\n  %bwipe!\nendfunction\n\nfunction! Test_ShowDetailedDiagnostic_Popup_MultipleDiagsPerLine_SameMessage()\n  let f = tempname() . '.cc'\n  execut 'edit' f\n  call setline( 1, [ 'void f(){a;a;}', ] )\n  call youcompleteme#test#setup#WaitForInitialParse( {} )\n\n  call WaitForAssert( {->\n    \\ assert_true(\n      \\ py3eval(\n        \\ 'len( ycm_state.CurrentBuffer()._diag_interface._diagnostics )'\n    \\ ) ) } )\n\n  YcmShowDetailedDiagnostic popup\n  let popup_list = popup_list()\n  call assert_equal( 1, len( popup_list ) )\n  call popup_close( popup_list[ 0 ] )\nendfunction\n"
  },
  {
    "path": "test/docker/ci/image/Dockerfile",
    "content": "FROM ubuntu:24.04\n\nENV DEBIAN_FRONTEND=noninteractive\nENV LC_ALL C.UTF-8\n\nARG VIM_VERSION=v9.1.0016\nARG YCM_VIM_PYTHON=python3\nARG NODE_MAJOR=18\n\nRUN apt-get update && \\\n  apt-get -y dist-upgrade && \\\n  apt-get -y --no-install-recommends install \\\n                     gnupg \\\n                     locales \\\n                     tzdata \\\n                     language-pack-en \\\n                     sudo \\\n                     libncurses5-dev libncursesw5-dev \\\n                     git \\\n                     build-essential \\\n                     cmake \\\n                     python3-dev \\\n                     python3-pip \\\n                     python3-setuptools \\\n                     python3-wheel \\\n                     openjdk-21-jdk-headless \\\n                     nodejs \\\n                     npm \\\n                     vim-nox \\\n                     zlib1g-dev && \\\n  apt-get -y autoremove\n\nRUN ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime && \\\n  dpkg-reconfigure --frontend noninteractive tzdata\n\nENV CONF_ARGS \"--with-features=huge \\\n               --enable-${YCM_VIM_PYTHON}interp \\\n               --enable-terminal \\\n               --enable-multibyte \\\n               --enable-fail-if-missing\"\n\nRUN mkdir -p $HOME/vim && \\\n    cd $HOME/vim && \\\n    git clone https://github.com/vim/vim && \\\n    cd vim && \\\n    git checkout ${VIM_VERSION} && \\\n    make -j 4 && \\\n    make install\n\n# clean up\nRUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* &&\\\n    rm -rf ~/.cache && \\\n    rm -rf $HOME/vim\n"
  },
  {
    "path": "test/docker/ci/push",
    "content": "#!/usr/bin/env bash\n\nset -e\n\nARCH=$(uname -m)\n\ndocker push youcompleteme/ycm-vim-${ARCH}-py3:test\n"
  },
  {
    "path": "test/docker/ci/rebuild",
    "content": "#!/usr/bin/env bash\n\nset -e\n\nif [ \"$1\" = \"--continue\" ]; then\n  OPTS=\"\"\nelse\n  OPTS=\"--no-cache\"\nfi\n\nARCH=$(uname -m)\n\ndocker build ${OPTS} -t youcompleteme/ycm-vim-${ARCH}-py3:test \\\n                     --build-arg YCM_VIM_PYTHON=python3 \\\n                     image/\n"
  },
  {
    "path": "test/docker/manual/image/.vim/vimrc",
    "content": "runtime defaults.vim\nset rtp+=/home/dev/YouCompleteMe\nfiletype plugin indent on\n"
  },
  {
    "path": "test/docker/manual/image/Dockerfile",
    "content": "ARG YCM_PYTHON=py3\nARG ARCH=x86_64\n\nFROM youcompleteme/ycm-vim-${ARCH}-${YCM_PYTHON}:test\n\nRUN apt-get update && \\\n  apt-get -y --no-install-recommends install less && \\\n  apt-get -y autoremove\n\nRUN useradd -ms /bin/bash -d /home/dev -G sudo dev && \\\n    echo \"dev:dev\" | chpasswd && \\\n    echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/sudo\n\nUSER dev\nWORKDIR /home/dev\n\nENV HOME /home/dev\nENV PYTHON_CONFIGURE_OPTS --enable-shared\n\nADD --chown=dev:dev .vim/ /home/dev/.vim/\n\n## cleanup of files from setup\nRUN sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*\n\n"
  },
  {
    "path": "test/docker/manual/push",
    "content": "#!/usr/bin/env bash\n\nset -e\n\nARCH=$(uname -m)\n\ndocker push youcompleteme/ycm-vim-${ARCH}-py3:manual\n"
  },
  {
    "path": "test/docker/manual/rebuild",
    "content": "#!/usr/bin/env bash\n\nset -e\n\nif [ \"$1\" = \"--continue\" ]; then\n  OPTS=\"\"\nelse\n  OPTS=\"--no-cache\"\nfi\n\nARCH=$(uname -m)\n\ndocker build ${OPTS} -t youcompleteme/ycm-vim-${ARCH}-py3:manual \\\n                     --build-arg YCM_PYTHON=py3 \\\n                     --build-arg ARCH=${ARCH} \\\n                     image/\n"
  },
  {
    "path": "test/docker/manual/run",
    "content": "#!/usr/bin/env bash\n\nARCH=$(uname -m)\nCONTAINER=youcompleteme/ycm-vim-${ARCH}-py3:manual\n\npushd $(dirname $0)\n  docker run --mount src=\"$(pwd)/../../../\",target=/home/dev/YouCompleteMe,type=bind \\\n             -it ${CONTAINER} \\\n             \"$@\"\npopd\n"
  },
  {
    "path": "test/docker/rebuild_all",
    "content": "#!/usr/bin/env bash\n\nset -e\n\nfor d in ci manual; do\n  pushd $(dirname $0)/$d\n    ./rebuild \"$@\"\n    ./push\n  popd\ndone\n"
  },
  {
    "path": "test/filesize.test.vim",
    "content": "function! SetUp()\n  let g:ycm_use_clangd = 1\n  let g:ycm_confirm_extra_conf = 0\n  let g:ycm_auto_trigger = 1\n  let g:ycm_keep_logfiles = 1\n  let g:ycm_always_populate_location_list = 1\n\n  \" diagnostics take ages\n  let g:ycm_test_min_delay = 7 \n  call youcompleteme#test#setup#SetUp()\nendfunction\n\nfunction! TearDown()\n  call youcompleteme#test#setup#CleanUp()\nendfunction\n\nfunction! Test_Open_Unsupported_Filetype_Messages()\n  messages clear\n  enew\n\n  let X = join( map( range( 0, 1000 * 1024 + 1 ), {->'X'} ), '' )\n  call append( line( '$' ), X )\n\n  silent w! Xtest\n\n  let l:stderr = substitute( execute( '1messages' ), '\\n', '\\t', 'g' )\n  call assert_notmatch( 'the file exceeded the max size', stderr )\n  call delete( 'Xtest' )\nendfunction\n\nfunction! Test_Open_Supported_Filetype_Messages()\n  enew\n\n  let X = join( map( range( 0, 1000 * 1024 + 1 ), {->'X'} ), '' )\n  call append( line( '$' ), X )\n\n  silent w! Xtest\n  setf cpp\n\n  let l:stderr = substitute( execute( '1messages' ), '\\n', '\\t', 'g' )\n  call assert_match( 'the file exceeded the max size', stderr )\n  call assert_equal( 1, b:ycm_largefile )\n  messages clear\n\n  call delete( 'Xtest' )\nendfunction\n"
  },
  {
    "path": "test/finder.test.vim",
    "content": "function! SetUp()\n  let g:ycm_use_clangd = 1\n  let g:ycm_enable_semantic_highlighting = 1\n  call youcompleteme#test#setup#SetUp()\n  nmap <leader><leader>w <Plug>(YCMFindSymbolInWorkspace)\n  nmap <leader><leader>d <Plug>(YCMFindSymbolInDocument)\nendfunction\n\nfunction! TearDown()\nendfunction\n\nfunction! Test_WorkspaceSymbol_Basic()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/test/testdata/cpp/finder_test.cc', {} )\n\n  let original_win = winnr()\n  let b = bufnr()\n  let l = winlayout()\n\n  let popup_id = -1\n\n  function! PutQuery( ... )\n    \" Wait for the current buffer to be a prompt buffer\n    call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n    call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\n    call WaitForAssert( { -> assert_true(\n          \\ youcompleteme#finder#GetState().id != -1 ) } )\n\n    \" TODO: Wait for the popup to be displayed, and check the contents\n    call FeedAndCheckAgain( 'xthisisathing', funcref( 'SelectItem' ) )\n  endfunction\n\n  function SelectItem( ... )\n    let id = youcompleteme#finder#GetState().id\n\n    call WaitForAssert( { ->\n          \\ assert_equal( ' [X] Search for symbol: xthisisathing ',\n          \\ popup_getoptions( id ).title  ) },\n          \\ 10000 )\n\n    call WaitForAssert( { -> assert_equal( 1, line( '$', id ) ) } )\n\n    call feedkeys( \"\\<CR>\" )\n  endfunction\n\n  \" <Leader> is \\ - this calls <Plug>(YCMFindSymbolInWorkspace)\n  call FeedAndCheckMain( '\\\\w', funcref( 'PutQuery' ) )\n\n  call WaitForAssert( { -> assert_equal( l, winlayout() ) } )\n  call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )\n  call assert_equal( b, bufnr() )\n  call assert_equal( [ 0, 5, 7, 0 ], getpos( '.' ) )\n\n  delfunct PutQuery\n  delfunct SelectItem\n  silent %bwipe!\nendfunction\n\nfunction! Test_DocumentSymbols_Basic()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/test/testdata/cpp/finder_test.cc', {} )\n\n  let original_win = winnr()\n  let b = bufnr()\n  let l = winlayout()\n\n  let popup_id = -1\n\n  function! PutQuery( ... )\n    \" Wait for the current buffer to be a prompt buffer\n    call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n    call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\n    call WaitForAssert( { -> assert_true(\n          \\ youcompleteme#finder#GetState().id != -1 ) } )\n\n    \" TODO: Wait for the popup to be displayed, and check the contents\n    call FeedAndCheckAgain( 'xthisisathing', funcref( 'SelectItem' ) )\n  endfunction\n\n  function SelectItem( ... )\n    let id = youcompleteme#finder#GetState().id\n\n    call WaitForAssert( { ->\n          \\ assert_equal( ' [X] Search for symbol: xthisisathing ',\n          \\ popup_getoptions( id ).title  ) },\n          \\ 10000 )\n\n    call WaitForAssert( { -> assert_equal( 1, line( '$', id ) ) } )\n\n    call feedkeys( \"\\<CR>\" )\n  endfunction\n\n  \" <Leader> is \\ - this calls <Plug>(YCMFindSymbolInDocument)\n  call FeedAndCheckMain( '\\\\d', funcref( 'PutQuery' ) )\n\n  call WaitForAssert( { -> assert_equal( l, winlayout() ) } )\n  call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )\n  call assert_equal( b, bufnr() )\n  \" NOTE: cland returns the position of the decl here not the identifier. This\n  \" is why it's position 3 not 7 as in the Test_WorkspaceSymbol_Basic\n  call assert_equal( [ 0, 5, 3, 0 ], getpos( '.' ) )\n\n  delfunct PutQuery\n  delfunct SelectItem\n  silent %bwipe!\nendfunction\n\nfunction! Test_Cancel_DocumentSymbol()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/test/testdata/cpp/finder_test.cc', {} )\n\n  let original_win = winnr()\n  let b = bufnr()\n  let l = winlayout()\n\n  \" Jump to a different position so that we can ensure we return to the same\n  \" place\n  normal! G\n  let p = getpos( '.' )\n\n  let popup_id = -1\n\n  function! PutQuery( ... )\n    \" Wait for the current buffer to be a prompt buffer\n    call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n    call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\n    call WaitForAssert( { -> assert_true(\n          \\ youcompleteme#finder#GetState().id != -1 ) } )\n\n    call FeedAndCheckAgain( 'xthisisathing', funcref( 'SelectItem' ) )\n  endfunction\n\n  function SelectItem( ... )\n    let id = youcompleteme#finder#GetState().id\n\n    call WaitForAssert( { ->\n          \\ assert_equal( ' [X] Search for symbol: xthisisathing ',\n          \\ popup_getoptions( id ).title  ) },\n          \\ 10000 )\n\n    call WaitForAssert( { -> assert_equal( 1, line( '$', id ) ) } )\n\n    \" Cancel - this should stopinsert\n    call feedkeys( \"\\<C-c>\" )\n  endfunction\n\n  \" <Leader> is \\ - this calls <Plug>(YCMFindSymbolInDocument)\n  call FeedAndCheckMain( '\\\\d', funcref( 'PutQuery' ) )\n\n  call WaitForAssert( { -> assert_equal( l, winlayout() ) } )\n  call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )\n  call assert_equal( b, bufnr() )\n\n  \" Retuned to just where we started\n  call assert_equal( p, getpos( '.' ) )\n\n  delfunct PutQuery\n  delfunct SelectItem\n  silent %bwipe!\nendfunction\n\nfunction! Test_EmptySearch()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/test/testdata/cpp/finder_test.cc', {} )\n\n  let original_win = winnr()\n  let b = bufnr()\n  let l = winlayout()\n\n  let popup_id = -1\n\n  function! PutQuery( ... )\n    \" Wait for the current buffer to be a prompt buffer\n    call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n    call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\n    call WaitForAssert( { -> assert_true(\n          \\ youcompleteme#finder#GetState().id != -1 ) } )\n\n    \" TODO: Wait for the popup to be displayed, and check the contents\n    call FeedAndCheckAgain( 'xnothingshouldmatchthisx',\n                          \\ funcref( 'SelectNothing' ) )\n  endfunction\n\n  function SelectNothing( ... )\n    let id = youcompleteme#finder#GetState().id\n\n    call WaitForAssert( { ->\n          \\ assert_equal( ' [X] Search for symbol: xnothingshouldmatchthisx ',\n          \\ popup_getoptions( id ).title  ) },\n          \\ 10000 )\n\n    call WaitForAssert( { -> assert_equal( 1, line( '$', id ) ) } )\n\n    call assert_equal( 'No results', getbufline( winbufnr( id ), '$' )[ 0 ] )\n    call FeedAndCheckAgain( \"\\<CR>xnotarealthingx\",\n                          \\ funcref( 'ChangeSearch' ) )\n  endfunction\n\n  function ChangeSearch( ... )\n    let id = youcompleteme#finder#GetState().id\n\n    \" Hitting enter with nothing to select clears the prompt, because prompt\n    \" buffer\n    call WaitForAssert( { ->\n          \\ assert_equal( ' [X] Search for symbol: xnotarealthingx ',\n          \\ popup_getoptions( id ).title  ) },\n          \\ 10000 )\n    call assert_equal( 'No results', getbufline( winbufnr( id ), '$' )[ 0 ] )\n\n    call assert_equal( -1, youcompleteme#finder#GetState().selected )\n\n    call FeedAndCheckAgain( \"\\<C-u>xtiat\", funcref( 'TestUpDownSelect' ) )\n  endfunction\n\n  let popup_id = -1\n  function TestUpDownSelect( ... ) closure\n    let popup_id = youcompleteme#finder#GetState().id\n\n    call WaitForAssert( { ->\n          \\ assert_equal( ' [X] Search for symbol: xtiat ',\n          \\ popup_getoptions( popup_id ).title  ) },\n          \\ 10000 )\n    call WaitForAssert( { -> assert_equal( 2, line( '$', popup_id ) ) } )\n\n    \" FIXME: Doing all these tests with only 2 entries means that it's not\n    \" really checking the behaviour completely accurately, we should at least\n    \" use 3, but that would require crafting a new test file, which is nonzero\n    \" effort. Well, it's probably as much effort as writing this comment...\n\n    \" Check down movement\n    call assert_equal( 0, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_this_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<C-j>\", 'xt' )\n    call assert_equal( 1, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_that_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<Down>\", 'xt' )\n    call assert_equal( 0, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_this_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<Tab>\", 'xt' )\n    call assert_equal( 1, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_that_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<C-n>\", 'xt' )\n    call assert_equal( 0, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_this_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    \" Check up movement and wrapping\n    call feedkeys( \"\\<C-k>\", 'xt' )\n    call assert_equal( 1, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_that_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<Up>\", 'xt' )\n    call assert_equal( 0, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_this_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<S-Tab>\", 'xt' )\n    call assert_equal( 1, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_that_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<C-p>\", 'xt' )\n    call assert_equal( 0, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_this_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<Tab>\", 'xt' )\n    call assert_equal( 1, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_that_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<Home>\", 'xt' )\n    call assert_equal( 0, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_this_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<End>\", 'xt' )\n    call assert_equal( 1, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_that_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<End>\", 'xt' )\n    call assert_equal( 1, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_that_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<PageUp>\", 'xt' )\n    call assert_equal( 0, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_this_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<PageDown>\", 'xt' )\n    call assert_equal( 1, youcompleteme#finder#GetState().selected )\n    call assert_equal( 'x_that_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    call feedkeys( \"\\<CR>\" )\n  endfunction\n\n  \" <Leader> is \\ - this calls <Plug>(YCMFindSymbolInWorkspace)\n  call FeedAndCheckMain( '\\\\w', funcref( 'PutQuery' ) )\n\n  call WaitForAssert( { -> assert_equal( {}, popup_getpos( popup_id ) ) } )\n  call WaitForAssert( { -> assert_equal( l, winlayout() ) } )\n  call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )\n  call assert_equal( b, bufnr() )\n  call assert_equal( [ 0, 5, 30, 0 ], getpos( '.' ) )\n\n  \" We pop up a notification with some text in it\n  if exists( '*popup_list' )\n    call assert_equal( 1, len( popup_list() ) )\n  endif\n\n  \" Old vim doesn't have popup_list, so hit-test the top-right corner which is\n  \" where we pup the popu\n  let notification_id = popup_locate( 1, &columns - 1 )\n  call assert_equal( [ 'Added 2 entries to quickfix list.' ],\n                   \\ getbufline( winbufnr( notification_id ), 1, '$' ) )\n  \" Wait for the notification to clear\n  call WaitForAssert(\n        \\ { -> assert_equal( {}, popup_getpos( notification_id ) ) },\n        \\ 10000 )\n\n  delfunct PutQuery\n  delfunct SelectNothing\n  delfunct ChangeSearch\n  delfunct TestUpDownSelect\n  silent %bwipe!\nendfunction\n\nfunction! Test_LeaveWindow_CancelSearch()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/test/testdata/cpp/finder_test.cc', {} )\n\n  let original_win = winnr()\n  let b = bufnr()\n  let l = winlayout()\n\n  \" Jump to a different position so that we can ensure we return to the same\n  \" place\n  normal! G\n  let p = getpos( '.' )\n\n  let popup_id = -1\n\n  function! PutQuery( ... )\n    \" Wait for the current buffer to be a prompt buffer\n    call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n    call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\n    call WaitForAssert( { -> assert_true(\n          \\ youcompleteme#finder#GetState().id != -1 ) } )\n\n    call feedkeys( \"\\<C-w>w\" )\n  endfunction\n\n  \" <Leader> is \\ - this calls <Plug>(YCMFindSymbolInWorkspace)\n  call FeedAndCheckMain( '\\\\w', funcref( 'PutQuery' ) )\n\n  call WaitForAssert( { -> assert_equal( l, winlayout() ) } )\n  call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )\n  call assert_equal( b, bufnr() )\n\n  \" Retuned to just where we started\n  call assert_equal( p, getpos( '.' ) )\n\n  \" No notifiaction\n  if exists( '*popup_list' )\n    call assert_equal( 0, len( popup_list() ) )\n  endif\n\n  delfunct PutQuery\n  silent %bwipe!\nendfunction\n\n\nfunction! SetUp_Test_NoFileType_NoCompletionIn_PromptBuffer()\n  call youcompleteme#test#setup#PushGlobal( 'ycm_filetype_whitelist', {\n        \\ '*': 1,\n        \\ 'ycm_nofiletype': 1\n        \\ } )\nendfunction\n\nfunction! TearDown_Test_NoFileType_NoCompletionIn_PromptBuffer()\n  call youcompleteme#test#setup#PopGlobal( 'ycm_filetype_whitelist' )\nendfunction\n\nfunction! Test_NoFileType_NoCompletionIn_PromptBuffer()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/test/testdata/cpp/finder_test.cc', {} )\n\n  call test_override( 'char_avail', 1 )\n\n  new\n  call feedkeys(\n        \\ 'iThis is some text and so is xthisisathing x_this_is_a_thing',\n        \\ 'xt' )\n  wincmd w\n\n  let original_win = winnr()\n  let b = bufnr()\n  let l = winlayout()\n\n  let popup_id = -1\n\n  function! PutQuery( ... )\n    \" Wait for the current buffer to be a prompt buffer\n    call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n    call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\n    call WaitForAssert( { -> assert_true(\n          \\ youcompleteme#finder#GetState().id != -1 ) } )\n\n    \" TODO: Wait for the popup to be displayed, and check the contents\n    call FeedAndCheckAgain( 'xthisisathing', funcref( 'CheckNoPopup' ) )\n  endfunction\n\n  function! CheckNoPopup( ... )\n    let id = youcompleteme#finder#GetState().id\n\n    call WaitForAssert( { ->\n            \\ assert_equal( ' [X] Search for symbol: xthisisathing ',\n            \\ popup_getoptions( id ).title  ) },\n          \\ 10000 )\n\n    call WaitForAssert( { -> assert_equal( 1, line( '$', id ) ) } )\n    call assert_equal( 'x_this_is_a_thing',\n          \\ youcompleteme#finder#GetState().results[\n          \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\n    \" Check there is no PUM - we disable completion in the prompt buffer\n    call assert_false( pumvisible() )\n\n    call feedkeys( \"\\<CR>\" )\n  endfunction\n\n  \" <Leader> is \\ - this calls <Plug>(YCMFindSymbolInWorkspace)\n  call FeedAndCheckMain( '\\\\w', funcref( 'PutQuery' ) )\n\n  call WaitForAssert( { -> assert_equal( l, winlayout() ) } )\n  call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )\n  call assert_equal( b, bufnr() )\n  call assert_equal( [ 0, 5, 7, 0 ], getpos( '.' ) )\n\n  call test_override( 'ALL', 0 )\n  silent %bwipe!\n  delfunct! PutQuery\n  delfunct! CheckNoPopup\nendfunction\n\n\" function! Test_MultipleFileTypes()\n\"   call youcompleteme#test#setup#OpenFile(\n\"         \\ '/test/testdata/cpp/finder_test.cc', {} )\n\"   split\n\"   call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n\"   wincmd w\n\"\n\"   let original_win = winnr()\n\"   let b = bufnr()\n\"   let l = winlayout()\n\"\n\"   function! PutQuery( ... )\n\"     \" Wait for the current buffer to be a prompt buffer\n\"     call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n\"     call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\"\n\"     let popup_id = youcompleteme#finder#GetState().id\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: thiswillnotmatchanything ',\n\"           \\ popup_getoptions( popup_id ).title  ) },\n\"           \\ 10000 )\n\"\n\"\n\"     call WaitForAssert( { -> assert_true(\n\"           \\ youcompleteme#finder#GetState().id != -1 ) } )\n\"\n\"     let id = youcompleteme#finder#GetState().id\n\"     call assert_equal( 'No results', getbufline( winbufnr( id ), '$' )[ 0 ] )\n\"     call FeedAndCheckAgain( \"\\<C-u>xthisisathing\", funcref( 'CheckCpp' ) )\n\"   endfunction\n\"\n\"   function! CheckCpp( ... )\n\"     let popup_id = youcompleteme#finder#GetState().id\n\"\n\"     \" Python can be _really_ slow\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: xthisisathing ',\n\"           \\ popup_getoptions( popup_id ).title  ) },\n\"           \\ 10000 )\n\"\n\"     call WaitForAssert( { -> assert_equal( 1, line( '$', popup_id ) ) } )\n\"     call assert_equal( 0, youcompleteme#finder#GetState().selected )\n\"     call assert_equal( 'x_this_is_a_thing',\n\"           \\ youcompleteme#finder#GetState().results[\n\"           \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\"\n\"     \" Wait for the current buffer to be a prompt buffer\n\"     call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n\"     call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\"\n\"     call FeedAndCheckAgain(\n\"           \\ \"\\<C-u>Really_Long_Method\",\n\"           \\ funcref( 'CheckPython' ) )\n\"   endfunction\n\"\n\"   function! CheckPython( ... )\n\"     let popup_id = youcompleteme#finder#GetState().id\n\"\n\"     \" Python can be _really_ slow\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: Really_Long_Method ',\n\"           \\ popup_getoptions( popup_id ).title ) },\n\"           \\ 20000 )\n\"\n\"     call WaitForAssert( { -> assert_equal( 2, line( '$', popup_id ) ) },\n\"                       \\ 20000 )\n\"     call WaitForAssert( { ->\n\"           \\   assert_equal( 0, youcompleteme#finder#GetState().selected )\n\"           \\ },\n\"           \\ 20000 )\n\"     call assert_equal( 'def Really_Long_Method',\n\"           \\ youcompleteme#finder#GetState().results[\n\"           \\   youcompleteme#finder#GetState().selected ].description )\n\"\n\"     \" Toggle single-filetype mode\n\"     call FeedAndCheckAgain( \"\\<C-f>\", funcref( 'CheckCppAgain' ) )\n\"   endfunction\n\"\n\"   function! CheckCppAgain( ... )\n\"     let popup_id = youcompleteme#finder#GetState().id\n\"\n\"     \" Python can be _really_ slow\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: Really_Long_Method ',\n\"           \\ popup_getoptions( popup_id ).title ) },\n\"           \\ 20000 )\n\"\n\"     call WaitForAssert( { -> assert_true(\n\"           \\ youcompleteme#finder#GetState().id != -1 ) } )\n\"\n\"     let id = youcompleteme#finder#GetState().id\n\"     call assert_equal( 'No results', getbufline( winbufnr( id ), '$' )[ 0 ] )\n\"\n\"     \" And back to multiple filetypes\n\"     call FeedAndCheckAgain( \"\\<C-f>\", funcref( 'CheckPythonAgain' ) )\n\"   endfunction\n\"\n\"   function! CheckPythonAgain( ... )\n\"     let popup_id = youcompleteme#finder#GetState().id\n\"\n\"     \" Python can be _really_ slow\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: Really_Long_Method ',\n\"           \\ popup_getoptions( popup_id ).title ) },\n\"           \\ 20000 )\n\"\n\"     call WaitForAssert( { -> assert_equal( 2, line( '$', popup_id ) ) },\n\"                       \\ 20000 )\n\"     call assert_equal( 0, youcompleteme#finder#GetState().selected )\n\"     call assert_equal( 'def Really_Long_Method',\n\"           \\ youcompleteme#finder#GetState().results[\n\"           \\   youcompleteme#finder#GetState().selected ].description )\n\"\n\"     call feedkeys( \"\\<C-c>\" )\n\"   endfunction\n\"\n\"\n\"   \" <Leader> is \\ - this calls <Plug>(YCMFindSymbolInWorkspace)\n\"   call FeedAndCheckMain( '\\\\wthiswillnotmatchanything', funcref( 'PutQuery' ) )\n\"\n\"   call WaitForAssert( { -> assert_equal( l, winlayout() ) } )\n\"   call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )\n\"   call assert_equal( b, bufnr() )\n\" endfunction\n\"\n\" function! Test_MultipleFileTypes_CurrentNotSemantic()\n\"   call youcompleteme#test#setup#OpenFile(\n\"         \\ '/test/testdata/cpp/finder_test.cc', {} )\n\"   split\n\"   call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n\"   split\n\"   \" Current buffer is a ycm_nofiletype, which ycm is blacklisted in\n\"   \" but otherwise we behave the same as before with the exception that we open\n\"   \" the python file in the current window\n\"\n\"   let original_win = winnr()\n\"   let b = bufnr()\n\"   let l = winlayout()\n\"\n\"   function! PutQuery( ... )\n\"     \" Wait for the current buffer to be a prompt buffer\n\"     call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n\"     call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\"\n\"     call WaitForAssert( { -> assert_true(\n\"           \\ youcompleteme#finder#GetState().id != -1 ) } )\n\"\n\"     let popup_id = youcompleteme#finder#GetState().id\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: thiswillnotmatchanything ',\n\"           \\ popup_getoptions( popup_id ).title  ) },\n\"           \\ 10000 )\n\"\n\"\n\"     let id = youcompleteme#finder#GetState().id\n\"     call assert_equal( 'No results', getbufline( winbufnr( id ), '$' )[ 0 ] )\n\"     call FeedAndCheckAgain( \"\\<C-u>xthisisathing\", funcref( 'CheckCpp' ) )\n\"   endfunction\n\"\n\"   function! CheckCpp( ... )\n\"     let popup_id = youcompleteme#finder#GetState().id\n\"\n\"     \" Python can be _really_ slow\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: xthisisathing ',\n\"           \\ popup_getoptions( popup_id ).title  ) },\n\"           \\ 10000 )\n\"\n\"     call WaitForAssert( { -> assert_equal( 1, line( '$', popup_id ) ) } )\n\"     call assert_equal( 0, youcompleteme#finder#GetState().selected )\n\"     call assert_equal( 'x_this_is_a_thing',\n\"           \\ youcompleteme#finder#GetState().results[\n\"           \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\"\n\"     \" Wait for the current buffer to be a prompt buffer\n\"     call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n\"     call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\"\n\"     call FeedAndCheckAgain(\n\"           \\ \"\\<C-u>Really_Long_Method\",\n\"           \\ funcref( 'CheckPython' ) )\n\"   endfunction\n\"\n\"   function! CheckPython( ... )\n\"     let popup_id = youcompleteme#finder#GetState().id\n\"\n\"     \" Python can be _really_ slow\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: Really_Long_Method ',\n\"           \\ popup_getoptions( popup_id ).title ) },\n\"           \\ 10000 )\n\"\n\"     call WaitForAssert( { -> assert_equal( 2, line( '$', popup_id ) ) },\n\"                       \\ 10000 )\n\"     call assert_equal( 0, youcompleteme#finder#GetState().selected )\n\"     call assert_equal( 'def Really_Long_Method',\n\"           \\ youcompleteme#finder#GetState().results[\n\"           \\   youcompleteme#finder#GetState().selected ].description )\n\"\n\"     call feedkeys( \"\\<CR>\")\n\"   endfunction\n\"\n\"\n\"   \" <Leader> is \\ - this calls <Plug>(YCMFindSymbolInWorkspace)\n\"   call FeedAndCheckMain( '\\\\wthiswillnotmatchanything', funcref( 'PutQuery' ) )\n\"\n\"   \" We pop up a notification with some text in it\n\"   if exists( '*popup_list' )\n\"     call assert_equal( 1, len( popup_list() ) )\n\"   endif\n\"\n\"   \" Old vim doesn't have popup_list, so hit-test the top-right corner which is\n\"   \" where we pup the popu\n\"   let notification_id = popup_locate( 1, &columns - 1 )\n\"   call assert_equal( [ 'Added 2 entries to quickfix list.' ],\n\"                    \\ getbufline( winbufnr( notification_id ), 1, '$' ) )\n\"   \" Wait for the notification to clear\n\"   call WaitForAssert(\n\"         \\ { -> assert_equal( {}, popup_getpos( notification_id ) ) },\n\"         \\ 10000 )\n\"\n\"   call WaitForAssert( { -> assert_equal( l, winlayout() ) } )\n\"   call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )\n\"   call assert_equal( bufnr( 'doc.py' ), bufnr() )\n\"   call assert_equal( [ 0, 16, 5, 0 ], getpos( '.' ) )\n\" endfunction\n\"\n\" function! Test_WorkspaceSymbol_NormalModeChange()\n\"   call youcompleteme#test#setup#OpenFile(\n\"         \\ '/test/testdata/cpp/finder_test.cc', {} )\n\"\n\"   let original_win = winnr()\n\"   let b = bufnr()\n\"   let l = winlayout()\n\"\n\"   let popup_id = -1\n\"\n\"   function! PutQuery( ... )\n\"     \" Wait for the current buffer to be a prompt buffer\n\"     call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n\"     call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\"\n\"     call WaitForAssert( { -> assert_true(\n\"           \\ youcompleteme#finder#GetState().id != -1 ) } )\n\"\n\"     let popup_id = youcompleteme#finder#GetState().id\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: thiswillnotmatchanything ',\n\"           \\ popup_getoptions( popup_id ).title  ) },\n\"           \\ 10000 )\n\"\n\"     let id = youcompleteme#finder#GetState().id\n\"     call assert_equal( 'No results', getbufline( winbufnr( id ), '$' )[ 0 ] )\n\"     call FeedAndCheckAgain( \"\\<C-u>xthisisathing\", funcref( 'ChangeQuery' ) )\n\"   endfunction\n\"\n\"   function ChangeQuery( ... )\n\"     let id = youcompleteme#finder#GetState().id\n\"\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: xthisisathing ',\n\"           \\ popup_getoptions( id ).title  ) },\n\"           \\ 10000 )\n\"\n\"     call WaitForAssert( { -> assert_equal( 1, line( '$', id ) ) } )\n\"     call assert_equal( 0, youcompleteme#finder#GetState().selected )\n\"     call assert_equal( 'x_this_is_a_thing',\n\"           \\ youcompleteme#finder#GetState().results[\n\"           \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\"\n\"     \" Wait for the current buffer to be a prompt buffer\n\"     call WaitForAssert( { -> assert_equal( 'prompt', &buftype ) } )\n\"     call WaitForAssert( { -> assert_equal( 'i', mode() ) } )\n\"\n\"     call FeedAndCheckAgain( \"\\<Esc>bcwthatisathing\",\n\"                           \\ funcref( 'SelectNewItem' ) )\n\"   endfunction\n\"\n\"   function SelectNewItem( ... )\n\"     let id = youcompleteme#finder#GetState().id\n\"\n\"     call WaitForAssert( { ->\n\"           \\ assert_equal( ' [X] Search for symbol: thatisathing ',\n\"           \\ popup_getoptions( id ).title  ) },\n\"           \\ 10000 )\n\"\n\"     call WaitForAssert( { -> assert_equal( 1, line( '$', id ) ) } )\n\"     call assert_equal( 0, youcompleteme#finder#GetState().selected )\n\"     call assert_equal( 'x_that_is_a_thing',\n\"           \\ youcompleteme#finder#GetState().results[\n\"           \\   youcompleteme#finder#GetState().selected ].extra_data.name )\n\"\n\"     call feedkeys( \"\\<CR>\" )\n\"   endfunction\n\"\n\"   \" <Leader> is \\ - this calls <Plug>(YCMFindSymbolInWorkspace)\n\"   call FeedAndCheckMain( '\\\\wthiswillnotmatchanything', funcref( 'PutQuery' ) )\n\"\n\"   call WaitForAssert( { -> assert_equal( l, winlayout() ) } )\n\"   call WaitForAssert( { -> assert_equal( original_win, winnr() ) } )\n\"   call assert_equal( b, bufnr() )\n\"   call assert_equal( [ 0, 5, 28, 0 ], getpos( '.' ) )\n\"\n\"   delfunct PutQuery\n\"   delfunct SelectNewItem\n\"   delfunct ChangeQuery\n\"   silent %bwipe!\n\" endfunction\n"
  },
  {
    "path": "test/fixit.test.vim",
    "content": "function! SetUp()\n  let g:ycm_confirm_extra_conf = 0\n  let g:ycm_auto_trigger = 1\n  let g:ycm_keep_logfiles = 1\n  let g:ycm_log_level = 'DEBUG'\n\n  call youcompleteme#test#setup#SetUp()\nendfunction\n\nfunction! TearDown()\n  call youcompleteme#test#setup#CleanUp()\nendfunction\n\nfunction! Test_Ranged_Fixit_Works()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/java/testdata/simple_eclipse_project' .\n        \\ '/src/com/test/TestLauncher.java', { 'delay': 15 } )\n\n  call setpos( '.', [ 0, 34, 50 ] )\n  redraw\n  call assert_equal( '        System.out.println( \"Did something useful: ' .\n                     \\ '\" + w.getWidgetInfo() );', getline( '.' ) )\n  call feedkeys( \"vib\\<esc>\", 'xt' )\n\n  function! SelectEntry( id ) closure\n    redraw\n    call test_feedinput( \"4\\<CR>\" )\n  endfunction\n\n  let t = timer_start( 5000, funcref( 'SelectEntry' ) )\n  '<,'>YcmCompleter FixIt\n  redraw\n\n  call assert_match( '        String \\(x\\|string\\) = \"Did something useful: \"' .\n                     \\ ' + w.getWidgetInfo();', getline( 34 ) )\n  call assert_match( '        System.out.println( \\(x\\|string\\) );', getline( 35 ) )\n  silent! call timer_stop( t )\n  delfunction SelectEntry\nendfunction\n\nfunction! Test_Unresolved_Fixit_Works()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/cpp/fixit.cpp', {} )\n  call setpos( '.', [ 0, 3, 15 ] )\n  call assert_equal( '  printf(\"%s\",1);', getline( '.' ) )\n  function! SelectEntry( id ) closure\n    redraw\n    call test_feedinput( \"2\\<CR>\" )\n  endfunction\n  let t = timer_start( 2000, funcref( 'SelectEntry' ) )\n  YcmCompleter FixIt\n  redraw\n  call assert_equal( '  auto placeholder = 1;', getline( 3 ) )\n  call assert_equal( '  printf(\"%s\", placeholder);', getline( 4 ) )\n  %bwipeout!\n  silent! call timer_stop( t )\n  delfunction SelectEntry\nendfunction\n"
  },
  {
    "path": "test/hierarchies.test.vim",
    "content": "function! SetUp()\n  let g:ycm_auto_hover = 1\n  let g:ycm_auto_trigger = 1\n  let g:ycm_keep_logfiles = 1\n  let g:ycm_log_level = 'DEBUG'\n\n  call youcompleteme#test#setup#SetUp()\nendfunction\n\nfunction! TearDown()\n  call youcompleteme#test#setup#CleanUp()\nendfunction\n\nfunction! Test_Call_Hierarchy()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/cpp/hierarchies.cc', {} )\n  call cursor( [ 1, 5 ] )\n\n  call youcompleteme#hierarchy#StartRequest( 'call' )\n  call WaitForAssert( { -> assert_equal( len( popup_list() ), 1 ) } )\n  \" Check that `+Function f` is at the start of the only line in the popup.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 1 ) } )\n  call assert_match( '^+Function: f', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n\n  call feedkeys( \"\\<Tab>\", \"xt\" )\n  \" Check that f's callers are present.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 4 ) } )\n  call assert_match( '^+Function: f.*:1', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^  +Function: g.*:4', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n  call assert_match( '^  +Function: g.*:4', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[ 0 ] )\n  call assert_match( '^  +Function: h.*:9', getbufline( winbufnr( popup_list()[ 0 ] ), 4 )[ 0 ] )\n\n  call feedkeys( \"\\<Down>\\<Tab>\", \"xt\" )\n  \" Check that g's callers are present.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 5 ) } )\n  call assert_match( '^+Function: f.*:1', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^  -Function: g.*:4', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n  call assert_match( '^  -Function: g.*:4', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[ 0 ] )\n  call assert_match( '^    +Function: h.*:8', getbufline( winbufnr( popup_list()[ 0 ] ), 4 )[ 0 ] )\n  call assert_match( '^  +Function: h.*:9', getbufline( winbufnr( popup_list()[ 0 ] ), 5 )[ 0 ] )\n\n  \" silent, because h has no incoming calls.\n  silent call feedkeys( \"\\<Down>\\<Down>\\<Tab>\", \"xt\" )\n  \" Check that 1st h's callers are present.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 5 ) } )\n  call assert_match( '^+Function: f.*:1', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^  -Function: g.*:4', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n  call assert_match( '^  -Function: g.*:4', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[ 0 ] )\n  call assert_match( '^    -Function: h.*:8', getbufline( winbufnr( popup_list()[ 0 ] ), 4 )[ 0 ] )\n  call assert_match( '^  +Function: h.*:9', getbufline( winbufnr( popup_list()[ 0 ] ), 5 )[ 0 ] )\n\n  \" silent, because h has no incoming calls.\n  silent call feedkeys( \"\\<Down>\\<Tab>\", \"xt\" )\n  \" Check that 2nd h's callers are present.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 5 ) } )\n  call assert_match( '^+Function: f.*:1', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^  -Function: g.*:4', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n  call assert_match( '^  -Function: g.*:4', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[ 0 ] )\n  call assert_match( '^    -Function: h.*:8', getbufline( winbufnr( popup_list()[ 0 ] ), 4 )[ 0 ] )\n  call assert_match( '^  -Function: h.*:9', getbufline( winbufnr( popup_list()[ 0 ] ), 5 )[ 0 ] )\n\n  \" silent, because clangd does not support outgoing calls.\n  silent call feedkeys( \"\\<Up>\\<Up>\\<Up>\\<Up>\\<S-Tab>\", \"xt\" )\n  \" Try to access callees of f.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 5 ) } )\n  call assert_match( '^-Function: f.*:1', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^  -Function: g.*:4', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n  call assert_match( '^  -Function: g.*:4', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[ 0 ] )\n  call assert_match( '^    -Function: h.*:8', getbufline( winbufnr( popup_list()[ 0 ] ), 4 )[ 0 ] )\n  call assert_match( '^  -Function: h.*:9', getbufline( winbufnr( popup_list()[ 0 ] ), 5 )[ 0 ] )\n\n  \" re-root at h; show outgoing calls from h\n  call feedkeys( \"\\<Down>\\<Down>\\<Down>\\<Down>\\<S-Tab>\", \"xt\" )\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 3 ) } )\n  call assert_match( '^  +Function: g', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[0] )\n  call assert_match( '^  +Function: f', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[0] )\n  call assert_match( '^+Function: h', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[0] )\n\n  \" silent, because h() has no incoming calls\n  silent call feedkeys( \"\\<S-Tab>\\<Tab>\", \"xt\" )\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 3 ) } )\n  call assert_match( '^  +Function: g', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[0] )\n  call assert_match( '^  +Function: f', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[0] )\n  call assert_match( '^-Function: h', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[0] )\n\n  call feedkeys( \"\\<C-c>\", \"xt\" )\n  \" Make sure it is closed.\n  call WaitForAssert( { -> assert_equal( len( popup_list() ), 0 ) } )\n\n  %bwipe!\nendfunction\n\nfunction! Test_Type_Hierarchy()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/cpp/hierarchies.cc', {} )\n  call cursor( [ 13, 8 ] )\n\n  call youcompleteme#hierarchy#StartRequest( 'type' )\n  call WaitForAssert( { -> assert_equal( len( popup_list() ), 1 ) } )\n  \" Check that `+Struct: B1` is at the start of the only line in the popup.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 1 ) } )\n  call assert_match( '^+Struct: B1', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n\n  call feedkeys( \"\\<Tab>\", \"xt\" )\n  \" Check that B1's subtypes are present.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 2 ) } )\n  call assert_match( '^+Struct: B1.*:13', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^  +Struct: D1.*:16', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n\n  \" silent, because D1 has no subtypes.\n  silent call feedkeys( \"\\<Down>\\<Tab>\", \"xt\" )\n  \" Try to access D1's subtypes.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 2 ) } )\n  call assert_match( '^+Struct: B1.*:13', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^  -Struct: D1.*:16', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n\n  call feedkeys( \"\\<Up>\\<S-Tab>\", \"xt\" )\n  \" Check that B1's supertypes are present.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 3 ) } )\n  call assert_match( '^  +Struct: B0.*:12', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^-Struct: B1.*:13', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n  call assert_match( '^  -Struct: D1.*:16', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[ 0 ] )\n\n  \" silent, because there are no supertypes of B0.\n  silent call feedkeys( \"\\<Up>\\<S-Tab>\", \"xt\" )\n  \" Try to access B0's supertypes.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 3 ) } )\n  call assert_match( '^  -Struct: B0.*:12', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^-Struct: B1.*:13', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n  call assert_match( '^  -Struct: D1.*:16', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[ 0 ] )\n\n  call feedkeys( \"\\<Tab>\", \"xt\" )\n  \" Re-root at B0: supertypes->subtypes.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 4 ) } )\n  call assert_match( '^+Struct: B0.*:12', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^  +Struct: B1.*:13', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n  call assert_match( '^  +Struct: D0.*:15', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[ 0 ] )\n  call assert_match( '^  +Struct: D1.*:16', getbufline( winbufnr( popup_list()[ 0 ] ), 4 )[ 0 ] )\n\n  call feedkeys( \"\\<Down>\\<Down>\\<Down>\\<S-Tab>\", \"xt\" )\n  \" Re-root at D1: subtypes->supertypes.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 3 ) } )\n  call assert_match( '^  +Struct: B0.*:12', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^  +Struct: B1.*:13', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n  call assert_match( '^+Struct: D1.*:16', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[ 0 ] )\n\n  \" silent, because there are no subtypes of D1.\n  silent call feedkeys( \"\\<Tab>\\<Up>\\<S-Tab>\", \"xt\" )\n  \" Expansion after re-rooting works.\n  call WaitForAssert( { -> assert_equal( len( getbufline( winbufnr( popup_list()[ 0 ] ), 1, '$' ) ), 4 ) } )\n  call assert_match( '^  +Struct: B0.*:12', getbufline( winbufnr( popup_list()[ 0 ] ), 1 )[ 0 ] )\n  call assert_match( '^    +Struct: B0.*:12', getbufline( winbufnr( popup_list()[ 0 ] ), 2 )[ 0 ] )\n  call assert_match( '^  -Struct: B1.*:13', getbufline( winbufnr( popup_list()[ 0 ] ), 3 )[ 0 ] )\n  call assert_match( '^-Struct: D1.*:16', getbufline( winbufnr( popup_list()[ 0 ] ), 4 )[ 0 ] )\n\n  call feedkeys( \"\\<C-c>\", \"xt\" )\n  \" Make sure it is closed.\n  call WaitForAssert( { -> assert_equal( len( popup_list() ), 0 ) } )\n\n  %bwipe!\nendfunction\n"
  },
  {
    "path": "test/hover.test.vim",
    "content": "function! s:CheckNoCommandRequest()\n  return youcompleteme#test#commands#CheckNoCommandRequest()\nendfunction\n\nfunction! s:CheckPopupVisible( row, col, text, syntax )\n  \" Takes a buffer position, converts it to a screen position and checks the\n  \" popup found at that location\n  redraw\n  let loc = screenpos( win_getid(), a:row, a:col )\n  return s:CheckPopupVisibleScreenPos( loc, a:text, a:syntax )\nendfunction\n\nfunction! s:CheckPopupVisibleScreenPos( loc, text, syntax )\n  \" Takes a position dict like the one returned by screenpos() and verifies it\n  \" has 'text' (a list of lines) and 'syntax' the &syntax setting\n  \" popup found at that location\n  redraw\n  call s:CheckNoCommandRequest()\n  call WaitForAssert( { ->\n        \\   assert_notequal( 0,\n        \\                    popup_locate( a:loc.row, a:loc.col ),\n        \\                    'Locate popup at ('\n        \\                    . a:loc.row\n        \\                    . ','\n        \\                    . a:loc.col\n        \\                    . ')' )\n       \\ } )\n  let popup = popup_locate( a:loc.row, a:loc.col )\n  if a:text isnot v:none\n    call assert_equal( a:text,\n                     \\ getbufline( winbufnr( popup ), 1, '$' ) )\n  endif\n  call assert_equal( a:syntax, getbufvar( winbufnr( popup ), '&syntax' ) )\nendfunction\n\nfunction! s:CheckPopupNotVisible( row, col )\n  \" Takes a buffer position and ensures there is no popup visible at that\n  \" position. Like CheckPopupVisible, the position must be valid (i.e. there\n  \" must be buffer text at that position). Otherwise, you need to pass the\n  \" _screen_ position to CheckPopupNotVisibleScreenPos\n  redraw\n  let loc = screenpos( win_getid(), a:row, a:col )\n  return s:CheckPopupNotVisibleScreenPos( loc )\nendfunction\n\nfunction! s:CheckPopupNotVisibleScreenPos( loc )\n  \" Takes a position dict like the one returned by screenpos() and verifies it\n  \" does not have a popup drawn on it.\n  redraw\n  call s:CheckNoCommandRequest()\n  call WaitForAssert( { ->\n        \\   assert_equal( 0,\n        \\                 popup_locate( a:loc.row, a:loc.col ) )\n        \\ } )\nendfunction\n\nlet s:python_oneline = {\n      \\ 'GetDoc': [ 'Test_OneLine()', '', 'This is the one line output.' ],\n      \\ 'GetType': [ 'def Test_OneLine()' ],\n      \\ }\nlet s:cpp_lifetime = {\n      \\ 'GetDoc': [ 'field lifetime',\n      \\             '',\n      \\             'Type: char',\n      \\             'Offset: 16 bytes',\n      \\             'Size: 1 byte (+7 bytes padding), alignment 1 byte',\n      \\             'nobody will live > 128 years',\n      \\             '',\n      \\             '// In PointInTime',\n      \\             'public: char lifetime' ],\n      \\ 'GetType': [ 'public: char lifetime; // In PointInTime' ],\n      \\ }\n\nfunction! SetUp()\n  let g:ycm_use_clangd = 1\n  let g:ycm_keep_logfiles = 1\n  let g:ycm_log_level = 'DEBUG'\n  let g:ycm_enable_semantic_highlighting = 1\n\n  set signcolumn=no\n  nmap <leader>D <Plug>(YCMHover)\n  call youcompleteme#test#setup#SetUp()\nendfunction\n\nfunction! TearDown()\n  let g:ycm_auto_hover='CursorHold'\n\n  call assert_equal( -1, youcompleteme#Test_GetPollers().command.id )\nendfunction\n\nfunction! Test_Hover_Uses_GetDoc()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n\n  call assert_equal( 'python', &syntax )\n\n  \" no doc\n  call setpos( '.', [ 0, 1, 1 ] )\n  doautocmd CursorHold\n  call assert_equal( { 'command': 'GetDoc', 'syntax': '' }, b:ycm_hover )\n\n  call s:CheckPopupNotVisible( 2, 1 )\n  call s:CheckPopupNotVisible( 2, 2 )\n\n  \" some doc - autocommand\n  call setpos( '.', [ 0, 12, 3 ] )\n  doautocmd CursorHold\n  call s:CheckPopupVisible( 11, 4, s:python_oneline.GetDoc, '' )\n  call popup_clear()\n\n  \" some doc - mapping\n  call setpos( '.', [ 0, 12, 3 ] )\n  normal \\D\n  call s:CheckPopupVisible( 11, 4, s:python_oneline.GetDoc, '' )\n  call popup_clear()\nendfunction\n\nfunction! Test_Hover_Uses_GetHover()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n  py3 <<EOPYTHON\nfrom unittest import mock\nwith mock.patch.object( ycm_state,\n                        'GetDefinedSubcommands',\n                        return_value = [ 'GetHover' ] ):\n  vim.command( 'doautocmd CursorHold' )\nEOPYTHON\n\n  call assert_equal( { 'command': 'GetHover', 'syntax': 'markdown' },\n                   \\ b:ycm_hover )\n\n  \" Only the generic LSP completer supports the GetHover response, so i guess we\n  \" test the error condition here...\n\n  \" Python desn't support GetHover\n  call setpos( '.', [ 0, 12, 3 ] )\n  normal \\D\n  call s:CheckPopupNotVisible( 11, 4 )\n  call popup_clear()\n\nendfunction\n\nfunction! Test_Hover_Uses_None()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n  py3 <<EOPYTHON\nfrom unittest import mock\nwith mock.patch.object( ycm_state, 'GetDefinedSubcommands', return_value = [] ):\n  vim.command( 'doautocmd CursorHold' )\nEOPYTHON\n\n  call assert_equal( {}, b:ycm_hover )\n\n  call setpos( '.', [ 0, 12, 3 ] )\n  normal \\D\n  call s:CheckPopupNotVisible( 11, 4 )\n\n  call popup_clear()\nendfunction\n\nfunction! Test_Hover_Uses_GetType()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n\n  py3 <<EOPYTHON\nfrom unittest import mock\nwith mock.patch.object( ycm_state,\n                        'GetDefinedSubcommands',\n                        return_value = [ 'GetType' ] ):\n  vim.command( 'doautocmd CursorHold' )\nEOPYTHON\n\n  call assert_equal( { 'command': 'GetType', 'syntax': 'python' }, b:ycm_hover )\n\n  call s:CheckPopupNotVisible( 2, 1 )\n  call s:CheckPopupNotVisible( 2, 2 )\n\n  \" some doc - autocommand\n  call setpos( '.', [ 0, 12, 3 ] )\n  doautocmd CursorHold\n  call s:CheckPopupVisible( 11, 4, s:python_oneline.GetType, 'python' )\n  call popup_clear()\n\n  \" some doc - mapping\n  call setpos( '.', [ 0, 12, 3 ] )\n  normal \\D\n  call s:CheckPopupVisible( 11, 4, s:python_oneline.GetType, 'python' )\n\n  \" hide it again\n  normal \\D\n  call s:CheckPopupNotVisible( 11, 4 )\n\n  \" show it again\n  normal \\D\n  call s:CheckPopupVisible( 11, 4, s:python_oneline.GetType, 'python' )\n  call popup_clear()\n\nendfunction\n\nfunction! Test_Hover_NonNative()\n  call youcompleteme#test#setup#OpenFile( '_not_a_file', { 'native_ft': 0 } )\n  setfiletype NoASupportedFileType\n  let messages_before = execute( 'messages' )\n  doautocmd CursorHold\n  call s:CheckNoCommandRequest()\n  call assert_false( exists( 'b:ycm_hover' ) )\n  call assert_equal( messages_before, execute( 'messages' ) )\n\n  normal \\D\n  call s:CheckNoCommandRequest()\n  call assert_false( exists( 'b:ycm_hover' ) )\n  call assert_equal( messages_before, execute( 'messages' ) )\n\n  call popup_clear()\nendfunction\n\nfunction SetUp_Test_Hover_Disabled_NonNative()\n  let g:ycm_auto_hover = ''\nendfunction\n\nfunction! Test_Hover_Disabled_NonNative()\n  call youcompleteme#test#setup#OpenFile( '_not_a_file', { 'native_ft': 0 } )\n  setfiletype NoASupportedFileType\n  let messages_before = execute( 'messages' )\n  silent! doautocmd CursorHold\n  call s:CheckNoCommandRequest()\n  call assert_false( exists( 'b:ycm_hover' ) )\n  call assert_equal( messages_before, execute( 'messages' ) )\n\n  call popup_clear()\nendfunction\n\nfunction! SetUp_Test_AutoHover_Disabled()\n  let g:ycm_auto_hover = ''\nendfunction\n\nfunction! Test_AutoHover_Disabled()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n\n  let messages_before = execute( 'messages' )\n\n  call assert_false( exists( 'b:ycm_hover' ) )\n\n  call setpos( '.', [ 0, 12, 3 ] )\n  silent! doautocmd CursorHold\n  call s:CheckPopupNotVisible( 11, 4 )\n  call assert_equal( messages_before, execute( 'messages' ) )\n\n  \" Manual hover is still supported\n  normal \\D\n  call assert_true( exists( 'b:ycm_hover' ) )\n  call s:CheckPopupVisible( 11, 4, s:python_oneline.GetDoc, '' )\n  call assert_equal( messages_before, execute( 'messages' ) )\n\n  \" Manual close hover is still supported\n  normal \\D\n  call s:CheckPopupNotVisible( 11, 4 )\n  call assert_equal( messages_before, execute( 'messages' ) )\n\n  call popup_clear()\nendfunction\n\nfunction! Test_Hover_MoveCursor()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n  \" needed so that the feedkeys calls actually trigger vim to notice the cursor\n  \" moving. We also need to enter/exit insert mode as Vim only checks for these\n  \" cursor moved events in very specific times. In particular, _not_ while\n  \" running a script (like we are here), but it _does_ on enter/exit insert\n  \" mode.\n  call test_override( 'char_avail', 1 )\n\n  call setpos( '.', [ 0, 12, 3 ] )\n  doautocmd CursorHold\n  call s:CheckPopupVisible( 11, 3, s:python_oneline.GetDoc, '' )\n\n  call feedkeys( \"li\\<Esc>\", 'xt' )\n  call s:CheckPopupVisible( 11, 3, s:python_oneline.GetDoc, '' )\n\n  \" letters within word\n  call feedkeys( \"4li\\<Esc>\", 'xt' )\n  call s:CheckPopupVisible( 11, 3, s:python_oneline.GetDoc, '' )\n\n  \" word\n  call feedkeys( \"wi\\<Esc>\", 'xt' )\n  call s:CheckPopupNotVisible( 11, 3 )\n\n  call feedkeys( \"b\\\\D\", 'xt' )\n  call s:CheckPopupVisible( 11, 3, s:python_oneline.GetDoc, '' )\n\n  call test_override( 'ALL', 0 )\n\n  call popup_clear()\nendfunction\n\nfunction! Test_Hover_Dismiss()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n  \" needed so that the feedkeys calls actually trigger vim to notice the cursor\n  \" moving. We also need to enter/exit insert mode as Vim only checks for these\n  \" cursor moved events in very specific times. In particular, _not_ while\n  \" running a script (like we are here), but it _does_ on enter/exit insert\n  \" mode.\n  call test_override( 'char_avail', 1 )\n\n  call setpos( '.', [ 0, 12, 3 ] )\n  doautocmd CursorHold\n  call s:CheckPopupVisible( 11, 3, s:python_oneline.GetDoc, '' )\n\n  \" Dismiss\n  normal \\D\n  call s:CheckPopupNotVisible( 11, 3 )\n\n  \" Make sure it doesn't come back\n  silent! doautocmd CursorHold\n  call s:CheckPopupNotVisible( 11, 3 )\n\n  \" Move the cursor (again this is tricky). I couldn't find any tests in vim's\n  \" own code that trigger CursorMoved, so we just cheat. (for the record, just\n  \" moving the cursor in the middle of this script does not trigger CursorMoved)\n  doautocmd CursorMoved\n  doautocmd CursorHold\n  call s:CheckPopupVisible( 11, 3, s:python_oneline.GetDoc, '' )\n\n  call popup_clear()\nendfunction\n\nfunction! SetUp_Test_Hover_Custom_Syntax()\n  augroup MyYCMCustom\n    autocmd!\n    autocmd FileType cpp let b:ycm_hover = {\n      \\ 'command': 'GetDoc',\n      \\ 'syntax': 'cpp',\n      \\ }\n  augroup END\nendfunction\n\nfunction! Test_Hover_Custom_Syntax()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/cpp/completion.cc',\n                                        \\ {} )\n  call assert_equal( 'cpp', &filetype )\n  call assert_equal( { 'command': 'GetDoc', 'syntax': 'cpp' }, b:ycm_hover )\n\n  call setpos( '.', [ 0, 6, 8 ] )\n  doautocmd CursorHold\n  call assert_equal( { 'command': 'GetDoc', 'syntax': 'cpp' }, b:ycm_hover )\n  call s:CheckPopupVisibleScreenPos( { 'row': 7, 'col': 9 },\n                                   \\ s:cpp_lifetime.GetDoc,\n                                   \\ 'cpp' )\n\n  normal \\D\n  call s:CheckPopupNotVisibleScreenPos( { 'row': 7, 'col': 9 } )\n\n  call popup_clear()\nendfunction\n\nfunction! TearDown_Test_Hover_Custom_Syntax()\n  silent! au! MyYCMCustom\nendfunction\n\nfunction! SetUp_Test_Hover_Custom_Command()\n  augroup MyYCMCustom\n    autocmd!\n    autocmd FileType cpp let b:ycm_hover = {\n      \\ 'command': 'GetType',\n      \\ 'syntax': 'cpp',\n      \\ }\n  augroup END\nendfunction\n\nfunction! Test_Hover_Custom_Command()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/cpp/completion.cc',\n                                        \\ {} )\n  call assert_equal( 'cpp', &filetype )\n  call assert_equal( { 'command': 'GetType', 'syntax': 'cpp' }, b:ycm_hover )\n\n  call setpos( '.', [ 0, 6, 8 ] )\n  doautocmd CursorHold\n  call assert_equal( { 'command': 'GetType', 'syntax': 'cpp' }, b:ycm_hover )\n\n  call s:CheckPopupVisible( 5, 9, s:cpp_lifetime.GetType, 'cpp' )\n\n  call popup_clear()\nendfunction\n\nfunction! TearDown_Test_Hover_Custom_Command()\n  silent! au! MyYCMCustom\nendfunction\n\nfunction! SetUp_Test_Hover_Custom_Popup()\n  augroup MyYCMCustom\n    autocmd!\n    autocmd FileType cpp let b:ycm_hover = {\n      \\ 'command': 'GetDoc',\n      \\ 'syntax': 'cpp',\n      \\ 'popup_params': {\n      \\     'maxwidth': 10,\n      \\   }\n      \\ }\n  augroup END\nendfunction\n\nfunction! Test_Hover_Custom_Popup()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/cpp/completion.cc',\n                                        \\ {} )\n  call assert_equal( 'cpp', &filetype )\n  call assert_equal( {\n                   \\   'command': 'GetDoc',\n                   \\   'syntax': 'cpp',\n                   \\   'popup_params': { 'maxwidth': 10 }\n                   \\ }, b:ycm_hover )\n\n  call setpos( '.', [ 0, 6, 8 ] )\n  doautocmd CursorHold\n  call assert_equal( {\n                   \\   'command': 'GetDoc',\n                   \\   'syntax': 'cpp',\n                   \\   'popup_params': { 'maxwidth': 10 }\n                   \\ }, b:ycm_hover )\n\n  call s:CheckPopupVisibleScreenPos( { 'row': 7, 'col': 9 },\n                                   \\ s:cpp_lifetime.GetDoc,\n                                   \\ 'cpp' )\n  \" Check that popup's width is limited by maxwidth being passed\n  call s:CheckPopupNotVisibleScreenPos( { 'row': 7, 'col': 20 } )\n\n  normal \\D\n  call s:CheckPopupNotVisibleScreenPos( { 'row': 7, 'col': 9 } )\n\n  call popup_clear()\nendfunction\n\nfunction! TearDown_Test_Hover_Custom_Popup()\n  silent! au! MyYCMCustom\nendfunction\n\nfunction! Test_Long_Single_Line()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n  call cursor( [ 37, 3 ] )\n  normal \\D\n\n  \" The popup should cover at least the whole of the line above, and not the\n  \" current line\n  call s:CheckPopupVisible( 36, 1, v:none, '' )\n  call s:CheckPopupVisible( 36, &columns, v:none, '' )\n\n  call s:CheckPopupNotVisible( 37, 1 )\n  call s:CheckPopupNotVisible( 37, &columns )\n\n  \" Also wrap is ON so it should cover at least 2 lines + 2 for the header/empty\n  \" line\n  call s:CheckPopupVisible( 35, 1, v:none, '' )\n  call s:CheckPopupVisible( 35, &columns, v:none, '' )\n  call s:CheckPopupVisible( 33, 1, v:none, '' )\n  call s:CheckPopupVisible( 33, &columns, v:none, '' )\n\n  call popup_clear()\nendfunction\n\nfunction! Test_Long_Wrapped()\n  call youcompleteme#test#setup#OpenFile( '/test/testdata/python/doc.py', {} )\n  call cursor( [ 38, 22 ] )\n  normal \\D\n\n  \" The popup should cover at least the whole of the line above, and not the\n  \" current line. In this case, it's because the popup was shifted.\n  call s:CheckPopupVisible( 37, 1, v:none, '' )\n  call s:CheckPopupVisible( 37, &columns, v:none, '' )\n\n  call s:CheckPopupNotVisible( 38, 1 )\n  call s:CheckPopupNotVisible( 38, &columns )\n\n  \" Also, wrap is off, so it should be _exactly_ 9 lines + 2 for the signature\n  \" and the empty line\n  call s:CheckPopupVisible( 27, 1, v:none, '' )\n  call s:CheckPopupVisible( 27, &columns, v:none, '' )\n\n  call s:CheckPopupNotVisible( 26, 1 )\n  call s:CheckPopupNotVisible( 26, &columns )\n\n  call popup_clear()\nendfunction\n"
  },
  {
    "path": "test/lib/autoload/youcompleteme/test/commands.vim",
    "content": "function! youcompleteme#test#commands#CheckNoCommandRequest() abort\n  call WaitForAssert( { ->\n        \\ assert_true( py3eval(\n        \\     'ycm_state.GetCommandRequest( '\n        \\   . '  ycm_state._next_command_request_id - 1 ) is None or '\n        \\   . 'ycm_state.GetCommandRequest( '\n        \\   . '  ycm_state._next_command_request_id - 1 ).Done()' ) )\n        \\ } )\n\n  call WaitForAssert( { ->\n        \\ assert_equal( -1,\n        \\               youcompleteme#Test_GetPollers().command.id )\n        \\ } )\nendfunction\n\n"
  },
  {
    "path": "test/lib/autoload/youcompleteme/test/popup.vim",
    "content": "function! youcompleteme#test#popup#CheckPopupPosition( winid, pos )\n  redraw\n  let actual_pos = popup_getpos( a:winid )\n  let ret = 0\n  if a:pos->empty()\n    return assert_true( actual_pos->empty(),\n          \\ 'popup pos empty, got: ' . string( actual_pos ) )\n  endif\n  for c in keys( a:pos )\n    if !has_key( actual_pos, c )\n      let ret += 1\n      call assert_report( 'popup with ID '\n                        \\ . string( a:winid )\n                        \\ . ' has no '\n                        \\ . c\n                        \\ . ' in: '\n                        \\ . string( actual_pos ) )\n    else\n      let ret += assert_equal( a:pos[ c ],\n                             \\ actual_pos[ c ],\n                             \\ c . ' in: ' . string( actual_pos ) )\n    endif\n  endfor\n  return ret\nendfunction\n\n\nfunction! youcompleteme#test#popup#ScreenPos( winid, row, col )\n  \" Returns the screen position of the row/col in win with id winid. This\n  \" differs from screenpos() only in that the position need not be valid, that\n  \" is there need not be a text character in the referenced cell. This is useful\n  \" when finding where a popup _should_ be in screen position relative to actual\n  \" text position\n  \"\n  \" It also probably doesn't work properly for multi-byte characters and tabs\n  \" and things. And only returns the 'row' and 'col' items of the dict.\n  \"\n  \" So it's not that much like 'screenpos()' really.\n  \"\n  let [ w_row, w_col ] = win_screenpos( a:winid )\n  return { 'row': w_row + a:row, 'col':  w_col + a:col }\nendfunction\n\n\nfunction! youcompleteme#test#popup#DumpPopups() abort\n  if !exists( 'popup_list' )\n    \" Old vim..\n    return ''\n  endif\n\n  let output = 'Popups:'\n  for winid in popup_list()\n    let output .= ' ['\n              \\ . string( winid )\n              \\ . '@'\n              \\ . string( popup_getpos( winid ) )\n              \\ . ']'\n  endfor\n  return output\nendfunction\n"
  },
  {
    "path": "test/lib/autoload/youcompleteme/test/setup.vim",
    "content": "\nfunction! youcompleteme#test#setup#SetUp() abort\n  if exists ( 'g:loaded_youcompleteme' )\n    unlet g:loaded_youcompleteme\n  endif\n\n  if pyxeval( \"'ycm_state' in globals()\" )\n    pyx ycm_state.OnVimLeave()\n    pyx del ycm_state\n  endif\n\n  exe 'source' getcwd() . '/vimrc'\n\n  \" This is a bit of a hack\n  runtime! plugin/**/*.vim\n  call youcompleteme#Enable()\n\n  call assert_true( pyxeval( 'vimsupport.VimSupportsPopupWindows()' ) )\n  call WaitForAssert( {->\n        \\ assert_true( pyxeval( \"'ycm_state' in globals()\" ) )\n        \\ } )\n  call WaitForAssert( {->\n        \\ assert_true( pyxeval( 'ycm_state.CheckIfServerIsReady()' ) )\n        \\ } )\nendfunction\n\nfunction! youcompleteme#test#setup#CleanUp() abort\nendfunction\n\nfunction! youcompleteme#test#setup#OpenFile( f, kwargs ) abort\n  silent execute 'edit '\n        \\ . g:ycm_test_plugin_dir\n        \\ . '/'\n        \\ . a:f\n\n  call youcompleteme#test#setup#WaitForInitialParse( a:kwargs )\nendfunction\n\nfunction! youcompleteme#test#setup#WaitForInitialParse( kwargs ) abort\n  let native_ft = get( a:kwargs, 'native_ft', 1 )\n\n  if native_ft\n    call WaitForAssert( {->\n        \\ assert_true( pyxeval( 'ycm_state.NativeFiletypeCompletionUsable()' ) )\n        \\ } )\n\n    \" Need to wait for the server to be ready. The best way to do this is to\n    \" force compile and diagnostics, though this only works for the c-based\n    \" completers. For python and others, we actually need to parse the debug\n    \" info to check the server state.\n    YcmForceCompileAndDiagnostics\n  endif\n\n  if native_ft || get( a:kwargs, 'force_delay', 0 )\n    \" Sometimes, that's just not enough to ensure stuff works\n    if exists( '$YCM_TEST_DELAY' )\n      let default_delay = $YCM_TEST_DELAY\n    else\n      let default_delay = get( g:, 'ycm_test_delay', 2 )\n    endif\n    let delay = max( [ get( a:kwargs, 'delay', default_delay ),\n                   \\   get( g:, 'ycm_test_min_delay', 0 ) ] )\n    if delay > 0\n      exe 'sleep' delay\n    endif\n  endif\n\n  \" FIXME: We need a much more robust way to wait for the server to be ready\nendfunction\n\nlet s:g_stack = {}\n\nfunction! youcompleteme#test#setup#PushGlobal( name, value )\n  if !has_key( s:g_stack, a:name )\n    let s:g_stack[ a:name ] = []\n  endif\n\n  let old_value = get( g:, a:name, v:null )\n  call add( s:g_stack[ a:name ], old_value )\n  call extend( g:, { a:name: a:value  } )\n\n  return old_value\nendfunction\n\nfunction! youcompleteme#test#setup#PopGlobal( name )\n  if !has_key( s:g_stack, a:name ) || len( s:g_stack[ a:name ] ) == 0\n    return v:null\n  endif\n\n  let old_value = s:g_stack[ a:name ][ -1 ]\n  call remove( s:g_stack[ a:name ], -1 )\n\n  if old_value is v:null\n    silent! call remove( g:, a:name )\n  else\n    call extend( g:, { a:name: old_value  } )\n  endif\n\n  return old_value\nendfunction\n"
  },
  {
    "path": "test/lib/plugin/completion.vim",
    "content": "function! CheckCompletionItemsContainsExactly( expected_props, ... )\n  let prop = 'abbr'\n  if a:0 > 0\n    let prop = a:1\n  endif\n\n  let items = complete_info( [ 'items' ] )[ 'items' ]\n  let abbrs = []\n  for item in items\n    call add( abbrs, get( item, prop ) )\n  endfor\n\n  return assert_equal( a:expected_props,\n                     \\ abbrs,\n                     \\ 'not matched: '\n                     \\ .. string( a:expected_props )\n                     \\ .. ' against '\n                     \\ .. prop\n                     \\ .. ' in '\n                     \\ .. string( items )\n                     \\ .. ' matching '\n                     \\ .. string( abbrs ) )\nendfunction\n\nfunction! CheckCompletionItemsHasItems( expected_props, ... )\n  let prop = 'abbr'\n  if a:0 > 0\n    let prop = a:1\n  endif\n\n  let items = complete_info( [ 'items' ] )[ 'items' ]\n  let abbrs = []\n  for item in items\n    call add( abbrs, get( item, prop ) )\n  endfor\n\n  let result = 0\n  for expected in a:expected_props\n    if index( abbrs, expected ) < 0\n      call assert_report( \"Didn't find item with \"\n                        \\ .. prop\n                        \\ .. '=\"'\n                        \\ .. expected\n                        \\ .. '\" in completion list: '\n                        \\ .. string( abbrs ) )\n      let result += 1\n    endif\n  endfor\n\n  return result\nendfunction\n\nfunction! IndexOfCompletionItemInList( item, ... )\n  let prop = 'abbr'\n  if a:0 > 0\n    let prop = a:1\n  endif\n\n  let items = complete_info( [ 'items' ] )[ 'items' ]\n  let abbrs = []\n  let idx = 0\n  while idx < len( items )\n    if get( items[ idx ], prop ) == a:item\n      return idx\n    endif\n    let idx += 1\n  endwhile\n\n  call assert_report( 'Did not find item '\n                    \\ . string( a:item )\n                    \\ . ' in completion info list' )\n  return -1\nendfunction\n\n\nfunction! FeedAndCheckMain( keys, func )\n  call timer_start( 500, a:func )\n  call feedkeys( a:keys, 'tx!' )\nendfunction\n\nfunction! FeedAndCheckAgain( keys, func )\n  call timer_start( 500, a:func )\n  call feedkeys( a:keys )\nendfunction\n\nfunction! WaitForCompletion()\n  call WaitForAssert( {->\n        \\ assert_true( pyxeval( 'ycm_state.GetCurrentCompletionRequest() is not None' ) )\n        \\ } )\n  call WaitForAssert( {->\n        \\ assert_true( pyxeval( 'ycm_state.CompletionRequestReady()' ) )\n        \\ } )\n  redraw\n  call WaitForAssert( {->\n        \\ assert_true( pumvisible(), 'pumvisible()' )\n        \\ }, 10000 )\nendfunction\n\n"
  },
  {
    "path": "test/lib/plugin/shared.vim",
    "content": "\n\" Functions shared by several tests.\n\n\" Only load this script once.\nif exists('*WaitFor')\n  finish\nendif\n\n\" Run skip the current test if some expression returns true\nfunc SkipIf( expr, msg )\n  if type(a:expr) == v:t_func\n    let skip = a:expr()\n  else\n    let skip = eval(a:expr)\n  endif\n\n  if skip\n    throw 'SKIPPED: ' . a:msg\n  endif\nendfunction\n\n\" Wait for up to five seconds for \"expr\" to become true.  \"expr\" can be a\n\" stringified expression to evaluate, or a funcref without arguments.\n\" Using a lambda works best.  Example:\n\"\tcall WaitFor({-> status == \"ok\"})\n\"\n\" A second argument can be used to specify a different timeout in msec.\n\"\n\" When successful the time slept is returned.\n\" When running into the timeout an exception is thrown, thus the function does\n\" not return.\nfunc WaitFor(expr, ...)\n  let timeout = get(a:000, 0, 5000)\n  let slept = s:WaitForCommon(a:expr, v:null, timeout)\n  if slept < 0\n    throw 'WaitFor() timed out after ' . timeout . ' msec'\n  endif\n  return slept\nendfunc\n\n\" Wait for up to five seconds for \"assert\" to return zero.  \"assert\" must be a\n\" (lambda) function containing one assert function.  Example:\n\"\tcall WaitForAssert({-> assert_equal(\"dead\", job_status(job)})\n\"\n\" A second argument can be used to specify a different timeout in msec.\n\"\n\" Return zero for success, one for failure (like the assert function).\nfunc WaitForAssert(assert, ...)\n  let timeout = get(a:000, 0, 5000)\n  if s:WaitForCommon(v:null, a:assert, timeout) < 0\n    return 1\n  endif\n  return 0\nendfunc\n\n\" Common implementation of WaitFor() and WaitForAssert().\n\" Either \"expr\" or \"assert\" is not v:null\n\" Return the waiting time for success, -1 for failure.\nfunc s:WaitForCommon(expr, assert, timeout)\n  \" using reltime() is more accurate, but not always available\n  let slept = 0\n  if has('reltime')\n    let start = reltime()\n  endif\n\n  while 1\n    if type(a:expr) == v:t_func\n      let success = a:expr()\n    elseif type(a:assert) == v:t_func\n      let success = a:assert() == 0\n    else\n      let success = eval(a:expr)\n    endif\n    if success\n      return slept\n    endif\n\n    if slept >= a:timeout\n      break\n    endif\n    if type(a:assert) == v:t_func\n      \" Remove the error added by the assert function.\n      call remove(v:errors, -1)\n    endif\n\n    sleep 10m\n    if has('reltime')\n      let slept = float2nr(reltimefloat(reltime(start)) * 1000)\n    else\n      let slept += 10\n    endif\n    if slept % 100 == 0\n      redraw!\n    endif\n  endwhile\n\n  return -1  \" timed out\nendfunc\n"
  },
  {
    "path": "test/lib/plugin/util.vim",
    "content": "function! CheckCurrentLine( expected_value )\n  return assert_equal( a:expected_value, getline( '.' ) )\nendfunction\n\nfunction! AssertDictHasEntries( actual, expected, name = 'expected dict' )\n  let l:errs = 0\n  for key in keys( a:expected )\n    if !has_key( a:actual, key )\n      let l:errs += assert_report( 'Key '\n                                 \\ . key\n                                 \\ . ' of '\n                                 \\ . a:name\n                                 \\ . ' was not found' )\n    elseif type( a:expected[ key ] ) == v:t_dict\n      if type( a:actual[ key ] ) != v:t_dict\n        let l:errs += assert_report( 'Key '\n                                   \\ . key\n                                   \\ . ' of '\n                                   \\ . a:name\n                                   \\ . ' was expected to be a dict, but was '\n                                   \\ . string( a:actual[ key ] ) )\n      else\n        let l:errs += AssertDictHasEntries( a:actual[ key ],\n                                          \\ a:expected[ key ],\n                                          \\ 'entry ' . key . ' in ' . a:name )\n      endif\n    else\n      let l:errs += assert_equal( a:expected[ key ],\n                                \\ a:actual[ key ],\n                                \\ 'Key '\n                                \\ . key\n                                \\ . ' of '\n                                \\ . a:name\n                                \\ . ' did not match' )\n    endif\n  endfor\n  return l:errs\nendfunction\n\nfunction! CheckListOfDicts( actual_list, expected_list )\n  let l:errs = 0\n  let l:idx = 0\n  if len( a:actual_list ) != len( a:expected_list )\n    let l:errs += assert_report( 'Expected list to contain '\n                               \\ . len( a:actual_list )\n                               \\ . ' entries, but found '\n                               \\ . len( a:expected_list )\n                               \\ . ': Expected '\n                               \\ . string( a:expected_list )\n                               \\ . ' but found '\n                               \\ . string( a:actual_list ) )\n  endif\n\n  while l:idx < len( a:expected_list )\n    let l:expected = a:expected_list[ l:idx ]\n    if l:idx >= len( a:actual_list )\n      let l:errs += assert_report( 'The item at index '\n                                 \\ . l:idx\n                                 \\ . ' was not found: '\n                                 \\ . string( l:expected ) )\n    else\n      let l:actual = a:actual_list[ l:idx ]\n      let l:errs += AssertDictHasEntries( l:actual,\n                                        \\ l:expected,\n                                        \\ 'item at index ' . l:idx )\n    endif\n    let l:idx = l:idx + 1\n  endwhile\n\n  while idx < len( a:actual_list )\n    let l:actual = a:actual_list[ idx ]\n    let l:errs +=  assert_report( 'The following additional property '\n                                \\ . 'was found: '\n                                \\ . string( l:actual ) )\n    let l:idx = l:idx + 1\n  endwhile\n\n  return l:errs > 0 ? 1 : 0\nendfunction\n"
  },
  {
    "path": "test/lib/run_test.vim",
    "content": "\" This script is sourced while editing the .vim file with the tests.\n\" When the script is successful the .res file will be created.\n\" Errors are appended to the test.log file.\n\"\n\" To execute only specific test functions, add a second argument.  It will be\n\" matched against the names of the Test_ funtion.  E.g.:\n\"\t../vim -Nu NONE vimrc -S lib/run_test.vim test_channel.vim open_delay\n\" The output can be found in the \"messages\" file.\n\"\n\" The test script may contain anything, only functions that start with\n\" \"Test_\" are special.  These will be invoked and should contain assert\n\" functions.  See test_assert.vim for an example.\n\"\n\" It is possible to source other files that contain \"Test_\" functions.  This\n\" can speed up testing, since Vim does not need to restart.  But be careful\n\" that the tests do not interfere with each other.\n\"\n\" If an error cannot be detected properly with an assert function add the\n\" error to the v:errors list:\n\"   call add(v:errors, 'test foo failed: Cannot find xyz')\n\"\n\" If preparation for each Test_ function is needed, define a SetUp function.\n\" It will be called before each Test_ function.\n\"\n\" If cleanup after each Test_ function is needed, define a TearDown function.\n\" It will be called after each Test_ function.\n\"\n\" When debugging a test it can be useful to add messages to v:errors:\n\"   call add(v:errors, \"this happened\")\n\"\n\" But for real debug logging:\n\"   call ch_log( \",,,message...\" )\n\" Then view it in 'debuglog'\n\n\" Let a test take up to 1 minute\nlet s:single_test_timeout = 60000\n\n\" Restrict the runtimepath to the exact minimum needed for testing\nlet &rtp = getcwd() . '/lib'\nset rtp +=$VIM/vimfiles,$VIMRUNTIME,$VIM/vimfiles/after\n\ncall ch_logfile( 'debuglog', 'w' )\n\n\" For consistency run all tests with 'nocompatible' set.\n\" This also enables use of line continuation.\nset nocp\n\n\" Use utf-8 by default, instead of whatever the system default happens to be.\n\" Individual tests can overrule this at the top of the file.\nset encoding=utf-8\n\n\" Avoid stopping at the \"hit enter\" prompt\nset nomore\n\n\" Output all messages in English.\nlang messages C\n\n\" Always use forward slashes.\nset shellslash\n\nfunc s:TestFailed()\n  if pyxeval( '\"ycm_state\" in globals()' )\n    let logs =  pyxeval( 'ycm_state.GetLogfiles()' )\n    for log_name in sort( keys( logs ) )\n      let log = readfile( logs[ log_name ] )\n      let logfile = s:testid_filesafe . '_' . log_name . '.testlog'\n      call writefile( log, logfile, 's' )\n      call add( s:messages,\n              \\ 'Wrote '\n              \\ . log_name\n              \\ . ' log for failed test: '\n              \\ . logfile )\n      call add( s:messages, '**** LOG FILE ' . log_name . ' ****' )\n      call extend( s:messages, log )\n    endfor\n  endif\nendfunc\n\nfunc! Abort( timer_id )\n  call assert_report( 'Test timed out!!!' )\n  qa!\nendfunc\n\nfunc RunTheTest(test)\n  echo 'Executing ' . a:test\n\n  \" Avoid stopping at the \"hit enter\" prompt\n  set nomore\n\n  \" Avoid a three second wait when a message is about to be overwritten by the\n  \" mode message.\n  set noshowmode\n\n  \" Clear any overrides.\n  call test_override('ALL', 0)\n\n  \" Some tests wipe out buffers.  To be consistent, always wipe out all\n  \" buffers.\n  %bwipe!\n\n  \" The test may change the current directory. Save and restore the\n  \" directory after executing the test.\n  let save_cwd = getcwd()\n\n  if exists(\"*SetUp_\" . a:test)\n    try\n      exe 'call SetUp_' . a:test\n    catch\n      call add(v:errors,\n            \\ 'Caught exception in SetUp_' . a:test . ' before '\n            \\ . a:test\n            \\ . ': '\n            \\ . v:exception\n            \\ . ' @ '\n            \\ . g:testpath\n            \\ . ':'\n            \\ . v:throwpoint)\n    endtry\n  endif\n\n  if exists(\"*SetUp\")\n    try\n      call SetUp()\n    catch\n      call add(v:errors,\n            \\ 'Caught exception in SetUp() before '\n            \\ . a:test\n            \\ . ': '\n            \\ . v:exception\n            \\ . ' @ '\n            \\ . g:testpath\n            \\ . ':'\n            \\ . v:throwpoint)\n    endtry\n  endif\n\n  call add(s:messages, 'Executing ' . a:test)\n  let s:done += 1\n  let timer = timer_start( s:single_test_timeout, funcref( 'Abort' ) )\n\n  try\n    let s:test = a:test\n    let s:testid = g:testpath . ':' . a:test\n\n    let test_filesafe = substitute( a:test, '[)(,:]', '_', 'g' )\n    let s:testid_filesafe = g:testpath . '_' . test_filesafe\n\n    au VimLeavePre * call EarlyExit(s:test)\n    call ch_log( 'StartTest: ' . a:test )\n\n    messages clear\n    exe 'call ' . a:test\n    \" We require that tests either don't make errors or that they call messages\n    \" clear\n    call assert_true(\n          \\ empty( execute( 'messages' ) ),\n          \\ 'Test '\n          \\ .. a:test\n          \\ .. ' produced unexpected messages output '\n          \\ .. string( execute( 'messages' ) )\n          \\ .. ' (hint: call :messages clear if this is expected, '\n          \\ .. 'or use :silent)' )\n\n    call ch_log( 'EndTest: ' . a:test )\n    au! VimLeavePre\n  catch /^\\cskipped/\n    let v:errors = []\n    call ch_log( 'Skipped: ' . a:test )\n    call add(s:messages, '    Skipped')\n    call add(s:skipped,\n          \\ 'SKIPPED ' . a:test\n          \\ . ': '\n          \\ . substitute(v:exception, '^\\S*\\s\\+', '',  ''))\n  catch\n    call ch_log( 'Catch: ' . a:test )\n    call add(v:errors,\n          \\ 'Caught exception in ' . a:test\n          \\ . ': '\n          \\ . v:exception\n          \\ . ' @ '\n          \\ . g:testpath\n          \\ . ':'\n          \\ . v:throwpoint)\n\n    call s:TestFailed()\n  endtry\n\n  call timer_stop( timer )\n\n  \" In case 'insertmode' was set and something went wrong, make sure it is\n  \" reset to avoid trouble with anything else.\n  set noinsertmode\n\n  if exists(\"*TearDown\")\n    try\n      call TearDown()\n    catch\n      call add(v:errors,\n            \\ 'Caught exception in TearDown() after ' . a:test\n            \\ . ': '\n            \\ . v:exception\n            \\ . ' @ '\n            \\ . g:testpath\n            \\ . ':'\n            \\ . v:throwpoint)\n    endtry\n  endif\n\n  if exists(\"*TearDown_\" . a:test)\n    try\n      exe 'call TearDown_' . a:test\n    catch\n      call add(v:errors,\n            \\ 'Caught exception in TearDown_' . a:test . ' after ' . a:test\n            \\ . ': '\n            \\ . v:exception\n            \\ . ' @ '\n            \\ . g:testpath\n            \\ . ':'\n            \\ . v:throwpoint)\n    endtry\n  endif\n\n  \" Clear any autocommands\n  au!\n\n  call test_override( 'ALL', 0 )\n  %bwipe!\n\n  \" Close any extra tab pages and windows and make the current one not modified.\n  while tabpagenr('$') > 1\n    quit!\n  endwhile\n\n  while 1\n    let wincount = winnr('$')\n    if wincount == 1\n      break\n    endif\n    bwipe!\n    if wincount == winnr('$')\n      \" Did not manage to close a window.\n      only!\n      break\n    endif\n  endwhile\n\n  exe 'cd ' . save_cwd\nendfunc\n\nfunc AfterTheTest()\n  if len(v:errors) > 0\n    let s:fail += 1\n    call s:TestFailed()\n    call add(s:errors, 'Found errors in ' . s:testid . ':')\n    call extend(s:errors, v:errors)\n    let v:errors = []\n  endif\nendfunc\n\nfunc EarlyExit(test)\n  \" It's OK for the test we use to test the quit detection.\n  call add(v:errors, 'Test caused Vim to exit: ' . a:test)\n  call FinishTesting()\nendfunc\n\n\" This function can be called by a test if it wants to abort testing.\nfunc FinishTesting()\n  call AfterTheTest()\n\n  \" Don't write viminfo on exit.\n  set viminfo=\n\n  if s:fail == 0\n    \" Success, create the .res file so that make knows it's done.\n    call writefile( [], g:testname . '.res', 's' )\n  endif\n\n  if len(s:errors) > 0\n    \" Append errors to test.log\n    let l = []\n    if filereadable( 'test.log' )\n      let l = readfile( 'test.log' )\n    endif\n    call writefile( l->extend( [ '', 'From ' . g:testpath . ':' ] )\n                  \\  ->extend( s:errors ),\n                  \\ 'test.log',\n                  \\ 's' )\n  endif\n\n  if s:done == 0\n    let message = 'NO tests executed'\n  else\n    let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test')\n  endif\n  echo message\n  call add(s:messages, message)\n  if s:fail > 0\n    let message = s:fail . ' FAILED:'\n    echo message\n    call add(s:messages, message)\n    call extend(s:messages, s:errors)\n  endif\n\n  \" Add SKIPPED messages\n  call extend(s:messages, s:skipped)\n\n  \" Append messages to the file \"messages\"\n  let l = []\n  if filereadable( 'messages' )\n    let l = readfile( 'messages' )\n  endif\n  call writefile( l->extend( [ '', 'From ' . g:testpath . ':' ] )\n                \\  ->extend( s:messages ),\n                \\ 'messages',\n                \\ 's' )\n\n  if exists( '$COVERAGE' ) && pyxeval( '_cov is not None' )\n    pyx _cov.stop()\n    pyx _cov.save()\n  endif\n\n  if s:fail > 0\n    cquit!\n  else\n    qall!\n  endif\nendfunc\n\n\" Source the test script.  First grab the file name, in case the script\n\" navigates away.  g:testname can be used by the tests.\nlet g:testname = expand('%')\nlet g:testpath = expand('%:p')\nlet s:done = 0\nlet s:fail = 0\nlet s:errors = []\nlet s:messages = []\nlet s:skipped = []\ntry\n  source %\ncatch\n  let s:fail += 1\n  call add(s:errors,\n        \\ 'Caught exception: ' .\n        \\ v:exception .\n        \\ ' @ ' . v:throwpoint)\nendtry\n\n\" Locate Test_ functions and execute them.\nredir @q\nsilent function /^Test_\nredir END\nlet s:tests = split(substitute(@q, 'function \\(\\k*()\\)', '\\1', 'g'))\n\n\" If there is an extra argument filter the function names against it.\nif argc() > 1\n  let s:tests = filter(s:tests, 'v:val =~ argv(1)')\nendif\n\npyx <<EOF\ndef _InitCoverage():\n  try:\n    import coverage\n  except ImportError:\n    return None\n\n  cov = coverage.Coverage( data_file='.coverage.python', data_suffix = True )\n  cov.start()\n  return cov\n\nimport os\nif 'COVERAGE' in os.environ:\n  _cov = _InitCoverage()\nEOF\n\n\" Init covimerage\nif exists( '$COVERAGE' )\n  profile start .vim_profile\n  exe 'profile! file */youcompleteme.vim'\n  exe 'profile! file */youcompleteme/**.vim'\nendif\n\n\" Execute the tests in alphabetical order.\nfor s:test in sort(s:tests)\n  \" Silence, please!\n  set belloff=all\n  call RunTheTest(s:test)\n\n  \" Repeat a flaky test.  Give up when:\n  \" - $TEST_NO_RETRY is not empty\n  \" - $TEST_NO_RETRY is not 0\n  \" - it fails five times\n  if len(v:errors) > 0\n        \\ && ( $TEST_NO_RETRY == '' || $TEST_NO_RETRY == '0' )\n    for retry in range( 10 )\n      call add( s:messages, 'Found errors in ' . s:test . '. Retrying.' )\n      call extend( s:messages, v:errors )\n\n      sleep 2\n\n      let v:errors = []\n      call RunTheTest(s:test)\n\n      if len(v:errors) == 0\n        \" Test passed on rerun.\n        break\n      endif\n    endfor\n  endif\n\n  call AfterTheTest()\nendfor\n\ncall FinishTesting()\n\n\" vim: shiftwidth=2 sts=2 expandtab\n"
  },
  {
    "path": "test/run_vim_tests",
    "content": "#!/usr/bin/env bash\n\nif [ \"$1\" == \"--help\" ]; then\n  echo \"$(basename $0) <optional list of tests in form file:func>\"\n  echo \"e.g.: \"\n  echo \" - run all tests: $0\"\n  echo \" - run specific tests script: $0 signature_help.test.vim\"\n  echo \" - run specific tests fun: $0 signature_help.test.vim:Test_signatures_TopLine\\(\\)\"\n  exit 0\nelif [ \"$1\" == \"--stdout\" ]; then\n  export YCM_TEST_STDOUT=1\n  shift\nfi\n\nVIM=vim\nif [ \"$1\" == \"--vim\" ]; then\n  VIM=$2\n  shift\n  shift\nfi\n\nRUN_VIM=\"${VIM} --clean --not-a-term\"\nRUN_TEST=\"${RUN_VIM} -S lib/run_test.vim\"\n\npushd $(dirname $0) > /dev/null\n\necho \"Running YouCompleteMe Vim tests\"\n\nRESULT=0\n\nTESTS=\"$@\"\n\nif [ -z \"$TESTS\" ]; then\n  TESTS=*.test.vim\nfi\n\nfor t in ${TESTS}; do\n  echo \"\"\n  echo \"%RUN: $t\"\n\n  # split on : into fileName and testName\n  IFS=: read -s t T <<< \"$t\"\n\n  TESTLOGDIR=$(pwd)/logs/$t\n\n  if ${RUN_TEST} --cmd 'au SwapExists * let v:swapchoice = \"e\"' $t $T \\\n     && [ -f $t.res ];  then\n    echo \"%PASS: $t PASSED\"\n  else\n    echo \"%FAIL: $t FAILED - see $TESTLOGDIR\"\n    RESULT=1\n  fi\n\n  rm -rf $TESTLOGDIR\n  mkdir -p $TESTLOGDIR\n  ${RUN_VIM} --version > ${TESTLOGDIR}/vimversion\n  for l in messages debuglog test.log *.testlog; do\n    # In CI we can't view the output files, so we just have to cat them\n    if [ -f $l ]; then\n      if [ \"$YCM_TEST_STDOUT\" ]; then\n        echo \"\"\n        echo \"\"\n        echo \"*** START: $l ***\"\n        cat $l\n        echo \"*** END: $l ***\"\n      fi\n      mv $l $TESTLOGDIR\n    fi\n  done\n\n  if [ -n \"${COVERAGE}\" ]; then\n    covimerage write_coverage --append \\\n                              --source $(pwd)/.. \\\n                              --data-file .coverage.vim \\\n                              .vim_profile\n  fi\n\n  rm -f $t.res\ndone\n\necho \"Done running tests\"\n\nif [ -n \"${COVERAGE}\" ]; then\n  mv .coverage.* ../\nfi\n\npopd > /dev/null\n\necho \"\"\necho \"All done.\"\n\n\nexit $RESULT\n"
  },
  {
    "path": "test/signature_help.test.vim",
    "content": "let s:timer_interval = 2000\n\nfunction! s:WaitForSigHelpAvailable( filetype )\n  let tries = 0\n  call WaitFor( {-> s:_CheckSignatureHelpAvailable( a:filetype ) } )\n  while py3eval(\n        \\ 'ycm_state._signature_help_available_requests[ '\n        \\ . 'vim.eval( \"a:filetype\" ) ].Response() == \"PENDING\"' ) &&\n        \\ tries < 10\n    \" Force sending another request\n    py3 ycm_state._signature_help_available_requests[\n          \\ vim.eval( 'a:filetype' ) ].Start( vim.eval( 'a:filetype' ) )\n    call WaitFor( {-> s:_CheckSignatureHelpAvailable( a:filetype ) } )\n    let tries += 1\n  endwhile\n  call ch_log( \"Signature help is avaialble now for \" . a:filetype )\nendfunction\n\nfunction! s:_ClearSigHelp()\n  pythonx _sh_state = sh.UpdateSignatureHelp( _sh_state, {} )\n  call assert_true( pyxeval( '_sh_state.popup_win_id is None' ),\n        \\ 'win id none with emtpy' )\n  unlet! s:popup_win_id\nendfunction\n\nfunction! s:_CheckSignatureHelpAvailable( filetype )\n  return pyxeval(\n        \\ 'ycm_state.SignatureHelpAvailableRequestComplete('\n        \\ . ' vim.eval( \"a:filetype\" ), False )' )\nendfunction\n\nfunction s:_GetSigHelpWinID()\n  call WaitForAssert( {->\n        \\   assert_true(\n        \\     pyxeval(\n        \\       'ycm_state.SignatureHelpRequestReady()'\n        \\     ),\n        \\     'sig help request reqdy'\n        \\   )\n        \\ } )\n  call WaitForAssert( {->\n        \\   assert_true(\n        \\     pyxeval(\n        \\       'ycm_state._signature_help_state.popup_win_id is not None'\n        \\     ),\n        \\     'popup_win_id'\n        \\   )\n        \\ } )\n  let s:popup_win_id = pyxeval( 'ycm_state._signature_help_state.popup_win_id' )\n  return s:popup_win_id\nendfunction\n\nfunction! s:_CheckSigHelpAtPos( sh, cursor, pos )\n  call setpos( '.', [ 0 ] + a:cursor )\n  redraw\n  pythonx _sh_state = sh.UpdateSignatureHelp( _sh_state,\n                                            \\ vim.eval( 'a:sh' ) )\n  redraw\n  let winid = pyxeval( '_sh_state.popup_win_id' )\n  call youcompleteme#test#popup#CheckPopupPosition( winid, a:pos )\nendfunction\n\nfunction! SetUp()\n  let g:ycm_use_clangd = 1\n  let g:ycm_confirm_extra_conf = 0\n  let g:ycm_auto_trigger = 1\n  let g:ycm_keep_logfiles = 1\n  let g:ycm_log_level = 'DEBUG'\n\n  call youcompleteme#test#setup#SetUp()\n  pythonx from ycm import signature_help as sh\n  pythonx _sh_state = sh.SignatureHelpState()\nendfunction\n\nfunction! TearDown()\n  call s:_ClearSigHelp()\n  call youcompleteme#test#setup#CleanUp()\nendfunction\n\n\" This is how we might do screen dump tests\n\" function! Test_Compl()\n\"   let setup =<< trim END\n\"     edit ../third_party/ycmd/ycmd/tests/clangd/testdata/general_fallback/make_drink.cc\n\"     call setpos( '.', [ 0, 7, 27 ] )\n\"   END\n\"   call writefile( setup, 'Xtest_Compl' )\n\"   let vim = RunVimInTerminal( '-Nu vimrc -S Xtest_Compl', {} )\n\"\n\"   function! Test() closure\n\"     \" Wait for Vim to be ready\n\"     call term_sendkeys( vim, \"cl:\" )\n\"     call term_wait( vim )\n\"     call VerifyScreenDump( vim, \"signature_help_Test_Compl_01\", {} )\n\"   endfunction\n\"\n\"   call WaitForAssert( {-> Test()} )\n\"\n\"   \" clean up\n\"   call StopVimInTerminal(vim)\n\"   call delete('XtestPopup')\n\" endfunction\n\nfunction! Test_Enough_Screen_Space()\n  call assert_true( &lines >= 25,\n                  \\ &lines . \" is not enough rows. need 25.\" )\n  call assert_true( &columns >= 80,\n                  \\ &columns . \" is not enough columns. need 80.\" )\nendfunction\n\nfunction! Test_Signatures_After_Trigger()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/test/testdata/vim/mixed_filetype.vim',\n        \\ { 'native_ft': 0, 'force_delay': v:true } )\n\n  call WaitFor( {-> s:_CheckSignatureHelpAvailable( 'vim' ) } )\n  call s:WaitForSigHelpAvailable( 'python' )\n\n  call setpos( '.', [ 0, 3, 17 ] )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  \" Must do the checks in a timer callback because we need to stay in insert\n  \" mode until done. Use a func because it's big enough (a lambda is a little\n  \" neater in many contexts).\n  function! Check( id ) closure\n    call WaitForAssert( {->\n          \\   assert_true(\n          \\     pyxeval(\n          \\       'ycm_state.SignatureHelpRequestReady()'\n          \\     ),\n          \\     'sig help request ready'\n          \\   )\n          \\ } )\n    call WaitForAssert( {->\n          \\   assert_true(\n          \\     pyxeval(\n          \\       \"bool( ycm_state.GetSignatureHelpResponse()[ 'signatures' ] )\"\n          \\     ),\n          \\     'sig help request has signatures'\n          \\   )\n          \\ } )\n    call WaitForAssert( {->\n          \\   assert_true(\n          \\     pyxeval(\n          \\       'ycm_state._signature_help_state.popup_win_id is not None'\n          \\     ),\n          \\     'popup_win_id'\n          \\   )\n          \\ } )\n\n    let popup_win_id = pyxeval( 'ycm_state._signature_help_state.popup_win_id' )\n    let pos = win_screenpos( popup_win_id )\n    call assert_false( pos == [ 0, 0 ] )\n\n    \" Exit insert mode to ensure the test continues\n    call test_override( 'ALL', 0 )\n    call feedkeys( \"\\<ESC>\" )\n  endfunction\n\n  call assert_false( pyxeval( 'ycm_state.SignatureHelpRequestReady()' ) )\n  call timer_start( s:timer_interval, funcref( 'Check' ) )\n  call feedkeys( 'cl(', 'ntx!' )\n  call assert_false( pumvisible(), 'pumvisible()' )\n\n  call WaitForAssert( {->\n        \\   assert_true(\n        \\     pyxeval(\n        \\       'ycm_state._signature_help_state.popup_win_id is None'\n        \\     ),\n        \\     'popup_win_id'\n        \\   )\n        \\ } )\n\n  call test_override( 'ALL', 0 )\n  delfunc! Check\nendfunction\n\nfunction! Test_Signatures_With_PUM_NoSigns()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/clangd/testdata/general_fallback'\n        \\ . '/make_drink.cc', {} )\n\n  call s:WaitForSigHelpAvailable( 'cpp' )\n\n  \" Make sure that error signs don't shift the window\n  setlocal signcolumn=no\n\n  call setpos( '.', [ 0, 7, 13 ] )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check2( id ) closure\n    call WaitForAssert( {-> assert_true( pumvisible() ) } )\n    call WaitForAssert( {-> assert_notequal( [], complete_info().items ) } )\n    call assert_equal( 7, pum_getpos().row )\n    redraw\n\n    \" NOTE: anchor is 0-based\n    call assert_equal( 6,\n                     \\ pyxeval( 'ycm_state._signature_help_state.anchor[0]' ) )\n    call assert_equal( 13,\n                     \\ pyxeval( 'ycm_state._signature_help_state.anchor[1]' ) )\n\n\n    \" Popup is shifted due to 80 column screen\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 5, 'col': 5 } )\n\n    call test_override( 'ALL', 0 )\n    call feedkeys( \"\\<ESC>\", 't' )\n  endfunction\n\n  \" Must do the checks in a timer callback because we need to stay in insert\n  \" mode until done.\n  function! Check( id ) closure\n    call WaitForAssert( {->\n          \\   assert_true(\n          \\     pyxeval(\n          \\       'ycm_state._signature_help_state.popup_win_id is not None'\n          \\     ),\n          \\     'popup_win_id'\n          \\   )\n          \\ } )\n    \" Popup is shifted left due to 80 char screen\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 5, 'col': 5 } )\n\n    call timer_start( s:timer_interval, funcref( 'Check2' ) )\n    call feedkeys( ' TypeOfD', 't' )\n  endfunction\n\n  call assert_false( pyxeval( 'ycm_state.SignatureHelpRequestReady()' ) )\n  call timer_start( s:timer_interval, funcref( 'Check' ) )\n  call feedkeys( 'C(', 'ntx!' )\n\n  call WaitForAssert( {->\n        \\   assert_true(\n        \\     pyxeval(\n        \\       'ycm_state._signature_help_state.popup_win_id is None'\n        \\     ),\n        \\     'popup_win_id'\n        \\   )\n        \\ } )\n\n  call test_override( 'ALL', 0 )\n  delfunc! Check\n  delfunc! Check2\nendfunction\n\nfunction! Test_Signatures_With_PUM_Signs()\n  call youcompleteme#test#setup#OpenFile(\n        \\ '/third_party/ycmd/ycmd/tests/clangd/testdata/general_fallback'\n        \\ . '/make_drink.cc', {} )\n\n  call s:WaitForSigHelpAvailable( 'cpp' )\n\n  \" Make sure that sign causes the popup to shift\n  setlocal signcolumn=auto\n\n  call setpos( '.', [ 0, 7, 13 ] )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function Check2( id ) closure\n    call WaitForAssert( {-> assert_true( pumvisible() ) } )\n    call WaitForAssert( {-> assert_notequal( [], complete_info().items ) } )\n    call assert_equal( 7, pum_getpos().row )\n    redraw\n\n    \" NOTE: anchor is 0-based\n    call assert_equal( 6,\n                     \\ pyxeval( 'ycm_state._signature_help_state.anchor[0]' ) )\n    call assert_equal( 13,\n                     \\ pyxeval( 'ycm_state._signature_help_state.anchor[1]' ) )\n\n\n    \" Sign column is shown, popup shifts to the right 2 screen columns\n    \" Then shifts back due to 80 character screen width\n    \" FIXME: This test was supposed to show the shifting right. Write another\n    \" one which uses a much smaller popup to do that.\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 5, 'col': 5 } )\n\n    call test_override( 'ALL', 0 )\n    call feedkeys( \"\\<ESC>\", 't' )\n  endfunction\n\n  \" Must do the checks in a timer callback because we need to stay in insert\n  \" mode until done.\n  function! Check( id ) closure\n    call WaitForAssert( {->\n          \\   assert_true(\n          \\     pyxeval(\n          \\       'ycm_state._signature_help_state.popup_win_id is not None'\n          \\     ),\n          \\     'popup_win_id'\n          \\   )\n          \\ } )\n    \" Popup is shifted left due to 80 char screen\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 5, 'col': 5 } )\n\n    call timer_start( s:timer_interval, funcref( 'Check2' ) )\n    call feedkeys( ' TypeOfD', 't' )\n  endfunction\n\n  call assert_false( pyxeval( 'ycm_state.SignatureHelpRequestReady()' ) )\n  call timer_start( s:timer_interval, funcref( 'Check' ) )\n  call feedkeys( 'C(', 'ntx!' )\n\n  call WaitForAssert( {->\n        \\   assert_true(\n        \\     pyxeval(\n        \\       'ycm_state._signature_help_state.popup_win_id is None'\n        \\     ),\n        \\     'popup_win_id'\n        \\   )\n        \\ } )\n\n  call test_override( 'ALL', 0 )\n  delfunc! Check\n  delfunc! Check2\nendfunction\n\nfunction! Test_Placement_Simple()\n  call assert_true( &lines >= 25, \"Enough rows\" )\n  call assert_true( &columns >= 25, \"Enough columns\" )\n\n  let X = join( map( range( 0, &columns - 1 ), {->'X'} ), '' )\n\n  for i in range( 0, &lines )\n    call append( line('$'), X )\n  endfor\n\n  \" Delete the blank line that is always added to a buffer\n  0delete\n\n  call s:_ClearSigHelp()\n\n  let v_sh = {\n        \\   'activeSignature': 0,\n        \\   'activeParameter': 0,\n        \\   'signatures': [\n        \\     { 'label': 'test function', 'parameters': [] }\n        \\   ]\n        \\ }\n\n  \" When displayed in the middle with plenty of space\n  call s:_CheckSigHelpAtPos( v_sh, [ 10, 3 ], {\n        \\ 'line': 9,\n        \\ 'col': 1\n        \\ } )\n  \" Confirm that anchoring works (i.e. it doesn't move!)\n  call s:_CheckSigHelpAtPos( v_sh, [ 20, 10 ], {\n        \\ 'line': 9,\n        \\ 'col': 1\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Window slides from left of screen\n  call s:_CheckSigHelpAtPos( v_sh, [ 10, 2 ], {\n        \\ 'line': 9,\n        \\ 'col': 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Window slides from left of screen\n  call s:_CheckSigHelpAtPos( v_sh, [ 10, 1 ], {\n        \\ 'line': 9,\n        \\ 'col': 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Cursor at top-left of window\n  call s:_CheckSigHelpAtPos( v_sh, [ 1, 1 ], {\n        \\ 'line': 2,\n        \\ 'col': 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Cursor at top-right of window\n  call s:_CheckSigHelpAtPos( v_sh, [ 1, &columns ], {\n        \\ 'line': 2,\n        \\ 'col': &columns - len( \"test function\" ) - 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Bottom-left of window\n  call s:_CheckSigHelpAtPos( v_sh, [ &lines + 1, 1 ], {\n        \\ 'line': &lines - 2,\n        \\ 'col': 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Bottom-right of window\n  call s:_CheckSigHelpAtPos( v_sh, [ &lines + 1, &columns ], {\n        \\ 'line': &lines - 2,\n        \\ 'col': &columns - len( \"test function\" ) - 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  call popup_clear()\nendfunction\n\nfunction! Test_Placement_MultiLine()\n  call assert_true( &lines >= 25, \"Enough rows\" )\n  call assert_true( &columns >= 25, \"Enough columns\" )\n\n  let X = join( map( range( 0, &columns - 1 ), {->'X'} ), '' )\n\n  for i in range( 0, &lines )\n    call append( line('$'), X )\n  endfor\n\n  \" Delete the blank line that is always added to a buffer\n  0delete\n\n  call s:_ClearSigHelp()\n\n  let v_sh = {\n        \\   'activeSignature': 0,\n        \\   'activeParameter': 0,\n        \\   'signatures': [\n        \\     { 'label': 'test function', 'parameters': [] },\n        \\     { 'label': 'toast function', 'parameters': [\n        \\         { 'label': [ 0, 5 ] }\n        \\     ] },\n        \\   ]\n        \\ }\n\n  \" When displayed in the middle with plenty of space\n  call s:_CheckSigHelpAtPos( v_sh, [ 10, 3 ], {\n        \\ 'line': 8,\n        \\ 'col': 1\n        \\ } )\n  \" Confirm that anchoring works (i.e. it doesn't move!)\n  call s:_CheckSigHelpAtPos( v_sh, [ 20, 10 ], {\n        \\ 'line': 8,\n        \\ 'col': 1\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Window slides from left of screen\n  call s:_CheckSigHelpAtPos( v_sh, [ 10, 2 ], {\n        \\ 'line': 8,\n        \\ 'col': 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Window slides from left of screen\n  call s:_CheckSigHelpAtPos( v_sh, [ 10, 1 ], {\n        \\ 'line': 8,\n        \\ 'col': 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Cursor at top-left of window\n  call s:_CheckSigHelpAtPos( v_sh, [ 1, 1 ], {\n        \\ 'line': 2,\n        \\ 'col': 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Cursor at top-right of window\n  call s:_CheckSigHelpAtPos( v_sh, [ 1, &columns ], {\n        \\ 'line': 2,\n        \\ 'col': &columns - len( \"toast function\" ) - 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Bottom-left of window\n  call s:_CheckSigHelpAtPos( v_sh, [ &lines + 1, 1 ], {\n        \\ 'line': &lines - 3,\n        \\ 'col': 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  \" Bottom-right of window\n  call s:_CheckSigHelpAtPos( v_sh, [ &lines + 1, &columns ], {\n        \\ 'line': &lines - 3,\n        \\ 'col': &columns - len( \"toast function\" ) - 1,\n        \\ } )\n  call s:_ClearSigHelp()\n\n  call popup_clear()\nendfunction\n\nfunction! Test_Signatures_TopLine()\n  call youcompleteme#test#setup#OpenFile( 'test/testdata/python/test.py', {} )\n  call s:WaitForSigHelpAvailable( 'python' )\n  call setpos( '.', [ 0, 1, 24 ] )\n  call test_override( 'char_avail', 1 )\n\n  function! Check( id ) closure\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 2, 'col': 23 } )\n    call test_override( 'ALL', 0 )\n    call feedkeys( \"\\<ESC>\" )\n  endfunction\n\n  call timer_start( s:timer_interval, funcref( 'Check' ) )\n  call feedkeys( 'cl(', 'ntx!' )\n\n  call test_override( 'ALL', 0 )\n  delfun! Check\nendfunction\n\nfunction! Test_Signatures_TopLineWithPUM()\n  call youcompleteme#test#setup#OpenFile( 'test/testdata/python/test.py', {} )\n  call s:WaitForSigHelpAvailable( 'python' )\n  call setpos( '.', [ 0, 1, 24 ] )\n  call test_override( 'char_avail', 1 )\n\n  function! CheckSigHelpAndTriggerCompletion( id ) closure\n    \" Popup placed below the cursor\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 2, 'col': 23 } )\n\n    \" Push more characters into the typeahead buffer to trigger insert mode\n    \" completion.\n    \"\n    \" Nte for some reason the first semantic response can take quite some time,\n    \" and if our timer fires before then, the test just fails. so we take 2\n    \" seconds here.\n    call timer_start( s:timer_interval,\n                    \\ funcref( 'CheckCompletionVisibleAndSigHelpHidden' ) )\n    call feedkeys( \" os.\", 't' )\n  endfunction\n\n  function! CheckCompletionVisibleAndSigHelpHidden( id ) closure\n    \" Completion popup now visible, overlapping where the sig help popup was\n    redraw\n    call WaitForAssert( {-> assert_true( pumvisible() ) } )\n    call assert_equal( 1, get( pum_getpos(), 'row', -1 ) )\n    call assert_equal( 28, get( pum_getpos(), 'col', -1 ) )\n    \" so we hide the sig help popup.\n    call WaitForAssert( {->\n          \\   assert_true(\n          \\     pyxeval(\n          \\       'ycm_state._signature_help_state.popup_win_id is None'\n          \\     ),\n          \\     'popup_win_id'\n          \\   )\n          \\ } )\n    call youcompleteme#test#popup#CheckPopupPosition( s:popup_win_id, {} )\n\n    \" We're done in insert mode now.\n    call test_override( 'ALL', 0 )\n    call feedkeys( \"\\<ESC>\", 't' )\n  endfunction\n\n  \" Edit the line and trigger signature help\n  call timer_start( s:timer_interval,\n                  \\ funcref( 'CheckSigHelpAndTriggerCompletion' ) )\n  call feedkeys( 'C(', 'ntx!' )\n\n  call test_override( 'ALL', 0 )\n\n  delfunc! CheckSigHelpAndTriggerCompletion\n  delfunc! CheckCompletionVisibleAndSigHelpHidden\nendfunction\n\nfunction! SetUp_Test_Semantic_Completion_Popup_With_Sig_Help()\n  set signcolumn=no\n  call youcompleteme#test#setup#PushGlobal( 'ycm_add_preview_to_completeopt',\n                                          \\ 'popup' )\nendfunction\n\nfunction! Test_Semantic_Completion_Popup_With_Sig_Help()\n  call youcompleteme#test#setup#OpenFile(\n        \\ 'test/testdata/cpp/complete_with_sig_help.cc', {} )\n  call s:WaitForSigHelpAvailable( 'cpp' )\n\n  call setpos( '.', [ 0, 10, 1 ] )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check( ... )\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 6, 'visible': 1 } )\n\n    call FeedAndCheckAgain( '\"\", t.', funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( ... )\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'that_is_a_thing',\n                                              \\ 'this_is_a_thing' ] )\n\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 6, 'visible': 1 } )\n\n    call CheckCurrentLine( 'printf(\"\", t.' )\n    call FeedAndCheckAgain( \"\\<Tab>\", funcref( 'Check3' ) )\n  endfunction\n\n  function! Check3( ... )\n    \" Ensure that we didn't make an error?\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'that_is_a_thing',\n                                              \\ 'this_is_a_thing' ] )\n\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 6, 'visible': 1 } )\n\n    let compl = complete_info()\n    let selected = compl.items[ compl.selected ]\n    call assert_equal( 'that_is_a_thing', selected.word )\n\n    call WaitFor( {->\n          \\ popup_findinfo() > 0 &&\n          \\ has_key( popup_getpos( popup_findinfo() ), 'visible' ) } )\n    let info_popup_id = popup_findinfo()\n    call assert_true( popup_getpos( info_popup_id )[ 'visible' ] )\n\n    call CheckCurrentLine( 'printf(\"\", t.that_is_a_thing' )\n    call FeedAndCheckAgain( \"\\<Tab>\", funcref( 'Check4' ) )\n\n  endfunction\n\n  function! Check4( ... )\n    \" Ensure that we didn't make an error?\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'that_is_a_thing',\n                                              \\ 'this_is_a_thing' ] )\n\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 6, 'visible': 1 } )\n\n    let info_popup_id = popup_findinfo()\n    let compl = complete_info()\n    let selected = compl.items[ compl.selected ]\n    call assert_equal( 'this_is_a_thing', selected.word )\n    call assert_true( popup_getpos( info_popup_id )[ 'visible' ] )\n\n    call CheckCurrentLine( 'printf(\"\", t.this_is_a_thing' )\n\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call FeedAndCheckMain( 'iprintf(', funcref( 'Check' ) )\n\n  call test_override( 'ALL', 0 )\n\n  delfunc! Check\n  delfunc! Check2\n  delfunc! Check3\n  delfunc! Check4\nendfunction\n\nfunction! TearDown_Test_Semantic_Completion_Popup_With_Sig_Help()\n  set signcolumn&\n  call youcompleteme#test#setup#PopGlobal( 'ycm_add_preview_to_completeopt' )\nendfunction\n\nfunction! SetUp_Test_Semantic_Completion_Popup_With_Sig_Help_EmptyBuf()\n  set signcolumn=no\n  call youcompleteme#test#setup#PushGlobal( 'ycm_filetype_whitelist', {\n        \\ '*': 1,\n        \\ 'ycm_nofiletype': 1\n        \\ } )\n  call youcompleteme#test#setup#PushGlobal( 'ycm_filetype_blacklist', {} )\n  call youcompleteme#test#setup#PushGlobal( 'ycm_add_preview_to_completeopt',\n                                          \\ 'popup' )\nendfunction\n\nfunction! Test_Semantic_Completion_Popup_With_Sig_Help_EmptyBuf()\n  call youcompleteme#test#setup#OpenFile(\n        \\ 'test/testdata/cpp/complete_with_sig_help.cc', {} )\n  call s:WaitForSigHelpAvailable( 'cpp' )\n\n  call setpos( '.', [ 0, 10, 1 ] )\n\n  \" Required to trigger TextChangedI\n  \" https://github.com/vim/vim/issues/4665#event-2480928194\n  call test_override( 'char_avail', 1 )\n\n  function! Check( ... )\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 6, 'visible': 1 } )\n\n    call FeedAndCheckAgain( '\"\", t.', funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( ... )\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'that_is_a_thing',\n                                              \\ 'this_is_a_thing' ] )\n\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 6, 'visible': 1 } )\n\n    call CheckCurrentLine( 'printf(\"\", t.' )\n    call FeedAndCheckAgain( \"\\<Tab>\", funcref( 'Check3' ) )\n  endfunction\n\n  function! Check3( ... )\n    \" Ensure that we didn't make an error?\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'that_is_a_thing',\n                                              \\ 'this_is_a_thing' ] )\n\n    \" XFAIL: Currently the test fails here because the signature help popup\n    \" disappears when the info_popup is displayed. This seems to be because we\n    \" end up triggering a FileReadyToParse event inside the info popup (or the\n    \" signature popup) due to what appears to be a vim bug - the `buftype` of\n    \" the buffer inside the popup starts off as `popup` but shimers to `\"\"` at\n    \" some point, making us think it's ok to parse it with ycm_nofiletype is\n    \" whitelisted.\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 6, 'visible': 1 } )\n\n    let compl = complete_info()\n    let selected = compl.items[ compl.selected ]\n    call assert_equal( 'that_is_a_thing', selected.word )\n\n    call WaitFor( {->\n          \\ popup_findinfo() > 0 &&\n          \\ has_key( popup_getpos( popup_findinfo() ), 'visible' ) } )\n    let info_popup_id = popup_findinfo()\n    call assert_true( popup_getpos( info_popup_id )[ 'visible' ] )\n\n    call CheckCurrentLine( 'printf(\"\", t.that_is_a_thing' )\n    call FeedAndCheckAgain( \"\\<Tab>\", funcref( 'Check4' ) )\n\n  endfunction\n\n  function! Check4( ... )\n    \" Ensure that we didn't make an error?\n    call WaitForCompletion()\n    call CheckCompletionItemsContainsExactly( [ 'that_is_a_thing',\n                                              \\ 'this_is_a_thing' ] )\n\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 6, 'visible': 1 } )\n\n    let info_popup_id = popup_findinfo()\n    let compl = complete_info()\n    let selected = compl.items[ compl.selected ]\n    call assert_equal( 'this_is_a_thing', selected.word )\n    call assert_true( popup_getpos( info_popup_id )[ 'visible' ] )\n\n    call CheckCurrentLine( 'printf(\"\", t.this_is_a_thing' )\n\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n  call FeedAndCheckMain( 'iprintf(', funcref( 'Check' ) )\n\n  call test_override( 'ALL', 0 )\n\n  delfunc! Check\n  delfunc! Check2\n  delfunc! Check3\n  delfunc! Check4\n\n  throw 'SKIPPED: XFAIL: This test is expected to fail due to '\n        \\ .. 'https://github.com/ycm-core/YouCompleteMe/issues/3781'\n\nendfunction\n\nfunction! TearDown_Test_Semantic_Completion_Popup_With_Sig_Help_EmptyBuf()\n  set signcolumn&\n  call youcompleteme#test#setup#PopGlobal( 'ycm_filetype_whitelist' )\n  call youcompleteme#test#setup#PopGlobal( 'ycm_filetype_blacklist' )\n  call youcompleteme#test#setup#PopGlobal( 'ycm_add_preview_to_completeopt' )\nendfunction\n\nfunction! SetUp_Test_Signature_Help_Manual_HideShow()\n  imap <silent> kjkj <Plug>(YCMToggleSignatureHelp)\nendfunction\n\nfunction! Test_Signature_Help_Manual_HideShow()\n  call youcompleteme#test#setup#OpenFile(\n        \\ 'test/testdata/cpp/complete_with_sig_help.cc', {} )\n  call s:WaitForSigHelpAvailable( 'cpp' )\n\n  call setpos( '.', [ 0, 10, 1 ] )\n\n  call test_override( 'char_avail', 1 )\n\n  function! Check( ... )\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 8, 'visible': 1 } )\n\n    call FeedAndCheckAgain( 'kjkj', funcref( 'Check2' ) )\n  endfunction\n\n  function! Check2( ... )\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 8, 'visible': 0 } )\n\n    call FeedAndCheckAgain( 'kjkj', funcref( 'Check3' ) )\n  endfunction\n\n  function! Check3( ... )\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 8, 'visible': 1 } )\n\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n\n  call FeedAndCheckMain( 'iprintf(', funcref( 'Check' ) )\n\n  call test_override( 'ALL', 0 )\n\n  delfunc! Check\n  delfunc! Check2\n  delfunc! Check3\nendfunction\n\nfunction! TearDown_Test_Signature_Help_Manual_HideShow()\n  silent! iunmap kjkj\nendfunction\n\nfunction! SetUp_Test_Signature_Help_Manual_NoSigs()\n  imap <silent> kjkj <Plug>(YCMToggleSignatureHelp)\nendfunction\n\nfunction! Test_Signature_Help_Manual_NoSigs()\n  call youcompleteme#test#setup#OpenFile(\n        \\ 'test/testdata/cpp/complete_with_sig_help.cc', {} )\n  call s:WaitForSigHelpAvailable( 'cpp' )\n\n  call setpos( '.', [ 0, 10, 1 ] )\n\n  call test_override( 'char_avail', 1 )\n\n  let popup_id = 0\n\n  function! CheckSigs( ... ) closure\n    let popup_id = s:_GetSigHelpWinID()\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ s:_GetSigHelpWinID(),\n          \\ { 'line': 9, 'col': 8, 'visible': 1 } )\n\n    call FeedAndCheckAgain( ')', funcref( 'CheckSigsClosed' ) )\n  endfunction\n\n  function! CheckSigsClosed( ... ) closure\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ popup_id,\n          \\ {} )\n\n    call FeedAndCheckAgain( 'kjkj', funcref( 'CheckStillOK' ) )\n  endfunction\n\n  function! CheckStillOK( ... ) closure\n    call youcompleteme#test#popup#CheckPopupPosition(\n          \\ popup_id,\n          \\ {} )\n\n    call feedkeys( \"\\<Esc>\" )\n  endfunction\n\n\n  call FeedAndCheckMain( 'iprintf(', funcref( 'CheckSigs' ) )\n\n  call test_override( 'ALL', 0 )\n\n  delfunc! CheckSigs\n  delfunc! CheckSigsClosed\n  delfunc! CheckStillOK\nendfunction\n\nfunction! TearDown_Test_Signature_Help_Manual_NoSigs()\n  silent! iunmap kjkj\nendfunction\n"
  },
  {
    "path": "test/testdata/cpp/auto_include.cc",
    "content": "int main()\n{\n\n}\n"
  },
  {
    "path": "test/testdata/cpp/auto_include.h",
    "content": "#pragma once\n\nstruct Thing\n{\n};\n\nvoid do_a_thing( Thing thing );\nvoid do_another_thing();\n"
  },
  {
    "path": "test/testdata/cpp/auto_include_workaround.cc",
    "content": "#include \"auto_include.h\"\n\nvoid do_another_thing()\n{\n}\n\nvoid do_a_thing( Thing t )\n{\n}\n"
  },
  {
    "path": "test/testdata/cpp/complete_with_sig_help.cc",
    "content": "#include <stdio.h>\n\nstruct Test\n{\n  int this_is_a_thing; int that_is_a_thing;\n};\n\nint main() {\n  Test t;\n\n}\n"
  },
  {
    "path": "test/testdata/cpp/completion.cc",
    "content": "\nstruct PointInTime\n{\n  int point_before_time;\n  double age_of_universe;\n  char lifetime; // nobody will live > 128 years\n};\n\nstruct Line\n{\n  enum { RED_AND_YELLOW, PINK_AND_GREEN } colourOfLine;\n  double lengthOfLine;\n};\n\nstruct PointInTimeLine\n{\n  PointInTime point;\n  Line line;\n};\n\nstatic void what_is_the( PointInTimeLine* p )\n{\n  p->line.colourOfLine = Line::\n  p->line.colourOfLine = Line::PINK_AND_GREEN;\n}\n\nstatic void draw_a( Line l )\n{\n  PointInTimeLine p = { .line = l };\n  what_is_the( &p );\n}\n"
  },
  {
    "path": "test/testdata/cpp/finder_test.cc",
    "content": "#include <stdio.h>\n\nstruct Test\n{\n  int x_this_is_a_thing; int x_that_is_a_thing;\n};\n\nint main() {\n  Test t;\n\n}\n\n"
  },
  {
    "path": "test/testdata/cpp/fixit.cpp",
    "content": "#include <stdio.h>\nint main() {\n  printf(\"%s\",1);\n}\n"
  },
  {
    "path": "test/testdata/cpp/hierarchies.cc",
    "content": "int f();\n\nint g() {\n    return f() + f();\n}\n\nint h() {\n    int x = g();\n    return f() + x;\n}\n\nstruct B0 {};\nstruct B1 : B0 {};\n\nstruct D0 : B0 {};\nstruct D1 : B0, B1 {};\n"
  },
  {
    "path": "test/testdata/diagnostics/foo.cpp",
    "content": "xxx\n"
  },
  {
    "path": "test/testdata/diagnostics/foo.xml",
    "content": "blah\n"
  },
  {
    "path": "test/testdata/python/doc.py",
    "content": "# Comment\ndef Test_OneLine():\n  \"\"\"This is the one line output.\"\"\"\n  pass\n\ndef Test_MultiLine():\n  \"\"\"This is the one line output.\n  This is second line.\"\"\"\n  pass\n\ndef Main():\n  Test_OneLine()\n  Test_MultiLine()\n\n\ndef Really_Long_Method( which, has, some, param, that, take, the, whole, line ):\n  \"\"\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum egestas libero urna, vel sagittis felis condimentum in. Nulla arcu eros, aliquet vel mollis vitae, semper eu ex. Donec posuere quam et ornare sagittis. Curabitur nunc ex, fringilla quis lorem sed, dignissim congue felis. Integer vestibulum ac elit vel blandit. Nam non dui urna. Integer eu semper massa. Nullam ac elit interdum, aliquet elit nec, porttitor orci. Duis tempus justo lorem, ac fringilla ante viverra egestas. Etiam eleifend enim ac libero dapibus, quis condimentum lectus tristique. Fusce feugiat, lorem et faucibus eleifend, ipsum nisi maximus justo, at consectetur ligula leo vitae justo.\"\"\"\n  # Really long one-line\n  pass\n\n\ndef Really_Long_Method_2():\n  \"\"\"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum egestas\n  libero urna, vel sagittis felis condimentum in. Nulla arcu eros, aliquet vel\n  mollis vitae, semper eu ex. Donec posuere quam et ornare sagittis. Curabitur\n  nunc ex, fringilla quis lorem sed, dignissim congue felis. Integer vestibulum\n  ac elit vel blandit. Nam non dui urna. Integer eu semper massa. Nullam ac elit\n  interdum, aliquet elit nec, porttitor orci. Duis tempus justo lorem, ac\n  fringilla ante viverra egestas. Etiam eleifend enim ac libero dapibus, quis\n  condimentum lectus tristique. Fusce feugiat, lorem et faucibus eleifend, ipsum\n  nisi maximus justo, at consectetur ligula leo vitae justo.\"\"\"\n  # Really long one para\n  pass\n\n\ndef Moan():\n  Really_Long_Method()\n  Really_Long_Method_2()\n"
  },
  {
    "path": "test/testdata/python/test.py",
    "content": "import os; os.path.join( os.path.dirname( __file__ ) )\n"
  },
  {
    "path": "test/testdata/vim/mixed_filetype.vim",
    "content": "pyx << EOF\nimport os\nos.path.abspath(\nEOF\n\n\" vim: ft=vim.python\n"
  },
  {
    "path": "test/vimrc",
    "content": "runtime defaults.vim\nlet g:ycm_test_plugin_dir = expand( '<sfile>:p:h:h' )\nset mouse=a\nset lines=30\nset columns=80\nset shortmess+=c\n\nlet g:ycm_confirm_extra_conf=0\n\naugroup YCMTest\n  au!\n  au SwapExists * let v:swapchoice = 'e'\naugroup END\n\nlet &runtimepath = g:ycm_test_plugin_dir . ',' . &runtimepath\n\nfiletype plugin indent on\nsyntax enable\nset modeline\n"
  },
  {
    "path": "tox.ini",
    "content": "[flake8]\nignore = E111,E114,E121,E125,E126,E127,E128,E129,E131,E133,E201,E202,E203,E221,E222,E241,E251,E261,E301,E303,E402,W503,W504\nmax-complexity = 10\nmax-line-length = 80\n"
  },
  {
    "path": "update-vim-docs",
    "content": "#!/usr/bin/env bash\n\nset -e\nset -x\n\ntmpdir=$(mktemp -d)\npython3 -m venv ${tmpdir}/env\nsource ${tmpdir}/env/bin/activate\n\nif [ -z \"$1\" ]; then\n  git clone https://github.com/ycm-core/vim-tools ${tmpdir}/vim-tools\n  TOOLS=${tmpdir}/vim-tools\nelse\n  TOOLS=\"$1\"\nfi\n\npip install -r ${TOOLS}/requirements.txt\n\npushd $(dirname $0)\n  python3 ${TOOLS}/html2vimdoc.py -f youcompleteme \\\n                                   README.md \\\n                                   > doc/youcompleteme.txt\npopd\n\ndeactivate\n\nrm -rf ${tmpdir}\n"
  },
  {
    "path": "vimrc_ycm_minimal",
    "content": "\" windows default encoding is not supported\nset encoding=utf-8\n\n\" If you using neovim and python isn't loading, copy your python setup from your\n\" vimrc here:\n\"\n\" let g:python3_host_prog = '/path/to/python3/with/neovim/module'\n\"\n\" But remember that neovim is not officially supported, so please reproduce in\n\" Vim.\n\n\" Enable debugging\nlet g:ycm_keep_logfiles = 1\nlet g:ycm_log_level = 'debug'\n\n\" If the base settings don't repro, paste your existing config for YCM only,\n\" here:\n\" let g:ycm_....\n\n\" Load YCM (only)\nlet &rtp .= ',' . expand( '<sfile>:p:h' )\nfiletype plugin indent on\nsyn on\n"
  }
]