这是indexloc提供的服务,不要输入任何密码
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
6 changes: 3 additions & 3 deletions MLS.Agent.Tests/ApiViaHttpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ public static IEnumerable<int> Fibonacci()
public async Task When_aspnet_webapi_workspace_request_succeeds_then_output_shows_web_response()
{
var workspace = new Workspace(workspaceType: "aspnet.webapi", buffers: new[] { new Buffer("empty.cs", "") });
var request = new WorkspaceRequest(workspace, httpRequest: new HttpRequest("/api/values", "get"), requestId: "TestRun");
var request = new WorkspaceRequest(workspace, httpRequest: new HttpRequest("/custom/values", "get"), requestId: "TestRun");

var json = request.ToJson();

Expand Down Expand Up @@ -667,7 +667,7 @@ public async Task When_aspnet_webapi_workspace_request_succeeds_then_standard_ou
await package.CreateRoslynWorkspaceForRunAsync(new TimeBudget(10.Minutes()));
var workspace = WorkspaceFactory.CreateWorkspaceFromDirectory(package.Directory, package.Directory.Name);

var request = new WorkspaceRequest(workspace, httpRequest: new HttpRequest("/api/values", "get"), requestId: "TestRun");
var request = new WorkspaceRequest(workspace, httpRequest: new HttpRequest("/custom/values", "get"), requestId: "TestRun");

var response = await CallRun(request.ToJson(), 30000);

Expand All @@ -693,7 +693,7 @@ public async Task When_aspnet_webapi_workspace_request_fails_then_diagnostics_ar
files: workspace.Files.ToArray(),
workspaceType: workspace.WorkspaceType);

var request = new WorkspaceRequest(workspace, httpRequest: new HttpRequest("/api/values", "get"), requestId: "TestRun");
var request = new WorkspaceRequest(workspace, httpRequest: new HttpRequest("/custom/values", "get"), requestId: "TestRun");

var response = await CallRun(request.ToJson(), null);

Expand Down
6 changes: 3 additions & 3 deletions MLS.Agent.Tools/AsyncLazy{T}.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace MLS.Agent.Tools
{
public class AsyncLazy<T>
{
private readonly Lazy<Task<T>> lazy;
private readonly Lazy<Task<T>> _lazy;

public AsyncLazy(Func<Task<T>> initialize)
{
Expand All @@ -17,9 +17,9 @@ public AsyncLazy(Func<Task<T>> initialize)
throw new ArgumentNullException(nameof(initialize));
}

lazy = new Lazy<Task<T>>(initialize);
_lazy = new Lazy<Task<T>>(initialize);
}

public Task<T> ValueAsync() => lazy.Value;
public Task<T> ValueAsync() => _lazy.Value;
}
}
76 changes: 38 additions & 38 deletions MLS.Agent/CommandLine/CommandLineParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public delegate Task<int> Jupyter(
InvocationContext context = null);

public static Parser Create(
IServiceCollection services,
IServiceCollection services,
StartServer startServer = null,
Demo demo = null,
TryGitHub tryGithub = null,
Expand Down Expand Up @@ -100,7 +100,7 @@ public static Parser Create(

install = install ??
InstallCommand.Do;


var dirArgument = new Argument<DirectoryInfo>
{
Expand Down Expand Up @@ -146,63 +146,63 @@ RootCommand StartInTryMode()
command.AddOption(new Option(
"--add-package-source",
"Specify an additional NuGet package source")
{
Argument = new Argument<PackageSource>(() => new PackageSource(Directory.GetCurrentDirectory()))
{
Name = "NuGet source"
}
});
{
Argument = new Argument<PackageSource>(() => new PackageSource(Directory.GetCurrentDirectory()))
{
Name = "NuGet source"
}
});

command.AddOption(new Option(
"--package",
"Specify a Try .NET package or path to a .csproj to run code samples with")
{
Argument = new Argument<string>
{
Name = "name or .csproj"
}
});
{
Argument = new Argument<string>
{
Name = "name or .csproj"
}
});

command.AddOption(new Option(
"--package-version",
"Specify a Try .NET package version to use with the --package option")
{
Argument = new Argument<string>
{
Name = "version"
}
});
{
Argument = new Argument<string>
{
Name = "version"
}
});

command.AddOption(new Option(
"--uri",
"Specify a URL or a relative path to a Markdown file")
{
Argument = new Argument<Uri>()
});
{
Argument = new Argument<Uri>()
});

command.AddOption(new Option(
"--enable-preview-features",
"Enable preview features")
{
Argument = new Argument<bool>()
});
{
Argument = new Argument<bool>()
});

