From 2b03f5a15edf2afe16e2b463d2abe0e5fef0c09e Mon Sep 17 00:00:00 2001 From: Nathan Ridge Date: Wed, 30 Aug 2023 01:14:38 -0400 Subject: [PATCH] Document the forceRebuild extension --- extensions.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/extensions.md b/extensions.md index b0ef27a..ee8dd94 100644 --- a/extensions.md +++ b/extensions.md @@ -88,6 +88,22 @@ at a particular revision. - if unset, diagnostics will be produced for this version or some subsequent one in a bounded amount of time. +## Force AST rebuild +{:.v11} + +Clangd makes an effort to invalidate ASTs when dependent files change, but +there are some changes it does not detect, for example when an unresolved +include becomes resolved because the header file has been created. + +If the client knows a rebuild will be necessary (e.g. because it just +generated the missing header), it can use this extension to force clangd to +do a rebuild. + +**New property of `textDocument/didChange` request**: `forceRebuild: bool` + - If specified and true, clangd will rebuild the file's AST, including + for the preamble region. Warning: this is slow compared to incremental + rebuilds. + ## Diagnostic categories {:.v8}