Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 55642ef

Browse files
cesarzcfilipwScottCarda-MSbamarshabettinaheim
authored
Merge latest changes from main (#1237)
* added MSBuild_Logs to gitignore (#1171) * Command Line Support for Project File Input (#1192) * Change --inputs to --input (#1210) * Deprecate new array expression (#956) * Removing temporary project (#1225) * Formatter Updates Deprecated Boolean Operator Syntax (#1214) * Update the documentation found in the Q# Formatter Project (#1203) * Formatter Updates Deprecated Specialization Declaration Parameters (#1226) * Adding Sdk integration, and formatting support + code action for syntax updates to the language server (#1207) Co-authored-by: Filip W <[email protected]> Co-authored-by: Scott Carda <[email protected]> Co-authored-by: Sarah Marshall <[email protected]> Co-authored-by: bettinaheim <[email protected]> Co-authored-by: Jintao YU <[email protected]>
1 parent 1b01733 commit 55642ef

File tree

142 files changed

+2834
-855
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+2834
-855
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,6 @@ ASALocalRun/
342342
src/ProjectTemplates/Quantum.App1/Quantum.App1.csproj
343343
src/ProjectTemplates/Quantum.Library1/Quantum.Library1.csproj
344344
src/ProjectTemplates/Quantum.Test1/Quantum.Test1.csproj
345-
src/QsCompiler/LanguageServer/TemporaryProject.cs
346345
src/QuantumSdk/DefaultItems/DefaultItems.props
347346
src/ProjectTemplates/Quantum.App1/.template.config/template.json
348347
src/ProjectTemplates/Quantum.Library1/.template.config/template.json
@@ -366,3 +365,6 @@ src/ProjectTemplates/Quantum.Test1/.template.config/template.json
366365
src/QsCompiler/QirGeneration/QirGeneration.nuspec
367366
/examples/QIR/Development/qir/*
368367
/examples/QIR/Development/build
368+
369+
# MSBuild logs
370+
MSBuild_Logs/

QsCompiler.sln

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Tests.CSharpGeneration", "s
6565
EndProject
6666
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CodeGeneration", "CodeGeneration", "{160AABCE-2317-4695-815C-D3B3F88BE780}"
6767
EndProject
68+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Formatter", "Formatter", "{755A6971-AD80-4519-A64E-0333B89C1E9D}"
69+
EndProject
70+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Parser", "src\QsFmt\Parser\Parser.csproj", "{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}"
71+
EndProject
72+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Formatter", "src\QsFmt\Formatter\Formatter.fsproj", "{4D1F507F-7382-4F5B-9923-58398A565D8B}"
73+
EndProject
74+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "App", "src\QsFmt\App\App.fsproj", "{AD350766-EE10-4DE3-A834-129D026487FB}"
75+
EndProject
6876
Global
6977
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7078
Debug|Any CPU = Debug|Any CPU
@@ -387,6 +395,42 @@ Global
387395
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x64.Build.0 = Release|Any CPU
388396
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x86.ActiveCfg = Release|Any CPU
389397
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F}.Release|x86.Build.0 = Release|Any CPU
398+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
399+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|Any CPU.Build.0 = Debug|Any CPU
400+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x64.ActiveCfg = Debug|Any CPU
401+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x64.Build.0 = Debug|Any CPU
402+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x86.ActiveCfg = Debug|Any CPU
403+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Debug|x86.Build.0 = Debug|Any CPU
404+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|Any CPU.ActiveCfg = Release|Any CPU
405+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|Any CPU.Build.0 = Release|Any CPU
406+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x64.ActiveCfg = Release|Any CPU
407+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x64.Build.0 = Release|Any CPU
408+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x86.ActiveCfg = Release|Any CPU
409+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5}.Release|x86.Build.0 = Release|Any CPU
410+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
411+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
412+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x64.ActiveCfg = Debug|Any CPU
413+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x64.Build.0 = Debug|Any CPU
414+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x86.ActiveCfg = Debug|Any CPU
415+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Debug|x86.Build.0 = Debug|Any CPU
416+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
417+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|Any CPU.Build.0 = Release|Any CPU
418+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x64.ActiveCfg = Release|Any CPU
419+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x64.Build.0 = Release|Any CPU
420+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x86.ActiveCfg = Release|Any CPU
421+
{4D1F507F-7382-4F5B-9923-58398A565D8B}.Release|x86.Build.0 = Release|Any CPU
422+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
423+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
424+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x64.ActiveCfg = Debug|Any CPU
425+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x64.Build.0 = Debug|Any CPU
426+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x86.ActiveCfg = Debug|Any CPU
427+
{AD350766-EE10-4DE3-A834-129D026487FB}.Debug|x86.Build.0 = Debug|Any CPU
428+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
429+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|Any CPU.Build.0 = Release|Any CPU
430+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x64.ActiveCfg = Release|Any CPU
431+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x64.Build.0 = Release|Any CPU
432+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x86.ActiveCfg = Release|Any CPU
433+
{AD350766-EE10-4DE3-A834-129D026487FB}.Release|x86.Build.0 = Release|Any CPU
390434
EndGlobalSection
391435
GlobalSection(SolutionProperties) = preSolution
392436
HideSolutionNode = FALSE
@@ -407,6 +451,9 @@ Global
407451
{2BCE252C-DCE8-48A6-B08C-E5DDD753506C} = {160AABCE-2317-4695-815C-D3B3F88BE780}
408452
{B08BB875-89AF-4194-AC13-D8FB8290B54E} = {B4A9484D-31FC-4A27-9E26-4C8DE3E02D77}
409453
{23020BC1-8D69-40E1-A6BB-DB5D28247A7F} = {B4A9484D-31FC-4A27-9E26-4C8DE3E02D77}
454+
{005C0AEB-829A-4DD2-9A5D-973A9E351AF5} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
455+
{4D1F507F-7382-4F5B-9923-58398A565D8B} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
456+
{AD350766-EE10-4DE3-A834-129D026487FB} = {755A6971-AD80-4519-A64E-0333B89C1E9D}
410457
EndGlobalSection
411458
GlobalSection(ExtensibilityGlobals) = postSolution
412459
SolutionGuid = {B921C36B-4574-4025-8FE3-E5BD2D3D2B81}

QsFmt.sln

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,9 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Formatter", "src\QsFmt\Form
99
EndProject
1010
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "App", "src\QsFmt\App\App.fsproj", "{68F54AEE-C852-4FFA-831D-5BA741BE893E}"
1111
EndProject
12-
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4399BDF1-685A-4373-8748-142C835A52D6}"
13-
ProjectSection(SolutionItems) = preProject
14-
README.md = src\QsFmt\README.md
15-
EndProjectSection
12+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "Formatter.Tests", "src\QsFmt\Formatter.Tests\Formatter.Tests.fsproj", "{FC9E2BEC-F15F-4818-B0E1-805EA554269E}"
1613
EndProject
17-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Formatter.Tests", "src\QsFmt\Formatter.Tests\Formatter.Tests.fsproj", "{FC9E2BEC-F15F-4818-B0E1-805EA554269E}"
18-
EndProject
19-
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "App.Tests", "src\QsFmt\App.Tests\App.Tests.fsproj", "{E00FA726-F852-4D14-90F8-1B0E3E08D822}"
14+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "App.Tests", "src\QsFmt\App.Tests\App.Tests.fsproj", "{E00FA726-F852-4D14-90F8-1B0E3E08D822}"
2015
EndProject
2116
Global
2217
GlobalSection(SolutionConfigurationPlatforms) = preSolution

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ If you edit the [Microsoft.Quantum.Sdk](./src/QuantumSdk) as part of your change
7373
```
7474
dotnet publish src/QuantumSdk/Tools/Tools.sln -c Debug
7575
dotnet publish src/QsCompiler/CommandLineTool/CommandLineTool.csproj -c Debug
76+
dotnet publish src/QsFmt/App/App.fsproj -c Debug
7677
nuget.exe pack src/QuantumSdk/QuantumSdk.nuspec -Version 1.0.0 -Properties Configuration=Debug
7778
```
7879
Move the created .nupkg file into your [local NuGet folder](https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds). You can now use the package to build any Q# project by opening the project file in a text editor, and editing the Sdk version number in the first line to be

build/manifest.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ $artifacts = @{
5656
".\src\QsCompiler\LlvmBindings\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.LlvmBindings.dll",
5757
".\src\QsCompiler\Transformations\bin\$Env:BUILD_CONFIGURATION\netstandard2.1\Microsoft.Quantum.QsTransformations.dll",
5858
".\src\QsCompiler\CommandLineTool\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qsc.dll",
59+
".\src\QsFmt\App\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\qsfmt.dll",
5960
".\src\QuantumSdk\Tools\BuildConfiguration\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.BuildConfiguration.dll",
6061
".\src\QuantumSdk\Tools\DefaultEntryPoint\bin\$Env:BUILD_CONFIGURATION\netcoreapp3.1\Microsoft.Quantum.Sdk.DefaultEntryPoint.Generation.dll"
6162
) | ForEach-Object { Join-Path $PSScriptRoot (Join-Path ".." $_) };

build/pack.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ Publish-One '../src/QsCompiler/CommandLineTool/CommandLineTool.csproj'
8989
Publish-One '../src/QsCompiler/LlvmBindings/LlvmBindings.csproj'
9090
Publish-One '../src/QuantumSdk/Tools/BuildConfiguration/BuildConfiguration.csproj'
9191
Publish-One '../src/QuantumSdk/Tools/DefaultEntryPoint/DefaultEntryPoint.csproj'
92+
Publish-One '../src/QsFmt/App/App.fsproj'
9293

9394
Pack-One '../src/QsCompiler/Compiler/Compiler.csproj' '-IncludeReferencedProjects'
9495
Pack-One '../src/QsCompiler/QirGeneration/QirGeneration.csproj'

src/QsCompiler/CompilationManager/CompilationUnit.cs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -315,18 +315,14 @@ public class CompilationUnit : IReaderWriterLock, IDisposable
315315

316316
internal NamespaceManager GlobalSymbols { get; private set; }
317317

318+
internal ProjectProperties BuildProperties { get; }
319+
318320
private readonly Dictionary<QsQualifiedName, QsCallable> compiledCallables;
319321
private readonly Dictionary<QsQualifiedName, QsCustomType> compiledTypes;
320322

321323
private readonly ReaderWriterLockSlim syncRoot;
322324
private readonly HashSet<ReaderWriterLockSlim> dependentLocks;
323325

324-
internal RuntimeCapability RuntimeCapability { get; }
325-
326-
internal bool IsExecutable { get; }
327-
328-
internal string ProcessorArchitecture { get; }
329-
330326
/// <inheritdoc/>
331327
public void Dispose()
332328
{
@@ -338,9 +334,7 @@ public void Dispose()
338334
/// with <paramref name="dependentLocks"/> registered as dependent locks if not null.
339335
/// </summary>
340336
internal CompilationUnit(
341-
RuntimeCapability capability,
342-
bool isExecutable,
343-
string processorArchitecture,
337+
ProjectProperties projectProperties,
344338
References? externals = null,
345339
IEnumerable<ReaderWriterLockSlim>? dependentLocks = null)
346340
{
@@ -350,16 +344,19 @@ internal CompilationUnit(
350344
this.syncRoot = new ReaderWriterLockSlim(LockRecursionPolicy.SupportsRecursion);
351345
this.dependentLocks = new HashSet<ReaderWriterLockSlim>(dependentLocks);
352346

353-
this.RuntimeCapability = capability;
354-
this.IsExecutable = isExecutable;
355-
this.ProcessorArchitecture = processorArchitecture;
356-
357347
this.compiledCallables = new Dictionary<QsQualifiedName, QsCallable>();
358348
this.compiledTypes = new Dictionary<QsQualifiedName, QsCustomType>();
359349
this.Externals = externals;
350+
this.BuildProperties = projectProperties;
360351
this.GlobalSymbols = this.CreateGlobalSymbols();
361352
}
362353

354+
/// <inheritdoc cref="CompilationUnit(ProjectProperties, References?, IEnumerable{ReaderWriterLockSlim}?)" />
355+
internal CompilationUnit(CompilationUnit compilationUnit, IEnumerable<ReaderWriterLockSlim>? dependentLocks = null)
356+
: this(compilationUnit.BuildProperties, compilationUnit.Externals, dependentLocks ?? compilationUnit.dependentLocks)
357+
{
358+
}
359+
363360
/// <summary>
364361
/// Creates a new instance of the namespace manager for global symbols.
365362
/// </summary>
@@ -369,8 +366,8 @@ internal CompilationUnit(
369366
this.Externals.Declarations.Values.SelectMany(h =>
370367
h.Specializations.Select(t => Tuple.Create(t.Item1, t.Item2))),
371368
this.Externals.Declarations.Values.SelectMany(h => h.Types),
372-
this.RuntimeCapability,
373-
this.IsExecutable);
369+
this.BuildProperties.RuntimeCapability,
370+
this.BuildProperties.IsExecutable);
374371

375372
/// <summary>
376373
/// Replaces <see cref="GlobalSymbols"/> to match <paramref name="externals"/>.

0 commit comments

Comments
 (0)