﻿// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.

using System;
using System.Runtime.InteropServices;

namespace Microsoft.CodeAnalysis.Razor
{
    internal static class FilePathComparison
    {
        private static StringComparison? _instance;

        public static StringComparison Instance
        {
            get
            {
                if (_instance == null && RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
                {
                    _instance = StringComparison.Ordinal;
                }
                else if (_instance == null)
                {
                    _instance = StringComparison.OrdinalIgnoreCase;
                }

                return _instance.Value;
            }
        }
    }
}

Enable IntelliSense for new component parameters.
Enable IntelliSense for new component parameters.

- Added a `FilePathComparison` object since not all string methods allow a comparer.
- Updated `RazorDirectiveCompletionProvider` to also understand `.razor` files. This is an edge case scenario where users have disabled modern completion and are using Razor components (you need a reg key to disable the modern completion or MS needs to disable it).
- Tested this in VS by referencing the latest Razor SDK (preview 3) from NuGet and then replacing the Razor design time targets in VS to be the ones from the preview 3 package.
- Added workspace project state change detector tests.

dotnet/aspnetcore-tooling#8064
\n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/6a83ed13fcb127cae7e89414e878e075352fdbe4
