mirror-llvm-project/clang-tools-extra/clangd
Corentin Jabot e24eb10725
[Clang] Treat line directives as header names. (#211512)
We treated line directives as being unevaluated string literal. However
- The standard has no such restriction - or rather the standard has
different, unclear restriction (https://wg21.link/CWG2693)
- Because of Windows paths, it's common for "C:\foo\bar" to be used, and
these should not form escape sequences.

To remain consistent with other implementations, we do not allow `#line
1 <>` at this time. We do however support `#line 1 ""` to avoid a
breaking change.

Fixes a regression introduced by #201413
2026-07-29 19:04:17 +02:00
..
benchmarks
fuzzer
index [clangd][remote] Fix SmallVector assertion in uriToRelativePath for Windows paths (#208830) 2026-07-11 00:02:46 +03:00
indexer [clangd] Unify IndexAction callbacks into one (#178132) 2026-01-28 13:23:42 -05:00
quality
refactor Revert "[clang] Reland: fix getTemplateInstantiationArgs (#208285)" (#208426) 2026-07-09 12:11:45 +00:00
remap [clangd] Add background index path remapping tool (#185482) 2026-03-24 11:21:06 -04:00
support [clangd] Use plaintext newline handling for escaped markdown hover style (#185197) 2026-07-02 00:04:50 +02:00
test [clang-tools-extra] Drop option to use external shell 2026-07-14 20:30:03 -07:00
tool [clangd] Log environment variables that influence compilation at startup (#204990) 2026-06-22 09:41:22 -04:00
unittests [Clang] Treat line directives as header names. (#211512) 2026-07-29 19:04:17 +02:00
xpc
.clang-format-ignore [CI] Ignore TidyFastChecks.inc for formatter CI. NFC. (#196682) 2026-05-09 17:25:40 +08:00
AST.cpp [clangd] Navigate go-to-definition through forwarding wrappers to the constructor (#199480) 2026-06-26 11:26:31 +02:00
AST.h [clangd] Navigate go-to-definition through forwarding wrappers to the constructor (#199480) 2026-06-26 11:26:31 +02:00
ASTSignals.cpp
ASTSignals.h
ClangdLSPServer.cpp [clangd][nfc] Avoid type erasure for local recursive callbacks (#203042) 2026-06-16 10:09:03 +03:00
ClangdLSPServer.h [clangd] Add support for textDocument/rangesFormatting (#141208) 2025-05-26 10:08:18 +02:00
ClangdServer.cpp [clangd][modules] Provide correct context to ModulesBuilder::hasRequiredModules() call (#201419) 2026-06-05 09:47:24 +03:00
ClangdServer.h [clangd][modules] Provide correct context to ModulesBuilder::hasRequiredModules() call (#201419) 2026-06-05 09:47:24 +03:00
CMakeLists.txt [clangd][Support] Outline LSP payload decode errors (#203121) 2026-07-17 08:38:19 +03:00
CodeComplete.cpp [clangd] Respect ArgumentLists for struct templates (#212094) 2026-07-27 03:07:00 +02:00
CodeComplete.h [clangd] Add InsertReplaceEdit for code completion (#187623) 2026-05-10 02:32:42 +02:00
CodeCompletionStrings.cpp [clangd] Fix unknown doxygen command parsing in parameter documentation (#202121) 2026-06-25 14:21:45 +02:00
CodeCompletionStrings.h
CollectMacros.cpp
CollectMacros.h
CompileCommands.cpp [Allocator] Drop RedZoneSize (non-sanitizer) and BytesAllocated members (#205711) 2026-06-28 02:15:56 +00:00
CompileCommands.h
Compiler.cpp [Clang] Refactor and consolidate color diagnostic handling (#202441) 2026-06-29 15:30:10 -05:00
Compiler.h [clangd] Introduce --skip-preamble-build command line option (#189284) 2026-04-16 10:06:09 +03:00
Config.cpp
Config.h [clang][clang-tools-extra] Remove unused DenseMapInfo::getEmptyKey (#201987) 2026-06-06 13:38:23 -07:00
ConfigCompile.cpp [clangd] Add option to fuzzy-match macros in code-complete (#169880) 2025-12-14 03:29:53 -05:00
ConfigFragment.h [clangd] Add option to fuzzy-match macros in code-complete (#169880) 2025-12-14 03:29:53 -05:00
ConfigProvider.cpp
ConfigProvider.h
ConfigYAML.cpp [clangd] Use unique_function for config handlers (#203008) 2026-07-15 01:58:57 -04:00
DecisionForest.cpp
Diagnostics.cpp [clang] make concept normalization a SFINAE context (#197356) 2026-05-13 16:36:28 -03:00
Diagnostics.h [clangd] Support suppressions for driver diagnostics (#182912) 2026-03-18 15:27:45 +03:00
DraftStore.cpp
DraftStore.h
DumpAST.cpp [clangd] Guard against null TemplateName in DumpVisitor (#181554) 2026-02-20 01:55:09 +03:00
DumpAST.h
ExpectedTypes.cpp [clang][Index][NFC] Carve out USRGeneration from clangIndex (#185499) 2026-03-10 10:49:12 +00:00
ExpectedTypes.h [clang] NFC: reintroduce clang/include/clang/AST/Type.h (#155050) 2025-08-27 13:11:34 -03:00
Feature.cpp
Feature.h
FeatureModule.cpp Reland "[clangd] Add feature modules registry" (#154836) 2025-09-21 12:37:33 +03:00
FeatureModule.h Reland "[clangd] Add feature modules registry" (#154836) 2025-09-21 12:37:33 +03:00
Features.inc.in
FileDistance.cpp [clang-tools-extra] Remove redundant declarations (NFC) (#166894) 2025-11-07 07:58:32 -08:00
FileDistance.h
FindSymbols.cpp [clang][TypePrinter] Introduce AnonymousTagMode enum (#182317) 2026-02-19 22:50:25 +00:00
FindSymbols.h [clangd] Add support for additional symbol tags proposed for LSP 3.18 (#167536) 2026-01-22 22:00:15 -05:00
FindTarget.cpp [clangd] Resolve __builtin_offsetof designator components precisely (#194407) 2026-04-29 07:39:19 +03:00
FindTarget.h
Format.cpp
Format.h
FS.cpp
FS.h
FuzzyMatch.cpp [clangd] Fix out-of-bounds read in packedLookup (#197021) 2026-05-11 21:54:24 +02:00
FuzzyMatch.h
GlobalCompilationDatabase.cpp [NFC] [clangd] [C++20] [Modules] Rename and move scanningProjectModules (#193128) 2026-04-21 02:28:06 +00:00
GlobalCompilationDatabase.h [clangd] Add a (currently hidden) --strong-workspace-mode flag (#172160) 2025-12-14 03:24:18 -05:00
Headers.cpp [clangd] Use resolved path when checking AngledHeaders/QuotedHeaders in IncludeInserter (#148371) 2025-08-08 03:57:28 -04:00
Headers.h [clang][clang-tools-extra] Remove unused DenseMapInfo::getEmptyKey (#201987) 2026-06-06 13:38:23 -07:00
HeaderSourceSwitch.cpp [clangd][nfc] Avoid type erasure for local recursive callbacks (#203042) 2026-06-16 10:09:03 +03:00
HeaderSourceSwitch.h
Hover.cpp [clangd] Show comment of field on hover over accessor (#182738) 2026-03-13 21:31:15 +01:00
Hover.h [clangd] introduce doxygen parser (#150790) 2025-08-08 16:07:36 +02:00
IncludeCleaner.cpp Follow style configuration in clangd when inserting missing includes (#140594) 2025-06-05 11:36:01 +02:00
IncludeCleaner.h Follow style configuration in clangd when inserting missing includes (#140594) 2025-06-05 11:36:01 +02:00
IncludeFixer.cpp Remove unused variables in the monorepo (#204994) 2026-06-24 11:50:30 +02:00
IncludeFixer.h [clang] NFC: reintroduce clang/include/clang/AST/Type.h (#155050) 2025-08-27 13:11:34 -03:00
InlayHints.cpp [clangd] Handle dependent call to function with explicit object parameter in InlayHintVisitor (#201264) 2026-06-03 00:46:45 -04:00
InlayHints.h [clangd] Improve BlockEnd inlayhint presentation (#136106) 2025-04-23 02:36:48 -04:00
JSONTransport.cpp
LSPBinder.cpp [clangd][Support] Outline LSP payload decode errors (#203121) 2026-07-17 08:38:19 +03:00
LSPBinder.h [clangd][Support] Outline LSP payload decode errors (#203121) 2026-07-17 08:38:19 +03:00
ModulesBuilder.cpp [clangd] Invalidate preamble when new module imports are added (#199460) 2026-07-03 08:57:39 +08:00
ModulesBuilder.h [clangd] Invalidate preamble when new module imports are added (#199460) 2026-07-03 08:57:39 +08:00
ParsedAST.cpp [clangd] Replay macro definitions from preamble for clang-tidy checks (#202495) 2026-06-17 11:00:11 +03:00
ParsedAST.h [clangd] Find references to constructors called indirectly via a forwarding function (#169742) 2025-12-25 00:37:39 -05:00
PathMapping.cpp
PathMapping.h
Preamble.cpp [clangd] Invalidate preamble when new module imports are added (#199460) 2026-07-03 08:57:39 +08:00
Preamble.h [clangd] Keep ModuleCache alive for captured preamble AST (#203952) 2026-06-15 14:03:53 -04:00
ProjectModules.cpp [NFC] [clangd] [C++20] [Modules] Fix false duplicate module warning for equivalent paths (#199343) 2026-05-26 06:05:17 +00:00
ProjectModules.h [NFC] [clangd] [C++20] [Modules] Introduce ProjectModules::getModuleNameState interface (#193133) 2026-04-21 03:23:19 +00:00
Protocol.cpp [clangd][nfc] Avoid type erasure for local recursive callbacks (#203042) 2026-06-16 10:09:03 +03:00
Protocol.h [clang][clang-tools-extra] Remove unused DenseMapInfo::getEmptyKey (#201987) 2026-06-06 13:38:23 -07:00
Quality.cpp [clangd] extend and rearrange doxygen hover documentation (#152918) 2025-08-25 17:57:46 +00:00
Quality.h
README.md
RIFF.cpp
RIFF.h
Selection.cpp [clang] Add missing type source info of decltype specifier in destructor call to AST (#197680) 2026-05-26 22:03:32 +08:00
Selection.h
SemanticHighlighting.cpp [clangd] highlight import and export keywords for C++20 modules (#204511) 2026-07-15 16:44:02 +03:00
SemanticHighlighting.h
SemanticSelection.cpp [clangd] Remove the unused AST-based code folding Implementation. (#166189) 2025-12-09 13:33:48 +01:00
SemanticSelection.h [clangd] Remove the unused AST-based code folding Implementation. (#166189) 2025-12-09 13:33:48 +01:00
SourceCode.cpp [clangd] Find better insertion locations in DefineOutline tweak (#128164) 2025-11-14 13:46:36 +01:00
SourceCode.h [clangd] Find better insertion locations in DefineOutline tweak (#128164) 2025-11-14 13:46:36 +01:00
SymbolDocumentation.cpp [clangd] Fix unknown doxygen command parsing in parameter documentation (#202121) 2026-06-25 14:21:45 +02:00
SymbolDocumentation.h [clangd] Fix unknown doxygen command parsing in parameter documentation (#202121) 2026-06-25 14:21:45 +02:00
SystemIncludeExtractor.cpp [clang][clang-tools-extra] Remove unused DenseMapInfo::getEmptyKey (#201987) 2026-06-06 13:38:23 -07:00
TidyFastChecks.inc [clangd] Add llvm-formatv-string to TidyFastChecks (#197829) 2026-05-16 07:09:49 -07:00
TidyFastChecks.py
TidyProvider.cpp [clang-tidy] Remove hicpp modules [2/4] (#196870) 2026-05-11 08:28:36 +00:00
TidyProvider.h
Transport.h
TUScheduler.cpp [LLVM][ADT] Migrate users of make_scope_exit to CTAD (#174030) 2026-01-02 20:42:56 -08:00
TUScheduler.h
URI.cpp
URI.h
XRefs.cpp [clangd] Navigate go-to-definition through forwarding wrappers to the constructor (#199480) 2026-06-26 11:26:31 +02:00
XRefs.h

clangd

clangd is a language server, and provides C++ IDE features to editors. This is not its documentation.

Communication channels

If you have any questions or feedback, you can reach community and developers through one of these channels:

Building and testing clangd

For a minimal setup on building clangd:

  • Clone the LLVM repo to $LLVM_ROOT.

  • Create a build directory, for example at $LLVM_ROOT/build.

  • Inside the build directory run: cmake $LLVM_ROOT/llvm/ -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra".

    • We suggest building in Release mode as building DEBUG binaries requires considerably more resources. You can check Building LLVM with CMake documentation for more details about cmake flags.
    • In addition to that using Ninja as a generator rather than default make is preferred. To do that consider passing -G Ninja to cmake invocation.
    • Finally, you can turn on assertions via -DLLVM_ENABLE_ASSERTS=On.
  • Afterwards you can build clangd with cmake --build $LLVM_ROOT/build --target clangd, similarly run tests by changing target to check-clangd.