diff --git a/src/Workspaces/Core/Portable/Execution/Asset.cs b/src/Workspaces/Core/Portable/Execution/Asset.cs index 6d2d08a015b6342a87cbb777835f468855fa01d3..a4126768848242fc538bc6661416ec28a0d29f28 100644 --- a/src/Workspaces/Core/Portable/Execution/Asset.cs +++ b/src/Workspaces/Core/Portable/Execution/Asset.cs @@ -18,7 +18,7 @@ namespace Microsoft.CodeAnalysis.Execution /// internal abstract class Asset : ChecksumObject { - public static readonly Asset Nil = new NullAsset(); + public static readonly Asset Null = new NullAsset(); public Asset(Checksum checksum, string kind) : base(checksum, kind) { @@ -32,7 +32,7 @@ public Asset(Checksum checksum, string kind) : base(checksum, kind) private sealed class NullAsset : Asset { public NullAsset() : - base(Checksum.Nil, WellKnownChecksumObjects.Nil) + base(Checksum.Null, WellKnownChecksumObjects.Null) { } diff --git a/src/Workspaces/Core/Portable/Execution/Checksum.cs b/src/Workspaces/Core/Portable/Execution/Checksum.cs index e390578012b22e173911a6309f82fab995316956..592b18783decd0e3382b3bef7ce966bc4e4cf760 100644 --- a/src/Workspaces/Core/Portable/Execution/Checksum.cs +++ b/src/Workspaces/Core/Portable/Execution/Checksum.cs @@ -14,7 +14,7 @@ namespace Microsoft.CodeAnalysis.Execution /// internal sealed partial class Checksum : IObjectWritable, IEquatable { - public static readonly Checksum Nil = new Checksum(ImmutableArray.Empty); + public static readonly Checksum Null = new Checksum(ImmutableArray.Empty); private readonly ImmutableArray _checkSum; private int _lazyHash; diff --git a/src/Workspaces/Core/Portable/Execution/ChecksumObject.cs b/src/Workspaces/Core/Portable/Execution/ChecksumObject.cs index c3f268a99259ffdc89ce586a71db2ddbd570a7f7..96854d413df1f3ad8a9e55be6f31fcd8730c8b58 100644 --- a/src/Workspaces/Core/Portable/Execution/ChecksumObject.cs +++ b/src/Workspaces/Core/Portable/Execution/ChecksumObject.cs @@ -73,7 +73,7 @@ private static Checksum CreateChecksum(string kind, object[] children) // TODO: Kind might not actually needed. see whether we can get rid of this internal static class WellKnownChecksumObjects { - public const string Nil = nameof(Nil); + public const string Null = nameof(Null); public const string Projects = nameof(Projects); public const string Documents = nameof(Documents); diff --git a/src/Workspaces/Core/Portable/Execution/ChecksumTreeBuilder.cs b/src/Workspaces/Core/Portable/Execution/ChecksumTreeBuilder.cs index 91880a7e67c3d05e1fc322e7ce2bbc289c41b0e5..4d5128cab754332f5b0bea6137de1275d98de651 100644 --- a/src/Workspaces/Core/Portable/Execution/ChecksumTreeBuilder.cs +++ b/src/Workspaces/Core/Portable/Execution/ChecksumTreeBuilder.cs @@ -90,9 +90,11 @@ private async Task CreateProjectChecksumObjectAsync(Proje var subAssetBuilder = new AssetBuilder(subTreeNode); - // set Asset.Nil if this particular project doesn't support compiler options - var compilationOptions = projectState.CompilationOptions != null ? subAssetBuilder.Build(projectState, projectState.CompilationOptions, cancellationToken) : Asset.Nil; - var parseOptions = projectState.ParseOptions != null ? subAssetBuilder.Build(projectState, projectState.ParseOptions, cancellationToken) : Asset.Nil; + // set Asset.Null if this particular project doesn't support compiler options. + // this one is really bit wierd since project state has both compilation/parse options but only has support compilation. + // for now, we use support compilation for both options + var compilationOptions = projectState.SupportsCompilation ? subAssetBuilder.Build(projectState, projectState.CompilationOptions, cancellationToken) : Asset.Null; + var parseOptions = projectState.SupportsCompilation ? subAssetBuilder.Build(projectState, projectState.ParseOptions, cancellationToken) : Asset.Null; return new ProjectChecksumObject( _serializer, info.Checksum, compilationOptions.Checksum, parseOptions.Checksum, diff --git a/src/Workspaces/Core/Portable/Execution/ChecksumTreeCollection.cs b/src/Workspaces/Core/Portable/Execution/ChecksumTreeCollection.cs index 30fc4df89b296c5c5a2ded47f195c97b2bf07d82..fbb9775ba96ecb02ad31fb6cc770e48a15f05f93 100644 --- a/src/Workspaces/Core/Portable/Execution/ChecksumTreeCollection.cs +++ b/src/Workspaces/Core/Portable/Execution/ChecksumTreeCollection.cs @@ -73,10 +73,10 @@ public IRootChecksumTreeNode CreateRootTreeNode(SolutionState solutionState) public ChecksumObject GetChecksumObject(Checksum checksum, CancellationToken cancellationToken) { - if (checksum == Checksum.Nil) + if (checksum == Checksum.Null) { // check nil case - return Asset.Nil; + return Asset.Null; } // search snapshots we have @@ -114,9 +114,9 @@ public ChecksumObject GetChecksumObject(Checksum checksum, CancellationToken can var result = new Dictionary(numberOfChecksumsToSearch); // check nil case - if (searchingChecksumsLeft.Object.Remove(Checksum.Nil)) + if (searchingChecksumsLeft.Object.Remove(Checksum.Null)) { - result[Checksum.Nil] = Asset.Nil; + result[Checksum.Null] = Asset.Null; } // search checksum trees we have diff --git a/src/Workspaces/Core/Portable/Execution/Serializer.cs b/src/Workspaces/Core/Portable/Execution/Serializer.cs index 5ede59944d7511e2a2569a2029e1e91572736246..6b602a9bef6fedcc6ce2c7fb2307eec2dec29f19 100644 --- a/src/Workspaces/Core/Portable/Execution/Serializer.cs +++ b/src/Workspaces/Core/Portable/Execution/Serializer.cs @@ -43,7 +43,7 @@ public T Deserialize(string kind, ObjectReader reader, CancellationToken canc switch (kind) { - case WellKnownChecksumObjects.Nil: + case WellKnownChecksumObjects.Null: return default(T); case SolutionChecksumObject.Name: