Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
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
4 changes: 2 additions & 2 deletions build/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function Build-VSCode() {
}
} Catch {
Write-Host "##vso[task.logissue type=error;]Failed to build VS Code extension."
$all_ok = $False
$script:all_ok = $False
}
} else {
Write-Host "##vso[task.logissue type=warning;]npm not installed. Will skip creation of VS Code extension"
Expand Down Expand Up @@ -92,7 +92,7 @@ function Build-VS() {
}
} Catch {
Write-Host "##vso[task.logissue type=error;]Failed to build VS extension."
$all_ok = $False
$script:all_ok = $False
}
} else {
Write-Host "msbuild not installed. Will skip building the VisualStudio extension"
Expand Down
4 changes: 2 additions & 2 deletions build/pack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function Pack-VSCode() {
}
} Catch {
Write-Host "##vso[task.logissue type=error;]Failed to pack VS Code extension."
$all_ok = $False
$Script:all_ok = $False
}
} else {
Write-Host "##vso[task.logissue type=warning;]vsce not installed. Will skip creation of VS Code extension package"
Expand All @@ -195,7 +195,7 @@ function Pack-VS() {
}
} Catch {
Write-Host "##vso[task.logissue type=error;]Failed to pack VS extension."
$all_ok = $False
$Script:all_ok = $False
}
} else {
Write-Host "msbuild not installed. Will skip creation of VisualStudio extension package"
Expand Down
3 changes: 2 additions & 1 deletion omnisharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"enableEditorConfigSupport": true
},
"RoslynExtensionsOptions": {
"enableAnalyzersSupport": true
"enableAnalyzersSupport": true,
"enableDecompilationSupport": true
}
}
39 changes: 29 additions & 10 deletions src/QsCompiler/CommandLineTool/CompilationTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text.Json;
using System.Threading;
using Newtonsoft.Json;

namespace Microsoft.Quantum.QsCompiler.CommandLineCompiler
{
Expand Down Expand Up @@ -105,6 +106,21 @@ public CompilationTaskNode(CompilationTask task)
this.Task = task;
this.Children = new Dictionary<string, CompilationTaskNode>();
}

public void WriteToJson(Utf8JsonWriter jsonWriter, string prefix)
{
var preparedPrefix = "";
if (!string.IsNullOrEmpty(prefix)) {
preparedPrefix = $"{prefix}.";
}

var propertyName = $"{preparedPrefix}{this.Task.Name}";
jsonWriter.WriteNumber(propertyName, this.Task.DurationInMs ?? -1);
foreach (var entry in this.Children.OrderBy(e => e.Key))
{
entry.Value.WriteToJson(jsonWriter, propertyName);
}
}
}

/// <summary>
Expand Down Expand Up @@ -294,24 +310,27 @@ public static void PublishResults(string outputFolder)
Directory.CreateDirectory(outputPath);
using (var file = File.CreateText(Path.Combine(outputPath, CompilationPerfDataFileName)))
{
var serializer = new JsonSerializer
var jsonWriterOptions = new JsonWriterOptions()
{
Formatting = Formatting.Indented
Indented = true
};

serializer.Serialize(file, compilationProcessesForest);
var jsonWriter = new Utf8JsonWriter(file.BaseStream, jsonWriterOptions);
jsonWriter.WriteStartObject();
foreach (var tree in compilationProcessesForest.OrderBy(t => t.Task.Name))
{
tree.WriteToJson(jsonWriter, null);
}

jsonWriter.WriteEndObject();
jsonWriter.Flush();
}

if (Warnings.Count > 0)
{
using (var file = File.CreateText(Path.Combine(outputPath, CompilationPerfWarningsFileName)))
{
var serializer = new JsonSerializer
{
Formatting = Formatting.Indented
};

serializer.Serialize(file, Warnings);
JsonSerializer.SerializeAsync(file.BaseStream, Warnings).Wait();
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions src/QsCompiler/Compiler/FindNuspecReferences.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function Add-NuGetDependencyFromCsprojToNuspec($PathToCsproj)

# Check if package already added as dependency, only add if new:
$added = $dep.dependency | Where { $_.id -eq $id }
if (!$added) {
if (!$added -and $_.PrivateAssets -ne "All") {
Write-Host "Adding $id"
$onedependency = $dep.AppendChild($nuspec.CreateElement('dependency', $nuspec.package.metadata.NamespaceURI))
$onedependency.SetAttribute('id', $id)
Expand All @@ -58,4 +58,3 @@ Add-NuGetDependencyFromCsprojToNuspec "Compiler.csproj" $dep
# Save into .nuspec file:
$nuspec.package.metadata.AppendChild($dep)
$nuspec.Save("$PSScriptRoot\Compiler.nuspec")

2 changes: 1 addition & 1 deletion src/QsCompiler/Core/ConstructorExtensions.fs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ type TypedExpression with
/// the ResolvedType is set to the type constructed by resolving it using ResolveTypeParameters and the given look-up.
static member New (expr, typeParamResolutions : ImmutableDictionary<_,_>, exType, exInfo, range) = {
Expression = expr
TypeArguments = typeParamResolutions |> TypedExpression.AsTypeArguments
TypeArguments = TypedExpression.AsTypeArguments typeParamResolutions
ResolvedType = ResolvedType.ResolveTypeParameters typeParamResolutions exType
InferredInformation = exInfo
Range = range
Expand Down
Loading