From 37217cf1b921a2a6e128b6134518912f0bd57f62 Mon Sep 17 00:00:00 2001 From: Mel Date: Mon, 30 Jun 2025 23:15:23 +0200 Subject: Factor out translation unit includes to seperate header This allows both the usual build compiler and an LSP server like `clangd` to correctly locate symbols throughout every subunit. Signed-off-by: Mel --- boot/catboot.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 boot/catboot.h (limited to 'boot/catboot.h') diff --git a/boot/catboot.h b/boot/catboot.h new file mode 100644 index 0000000..4c40676 --- /dev/null +++ b/boot/catboot.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2025, Mel G. + * + * SPDX-License-Identifier: MPL-2.0 + */ + +#pragma once + +// include all partial translation units, for correct language server behaviour +// despite the fact that single translation units are not yet supported. + +// when included in the root of the translation unit, this will compile the whole project, +// however if included in a partial subunit, the `#pragma once` in the subunit will prevent +// multiple inclusions of the itself, only adding other files, thus allowing for an LSP like `clang` +// to find the definitions of all other functions and types in the project. +#include "common.c" +#include "lex.c" +#include "tree.c" +#include "parse.c" +#include "visit.c" -- cgit 1.4.1