public ProjectDebuggerProvider(ConfiguredProject configuredProject, ILaunchSettingsProvider launchSettingsProvider, OrderPrecedenceImportCollection <IDebugProfileLaunchTargetsProvider> providers) : base(configuredProject) { ProfileLaunchTargetsProviders = providers; LaunchSettingsProvider = launchSettingsProvider; }
/// <summary> /// The initialization entry point for the page It also hooks into debug provider so that it can update when the profile changes /// </summary> protected void InitializePropertyPage() { if (_debugProfileProviderLink == null) { var debugProfilesBlock = new ActionBlock <ILaunchSettings>( async(profiles) => { if (_firstSnapshotCompleteSource == null) { await ProjectThreadingService.SwitchToUIThread(); } InitializeDebugTargetsCore(profiles); }); ILaunchSettingsProvider profileProvider = GetDebugProfileProvider(); _debugProfileProviderLink = profileProvider.SourceBlock.LinkTo( debugProfilesBlock, linkOptions: new DataflowLinkOptions { PropagateCompletion = true }); // We need to get the set of UI providers, if any. InitializeUIProviders(); } }
public LaunchProfileInitializer(UnconfiguredProject project, ILaunchSettingsProvider launchSettingsProvider) { Assumes.ThrowIfNull(project, nameof(project)); Assumes.ThrowIfNull(launchSettingsProvider, nameof(launchSettingsProvider)); _project = project; _launchSettingsProvider = launchSettingsProvider; }
public LaunchTargetPropertyPageValueProvider( UnconfiguredProject project, ILaunchSettingsProvider launchSettingsProvider, IProjectThreadingService projectThreadingService) { _project = project; _launchSettingsProvider = launchSettingsProvider; _projectThreadingService = projectThreadingService; }
public ProjectDebuggerProvider(ConfiguredProject configuredProject, ILaunchSettingsProvider launchSettingsProvider) : base(configuredProject) { LaunchSettingsProvider = launchSettingsProvider; // We want it sorted so that higher numbers come first (is the default for these collections but explicitly expressed here) ProfileLaunchTargetsProviders = new OrderPrecedenceImportCollection <IDebugProfileLaunchTargetsProvider>(ImportOrderPrecedenceComparer.PreferenceOrder.PreferredComesFirst, configuredProject.UnconfiguredProject); }
public LaunchSettingsTracker( UnconfiguredProject project, ILaunchSettingsProvider launchSettingsProvider, LaunchSettingsQueryVersionProvider versionProvider) { _project = project; _launchSettingsProvider = launchSettingsProvider; _versionProvider = versionProvider; }
protected virtual ILaunchSettingsProvider GetDebugProfileProvider() { if (_launchSettingsProvider == null) { _launchSettingsProvider = Project.Services.ExportProvider.GetExportedValue <ILaunchSettingsProvider>(); } return(_launchSettingsProvider); }
public ProjectDebuggerProvider(ConfiguredProject configuredProject, ILaunchSettingsProvider launchSettingsProvider, OrderPrecedenceImportCollection <IDebugProfileLaunchTargetsProvider> providers, IVsService <SVsShellDebugger, IVsDebugger4> vsDebuggerService) : base(configuredProject) { ProfileLaunchTargetsProviders = providers; _vsDebuggerService = vsDebuggerService; LaunchSettingsProvider = launchSettingsProvider; }
public ProjectLaunchProfileHandler( UnconfiguredProject project, ILaunchSettingsProvider launchSettingsProvider, LaunchSettingsTracker launchSettingsTracker) { _project = project; _launchSettingsProvider = launchSettingsProvider; _launchSettingsTracker = launchSettingsTracker; }
public DebugProfileDebugTargetGenerator( UnconfiguredProject project, ILaunchSettingsProvider launchSettingProvider, IProjectThreadingService threadingService) : base(project.Services) { LaunchSettingProvider = launchSettingProvider; ProjectThreadingService = threadingService; }
protected void InitializePropertyPage() { if (_debugProfileProviderLink == null) { ILaunchSettingsProvider profileProvider = GetDebugProfileProvider(); _debugProfileProviderLink = profileProvider.SourceBlock.LinkToAsyncAction(OnLaunchSettingsChanged); InitializeUIProviders(); } }
protected override Task ExecuteAsync(ILaunchSettingsProvider launchSettingsProvider, CancellationToken cancellationToken) { return(launchSettingsProvider.AddOrUpdateProfileAsync( new WritableLaunchProfile { Name = _executableStep.NewProfileName, CommandName = _executableStep.CommandName }.ToLaunchProfile(), addToFront: false)); }
public LaunchProfilesDebugLaunchProvider( ConfiguredProject configuredProject, ILaunchSettingsProvider launchSettingsProvider, IVsService <IVsDebuggerLaunchAsync> vsDebuggerService) : base(configuredProject) { _launchSettingsProvider = launchSettingsProvider; _vsDebuggerService = vsDebuggerService; LaunchTargetsProviders = new OrderPrecedenceImportCollection <IDebugProfileLaunchTargetsProvider>(projectCapabilityCheckProvider: configuredProject.UnconfiguredProject); }
public LanguageSpecification(ILaunchSettingsProvider _launchSettingsProvider) { var languageSpecFile = _launchSettingsProvider.LaunchSettings.LanguageSpec; if (!File.Exists(languageSpecFile)) { throw new FileNotFoundException(); } var json = File.ReadAllText(languageSpecFile); _langSpec = JsonConvert.DeserializeObject <LanguageSpec>(json); }
public LaunchProfilesDebugLaunchProvider( IProjectThreadingService threadingService, ConfiguredProject configuredProject, ILaunchSettingsProvider launchSettingsProvider, IVsService <SVsShellDebugger, IVsDebugger4> vsDebuggerService) : base(configuredProject) { _threadingService = threadingService; _launchSettingsProvider = launchSettingsProvider; _vsDebuggerService = vsDebuggerService; LaunchTargetsProviders = new OrderPrecedenceImportCollection <IDebugProfileLaunchTargetsProvider>(projectCapabilityCheckProvider: configuredProject.UnconfiguredProject); }
/// <summary> /// Create a new instance of the class. /// </summary> internal DebugProfileEnumValuesGenerator(ILaunchSettingsProvider profileProvider) { listedValues = new AsyncLazy <ICollection <IEnumValue> >(delegate { var curSnapshot = profileProvider.CurrentSnapshot; if (curSnapshot != null) { return(Task.FromResult(GetEnumeratorEnumValues(curSnapshot))); } ICollection <IEnumValue> emptyCollection = new List <IEnumValue>(); return(Task.FromResult(emptyCollection)); }); }
/// <summary> /// Functions which actually does the save of the settings. Persists the changes to the launch settings /// file and configures IIS if needed. /// </summary> public async virtual System.Threading.Tasks.Task SaveLaunchSettings() { ILaunchSettingsProvider provider = GetDebugProfileProvider(); if (EnvironmentVariables != null && EnvironmentVariables.Count > 0) { SelectedDebugProfile.MutableEnvironmentVariables = EnvironmentVariables.CreateDictionary(); } else if (SelectedDebugProfile != null) { SelectedDebugProfile.MutableEnvironmentVariables = null; } var globalSettings = provider.CurrentSnapshot.GlobalSettings; await provider.UpdateAndSaveSettingsAsync(new LaunchSettings(DebugProfiles, globalSettings, SelectedDebugProfile != null ? SelectedDebugProfile.Name : null)).ConfigureAwait(false); }
/// <summary> /// Blocks until at least one snapshot has been generated. /// </summary> /// <param name="provider">The underlying provider to satisfy this request.</param> /// <param name="token">An optional token to signal cancellation of the request.</param> /// <returns> /// The current <see cref="ILaunchSettings"/> snapshot. /// </returns> public static async Task <ILaunchSettings> WaitForFirstSnapshot(this ILaunchSettingsProvider provider, CancellationToken token = default) { // With an infinite timeout, the provider is contractually obligated to return a non-null value. Task <ILaunchSettings?> task = provider.WaitForFirstSnapshot(Timeout.Infinite); if (token.CanBeCanceled) { task = task.WithCancellation(token); } ILaunchSettings?launchSettings = await task; Assumes.NotNull(launchSettings); return(launchSettings); }
protected override async Task ExecuteAsync(ILaunchSettingsProvider launchSettingsProvider, CancellationToken cancellationToken) { ILaunchSettings?launchSettings = await launchSettingsProvider.WaitForFirstSnapshot(Timeout.Infinite).WithCancellation(cancellationToken); Assumes.NotNull(launchSettings); ILaunchProfile?existingProfile = launchSettings.Profiles.FirstOrDefault(p => StringComparers.LaunchProfileNames.Equals(p.Name, _executableStep.CurrentProfileName)); if (existingProfile is not null) { var writableProfile = new WritableLaunchProfile(existingProfile); writableProfile.Name = _executableStep.NewProfileName; writableProfile.CommandName = _executableStep.NewProfileCommandName; await launchSettingsProvider.AddOrUpdateProfileAsync(writableProfile.ToLaunchProfile(), addToFront : false); } }
/// <summary> /// Create a new instance of the class. /// </summary> internal DebugProfileEnumValuesGenerator( ILaunchSettingsProvider profileProvider, IProjectThreadingService threadingService) { Requires.NotNull(profileProvider, nameof(profileProvider)); Requires.NotNull(threadingService, nameof(threadingService)); _listedValues = new AsyncLazy <ICollection <IEnumValue> >(delegate { ILaunchSettings?curSnapshot = profileProvider.CurrentSnapshot; if (curSnapshot != null) { return(Task.FromResult(GetEnumeratorEnumValues(curSnapshot))); } ICollection <IEnumValue> emptyCollection = new List <IEnumValue>(); return(Task.FromResult(emptyCollection)); }, threadingService.JoinableTaskFactory); }
public virtual async Task SaveLaunchSettings() { ILaunchSettingsProvider provider = GetDebugProfileProvider(); if (EnvironmentVariables != null && EnvironmentVariables.Count > 0 && SelectedDebugProfile != null) { SelectedDebugProfile.EnvironmentVariables.Clear(); foreach (NameValuePair kvp in EnvironmentVariables) { SelectedDebugProfile.EnvironmentVariables.Add(kvp.Name, kvp.Value); } } else if (SelectedDebugProfile != null) { SelectedDebugProfile.EnvironmentVariables.Clear(); } await provider.UpdateAndSaveSettingsAsync(CurrentLaunchSettings.ToLaunchSettings()); }
/// <summary> /// Functions which actually does the save of the settings. Persists the changes to the launch settings /// file and configures IIS if needed. /// </summary> public async virtual System.Threading.Tasks.Task SaveLaunchSettings() { ILaunchSettingsProvider provider = GetDebugProfileProvider(); if (EnvironmentVariables != null && EnvironmentVariables.Count > 0 && SelectedDebugProfile != null) { SelectedDebugProfile.EnvironmentVariables.Clear(); foreach (var kvp in EnvironmentVariables) { SelectedDebugProfile.EnvironmentVariables.Add(kvp.Name, kvp.Value); } } else if (SelectedDebugProfile != null) { SelectedDebugProfile.EnvironmentVariables.Clear(); } await provider.UpdateAndSaveSettingsAsync(CurrentLaunchSettings.ToLaunchSettings()).ConfigureAwait(false); }
public Lexicon(ILaunchSettingsProvider launchSettingsProvider) { var dictionaryFile = launchSettingsProvider.LaunchSettings.Lexicon; if (!File.Exists(dictionaryFile)) { return; } var json = File.ReadAllText(dictionaryFile); var dictionary = JsonConvert.DeserializeObject <LexiconDictionary>(json); _dictionary[TokenType.Verb] = new HashSet <string>(); _dictionary[TokenType.Noun] = new HashSet <string>(); _dictionary[TokenType.Direction] = new HashSet <string>(); _dictionary[TokenType.Joiner] = new HashSet <string>(); _dictionary[TokenType.Verb].AddRange(dictionary.verbs); _dictionary[TokenType.Noun].AddRange(dictionary.nouns); _dictionary[TokenType.Direction].AddRange(dictionary.directions); _dictionary[TokenType.Joiner].AddRange(dictionary.joiners); }
public ActiveLaunchProfileCommonValueProvider(ILaunchSettingsProvider launchSettingsProvider) : base(launchSettingsProvider) { }
public WorkingDirectoryValueProvider(UnconfiguredProject project, ILaunchSettingsProvider launchSettingsProvider, IProjectThreadingService projectThreadingService) : base(project, launchSettingsProvider, projectThreadingService) { }
public LaunchSettingsValueProviderBase(ILaunchSettingsProvider launchSettingsProvider) { _launchSettingsProvider = launchSettingsProvider; }
public ActiveLaunchProfileCommonValueProvider(UnconfiguredProject project, ILaunchSettingsProvider launchSettingsProvider, IProjectThreadingService projectThreadingService) : base(project, launchSettingsProvider, projectThreadingService) { }
private static bool TryLocateHandler(string commandName, out ILaunchSettingsProvider provider) { return(_providers.TryGetValue(commandName, out provider)); }
public ActiveLaunchProfileNameValueProvider(ILaunchSettingsProvider launchSettings) { _launchSettings = launchSettings; }
public LaunchTargetValueProvider(UnconfiguredProject project, ILaunchSettingsProvider launchSettingsProvider, IProjectThreadingService projectThreadingService) : base(project, launchSettingsProvider, projectThreadingService) { }