@@ -1,5 +1,6 @@
|
||||
build/
|
||||
.clangd
|
||||
.nvim.lua
|
||||
.clang-format
|
||||
pyrightconfig.json
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ COMMANDS = (
|
||||
"test",
|
||||
"package",
|
||||
"lsp",
|
||||
"clangd",
|
||||
)
|
||||
COMMON_DIR = pathlib.Path("build") / "build_common"
|
||||
TOOLS_DIR = pathlib.Path("build") / "build_tools"
|
||||
@@ -56,6 +57,7 @@ def runtime_ready(root):
|
||||
return (
|
||||
(root / TOOLS_DIR / "configure.py").is_file()
|
||||
and (root / TOOLS_DIR / "lsp.py").is_file()
|
||||
and (root / TOOLS_DIR / "clangd.py").is_file()
|
||||
and (root / RUNTIME_DIR / "modulus" / "cli.py").is_file()
|
||||
and (root / RUNTIME_DIR / "modulus" / "export.py").is_file()
|
||||
)
|
||||
@@ -338,6 +340,11 @@ def ensure_runtime(root):
|
||||
|
||||
def delegate(command, argv):
|
||||
root = repo_root()
|
||||
if command == "clangd":
|
||||
if not runtime_ready(root):
|
||||
print("Modulus clangd tooling is missing; run ./modulus.py configure first", file=sys.stderr)
|
||||
return 1
|
||||
else:
|
||||
ensure_runtime(root)
|
||||
sys.path.insert(0, str(root / RUNTIME_DIR))
|
||||
import modulus.cli
|
||||
|
||||
Reference in New Issue
Block a user