Merge pull request #6 from unoplatform/dev/jela/ready-to-run
feat: Add ready to run
This commit is contained in:
Коммит
964d652192
|
@ -68,6 +68,8 @@
|
|||
Content="Keep redundant API calls " />
|
||||
<CheckBox x:Name="checkBoxNoSyntaxFactory"
|
||||
Content="Do not require 'using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;' " />
|
||||
<CheckBox x:Name="readyToRun"
|
||||
Content="Ready-To-Run (with compilation and diagnostics)" />
|
||||
</StackPanel>
|
||||
<TextBox x:Name="result"
|
||||
Grid.Column="1"
|
||||
|
|
|
@ -17,6 +17,8 @@ using Microsoft.UI.Xaml.Input;
|
|||
using Microsoft.UI.Xaml.Media;
|
||||
using Microsoft.UI.Xaml.Navigation;
|
||||
using RoslynQuoter;
|
||||
using Windows.Web.Http;
|
||||
using QuoterWeb;
|
||||
|
||||
// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
|
||||
|
||||
|
@ -135,6 +137,21 @@ public sealed partial class MainPage : Page
|
|||
};
|
||||
|
||||
responseText = quoter.QuoteText(sourceText, nodeKind);
|
||||
|
||||
if (readyToRun.IsChecked ?? false)
|
||||
{
|
||||
responseText = ReadyToRunHelper.CreateReadyToRunCode(new QuoterRequestArgument
|
||||
{
|
||||
SourceText = sourceText,
|
||||
NodeKind = nodeKind,
|
||||
OpenCurlyOnNewLine = openCurlyOnNewLine,
|
||||
CloseCurlyOnNewLine = closeCurlyOnNewLine,
|
||||
PreserveOriginalWhitespace = preserveOriginalWhitespace,
|
||||
KeepRedundantApiCalls = keepRedundantApiCalls,
|
||||
AvoidUsingStatic = avoidUsingStatic,
|
||||
ReadyToRun = true
|
||||
}, responseText);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,4 +56,9 @@
|
|||
<None Remove="Platforms\WebAssembly\WasmScripts\GoogleAnalytics.js" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Include="..\..\Quoter.Web\Dtos\QuoterRequestArgument.cs" Link="QuoterRequestArgument.cs" />
|
||||
<Compile Include="..\..\Quoter.Web\ReadyToRunHelper.cs" Link="ReadyToRunHelper.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
Загрузка…
Ссылка в новой задаче