Tags: dotmake-build/command-line
Tags
Version 2.4.2 - Updated to daily build 2.0.0-beta5.25302.104 of System.CommandLine (cannot update beyond this version for now, as Help related classes are made internal). - Improved: In previous versions, for setting DefaultValueFactory of options and arguments, a default instance of definition type was being created and its properties were being accessed. However if you used dependency injection, this caused unnecessary instantiations because every definition type in the hierarchy had to be instantiated for building the command hierarchy. From now on, CliCommandBuilder.Build method will not create a default instance of definition type to avoid IServiceProvider instantiations for other commands in the hierarchy. Instead, we will read the property initializer's SyntaxNode, fully-qualify symbols and then use that SyntaxNode directly for setting DefaultValueFactory. However, we still need an uninitialized instance for being able to call AddCompletions method that comes with ICliAddCompletions interface, for now. The uninitialized instance can not be used for property access, as the constructor is skipped, properties will come as null but it can be used for calling method access. Creating an uninitialized instance will not trigger dependency injection, so the problem will be avoided. - Fixed: Property initializers were being checked for `SyntaxKind.NullKeyword` where they should be checked for `SyntaxKind.NullLiteralExpression` instead to auto-determine `Required = true` when it's not specified explicitly.
PreviousNext