internal InterpreterOptions GetInterpreterOptions(string id) { InterpreterOptions options; if (!_interpreterOptions.TryGetValue(id, out options)) { _interpreterOptions[id] = options = new InterpreterOptions(this, _interpreterRegistry.FindConfiguration(id)); options.Load(); RaiseEnvironmentsChanged(); } return(options); }
private IInteractiveEvaluator GetEnvironmentEvaluator(IReadOnlyList <string> args) { var config = _interpreterService.FindConfiguration(args.ElementAtOrDefault(1)); var eval = new PythonInteractiveEvaluator(_serviceProvider) { DisplayName = args.ElementAtOrDefault(0), Configuration = new LaunchConfiguration(config) }; return(eval); }
private IInteractiveEvaluator GetEnvironmentEvaluator(IReadOnlyList <string> args) { var config = _interpreterService.FindConfiguration(args.ElementAtOrDefault(1)); var eval = new PythonInteractiveEvaluator(_serviceProvider) { DisplayName = args.ElementAtOrDefault(0), Configuration = new LaunchConfiguration(config) }; eval.Configuration.SearchPaths = _serviceProvider.GetPythonToolsService().GetGlobalPythonSearchPaths(config).ToList(); return(eval); }
private async void AddCustomEnvironment_Executed(object sender, ExecutedRoutedEventArgs e) { if (_service == null) { return; } const string baseName = "New Environment"; string name = baseName; int count = 2; while (_interpreters.FindConfiguration(CPythonInterpreterFactoryConstants.GetInterpreterId("VisualStudio", name)) != null) { name = baseName + " " + count++; } var factory = _service.AddConfigurableInterpreter( name, new InterpreterConfiguration( "", name, "", "python\\python.exe", arch: InterpreterArchitecture.x86 ) ); UpdateEnvironments(factory); await Dispatcher.InvokeAsync(() => { var coll = TryFindResource("SortedExtensions") as CollectionViewSource; if (coll != null) { var select = coll.View.OfType <ConfigurationExtensionProvider>().FirstOrDefault(); if (select != null) { coll.View.MoveCurrentTo(select); } } }, DispatcherPriority.Normal); }