summaryrefslogtreecommitdiff
path: root/source/slang/slang-check-expr.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-12-06 15:52:02 -0800
committerGitHub <noreply@github.com>2023-12-06 15:52:02 -0800
commit8102e5ee81db177372bb90188c65d003a4907aa4 (patch)
tree2ea145d7a58abe395e1765009bc943d97933104b /source/slang/slang-check-expr.cpp
parent11111e5733b189127dc2c4934d67693b9bc6e764 (diff)
Change default visibility of interface members and update docs. (#3381)
* Update behavior around interfaces and docs. * Update toc --------- Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'source/slang/slang-check-expr.cpp')
-rw-r--r--source/slang/slang-check-expr.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/slang/slang-check-expr.cpp b/source/slang/slang-check-expr.cpp
index dd868f70c..9d1898cf5 100644
--- a/source/slang/slang-check-expr.cpp
+++ b/source/slang/slang-check-expr.cpp
@@ -841,6 +841,12 @@ namespace Slang
else if (as<PrivateModifier>(modifier))
return DeclVisibility::Private;
}
+
+ // Interface members will always have the same visibility as the interface itself.
+ if (auto interfaceDecl = findParentInterfaceDecl(decl))
+ {
+ return getDeclVisibility(interfaceDecl);
+ }
if (auto parentModule = getModuleDecl(decl))
return parentModule->isInLegacyLanguage ? DeclVisibility::Public : DeclVisibility::Internal;
@@ -919,6 +925,13 @@ namespace Slang
{
getSink()->diagnose(loc, Diagnostics::declIsNotVisible, lookupResult.item.declRef);
outDiagnosed = true;
+
+ if (getShared()->isInLanguageServer())
+ {
+ // When in language server mode, return the unfiltered result so we can still
+ // provide language service around it.
+ return lookupResult;
+ }
}
return result;
}