From 0c64995ea28febcc7d38e1519da8d93391ce2e7d Mon Sep 17 00:00:00 2001 From: Yong He Date: Tue, 7 Jun 2022 14:10:49 -0700 Subject: Major language server features. (#2264) * Major language server features. * Include slangd in binary release. * Fix compiler issues. * Fix compiler error. * Completion resolve. * Various improvements. * Update diagnostic test expected output. * Bug fix for source locations. * Adjust diagnostic update frequency. * Update github actions to store artifacts. * Fix infinite parser loop. * Fix parser recovery. * Fix parser recovery. * Update test. * Fix test. * Disable IR gen for language server. * Allow commit characters in auto completion. * Fix lookup for invoke exprs. * More parser robustness fixes. * update solution file Co-authored-by: Yong He --- source/slang/slang-ast-expr.h | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'source/slang/slang-ast-expr.h') diff --git a/source/slang/slang-ast-expr.h b/source/slang/slang-ast-expr.h index f2fae7ced..647eb37a4 100644 --- a/source/slang/slang-ast-expr.h +++ b/source/slang/slang-ast-expr.h @@ -7,8 +7,13 @@ namespace Slang { // Syntax class definitions for expressions. - -// Base class for expressions that will reference declarations +// + // A placeholder for where an Expr is expected but is missing from source. +class IncompleteExpr : public Expr +{ + SLANG_AST_CLASS(IncompleteExpr) +}; + // Base class for expressions that will reference declarations class DeclRefExpr: public Expr { SLANG_ABSTRACT_AST_CLASS(DeclRefExpr) @@ -20,6 +25,9 @@ class DeclRefExpr: public Expr // The name of the symbol being referenced Name* name = nullptr; + // The original expr before DeclRef resolution. + Expr* originalExpr = nullptr; + SLANG_UNREFLECTED // The scope in which to perform lookup Scope* scope = nullptr; @@ -137,6 +145,13 @@ class AppExprBase : public ExprWithArgsBase SLANG_ABSTRACT_AST_CLASS(AppExprBase) Expr* functionExpr = nullptr; + + // The original function expr before overload resolution. + Expr* originalFunctionExpr = nullptr; + + // The source location of `(`, `)`, and `,` that marks the start/end of the application op and + // each argument expr. This info is used by language server. + List argumentDelimeterLocs; }; class InvokeExpr: public AppExprBase @@ -196,6 +211,7 @@ class MemberExpr: public DeclRefExpr { SLANG_AST_CLASS(MemberExpr) Expr* baseExpression = nullptr; + SourceLoc memberOperatorLoc; }; // Member looked up on a type, rather than a value @@ -203,6 +219,7 @@ class StaticMemberExpr: public DeclRefExpr { SLANG_AST_CLASS(StaticMemberExpr) Expr* baseExpression = nullptr; + SourceLoc memberOperatorLoc; }; struct MatrixCoord @@ -220,6 +237,7 @@ class MatrixSwizzleExpr : public Expr Expr* base = nullptr; int elementCount; MatrixCoord elementCoords[4]; + SourceLoc memberOpLoc; }; class SwizzleExpr: public Expr @@ -228,6 +246,7 @@ class SwizzleExpr: public Expr Expr* base = nullptr; int elementCount; int elementIndices[4]; + SourceLoc memberOpLoc; }; // A dereference of a pointer or pointer-like type -- cgit v1.2.3