<commit_before>﻿// Copyright (c) Microsoft.  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.Collections.Immutable;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.MSBuild.Build;
using Roslyn.Utilities;
using MSB = Microsoft.Build;

namespace Microsoft.CodeAnalysis.MSBuild
{
    /// <summary>
    /// An API for loading msbuild project files.
    /// </summary>
    public partial class MSBuildProjectLoader
    {
        // the workspace that the projects and solutions are intended to be loaded into.
        private readonly Workspace _workspace;

        private readonly DiagnosticReporter _diagnosticReporter;
        private readonly PathResolver _pathResolver;
        private readonly ProjectFileLoaderRegistry _projectFileLoaderRegistry;

        // used to protect access to the following mutable state
        private readonly NonReentrantLock _dataGuard = new NonReentrantLock();
        private ImmutableDictionary<string, string> _properties;

        internal readonly ProjectBuildManager BuildManager;

        internal MSBuildProjectLoader(
            Workspace workspace,
            DiagnosticReporter diagnosticReporter,
            ProjectFileLoaderRegistry projectFileLoaderRegistry,
            ImmutableDictionary<string, string> properties)
        {
            _workspace = workspace;
            _diagnosticReporter = diagnosticReporter ?? new DiagnosticReporter(workspace);
            _pathResolver = new PathResolver(_diagnosticReporter);
            _projectFileLoaderRegistry = projectFileLoaderRegistry ?? new ProjectFileLoaderRegistry(workspace, _diagnosticReporter);
            _properties = properties ?? ImmutableDictionary<string, string>.Empty;

            BuildManager = new ProjectBuildManager();
        }

        /// <summary>
        /// Create a new instance of an <see cref="MSBuildProjectLoader"/>.<commit_msg>Use case-insensitive string comparison in MSBuildProjectLoader properties map<commit_after>﻿// Copyright (c) Microsoft.  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.Collections.Immutable;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.MSBuild.Build;
using Roslyn.Utilities;
using MSB = Microsoft.Build;

namespace Microsoft.CodeAnalysis.MSBuild
{
    /// <summary>
    /// An API for loading msbuild project files.
    /// </summary>
    public partial class MSBuildProjectLoader
    {
        // the workspace that the projects and solutions are intended to be loaded into.
        private readonly Workspace _workspace;

        private readonly DiagnosticReporter _diagnosticReporter;
        private readonly PathResolver _pathResolver;
        private readonly ProjectFileLoaderRegistry _projectFileLoaderRegistry;

        // used to protect access to the following mutable state
        private readonly NonReentrantLock _dataGuard = new NonReentrantLock();
        private ImmutableDictionary<string, string> _properties;

        internal readonly ProjectBuildManager BuildManager;

        internal MSBuildProjectLoader(
            Workspace workspace,
            DiagnosticReporter diagnosticReporter,
            ProjectFileLoaderRegistry projectFileLoaderRegistry,
            ImmutableDictionary<string, string> properties)
        {
            _workspace = workspace;
            _diagnosticReporter = diagnosticReporter ?? new DiagnosticReporter(workspace);
            _pathResolver = new PathResolver(_diagnosticReporter);
            _projectFileLoaderRegistry = projectFileLoaderRegistry ?? new ProjectFileLoaderRegistry(workspace, _diagnosticReporter);

            _properties = ImmutableDictionary.Create<string, string>(StringComparer.OrdinalIgnoreCase);

            if (properties != null)
            {
                _properties = _properties.AddRange(properties);
            }

            BuildManager = new ProjectBuildManager();
        }

        /// <summary>
        /// Create a new instance of an <see cref="MSBuildProjectLoader"/>.
{'fraction_non_alphanumeric': 0.06298290798407867, 'fraction_numerical': 0.0009365488176071178, 'mean_word_length': 3.1556420233463034, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3400227', 'n_tokens_mistral': 976, 'n_tokens_neox': 960, 'n_words': 306}