дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-12-03 16:51:16 +02:00
In an Xcode project plain clangd finds no compile flags, so headers on the target's search paths and the generated <Module>-Swift.h were not found. C, C++, Objective-C and Objective-C++ now list sourcekit-lsp before clangd with require-root-marker on buildServer.json and replaces clangd: with an Xcode BSP config sourcekit-lsp serves them with the build server's flags; without one, or without sourcekit-lsp, clangd serves as before. Closes #7022 Co-authored-by: wildcatDownstairs <[email protected]>
45 рядки
1.6 KiB
TOML
45 рядки
1.6 KiB
TOML
id = "cpp"
|
||
name = "C++"
|
||
extensions = ["cpp", "cc", "cxx", "c++", "hpp", "hh", "hxx", "h++", "ipp", "tpp", "inl", "ixx", "cppm"]
|
||
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"
|