command.AddOption(new Option(
"--log-path",
"Enable file logging to the specified directory")
{
Argument = new Argument<DirectoryInfo>
{
Name = "dir"
}
});
{
Argument = new Argument<DirectoryInfo>
{
Name = "dir"
}
});

command.AddOption(new Option(
"--verbose",
"Enable verbose logging to the console")
{
Argument = new Argument<bool>()
});
{
Argument = new Argument<bool>()
});

var portArgument = new Argument<ushort>();

Expand All @@ -221,9 +221,9 @@ RootCommand StartInTryMode()
command.AddOption(new Option(
"--port",
"Specify the port for dotnet try to listen on")
{
Argument = portArgument
});
{
Argument = portArgument
});

command.Handler = CommandHandler.Create<InvocationContext, StartupOptions>((context, options) =>
{
Expand Down
4 changes: 2 additions & 2 deletions MLS.Agent/CommandLine/PackCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static async Task<string> Do(PackOptions options, IConsole console)

if (options.EnableWasm)
{
string runnerDirectoryName = $"wasm";
string runnerDirectoryName = "wasm";
var temp_projects_wasm = temp_projects.CreateSubdirectory(runnerDirectoryName);
var temp_mlsblazor = temp.CreateSubdirectory("MLS.Blazor");
await AddBlazorProject(temp_mlsblazor, GetProjectFile(temp_projects_build), name, temp_projects_wasm);
Expand Down Expand Up @@ -73,7 +73,7 @@ await File.WriteAllTextAsync(

private static async Task AddBlazorProject(DirectoryInfo blazorTargetDirectory, FileInfo projectToReference, string name, DirectoryInfo wasmLocation)
{
var initializer = new BlazorPackageInitializer(name, new System.Collections.Generic.List<string>());
var initializer = new BlazorPackageInitializer(name, new System.Collections.Generic.List<(string,string)>());
await initializer.Initialize(blazorTargetDirectory);

await AddReference(blazorTargetDirectory, projectToReference);
Expand Down
6 changes: 3 additions & 3 deletions MLS.Agent/MLS.Agent.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
</PropertyGroup>

<Exec Command="npm rebuild node-sass" WorkingDirectory="$(CssInputDir)" />
<Exec Command="npm i" WorkingDirectory="$(CssInputDir)" />
<Exec Command="npm ci" WorkingDirectory="$(CssInputDir)" />
<Exec Command="npm run ciCreateDir -- $(CssOutputDir)" WorkingDirectory="$(CssInputDir)" />
<Exec Command="npm run release -- $(CssOutputFile)" WorkingDirectory="$(CssInputDir)" />

Expand All @@ -172,7 +172,7 @@
<_TryDotNetMinJsExists Condition="Exists('$(TryDotNetJsFile)')">true</_TryDotNetMinJsExists>
</PropertyGroup>

<Exec Command="npm i" WorkingDirectory="$(TryDotNetJsInputDir)" />
<Exec Command="npm ci" WorkingDirectory="$(TryDotNetJsInputDir)" />
<Exec Command="npm run ciCreateDir -- $(TryDotNetJsOutputDir)" WorkingDirectory="$(TryDotNetJsInputDir)" />
<Exec Command="npm run build" WorkingDirectory="$(TryDotNetJsInputDir)" />
<Exec Command="npm run ciMinify -- --output $(TryDotNetJsFile)" WorkingDirectory="$(TryDotNetJsInputDir)" />
Expand All @@ -191,7 +191,7 @@
<_TryDotNetClientExists Condition="Exists('$(ClientOutputFile)')">true</_TryDotNetClientExists>
</PropertyGroup>

<Exec Command="npm i" WorkingDirectory="$(ClientInputDir)" />
<Exec Command="npm ci" WorkingDirectory="$(ClientInputDir)" />
<Exec Command="npm run ciCreateDir -- $(ClientOutputDir)" WorkingDirectory="$(ClientInputDir)" />
<Exec Command="npm run buildCi -- --output-path $(ClientOutputDir)" WorkingDirectory="$(ClientInputDir)" />

Expand Down
5 changes: 4 additions & 1 deletion MLS.Agent/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,10 @@ private void LaunchBrowser(IBrowserLauncher browserLauncher, IDirectoryAccessor

RelativeFilePath FindReadmeFileAtRoot()
{
var files = directoryAccessor.GetAllFilesRecursively().Where(f => (StringComparer.InvariantCultureIgnoreCase.Compare(f.FileName, "readme.md") == 0) && IsRoot(f.Directory)).ToList();
var files = directoryAccessor
.GetAllFilesRecursively()
.Where(f => (StringComparer.InvariantCultureIgnoreCase.Compare(f.FileName, "readme.md") == 0) && IsRoot(f.Directory))
.ToList();

return files.FirstOrDefault();
}
Expand Down
Loading