From b4fc380af5e390ca11892f9e657e653f6869c21b Mon Sep 17 00:00:00 2001 From: Yong He Date: Thu, 3 Jul 2025 15:20:23 -0700 Subject: Language Server Enhancements (#7604) * Language Server: auto-select the best candidate in signature help. * Fix constructor call highlighting + goto definition. * Add test. * format code * Improve ctor signature help. * Add tests. * Fix decl path printing for extension children. * Allow goto definition to show core module source. * c++ compile fix. --------- Co-authored-by: slangbot <186143334+slangbot@users.noreply.github.com> --- source/slang/slang-ast-print.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-ast-print.cpp') diff --git a/source/slang/slang-ast-print.cpp b/source/slang/slang-ast-print.cpp index 4b5a69f15..ee747a4c2 100644 --- a/source/slang/slang-ast-print.cpp +++ b/source/slang/slang-ast-print.cpp @@ -1129,6 +1129,7 @@ void ASTPrinter::addVal(Val* val) /* static */ void ASTPrinter::appendDeclName(Decl* decl, StringBuilder& out) { + decl = maybeGetInner(decl); if (as(decl)) { out << "init"; @@ -1231,8 +1232,7 @@ void ASTPrinter::_addDeclPathRec(const DeclRef& declRef, Index depth) } else if (auto extensionDeclRef = parentDeclRef.as()) { - ExtensionDecl* extensionDecl = as(parentDeclRef.getDecl()); - Type* type = extensionDecl->targetType.type; + Type* type = getTargetType(m_astBuilder, extensionDeclRef); if (m_optionFlags & OptionFlag::NoSpecializedExtensionTypeName) { if (auto unspecializedDeclRef = isDeclRefTypeOf(type)) @@ -1522,6 +1522,8 @@ void ASTPrinter::addDeclKindPrefix(Decl* decl) continue; if (as(modifier)) continue; + if (as(modifier)) + continue; } // Don't print out attributes. if (as(modifier)) -- cgit v1.2.3