示例#1
0
        private EditFilter(
            IVsTextView vsTextView,
            ITextView textView,
            IEditorOperations editorOps,
            IServiceProvider serviceProvider,
            IComponentModel model,
            IOleCommandTarget next
            )
        {
            _vsTextView          = vsTextView;
            _textView            = textView;
            _editorOps           = editorOps;
            _serviceProvider     = serviceProvider;
            _componentModel      = model;
            _pyService           = _serviceProvider.GetPythonToolsService();
            _entryService        = _componentModel.GetService <AnalysisEntryService>();
            _undoManagerProvider = _componentModel.GetService <ITextBufferUndoManagerProvider>();
            _next = next;

            BraceMatcher.WatchBraceHighlights(textView, _componentModel);

            if (_next == null)
            {
                ErrorHandler.ThrowOnFailure(vsTextView.AddCommandFilter(this, out _next));
            }
        }
示例#2
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);
        }
示例#3
0
 public NavigableSymbolSource(IServiceProvider serviceProvider, ITextBuffer buffer, IClassifier classifier, ITextStructureNavigator textNavigator)
 {
     _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
     _buffer          = buffer ?? throw new ArgumentNullException(nameof(buffer));
     _classifier      = classifier ?? throw new ArgumentNullException(nameof(classifier));
     _textNavigator   = textNavigator ?? throw new ArgumentNullException(nameof(textNavigator));
     _entryService    = serviceProvider.GetEntryService();
 }
 public PythonClassifierProvider(
     IContentTypeRegistryService contentTypeRegistryService,
     [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider,
     IClassificationTypeRegistryService classificationRegistry,
     AnalysisEntryService entryService
     )
 {
     _type                   = contentTypeRegistryService.GetContentType(PythonCoreConstants.ContentType);
     _serviceProvider        = serviceProvider;
     _classificationRegistry = classificationRegistry;
     _entryService           = entryService;
 }