Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public static Task<ExportProvider> CreateExportProviderAsync(
DevKitDependencyPath: devKitDependencyPath,
RazorSourceGenerator: null,
RazorDesignTimePath: null,
ExtensionLogDirectory: string.Empty);
ExtensionLogDirectory: string.Empty,
ServerPipeName: null);
var extensionManager = ExtensionAssemblyManager.Create(serverConfiguration, loggerFactory);
assemblyLoader = new CustomExportAssemblyLoader(extensionManager, loggerFactory);
return ExportProviderBuilder.CreateExportProviderAsync(extensionManager, assemblyLoader, devKitDependencyPath, cacheDirectory, loggerFactory);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ static async Task RunAsync(ServerConfiguration serverConfiguration, Cancellation

var languageServerLogger = loggerFactory.CreateLogger(nameof(LanguageServerHost));

var (clientPipeName, serverPipeName) = CreateNewPipeNames();
var (clientPipeName, serverPipeName) = serverConfiguration.ServerPipeName is null
? CreateNewPipeNames()
: (serverConfiguration.ServerPipeName, serverConfiguration.ServerPipeName);

var pipeServer = new NamedPipeServerStream(serverPipeName,
PipeDirection.InOut,
maxNumberOfServerInstances: 1,
Expand Down Expand Up @@ -224,6 +227,12 @@ static CliRootCommand CreateCommandLineParser()
Required = false
};

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

var rootCommand = new CliRootCommand()
{
debugOption,
Expand All @@ -236,7 +245,8 @@ static CliRootCommand CreateCommandLineParser()
devKitDependencyPathOption,
razorSourceGeneratorOption,
razorDesignTimePathOption,
extensionLogDirectoryOption
extensionLogDirectoryOption,
serverPipeNameOption
};
rootCommand.SetAction((parseResult, cancellationToken) =>
{
Expand All @@ -250,6 +260,7 @@ static CliRootCommand CreateCommandLineParser()
var razorSourceGenerator = parseResult.GetValue(razorSourceGeneratorOption);
var razorDesignTimePath = parseResult.GetValue(razorDesignTimePathOption);
var extensionLogDirectory = parseResult.GetValue(extensionLogDirectoryOption)!;
var serverPipeName = parseResult.GetValue(serverPipeNameOption);

var serverConfiguration = new ServerConfiguration(
LaunchDebugger: launchDebugger,
Expand All @@ -261,6 +272,7 @@ static CliRootCommand CreateCommandLineParser()
DevKitDependencyPath: devKitDependencyPath,
RazorSourceGenerator: razorSourceGenerator,
RazorDesignTimePath: razorDesignTimePath,
ServerPipeName: serverPipeName,
ExtensionLogDirectory: extensionLogDirectory);

return RunAsync(serverConfiguration, cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ internal record class ServerConfiguration(
string? DevKitDependencyPath,
string? RazorSourceGenerator,
string? RazorDesignTimePath,
string? ServerPipeName,
string ExtensionLogDirectory);

internal class LogConfiguration
Expand Down