Example #1
0
        internal PythonToolsService(IServiceContainer container)
        {
            _container = container;
            _analyzers = new ConcurrentDictionary <string, VsProjectAnalyzer>();

            _langPrefs = new Lazy <LanguagePreferences>(() => new LanguagePreferences(this, typeof(PythonLanguageInfo).GUID));
            _interpreterOptionsService  = new Lazy <IInterpreterOptionsService>(Site.GetComponentModel().GetService <IInterpreterOptionsService>);
            _interpreterRegistryService = new Lazy <IInterpreterRegistryService>(Site.GetComponentModel().GetService <IInterpreterRegistryService>);

            _optionsService = (IPythonToolsOptionsService)container.GetService(typeof(IPythonToolsOptionsService));

            _idleManager             = new IdleManager(container);
            _advancedOptions         = new Lazy <AdvancedEditorOptions>(CreateAdvancedEditorOptions);
            _debuggerOptions         = new Lazy <DebuggerOptions>(CreateDebuggerOptions);
            _experimentalOptions     = new Lazy <Options.ExperimentalOptions>(CreateExperimentalOptions);
            _diagnosticsOptions      = new Lazy <DiagnosticsOptions>(CreateDiagnosticsOptions);
            _generalOptions          = new Lazy <GeneralOptions>(CreateGeneralOptions);
            _suppressDialogOptions   = new Lazy <SuppressDialogOptions>(() => new SuppressDialogOptions(this));
            _interactiveOptions      = new Lazy <PythonInteractiveOptions>(() => CreateInteractiveOptions("Interactive"));
            _debugInteractiveOptions = new Lazy <PythonInteractiveOptions>(() => CreateInteractiveOptions("Debug Interactive Window"));
            _logger = (IPythonToolsLogger)container.GetService(typeof(IPythonToolsLogger));
            _diagnosticsProvider = new DiagnosticsProvider(container);

            _idleManager.OnIdle += OnIdleInitialization;

            EditorServices = ComponentModel.GetService <PythonEditorServices>();
            EditorServices.SetPythonToolsService(this);
        }
Example #2
0
        internal PythonToolsService(IServiceContainer container, bool forTests = false)
        {
            _forTests  = forTests;
            _container = container;

            _langPrefs = new Lazy <LanguagePreferences>(() => new LanguagePreferences(Site, typeof(PythonLanguageInfo).GUID));
            _interpreterOptionsService  = new Lazy <IInterpreterOptionsService>(Site.GetComponentModel().GetService <IInterpreterOptionsService>);
            _interpreterRegistryService = new Lazy <IInterpreterRegistryService>(Site.GetComponentModel().GetService <IInterpreterRegistryService>);

            _optionsService = (IPythonToolsOptionsService)container.GetService(typeof(IPythonToolsOptionsService));

            _idleManager             = !forTests ? new IdleManager(container) : null;
            _formattingOptions       = new Lazy <PythonFormattingOptions>(CreateFormattingOptions);
            _advancedEditorOptions   = new Lazy <PythonAdvancedEditorOptions>(CreateAdvancedEditorOptions);
            _debuggerOptions         = new Lazy <PythonDebuggingOptions>(CreateDebuggerOptions);
            _condaOptions            = new Lazy <PythonCondaOptions>(CreateCondaOptions);
            _analysisOptions         = new Lazy <PythonAnalysisOptions>(CreateAnalysisOptions);
            _generalOptions          = new Lazy <PythonGeneralOptions>(CreateGeneralOptions);
            _suppressDialogOptions   = new Lazy <SuppressDialogOptions>(() => new SuppressDialogOptions(this));
            _interactiveOptions      = new Lazy <PythonInteractiveOptions>(() => CreateInteractiveOptions("Interactive"));
            _debugInteractiveOptions = new Lazy <PythonInteractiveOptions>(() => CreateInteractiveOptions("Debug Interactive Window"));
            _diagnosticsProvider     = new DiagnosticsProvider(container);
            Logger = (IPythonToolsLogger)container.GetService(typeof(IPythonToolsLogger));
            EnvironmentSwitcherManager = new EnvironmentSwitcherManager(container);
            WorkspaceInfoBarManager    = new WorkspaceInfoBarManager(container);

            if (_idleManager != null)
            {
                _idleManager.OnIdle += OnIdleInitialization;
            }
        }
Example #3
0
        internal PythonToolsService(IServiceContainer container)
        {
            _container = container;

            _langPrefs = new Lazy <LanguagePreferences>(() => new LanguagePreferences(this, typeof(PythonLanguageInfo).GUID));
            _interpreterOptionsService = new Lazy <IInterpreterOptionsService>(CreateInterpreterOptionsService);

            _optionsService = (IPythonToolsOptionsService)container.GetService(typeof(IPythonToolsOptionsService));

            _idleManager             = new IdleManager(container);
            _advancedOptions         = new Lazy <AdvancedEditorOptions>(CreateAdvancedEditorOptions);
            _debuggerOptions         = new Lazy <DebuggerOptions>(CreateDebuggerOptions);
            _experimentalOptions     = new Lazy <Options.ExperimentalOptions>(CreateExperimentalOptions);
            _diagnosticsOptions      = new Lazy <DiagnosticsOptions>(CreateDiagnosticsOptions);
            _generalOptions          = new Lazy <GeneralOptions>(CreateGeneralOptions);
            _suppressDialogOptions   = new Lazy <SuppressDialogOptions>(() => new SuppressDialogOptions(this));
            _interactiveOptions      = new Lazy <PythonInteractiveOptions>(() => CreateInteractiveOptions("Interactive"));
            _debugInteractiveOptions = new Lazy <PythonInteractiveOptions>(() => CreateInteractiveOptions("Debug Interactive Window"));
            _logger              = new PythonToolsLogger(ComponentModel.GetExtensions <IPythonToolsLogger>().ToArray());
            _entryService        = (AnalysisEntryService)ComponentModel.GetService <IAnalysisEntryService>();
            _diagnosticsProvider = new DiagnosticsProvider(container);

            _idleManager.OnIdle += OnIdleInitialization;

            EditorServices.SetPythonToolsService(this);
        }