From cfd08da1036cf72b8e6c6f661260b968f79667e7 Mon Sep 17 00:00:00 2001 From: ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> Date: Thu, 14 Aug 2025 14:43:42 -0700 Subject: Clean up `natvis` and use fiddle to generate info needed for `.natvis` debugging (#8192) fixes: #8188 Changes: * Fix Indentation * Add a visualizer for `NodeBase` based on changes to `slang-fiddle` --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- tools/slang-fiddle/slang-fiddle-scrape.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'tools') diff --git a/tools/slang-fiddle/slang-fiddle-scrape.cpp b/tools/slang-fiddle/slang-fiddle-scrape.cpp index c3b83527c..4fe80d5b2 100644 --- a/tools/slang-fiddle/slang-fiddle-scrape.cpp +++ b/tools/slang-fiddle/slang-fiddle-scrape.cpp @@ -1816,6 +1816,30 @@ int _indexVal(lua_State* L) lua_pushboolean(L, decl->findModifier() != nullptr); return 1; } + if (strcmp(name, "getDebugVisType") == 0) + { + auto aggTypeDecl = as(decl); + if (aggTypeDecl) + { + if (aggTypeDecl->isSubTypeOf("Decl")) + lua_pushstring(L, "SyntaxClassInfoDebugVisType::Decl"); + else if (aggTypeDecl->isSubTypeOf("Expr")) + lua_pushstring(L, "SyntaxClassInfoDebugVisType::Expr"); + else if (aggTypeDecl->isSubTypeOf("Modifier")) + lua_pushstring(L, "SyntaxClassInfoDebugVisType::Modifier"); + else if (aggTypeDecl->isSubTypeOf("Stmt")) + lua_pushstring(L, "SyntaxClassInfoDebugVisType::Stmt"); + else if (aggTypeDecl->isSubTypeOf("Val")) + lua_pushstring(L, "SyntaxClassInfoDebugVisType::Val"); + else if (aggTypeDecl->isSubTypeOf("Scope")) + lua_pushstring(L, "SyntaxClassInfoDebugVisType::Scope"); + else + lua_pushstring(L, "SyntaxClassInfoDebugVisType::Unknown"); + } + else + lua_pushstring(L, "SyntaxClassInfoDebugVisType::Unknown"); + return 1; + } } if (auto varDecl = as(val)) -- cgit v1.2.3