using System.Collections.Immutable;
using System.Runtime.CompilerServices;
using Microsoft.CodeAnalysis;

#pragma warning disable RS1024

namespace RoslynPad.Roslyn
{
    public class DummyScriptMetadataResolver : MetadataReferenceResolver
    {
        private DummyScriptMetadataResolver()
        {
        }

        public static DummyScriptMetadataResolver Instance { get; } = new();

        public override bool ResolveMissingAssemblies => false;

        public override bool Equals(object? other) => ReferenceEquals(this, other);

        public override int GetHashCode() => RuntimeHelpers.GetHashCode(this);

        public override PortableExecutableReference? ResolveMissingAssembly(MetadataReference definition, AssemblyIdentity referenceIdentity) => null;

        public override ImmutableArray<PortableExecutableReference> ResolveReference(string reference, string? baseFilePath,
            MetadataReferenceProperties properties) =>
            ImmutableArray<PortableExecutableReference>.Empty;
    }
}
