Skip to content

Commit eeabe2c

Browse files
committed
Consider also '#include' lines to trigger re-builds
1 parent c2e6b69 commit eeabe2c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: handler/handler.go

+7-1
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,11 @@ func (handler *InoHandler) refreshCppDocumentSymbols(prefix string) error {
606606
symbols = symbols[:i]
607607

608608
canary := ""
609+
for _, line := range strings.Split(handler.sketchMapper.CppText.Text, "\n") {
610+
if strings.Contains(line, "#include <") {
611+
canary += line
612+
}
613+
}
609614
for _, symbol := range symbols {
610615
log.Printf(prefix+" symbol: %s %s %s", symbol.Kind, symbol.Name, symbol.Range)
611616
if symbolText, err := textutils.ExtractRange(handler.sketchMapper.CppText.Text, symbol.Range); err != nil {
@@ -1603,7 +1608,8 @@ func (handler *InoHandler) FromClangd(ctx context.Context, connection *jsonrpc2.
16031608
for _, diag := range inoDiag.Diagnostics {
16041609
if diag.Code == "undeclared_var_use_suggest" ||
16051610
diag.Code == "undeclared_var_use" ||
1606-
diag.Code == "ovl_no_viable_function_in_call" {
1611+
diag.Code == "ovl_no_viable_function_in_call" ||
1612+
diag.Code == "pp_file_not_found" {
16071613
handler.buildSketchSymbolsCheck = true
16081614
}
16091615
}

0 commit comments

Comments
 (0)