diff options
| author | Yong He <yonghe@outlook.com> | 2023-04-26 22:40:06 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-26 22:40:06 -0700 |
| commit | 7be108c379ccc7da3f46b30a2b5917104155d52b (patch) | |
| tree | b38b6d5483ba63b18d38c282c06dd55ff9c188ea /source/slang/slang-syntax.cpp | |
| parent | 3acbe8145c60f4d1e7a180b4602a94269a489df5 (diff) | |
Intellisense: show info on decl kind and differentiability. (#2847)
Diffstat (limited to 'source/slang/slang-syntax.cpp')
| -rw-r--r-- | source/slang/slang-syntax.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/slang/slang-syntax.cpp b/source/slang/slang-syntax.cpp index 11729800c..606c77096 100644 --- a/source/slang/slang-syntax.cpp +++ b/source/slang/slang-syntax.cpp @@ -1413,6 +1413,17 @@ Decl* getParentDecl(Decl* decl) return decl; } +Decl* getParentFunc(Decl* decl) +{ + while (decl) + { + if (as<FunctionDeclBase>(decl)) + return decl; + decl = decl->parentDecl; + } + return nullptr; +} + static const ImageFormatInfo kImageFormatInfos[] = { #define SLANG_IMAGE_FORMAT_INFO(TYPE, COUNT, SIZE) SLANG_SCALAR_TYPE_##TYPE, uint8_t(COUNT), uint8_t(SIZE) |
