diff options
| author | ArielG-NV <159081215+ArielG-NV@users.noreply.github.com> | 2025-08-14 14:43:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-14 21:43:42 +0000 |
| commit | cfd08da1036cf72b8e6c6f661260b968f79667e7 (patch) | |
| tree | f4f02a97a2499eb11254869f37c77e3d674673d2 /tools | |
| parent | dd06524f523cdac9c753801ce9c3992f66ae5576 (diff) | |
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>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/slang-fiddle/slang-fiddle-scrape.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
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<AbstractModifier>() != nullptr); return 1; } + if (strcmp(name, "getDebugVisType") == 0) + { + auto aggTypeDecl = as<AggTypeDecl>(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<VarDecl>(val)) |
