public Configuration GetProjectConfiguration(ImmutableArray <AdditionalText> additionalFiles) { lock (ProjectConfigsLock) { foreach (var file in additionalFiles) { if (ProjectConfigs.TryGetValue(file.Path, out var projectConfiguration)) { return(projectConfiguration); } } var projectConfig = ConfigurationReader.GetProjectConfiguration(additionalFiles, out var configPath); if (projectConfig == null) { return(GetBuiltInAndUserConfiguration()); } var mergedConfig = new Configuration(GetBuiltInAndUserConfiguration()); mergedConfig.MergeWith(projectConfig); mergedConfig.PrepareForQueries(); ProjectConfigs[configPath] = mergedConfig; return(mergedConfig); } }
private Configuration GetBuiltInAndUserConfiguration(bool refreshUserConfig = false) { lock (ConfigurationLock) { if (refreshUserConfig == false && CachedBuiltInAndUserConfiguration != null) { return(CachedBuiltInAndUserConfiguration); } if (CachedBuiltInAndUserConfiguration == null) { CachedBuiltInConfiguration = ConfigurationReader.GetBuiltinConfiguration(); } CachedBuiltInAndUserConfiguration = new Configuration(CachedBuiltInConfiguration); var userConfig = ConfigurationReader.GetUserConfiguration(); if (userConfig != null) { CachedBuiltInAndUserConfiguration.MergeWith(userConfig); } CachedBuiltInAndUserConfiguration.PrepareForQueries(); return(CachedBuiltInAndUserConfiguration); } }
public Configuration GetBuiltInAndUserConfiguration() { var configuration = new Configuration(CachedBuiltInConfiguration.Value); var userConfig = Reader.GetUserConfiguration(); if (userConfig != null) { configuration.MergeWith(userConfig); } configuration.PrepareForQueries(); return(configuration); }
public Configuration GetProjectConfiguration(ImmutableArray <AdditionalText> additionalFiles) { var projectConfig = Reader.GetProjectConfiguration(additionalFiles, out var configPath); if (projectConfig == null) { return(GetBuiltInAndUserConfiguration()); } var mergedConfig = new Configuration(GetBuiltInAndUserConfiguration()); mergedConfig.MergeWith(projectConfig); mergedConfig.PrepareForQueries(); return(mergedConfig); }
public Configuration GetUpdatedProjectConfiguration(ImmutableArray <AdditionalText> additionalFiles) { lock (ProjectConfigsLock) { var projectConfig = ConfigurationReader.GetProjectConfiguration(additionalFiles, out var configPath); if (projectConfig == null) { return(GetBuiltInAndUserConfiguration(refreshUserConfig: true)); } var mergedConfig = new Configuration(GetBuiltInAndUserConfiguration(refreshUserConfig: true)); mergedConfig.MergeWith(projectConfig); mergedConfig.PrepareForQueries(); ProjectConfigs[configPath] = mergedConfig; return(mergedConfig); } }