Skip to content

v0.2.7-beta.12

Pre-release
Pre-release
Compare
Choose a tag to compare
@github-actions github-actions released this 25 Jan 00:19

Fixed

  • Fixed Minify renaming variables that were being used incorrectly.
  • Fixed Minify not adding a leading _ for certain variable names.
  • Fixed Minify adding prefixes for variable names that were already renamed.

Changed

  • [Breaking] The following were changed as a result of the move to EqualsValuesClauseSyntax:
    • Replaced EqualsToken and Values in AssignmentStatementSyntax by EqualsValues;
    • Replaced EqualsToken and Values in LocalVariableDeclarationStatementSyntax by EqualsValues.
  • [Breaking] SyntaxFactory methods will now throw exceptions if the lists provided to them do not have the minimum amount of items required.
  • [Breaking] NamingStrategy was changed to receive a list of IScopes instead of a single one.
    The received scopes are the scopes where the variable is accessed in.
  • [Breaking] The following strategies were changed as a result of the above:
    • NamingStrategies.Alphabetic;
    • NamingStrategies.Numeric;
    • NamingStrategies.ZeroWidth.

Removed

  • [Breaking] The following were removed as a result of the move to EqualsValuesClauseSyntax:
    • AssignmentStatementSyntax.EqualsToken;
    • AssignmentStatementSyntax.Values;
    • AssignmentStatementSyntax.Update(SeparatedSyntaxList<PrefixExpressionSyntax> variables, SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values, SyntaxToken semicolonToken);
    • AssignmentStatementSyntax.AddValues(params ExpressionSyntax[] items);
    • AssignmentStatementSyntax.WithEqualsToken(SyntaxToken equalsToken);
    • AssignmentStatementSyntax.WithValues(SeparatedSyntaxList<ExpressionSyntax> values);
    • LocalVariableDeclarationStatementSyntax.AddValues(params ExpressionSyntax[] items);
    • LocalVariableDeclarationStatementSyntax.EqualsToken;
    • LocalVariableDeclarationStatementSyntax.Update(SyntaxToken localKeyword, SeparatedSyntaxList<IdentifierNameSyntax> names, SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values, SyntaxToken semicolonToken);
    • LocalVariableDeclarationStatementSyntax.Values;
    • LocalVariableDeclarationStatementSyntax.WithEqualsToken(SyntaxToken equalsToken);
    • LocalVariableDeclarationStatementSyntax.WithValues(SeparatedSyntaxList<ExpressionSyntax> values);
    • SyntaxFactory.AssignmentStatement();
    • SyntaxFactory.AssignmentStatement(SeparatedSyntaxList<PrefixExpressionSyntax> variables, SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values, SyntaxToken semicolonToken);
    • SyntaxFactory.LocalVariableDeclarationStatement();
    • SyntaxFactory.LocalVariableDeclarationStatement(SeparatedSyntaxList<IdentifierNameSyntax> names, SeparatedSyntaxList<ExpressionSyntax> values);
    • SyntaxFactory.LocalVariableDeclarationStatement(SyntaxToken localKeyword, SeparatedSyntaxList<IdentifierNameSyntax> names, SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values, SyntaxToken semicolonToken).
  • [Breaking] The following were removed as a result of the MinCount fix for Syntax.xml:
    • SyntaxFactory.GenericForStatement(StatementListSyntax? body = null).

Added

  • The following were added as a result of the move to EqualsValuesClauseSyntax:
    • SyntaxKind.EqualsValuesClause;
    • EqualsValuesClauseSyntax;
    • EqualsValuesClauseSyntax.EqualsToken;
    • EqualsValuesClauseSyntax.Values;
    • EqualsValuesClauseSyntax.Update(SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values);
    • EqualsValuesClauseSyntax.WithEqualsToken(SyntaxToken equalsToken);
    • EqualsValuesClauseSyntax.AddValues(params ExpressionSyntax[] items);
    • EqualsValuesClauseSyntax.WithValues(SeparatedSyntaxList<ExpressionSyntax> values);
    • EqualsValuesClauseSyntax.Accept(LuaSyntaxVisitor visitor);
    • EqualsValuesClauseSyntax.Accept<TResult>(LuaSyntaxVisitor<TResult> visitor);
    • AssignmentStatementSyntax.EqualsValues;
    • AssignmentStatementSyntax.Update(SeparatedSyntaxList<PrefixExpressionSyntax> variables, EqualsValuesClauseSyntax equalsValues, SyntaxToken semicolonToken);
    • AssignmentStatementSyntax.WithEqualsValues(EqualsValuesClauseSyntax equalsValues);
    • LocalVariableDeclarationStatementSyntax.EqualsValues;
    • LocalVariableDeclarationStatementSyntax.Update(SyntaxToken localKeyword, SeparatedSyntaxList<IdentifierNameSyntax> names, EqualsValuesClauseSyntax? equalsValues, SyntaxToken semicolonToken);
    • LocalVariableDeclarationStatementSyntax.WithEqualsValues(Loretta.CodeAnalysis.Lua.Syntax.EqualsValuesClauseSyntax? equalsValues);
    • SyntaxFactory.AssignmentStatement(SeparatedSyntaxList<PrefixExpressionSyntax> variables, EqualsValuesClauseSyntax equalsValues, SyntaxToken semicolonToken);
    • SyntaxFactory.AssignmentStatement(SeparatedSyntaxList<PrefixExpressionSyntax> variables, EqualsValuesClauseSyntax equalsValues);
    • SyntaxFactory.EqualsValuesClause(SyntaxToken equalsToken, SeparatedSyntaxList<ExpressionSyntax> values);
    • SyntaxFactory.EqualsValuesClause(SeparatedSyntaxList<ExpressionSyntax> values);
    • SyntaxFactory.LocalVariableDeclarationStatement(SyntaxToken localKeyword, SeparatedSyntaxList<IdentifierNameSyntax> names, EqualsValuesClauseSyntax? equalsValues, SyntaxToken semicolonToken);
    • SyntaxFactory.LocalVariableDeclarationStatement(SeparatedSyntaxList<IdentifierNameSyntax> names, EqualsValuesClauseSyntax? equalsValues);
    • SyntaxFactory.LocalVariableDeclarationStatement(SeparatedSyntaxList<IdentifierNameSyntax> names);
    • LuaSyntaxVisitor.VisitEqualsValuesClause(EqualsValuesClauseSyntax node);
    • LuaSyntaxVisitor<TResult>.VisitEqualsValuesClause(EqualsValuesClauseSyntax node);
    • LuaSyntaxWalker.VisitEqualsValuesClause(EqualsValuesClauseSyntax node);
    • LuaSyntaxRewriter.VisitEqualsValuesClause(EqualsValuesClauseSyntax node).
  • Added SyntaxFacts.GetKeywordKind(ReadOnlySpan<char> span).
  • The following were added as a result of the MinCount fix for Syntax.xml:
    • SyntaxFactory.GenericForStatement(SeparatedSyntaxList<IdentifierNameSyntax> identifiers, SeparatedSyntaxList<ExpressionSyntax> expressions).
  • Added MinifyingUtils.CanRename to check if a variable will be renamed by the minifier.
  • Added MinifyingUtils.GetUnavailableNames to get the list of variable names that can't be used for a given scope or list of scopes.
    This is particularly useful for implementing your own NamingStrategy.