Файли
openidea/languages/cpp.toml
T
a2499123744-delтаa2499123744-del d6d6fd0909 fix(language): detect C++ standard headers from their first line (#7567)
Extensionless headers carrying an Emacs -*- C++ -*- mode line (libstdc++, libc++) or an MSVC "// <name> standard header" comment open as C++ even outside a known toolchain include tree, complementing the include-tree detection from #7547. Known extensions and shebangs keep precedence.

Co-authored-by: a2499123744-del <[email protected]>
2026-12-03 00:26:43 +08:00

46 рядки
1.7 KiB
TOML
Неформатований Анотація Історія

Цей файл містить неоднозначні символи Юнікоду
Цей файл містить символи Юнікоду, які можна сплутати з іншими символами. Якщо ви вважаєте, що це зроблено навмисно, можете сміливо ігнорувати це попередження. Щоб показати їх, скористайтеся кнопкою Escape.
id = "cpp"
name = "C++"
extensions = ["cpp", "cc", "cxx", "c++", "hpp", "hh", "hxx", "h++", "ipp", "tpp", "inl", "ixx", "cppm"]
first-line = "^\\s*(?:(?://|/\\*).*-\\*-\\s*(?:[Mm][Oo][Dd][Ee]\\s*:\\s*)?[Cc]\\+\\+\\s*(?:;.*)?-\\*-|//\\s*\\w+\\s+standard\\s+header(?:\\s*\\(core\\))?\\s*$)"
line-comment = "//"
block-comment = ["/*", "*/"]
indent = { tab-size = 4, insert-spaces = true }
ui-mode = "C++"
tree-sitter = "cpp"
scratch-template = '''
#include <iostream>
int main() {
$END$
return 0;
}
'''
# Rainbow brackets › angle: editor syntax nodes whose `<` `>` pair up (never comparisons).
[rainbow-brackets]
angle = ["TemplateArgumentList", "TemplateParameterList"]
[[language-servers]]
# Xcode projects with a BSP config: plain clangd finds no compile flags there, while
# sourcekit-lsp reads them through the build server and serves C-family files with its
# own clangd. Only `buildServer.json` (xcode-build-server, sourcekit-xcode-bsp): a bare
# `.bsp` directory also belongs to sbt, Mill and Bazel.
name = "sourcekit-lsp"
command = "sourcekit-lsp"
root-markers = ["buildServer.json"]
require-root-marker = true
replaces = ["clangd"]
install-hint = "Ships with the Swift toolchain / Xcode (xcrun sourcekit-lsp); https://www.swift.org/install"
[[language-servers]]
name = "clangd"
command = "clangd"
args = ["--background-index", "--header-insertion=never"]
root-markers = ["compile_commands.json", "compile_flags.txt", ".clangd", "CMakeLists.txt", "meson.build", "Makefile"]
install-hint = "Install clangd (LLVM): brew install llvm, apt install clangd, or https://clangd.llvm.org/installation"
[debugger]
adapter = "lldb-dap"
command = "lldb-dap"
install-hint = "Install LLVM's lldb-dap (brew install llvm), or on macOS use the one found by xcrun -f lldb-dap"