// Copyright (c) .NET Foundation and contributors. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace Microsoft.DotNet.ProjectModel { public static class ProjectExtensions { private static readonly KeyValuePair[] _compilerNameToLanguageId = { new KeyValuePair("csc", "cs"), new KeyValuePair("vbc", "vb"), new KeyValuePair("fsc", "fs") }; public static string GetSourceCodeLanguage(this Project project) { foreach (var kvp in _compilerNameToLanguageId) { if (kvp.Key == (project._defaultCompilerOptions.CompilerName)) { return kvp.Value; } } return null; } } }