Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
<Sha>8a21184a27103ca3e365b21553e32f2a1c0661d3</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency>
<Dependency Name="System.CommandLine" Version="2.0.0-beta4.24528.1">
<Dependency Name="System.CommandLine" Version="2.0.0-beta5.25210.1">
<Uri>https://github.com/dotnet/command-line-api</Uri>
<Sha>feb61c7f328a2401d74f4317b39d02126cfdfe24</Sha>
<Sha>e9b0511d7f1128e2bc3be7a658a2a4ea977e602d</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.command-line-api" Version="0.1.552801">
<Dependency Name="Microsoft.SourceBuild.Intermediate.command-line-api" Version="0.1.621001">
<Uri>https://github.com/dotnet/command-line-api</Uri>
<Sha>feb61c7f328a2401d74f4317b39d02126cfdfe24</Sha>
<Sha>e9b0511d7f1128e2bc3be7a658a2a4ea977e602d</Sha>
<SourceBuild RepoName="command-line-api" ManagedOnly="true" />
</Dependency>
<!-- Necessary for source-build. This allows the live version of the package to be used by source-build. -->
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
Versions managed by Arcade (see Versions.Details.xml)
-->
<PropertyGroup>
<SystemCommandLineVersion>2.0.0-beta4.24528.1</SystemCommandLineVersion>
<SystemCommandLineVersion>2.0.0-beta5.25210.1</SystemCommandLineVersion>
<SystemCompositionVersion>9.0.0</SystemCompositionVersion>
<SystemConfigurationConfigurationManagerVersion>9.0.0</SystemConfigurationConfigurationManagerVersion>
<SystemDiagnosticsEventLogVersion>9.0.0</SystemDiagnosticsEventLogVersion>
Expand Down
16 changes: 8 additions & 8 deletions src/Features/Lsif/Generator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,17 @@ internal static class Program
{
public static Task Main(string[] args)
{
var solution = new CliOption<FileInfo>("--solution") { Description = "input solution file" }.AcceptExistingOnly();
var project = new CliOption<FileInfo>("--project") { Description = "input project file" }.AcceptExistingOnly();
var compilerInvocation = new CliOption<FileInfo>("--compiler-invocation") { Description = "path to a .json file that contains the information for a csc/vbc invocation" }.AcceptExistingOnly();
var binLog = new CliOption<FileInfo>("--binlog") { Description = "path to a MSBuild binlog that csc/vbc invocations will be extracted from" }.AcceptExistingOnly();
var output = new CliOption<string?>("--output") { Description = "file to write the LSIF output to, instead of the console", DefaultValueFactory = _ => null };
var solution = new Option<FileInfo>("--solution") { Description = "input solution file" }.AcceptExistingOnly();
var project = new Option<FileInfo>("--project") { Description = "input project file" }.AcceptExistingOnly();
var compilerInvocation = new Option<FileInfo>("--compiler-invocation") { Description = "path to a .json file that contains the information for a csc/vbc invocation" }.AcceptExistingOnly();
var binLog = new Option<FileInfo>("--binlog") { Description = "path to a MSBuild binlog that csc/vbc invocations will be extracted from" }.AcceptExistingOnly();
var output = new Option<string?>("--output") { Description = "file to write the LSIF output to, instead of the console", DefaultValueFactory = _ => null };
output.AcceptLegalFilePathsOnly();
var outputFormat = new CliOption<LsifFormat>("--output-format") { Description = "format of LSIF output", DefaultValueFactory = _ => LsifFormat.Line };
var log = new CliOption<string?>("--log") { Description = "file to write a log to", DefaultValueFactory = _ => null };
var outputFormat = new Option<LsifFormat>("--output-format") { Description = "format of LSIF output", DefaultValueFactory = _ => LsifFormat.Line };
var log = new Option<string?>("--log") { Description = "file to write a log to", DefaultValueFactory = _ => null };
log.AcceptLegalFilePathsOnly();

var generateCommand = new CliRootCommand("generates an LSIF file")
var generateCommand = new RootCommand("generates an LSIF file")
{
solution,
project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using Microsoft.CodeAnalysis.LanguageServer.Logging;
using Microsoft.CodeAnalysis.LanguageServer.Services;
using Microsoft.CodeAnalysis.LanguageServer.StarredSuggestions;
using Microsoft.CodeAnalysis.Options;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;
using Roslyn.Utilities;
Expand Down Expand Up @@ -103,7 +102,7 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation

// LSP server doesn't have the pieces yet to support 'balanced' mode for source-generators. Hardcode us to
// 'automatic' for now.
var globalOptionService = exportProvider.GetExportedValue<IGlobalOptionService>();
var globalOptionService = exportProvider.GetExportedValue<Microsoft.CodeAnalysis.Options.IGlobalOptionService>();
globalOptionService.SetGlobalOption(WorkspaceConfigurationOptionsStorage.SourceGeneratorExecution, SourceGeneratorExecutionPreference.Automatic);

// The log file directory passed to us by VSCode might not exist yet, though its parent directory is guaranteed to exist.
Expand Down Expand Up @@ -172,87 +171,87 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation
}
}

static CliConfiguration CreateCommandLineParser()
static CommandLineConfiguration CreateCommandLineParser()
{
var debugOption = new CliOption<bool>("--debug")
var debugOption = new Option<bool>("--debug")
{
Description = "Flag indicating if the debugger should be launched on startup.",
Required = false,
DefaultValueFactory = _ => false,
};
var brokeredServicePipeNameOption = new CliOption<string?>("--brokeredServicePipeName")
var brokeredServicePipeNameOption = new Option<string?>("--brokeredServicePipeName")
{
Description = "The name of the pipe used to connect to a remote process (if one exists).",
Required = false,
};

var logLevelOption = new CliOption<LogLevel>("--logLevel")
var logLevelOption = new Option<LogLevel>("--logLevel")
{
Description = "The minimum log verbosity.",
Required = true,
};
var starredCompletionsPathOption = new CliOption<string?>("--starredCompletionComponentPath")
var starredCompletionsPathOption = new Option<string?>("--starredCompletionComponentPath")
{
Description = "The location of the starred completion component (if one exists).",
Required = false,
};

var telemetryLevelOption = new CliOption<string?>("--telemetryLevel")
var telemetryLevelOption = new Option<string?>("--telemetryLevel")
{
Description = "Telemetry level, Defaults to 'off'. Example values: 'all', 'crash', 'error', or 'off'.",
Required = false,
};
var extensionLogDirectoryOption = new CliOption<string>("--extensionLogDirectory")
var extensionLogDirectoryOption = new Option<string>("--extensionLogDirectory")
{
Description = "The directory where we should write log files to",
Required = true,
};

var sessionIdOption = new CliOption<string?>("--sessionId")
var sessionIdOption = new Option<string?>("--sessionId")
{
Description = "Session Id to use for telemetry",
Required = false
};

var extensionAssemblyPathsOption = new CliOption<string[]?>("--extension")
var extensionAssemblyPathsOption = new Option<string[]?>("--extension")
{
Description = "Full paths of extension assemblies to load (optional).",
Required = false
};

var devKitDependencyPathOption = new CliOption<string?>("--devKitDependencyPath")
var devKitDependencyPathOption = new Option<string?>("--devKitDependencyPath")
{
Description = "Full path to the Roslyn dependency used with DevKit (optional).",
Required = false
};

var razorSourceGeneratorOption = new CliOption<string?>("--razorSourceGenerator")
var razorSourceGeneratorOption = new Option<string?>("--razorSourceGenerator")
{
Description = "Full path to the Razor source generator (optional).",
Required = false
};

var razorDesignTimePathOption = new CliOption<string?>("--razorDesignTimePath")
var razorDesignTimePathOption = new Option<string?>("--razorDesignTimePath")
{
Description = "Full path to the Razor design time target path (optional).",
Required = false
};

var serverPipeNameOption = new CliOption<string?>("--pipe")
var serverPipeNameOption = new Option<string?>("--pipe")
{
Description = "The name of the pipe the server will connect to.",
Required = false
};

var useStdIoOption = new CliOption<bool>("--stdio")
var useStdIoOption = new Option<bool>("--stdio")
{
Description = "Use stdio for communication with the client.",
Required = false,
DefaultValueFactory = _ => false,

};

var rootCommand = new CliRootCommand()
var rootCommand = new RootCommand()
{
debugOption,
brokeredServicePipeNameOption,
Expand Down Expand Up @@ -301,7 +300,7 @@ static CliConfiguration CreateCommandLineParser()
return RunAsync(serverConfiguration, cancellationToken);
});

var config = new CliConfiguration(rootCommand)
var config = new CommandLineConfiguration(rootCommand)
{
// By default, System.CommandLine will catch all exceptions, log them to the console, and return a non-zero exit code.
// Unfortunately this makes .NET's crash dump collection environment variables (e.g. 'DOTNET_DbgEnableMiniDump')
Expand Down
18 changes: 9 additions & 9 deletions src/Tools/BuildValidator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,45 +31,45 @@ static int Main(string[] args)
{
System.Diagnostics.Trace.Listeners.Clear();

var assembliesPath = new CliOption<string[]>("--assembliesPath")
var assembliesPath = new Option<string[]>("--assembliesPath")
{
Description = BuildValidatorResources.Path_to_assemblies_to_rebuild_can_be_specified_one_or_more_times,
Required = true,
Arity = ArgumentArity.OneOrMore,
};
var exclude = new CliOption<string[]>("--exclude")
var exclude = new Option<string[]>("--exclude")
{
Description = BuildValidatorResources.Assemblies_to_be_excluded_substring_match,
Arity = ArgumentArity.ZeroOrMore,
};
var source = new CliOption<string>("--sourcePath")
var source = new Option<string>("--sourcePath")
{
Description = BuildValidatorResources.Path_to_sources_to_use_in_rebuild,
Required = true,
};
var referencesPath = new CliOption<string[]>("--referencesPath")
var referencesPath = new Option<string[]>("--referencesPath")
{
Description = BuildValidatorResources.Path_to_referenced_assemblies_can_be_specified_zero_or_more_times,
Arity = ArgumentArity.ZeroOrMore,
};
var verbose = new CliOption<bool>("--verbose")
var verbose = new Option<bool>("--verbose")
{
Description = BuildValidatorResources.Output_verbose_log_information
};
var quiet = new CliOption<bool>("--quiet")
var quiet = new Option<bool>("--quiet")
{
Description = BuildValidatorResources.Do_not_output_log_information_to_console
};
var debug = new CliOption<bool>("--debug")
var debug = new Option<bool>("--debug")
{
Description = BuildValidatorResources.Output_debug_info_when_rebuild_is_not_equal_to_the_original
};
var debugPath = new CliOption<string?>("--debugPath")
var debugPath = new Option<string?>("--debugPath")
{
Description = BuildValidatorResources.Path_to_output_debug_info
};

var rootCommand = new CliRootCommand
var rootCommand = new RootCommand
{
assembliesPath,
exclude,
Expand Down
10 changes: 5 additions & 5 deletions src/Workspaces/MSBuild/BuildHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ internal static class Program
{
internal static async Task Main(string[] args)
{
var pipeOption = new CliOption<string>("--pipe") { Required = true };
var propertyOption = new CliOption<string[]>("--property") { Arity = ArgumentArity.ZeroOrMore };
var binaryLogOption = new CliOption<string?>("--binlog") { Required = false };
var localeOption = new CliOption<string>("--locale") { Required = true };
var command = new CliRootCommand { pipeOption, binaryLogOption, propertyOption, localeOption };
var pipeOption = new Option<string>("--pipe") { Required = true };
var propertyOption = new Option<string[]>("--property") { Arity = ArgumentArity.ZeroOrMore };
var binaryLogOption = new Option<string?>("--binlog") { Required = false };
var localeOption = new Option<string>("--locale") { Required = true };
var command = new RootCommand { pipeOption, binaryLogOption, propertyOption, localeOption };
var parsedArguments = command.Parse(args);
var pipeName = parsedArguments.GetValue(pipeOption)!;
var properties = parsedArguments.GetValue(propertyOption)!;
Expand Down