public ColorResolvingFormatDefinition(IEditorFormatMapService service, string property, string category = null, bool foreground = false, bool background = false)
        {
            if (foreground)
            {
                ForegroundBrush = GetBrush(service, category, property, ForegroundBrushId);

                if (ForegroundBrush == null)
                {
                    ForegroundColor = GetColor(service, category, property, ForegroundColorId);
                }

                if (ForegroundBrush == null && ForegroundColor.HasValue)
                {
                    ForegroundBrush = new SolidColorBrush(ForegroundColor.Value);
                }
            }

            if (background)
            {
                BackgroundBrush = GetBrush(service, category, property, BackgroundBrushId);

                if (BackgroundBrush == null)
                {
                    BackgroundColor = GetColor(service, category, property, BackgroundColorId);
                }

                if (BackgroundBrush == null && BackgroundColor.HasValue)
                {
                    BackgroundBrush = new SolidColorBrush(BackgroundColor.Value);
                }
            }
        }
Ejemplo n.º 2
0
 internal CommandMarginProvider(
     IVim vim,
     IEditorFormatMapService editorFormatMapService)
 {
     _vim = vim;
     _editorFormatMapService = editorFormatMapService;
 }
        public StreamingFindUsagesPresenter(
            IThreadingContext threadingContext,
            VisualStudioWorkspace workspace,
            Shell.SVsServiceProvider serviceProvider,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            ClassificationTypeMap typeMap,
            IEditorFormatMapService formatMapService,
            IClassificationFormatMapService classificationFormatMapService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            [ImportMany] IEnumerable <ITableColumnDefinition> columns)
            : base(threadingContext)
        {
            _workspace                 = workspace;
            _serviceProvider           = serviceProvider;
            TextBufferFactoryService   = textBufferFactoryService;
            ContentTypeRegistryService = contentTypeRegistryService;

            TextEditorFactoryService = textEditorFactoryService;
            TypeMap                        = typeMap;
            FormatMapService               = formatMapService;
            ClassificationFormatMap        = classificationFormatMapService.GetClassificationFormatMap("tooltip");
            ProjectionBufferFactoryService = projectionBufferFactoryService;
            EditorOptionsFactoryService    = editorOptionsFactoryService;

            _vsFindAllReferencesService = (IFindAllReferencesService)_serviceProvider.GetService(typeof(SVsFindAllReferences));
            _customColumns = columns.OfType <AbstractFindUsagesCustomColumnDefinition>().ToImmutableArray();
        }
        public StreamingFindReferencesPresenter(
            Shell.SVsServiceProvider serviceProvider,
            ITextBufferFactoryService textBufferFactoryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            ClassificationTypeMap typeMap,
            IEditorFormatMapService formatMapService,
            [ImportMany] IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > asyncListeners)
        {
            _serviceProvider                = serviceProvider;
            _textBufferFactoryService       = textBufferFactoryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService    = editorOptionsFactoryService;
            _contentTypeRegistryService     = contentTypeRegistryService;

            _textEditorFactoryService = textEditorFactoryService;
            _typeMap          = typeMap;
            _formatMapService = formatMapService;

            _asyncListener = new AggregateAsynchronousOperationListener(
                asyncListeners, FeatureAttribute.ReferenceHighlighting);

            _vsFindAllReferencesService = (IFindAllReferencesService)_serviceProvider.GetService(typeof(SVsFindAllReferences));
        }
Ejemplo n.º 5
0
        public StreamingFindUsagesPresenter(
            IThreadingContext threadingContext,
            VisualStudioWorkspace workspace,
            Shell.SVsServiceProvider serviceProvider,
            ITextBufferFactoryService textBufferFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            ClassificationTypeMap typeMap,
            IEditorFormatMapService formatMapService,
            IClassificationFormatMapService classificationFormatMapService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService)
            : base(threadingContext)
        {
            _workspace                 = workspace;
            _serviceProvider           = serviceProvider;
            TextBufferFactoryService   = textBufferFactoryService;
            ContentTypeRegistryService = contentTypeRegistryService;

            TextEditorFactoryService = textEditorFactoryService;
            TypeMap                        = typeMap;
            FormatMapService               = formatMapService;
            ClassificationFormatMap        = classificationFormatMapService.GetClassificationFormatMap("tooltip");
            ProjectionBufferFactoryService = projectionBufferFactoryService;
            EditorOptionsFactoryService    = editorOptionsFactoryService;

            _vsFindAllReferencesService = (IFindAllReferencesService)_serviceProvider.GetService(typeof(SVsFindAllReferences));
        }
Ejemplo n.º 6
0
 internal BlockCaretFactoryService(IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService formatMapService, IControlCharUtil controlCharUtil, IVimProtectedOperations protectedOperations)
 {
     _classificationFormatMapService = classificationFormatMapService;
     _formatMapService    = formatMapService;
     _controlCharUtil     = controlCharUtil;
     _protectedOperations = protectedOperations;
 }
Ejemplo n.º 7
0
 internal BlockCaretFactoryService(IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService formatMapService, IControlCharUtil controlCharUtil, IVimProtectedOperations protectedOperations)
 {
     _classificationFormatMapService = classificationFormatMapService;
     _formatMapService = formatMapService;
     _controlCharUtil = controlCharUtil;
     _protectedOperations = protectedOperations;
 }
Ejemplo n.º 8
0
 internal ConflictingKeyBindingMarginProvider(IVim vim, IKeyBindingService keyBindingService, IEditorFormatMapService formatMapService, IVimApplicationSettings vimApplicationSettings)
 {
     _vim = vim;
     _keyBindingService      = keyBindingService;
     _formatMapService       = formatMapService;
     _vimApplicationSettings = vimApplicationSettings;
 }
Ejemplo n.º 9
0
 public StructureVisualizerService(IWpfTextView wpfTextView, IEditorFormatMapService editorFormatMapService)
 {
     if (wpfTextView == null)
     {
         throw new ArgumentNullException(nameof(wpfTextView));
     }
     if (editorFormatMapService == null)
     {
         throw new ArgumentNullException(nameof(editorFormatMapService));
     }
     this.wpfTextView            = wpfTextView;
     this.editorFormatMapService = editorFormatMapService;
     this.structureVisualizerServiceDataProvider = NullStructureVisualizerServiceDataProvider.Instance;
     this.onRemovedDelegate = OnRemoved;
     this.lineElements      = new List <LineElement>();
     this.xPosCache         = new XPosCache(wpfTextView);
     this.lineColorInfos    = new List <LineColorInfo> {
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerNamespace),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerType),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerMethod),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerConditional),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerLoop),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerProperty),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerEvent),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerTry),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerCatch),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerFilter),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerFinally),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerFault),
         new LineColorInfo(ThemeClassificationTypeNameKeys.StructureVisualizerOther),
     };
     wpfTextView.Closed += WpfTextView_Closed;
     wpfTextView.Options.OptionChanged += Options_OptionChanged;
     UpdateEnabled();
 }
Ejemplo n.º 10
0
 TextEditorFactoryService(ITextBufferFactoryService textBufferFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, ICommandService commandService, ISmartIndentationService smartIndentationService, [ImportMany] IEnumerable <Lazy <IWpfTextViewCreationListener, IDeferrableContentTypeAndTextViewRoleMetadata> > wpfTextViewCreationListeners, [ImportMany] IEnumerable <Lazy <ITextViewCreationListener, IDeferrableContentTypeAndTextViewRoleMetadata> > textViewCreationListeners, IFormattedTextSourceFactoryService formattedTextSourceFactoryService, IViewClassifierAggregatorService viewClassifierAggregatorService, ITextAndAdornmentSequencerFactoryService textAndAdornmentSequencerFactoryService, IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService editorFormatMapService, IAdornmentLayerDefinitionService adornmentLayerDefinitionService, ILineTransformProviderService lineTransformProviderService, IWpfTextViewMarginProviderCollectionProvider wpfTextViewMarginProviderCollectionProvider, IMenuService menuService, IEditorOperationsFactoryService editorOperationsFactoryService, ISpaceReservationStackProvider spaceReservationStackProvider, IWpfTextViewConnectionListenerServiceProvider wpfTextViewConnectionListenerServiceProvider, IBufferGraphFactoryService bufferGraphFactoryService, [ImportMany] IEnumerable <Lazy <ITextViewModelProvider, IContentTypeAndTextViewRoleMetadata> > textViewModelProviders, IContentTypeRegistryService contentTypeRegistryService, IThemeService themeService, Lazy <ITextViewUndoManagerProvider> textViewUndoManagerProvider)
 {
     this.textBufferFactoryService    = textBufferFactoryService;
     this.editorOptionsFactoryService = editorOptionsFactoryService;
     this.commandService                              = commandService;
     this.smartIndentationService                     = smartIndentationService;
     this.wpfTextViewCreationListeners                = wpfTextViewCreationListeners.ToArray();
     this.textViewCreationListeners                   = textViewCreationListeners.ToArray();
     this.formattedTextSourceFactoryService           = formattedTextSourceFactoryService;
     this.viewClassifierAggregatorService             = viewClassifierAggregatorService;
     this.textAndAdornmentSequencerFactoryService     = textAndAdornmentSequencerFactoryService;
     this.classificationFormatMapService              = classificationFormatMapService;
     this.editorFormatMapService                      = editorFormatMapService;
     this.adornmentLayerDefinitionService             = adornmentLayerDefinitionService;
     this.lineTransformProviderService                = lineTransformProviderService;
     this.wpfTextViewMarginProviderCollectionProvider = wpfTextViewMarginProviderCollectionProvider;
     this.menuService = menuService;
     this.editorOperationsFactoryService = editorOperationsFactoryService;
     this.spaceReservationStackProvider  = spaceReservationStackProvider;
     this.wpfTextViewConnectionListenerServiceProvider = wpfTextViewConnectionListenerServiceProvider;
     this.bufferGraphFactoryService  = bufferGraphFactoryService;
     this.textViewModelProviders     = textViewModelProviders.ToArray();
     this.contentTypeRegistryService = contentTypeRegistryService;
     this.themeService = themeService;
     this.textViewUndoManagerProvider = textViewUndoManagerProvider;
 }
Ejemplo n.º 11
0
 internal CharDisplayTaggerSourceFactory(IVim vim, IEditorFormatMapService editorFormatMapService, IControlCharUtil controlCharUtil, IClassificationFormatMapService classificationFormatMapService)
 {
     _editorFormatMapService = editorFormatMapService;
     _vim             = vim;
     _controlCharUtil = controlCharUtil;
     _classificationFormatMapService = classificationFormatMapService;
 }
Ejemplo n.º 12
0
        public GlyphMargin(IMenuService menuService, IWpfTextViewHost wpfTextViewHost, IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService, Lazy <IGlyphMouseProcessorProvider, IGlyphMouseProcessorProviderMetadata>[] glyphMouseProcessorProviders, Lazy <IGlyphFactoryProvider, IGlyphMetadata>[] glyphFactoryProviders, IMarginContextMenuService marginContextMenuHandlerProviderService)
        {
            if (menuService is null)
            {
                throw new ArgumentNullException(nameof(menuService));
            }
            glyphFactories       = new Dictionary <Type, GlyphFactoryInfo>();
            childCanvases        = Array.Empty <Canvas>();
            this.wpfTextViewHost = wpfTextViewHost ?? throw new ArgumentNullException(nameof(wpfTextViewHost));
            this.viewTagAggregatorFactoryService = viewTagAggregatorFactoryService ?? throw new ArgumentNullException(nameof(viewTagAggregatorFactoryService));
            this.editorFormatMapService          = editorFormatMapService ?? throw new ArgumentNullException(nameof(editorFormatMapService));
            lazyGlyphMouseProcessorProviders     = glyphMouseProcessorProviders ?? throw new ArgumentNullException(nameof(glyphMouseProcessorProviders));
            lazyGlyphFactoryProviders            = glyphFactoryProviders ?? throw new ArgumentNullException(nameof(glyphFactoryProviders));

            var binding = new Binding {
                Path   = new PropertyPath(BackgroundProperty),
                Source = this,
            };

            SetBinding(DsImage.BackgroundBrushProperty, binding);

            wpfTextViewHost.TextView.Options.OptionChanged += Options_OptionChanged;
            wpfTextViewHost.TextView.ZoomLevelChanged      += TextView_ZoomLevelChanged;
            IsVisibleChanged += GlyphMargin_IsVisibleChanged;
            UpdateVisibility();
            Width        = MARGIN_WIDTH;
            ClipToBounds = true;
            menuService.InitializeContextMenu(VisualElement, new Guid(MenuConstants.GUIDOBJ_GLYPHMARGIN_GUID), marginContextMenuHandlerProviderService.Create(wpfTextViewHost, this, PredefinedMarginNames.Glyph), null, new Guid(MenuConstants.GLYPHMARGIN_GUID));
        }
		protected ClassificationFormatMapService(IThemeService themeService, IEditorFormatMapService editorFormatMapService, IEditorFormatDefinitionService editorFormatDefinitionService, IClassificationTypeRegistryService classificationTypeRegistryService) {
			this.themeService = themeService;
			this.editorFormatMapService = editorFormatMapService;
			this.editorFormatDefinitionService = editorFormatDefinitionService;
			this.classificationTypeRegistryService = classificationTypeRegistryService;
			toCategoryMap = new Dictionary<IEditorFormatMap, IClassificationFormatMap>();
		}
        public PrintfColorManager(ThemeManager themeManager, IEditorFormatMapService editorFormatMapService)
        {
            _themeManager           = themeManager;
            _editorFormatMapService = editorFormatMapService;

            _currentTheme = _themeManager.GetCurrentTheme();
        }
Ejemplo n.º 15
0
 internal CommandMarginProvider(
     IVim vim,
     IEditorFormatMapService editorFormatMapService)
 {
     _vim = vim;
     _editorFormatMapService = editorFormatMapService;
 }
Ejemplo n.º 16
0
 public DashboardAdornmentProvider(
     InlineRenameService renameService,
     IEditorFormatMapService editorFormatMapService)
 {
     _renameService          = renameService;
     _editorFormatMapService = editorFormatMapService;
 }
 internal ConflictingKeyBindingMarginProvider(IVim vim, IKeyBindingService keyBindingService, IEditorFormatMapService formatMapService, IVimApplicationSettings vimApplicationSettings)
 {
     _vim = vim;
     _keyBindingService = keyBindingService;
     _formatMapService = formatMapService;
     _vimApplicationSettings = vimApplicationSettings;
 }
 internal ConflictingKeyBindingMarginProvider(IVim vim, IKeyBindingService keyBindingService, IEditorFormatMapService formatMapService, ILegacySettings legacySettings)
 {
     _vim = vim;
     _keyBindingService = keyBindingService;
     _formatMapService  = formatMapService;
     _legacySettings    = legacySettings;
 }
        public StreamingFindReferencesPresenter(
            Shell.SVsServiceProvider serviceProvider,
            ITextBufferFactoryService textBufferFactoryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            ClassificationTypeMap typeMap,
            IEditorFormatMapService formatMapService,
            [ImportMany] IEnumerable<Lazy<IAsynchronousOperationListener, FeatureMetadata>> asyncListeners)
        {
            _serviceProvider = serviceProvider;
            _textBufferFactoryService = textBufferFactoryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService = editorOptionsFactoryService;
            _contentTypeRegistryService = contentTypeRegistryService;

            _textEditorFactoryService = textEditorFactoryService;
            _typeMap = typeMap;
            _formatMapService = formatMapService;

            _asyncListener = new AggregateAsynchronousOperationListener(
                asyncListeners, FeatureAttribute.ReferenceHighlighting);

            _vsFindAllReferencesService = (IFindAllReferencesService)_serviceProvider.GetService(typeof(SVsFindAllReferences));
        }
Ejemplo n.º 20
0
        public InlineCommentMargin(
            IWpfTextViewHost wpfTextViewHost,
            IInlineCommentPeekService peekService,
            IEditorFormatMapService editorFormatMapService,
            IViewTagAggregatorFactoryService tagAggregatorFactory,
            Lazy <IPullRequestSessionManager> sessionManager)
        {
            textView            = wpfTextViewHost.TextView;
            this.sessionManager = sessionManager.Value;

            // Default to not show comment margin
            textView.Options.SetOptionValue(InlineCommentTextViewOptions.MarginEnabledId, false);

            marginGrid = new GlyphMarginGrid {
                Width = 17.0
            };
            var glyphFactory    = new InlineCommentGlyphFactory(peekService, textView);
            var editorFormatMap = editorFormatMapService.GetEditorFormatMap(textView);

            glyphMargin = new GlyphMargin <InlineCommentTag>(textView, glyphFactory, marginGrid, tagAggregatorFactory,
                                                             editorFormatMap, MarginPropertiesName);

            if (IsDiffView())
            {
                TrackCommentGlyph(wpfTextViewHost, marginGrid);
            }

            currentSessionSubscription = this.sessionManager.WhenAnyValue(x => x.CurrentSession)
                                         .Subscribe(x => RefreshCurrentSession().Forget());

            visibleSubscription = marginGrid.WhenAnyValue(x => x.IsVisible)
                                  .Subscribe(x => textView.Options.SetOptionValue(InlineCommentTextViewOptions.MarginVisibleId, x));

            textView.Options.OptionChanged += (s, e) => RefreshMarginVisibility();
        }
 internal ConflictingKeyBindingMarginProvider(IVim vim, IKeyBindingService keyBindingService, IEditorFormatMapService formatMapService, ILegacySettings legacySettings)
 {
     _vim = vim;
     _keyBindingService = keyBindingService;
     _formatMapService = formatMapService;
     _legacySettings = legacySettings;
 }
Ejemplo n.º 22
0
 public ScssImportanceModifier(IEditorFormatMapService service)
     : base(service, "Keyword", foreground: true, category: "{E0187991-B458-4F7E-8CA9-42C9A573B56C}")
 {
     DisplayName = "SCSS Importance Modifier";
     ForegroundCustomizable = true;
     IsBold = true;
 }
Ejemplo n.º 23
0
        internal static void Attach(IWpfTextView view, IEditorOptions options, IEditorFormatMapService formatMapService, IEolOptions eolOptions)
        {
            var textView  = new EolAdornedTextView(view, view.GetAdornmentLayer("EolAdornment"), eolOptions);
            var adornment = new EolAdornment(options, formatMapService, textView, eolOptions);

            view.Closed += adornment.OnClosed;
        }
Ejemplo n.º 24
0
 GlyphTextMarkerService(IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService, [ImportMany] IEnumerable <Lazy <IGlyphTextMarkerMouseProcessorProvider, IGlyphTextMarkerMouseProcessorProviderMetadata> > glyphTextMarkerMouseProcessorProviders)
 {
     ViewTagAggregatorFactoryService = viewTagAggregatorFactoryService;
     EditorFormatMapService          = editorFormatMapService;
     glyphTextMarkers = new HashSet <IGlyphTextMarkerImpl>();
     GlyphTextMarkerMouseProcessorProviders = Orderer.Order(glyphTextMarkerMouseProcessorProviders).ToArray();
 }
 protected ClassificationFormatMapService(IThemeService themeService, IEditorFormatMapService editorFormatMapService, IEditorFormatDefinitionService editorFormatDefinitionService, IClassificationTypeRegistryService classificationTypeRegistryService)
 {
     this.themeService                      = themeService;
     this.editorFormatMapService            = editorFormatMapService;
     this.editorFormatDefinitionService     = editorFormatDefinitionService;
     this.classificationTypeRegistryService = classificationTypeRegistryService;
     toCategoryMap = new Dictionary <IEditorFormatMap, IClassificationFormatMap>();
 }
Ejemplo n.º 26
0
 public DiagnosticsSuggestionTaggerProvider(
     IEditorFormatMapService editorFormatMapService,
     IDiagnosticService diagnosticService,
     IForegroundNotificationService notificationService,
     [ImportMany] IEnumerable <Lazy <IAsynchronousOperationListener, FeatureMetadata> > listeners)
     : base(diagnosticService, notificationService, listeners)
 {
 }
Ejemplo n.º 27
0
		GlyphMarginProvider(IMenuService menuService, IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService, [ImportMany] IEnumerable<Lazy<IGlyphMouseProcessorProvider, IGlyphMouseProcessorProviderMetadata>> glyphMouseProcessorProviders, [ImportMany] IEnumerable<Lazy<IGlyphFactoryProvider, IGlyphMetadata>> glyphFactoryProviders, IMarginContextMenuService marginContextMenuHandlerProviderService) {
			this.menuService = menuService;
			this.viewTagAggregatorFactoryService = viewTagAggregatorFactoryService;
			this.editorFormatMapService = editorFormatMapService;
			this.glyphMouseProcessorProviders = Orderer.Order(glyphMouseProcessorProviders).ToArray();
			this.glyphFactoryProviders = Orderer.Order(glyphFactoryProviders).ToArray();
			this.marginContextMenuHandlerProviderService = marginContextMenuHandlerProviderService;
		}
Ejemplo n.º 28
0
 public ScssInterpolation(IEditorFormatMapService service)
     : base(service, "Preprocessor Keyword", category: "{E0187991-B458-4F7E-8CA9-42C9A573B56C}", foreground: true, background: true)
 {
     DisplayName            = "SCSS Interpolation";
     ForegroundCustomizable = true;
     BackgroundCustomizable = true;
     IsBold = true;
 }
Ejemplo n.º 29
0
 internal CommandMarginProvider(
     IVim vim,
     IEditorFormatMapService editorFormatMapService,
     IClassificationFormatMapService classificationFormatMapService)
 {
     _vim = vim;
     _editorFormatMapService = editorFormatMapService;
     _classificationFormatMapService = classificationFormatMapService;
 }
Ejemplo n.º 30
0
 GlyphMarginProvider(IMenuService menuService, IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService, [ImportMany] IEnumerable <Lazy <IGlyphMouseProcessorProvider, IGlyphMouseProcessorProviderMetadata> > glyphMouseProcessorProviders, [ImportMany] IEnumerable <Lazy <IGlyphFactoryProvider, IGlyphMetadata> > glyphFactoryProviders, IMarginContextMenuService marginContextMenuHandlerProviderService)
 {
     this.menuService = menuService;
     this.viewTagAggregatorFactoryService         = viewTagAggregatorFactoryService;
     this.editorFormatMapService                  = editorFormatMapService;
     this.glyphMouseProcessorProviders            = Orderer.Order(glyphMouseProcessorProviders).ToArray();
     this.glyphFactoryProviders                   = Orderer.Order(glyphFactoryProviders).ToArray();
     this.marginContextMenuHandlerProviderService = marginContextMenuHandlerProviderService;
 }
Ejemplo n.º 31
0
 public StringIndentationTaggerProvider(
     IThreadingContext threadingContext,
     IEditorFormatMapService editorFormatMapService,
     IGlobalOptionService globalOptions,
     IAsynchronousOperationListenerProvider listenerProvider)
     : base(threadingContext, globalOptions, listenerProvider.GetListener(FeatureAttribute.StringIndentation))
 {
     _editorFormatMap = editorFormatMapService.GetEditorFormatMap("text");
 }
Ejemplo n.º 32
0
 internal CommandMarginProvider(
     IVim vim,
     IEditorFormatMapService editorFormatMapService,
     [ImportMany] IEnumerable <Lazy <IOptionsProviderFactory> > optionsProviderFactories)
 {
     _vim = vim;
     _editorFormatMapService   = editorFormatMapService;
     _optionsProviderFactories = optionsProviderFactories.ToList().AsReadOnly();
 }
 public DashboardAdornmentProvider(
     InlineRenameService renameService,
     IEditorFormatMapService editorFormatMapService,
     [Import(AllowDefault = true)] IDashboardColorUpdater?dashboardColorUpdater)
 {
     _renameService          = renameService;
     _editorFormatMapService = editorFormatMapService;
     _dashboardColorUpdater  = dashboardColorUpdater;
 }
Ejemplo n.º 34
0
 public ThemeColorManager(
     IEditorFormatMapService editorFormatMapService,
     IClassificationFormatMapService classificationFormatMapService,
     IClassificationTypeRegistryService classificationTypeRegistry)
 {
     _editorFormatMapService         = editorFormatMapService;
     _classificationFormatMapService = classificationFormatMapService;
     _classificationTypeRegistry     = classificationTypeRegistry;
 }
Ejemplo n.º 35
0
 internal CommandMarginProvider(
     IVim vim,
     IEditorFormatMapService editorFormatMapService,
     IClassificationFormatMapService classificationFormatMapService)
 {
     _vim = vim;
     _editorFormatMapService         = editorFormatMapService;
     _classificationFormatMapService = classificationFormatMapService;
 }
Ejemplo n.º 36
0
 internal CommandMarginProvider(
     IVim vim,
     IEditorFormatMapService editorFormatMapService,
     [ImportMany] IEnumerable<Lazy<IOptionsProviderFactory>> optionsProviderFactories)
 {
     _vim = vim;
     _editorFormatMapService = editorFormatMapService;
     _optionsProviderFactories = optionsProviderFactories.ToList().AsReadOnly();
 }
Ejemplo n.º 37
0
 GlyphTextMarkerService(IModuleIdProvider moduleIdProvider, IThemeService themeService, IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService, [ImportMany] IEnumerable <Lazy <IGlyphTextMarkerMouseProcessorProvider, IGlyphTextMarkerMouseProcessorProviderMetadata> > glyphTextMarkerMouseProcessorProviders)
 {
     this.moduleIdProvider                       = moduleIdProvider;
     ThemeService                                = themeService;
     ViewTagAggregatorFactoryService             = viewTagAggregatorFactoryService;
     EditorFormatMapService                      = editorFormatMapService;
     this.glyphTextMarkers                       = new HashSet <IGlyphTextMarkerImpl>();
     this.GlyphTextMarkerMouseProcessorProviders = Orderer.Order(glyphTextMarkerMouseProcessorProviders).ToArray();
 }
Ejemplo n.º 38
0
 internal PasteFactoryService(
     IClassificationFormatMapService classificationFormatMapService,
     IEditorFormatMapService formatMapService,
     IProtectedOperations protectedOperations)
 {
     _classificationFormatMapService = classificationFormatMapService;
     _formatMapService    = formatMapService;
     _protectedOperations = protectedOperations;
 }
Ejemplo n.º 39
0
 public StringIndentationTaggerProvider(
     IThreadingContext threadingContext,
     IEditorFormatMapService editorFormatMapService,
     IGlobalOptionService globalOptions,
     [Import(AllowDefault = true)] ITextBufferVisibilityTracker?visibilityTracker,
     IAsynchronousOperationListenerProvider listenerProvider)
     : base(threadingContext, globalOptions, visibilityTracker, listenerProvider.GetListener(FeatureAttribute.StringIndentation))
 {
     _editorFormatMap = editorFormatMapService.GetEditorFormatMap("text");
 }
Ejemplo n.º 40
0
        internal ColorColumnAdornmentFactory(IEditorFormatMapService formatMapService, SVsServiceProvider serviceProvider)
        {
            this.formatMapService = formatMapService;

            IVsPackage package;

            var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            Marshal.ThrowExceptionForHR(shell.LoadPackage(new Guid(GuidList.colorColumnPkgString), out package));

            this.settings = ((ColorColumnPackage)package).Settings;
        }
Ejemplo n.º 41
0
        public MarginCore(IWpfTextView textView, IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService editorFormatMapService)
        {
            _textView = textView;

            _classificationFormatMap = classificationFormatMapService.GetClassificationFormatMap(textView);

            _editorFormatMap = editorFormatMapService.GetEditorFormatMap(textView);
            _editorFormatMap.FormatMappingChanged += HandleFormatMappingChanged;

            _textView.Options.OptionChanged += HandleOptionChanged;

            _textView.Closed += (sender, e) =>
            {
                _editorFormatMap.FormatMappingChanged -= HandleFormatMappingChanged;
            };

            UpdateBrushes();
        }
        public HistorySelectionTextAdornment(IWpfTextView textView, IEditorFormatMapService editorFormatMapService, IRHistoryProvider historyProvider) {
            _textView = textView;
            _layer = textView.GetAdornmentLayer("HistorySelectionTextAdornment");

            _editorFormatMap = editorFormatMapService.GetEditorFormatMap(_textView);
            _history = historyProvider.GetAssociatedRHistory(_textView);

            // Advise to events
            _editorFormatMap.FormatMappingChanged += OnFormatMappingChanged;
            _textView.VisualElement.GotKeyboardFocus += OnGotKeyboardFocus;
            _textView.VisualElement.LostKeyboardFocus += OnLostKeyboardFocus;
            _textView.LayoutChanged += OnLayoutChanged;
            _textView.Closed += OnClosed;
            _history.SelectionChanged += OnSelectionChanged;

            _activeVisualToolset = CreateVisualToolset(ActiveSelectionPropertiesName, SystemColors.HighlightColor);
            _inactiveVisualToolset = CreateVisualToolset(InactiveSelectionPropertiesName, SystemColors.GrayTextColor);
            Redraw();
        }
Ejemplo n.º 43
0
        public StreamingFindUsagesPresenter(
            Shell.SVsServiceProvider serviceProvider,
            ITextBufferFactoryService textBufferFactoryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextEditorFactoryService textEditorFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            ClassificationTypeMap typeMap,
            IEditorFormatMapService formatMapService)
        {
            _serviceProvider = serviceProvider;
            _textBufferFactoryService = textBufferFactoryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService = editorOptionsFactoryService;
            _contentTypeRegistryService = contentTypeRegistryService;

            _textEditorFactoryService = textEditorFactoryService;
            _typeMap = typeMap;
            _formatMapService = formatMapService;

            _vsFindAllReferencesService = (IFindAllReferencesService)_serviceProvider.GetService(typeof(SVsFindAllReferences));
        }
Ejemplo n.º 44
0
        internal VisualAssistUtil(
            SVsServiceProvider serviceProvider,
            IVim vim,
            IEditorFormatMapService editorFormatMapService)
        {
            _vim = vim;
            _editorFormatMapService = editorFormatMapService;

            var vsShell = serviceProvider.GetService<SVsShell, IVsShell>();
            _isVisualAssistInstalled = vsShell.IsPackageInstalled(VisualAssistPackageId);
            if (_isVisualAssistInstalled)
            {
                var dte = serviceProvider.GetService<SDTE, _DTE>();
                _visualStudioVersion = dte.GetVisualStudioVersion();
                _isRegistryFixedNeeded = !CheckRegistryKey(_visualStudioVersion);
            }
            else
            {
                // If Visual Assist isn't installed then don't do any extra work
                _isRegistryFixedNeeded = false;
                _visualStudioVersion = VisualStudioVersion.Unknown;
            }
        }
Ejemplo n.º 45
0
        public MarginCore(IWpfTextView textView, ITextDocumentFactoryService textDocumentFactoryService, IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService editorFormatMapService, IGitCommands gitCommands)
        {
            _textView = textView;

            _classificationFormatMap = classificationFormatMapService.GetClassificationFormatMap(textView);

            _editorFormatMap = editorFormatMapService.GetEditorFormatMap(textView);
            _editorFormatMap.FormatMappingChanged += HandleFormatMappingChanged;

            _gitCommands = gitCommands;

            _parser = new DiffUpdateBackgroundParser(textView.TextBuffer, textView.TextDataModel.DocumentBuffer, TaskScheduler.Default, textDocumentFactoryService, GitCommands);
            _parser.ParseComplete += HandleParseComplete;
            _parser.RequestParse(false);

            _textView.Closed += (sender, e) =>
            {
                _editorFormatMap.FormatMappingChanged -= HandleFormatMappingChanged;
                _parser.ParseComplete -= HandleParseComplete;
            };

            UpdateBrushes();
        }
        public DiagnosticStripeMargin(IWpfTextView textView, IVerticalScrollBar scrollBar,
            IEditorFormatMapService editorFormatMapService) {

            _textView          = textView;
            _isDisposed        = false;
            _scrollBar         = scrollBar;
            _editorFormatMap   = editorFormatMapService.GetEditorFormatMap(textView);
            _diagnosticService = DiagnosticService.GetOrCreate(textView);

            ClipToBounds      = true;
            Background        = null;
            VerticalAlignment = VerticalAlignment.Stretch;
            Focusable         = false;
            Width             = 10;

            RenderOptions.SetEdgeMode(this, System.Windows.Media.EdgeMode.Aliased);

            _diagnosticService.DiagnosticsChanging += OnDiagnosticsChanging;
            _diagnosticService.DiagnosticsChanged  += OnDiagnosticsChanged;
            _editorFormatMap.FormatMappingChanged  += OnFormatMappingChanged;
            _scrollBar.TrackSpanChanged            += OnTrackSpanChanged;
            _textView.LayoutChanged                += OnTextViewLayoutChanged;
            _textView.Closed                       += OnTextViewClosed;
        }
 internal ConflictingKeyBindingMarginProvider(IVim vim, IKeyBindingService keyBindingService, IEditorFormatMapService formatMapService)
 {
     _vim = vim;
     _keyBindingService = keyBindingService;
     _formatMapService = formatMapService;
 }
Ejemplo n.º 48
0
        public VimEditorHost(CompositionContainer compositionContainer) : base(compositionContainer)
        {
            _vim = CompositionContainer.GetExportedValue<IVim>();
            _vimBufferFactory = CompositionContainer.GetExportedValue<IVimBufferFactory>();
            _vimErrorDetector = CompositionContainer.GetExportedValue<IVimErrorDetector>();
            _commonOperationsFactory = CompositionContainer.GetExportedValue<ICommonOperationsFactory>();
            _wordUtil = CompositionContainer.GetExportedValue<IWordUtil>();
            _bufferTrackingService = CompositionContainer.GetExportedValue<IBufferTrackingService>();
            _foldManagerFactory = CompositionContainer.GetExportedValue<IFoldManagerFactory>();
            _bulkOperations = CompositionContainer.GetExportedValue<IBulkOperations>();
            _keyUtil = CompositionContainer.GetExportedValue<IKeyUtil>();
            _vimProtectedOperations = CompositionContainer.GetExportedValue<IVimProtectedOperations>();

            _keyboardDevice = CompositionContainer.GetExportedValue<IKeyboardDevice>();
            _mouseDevice = CompositionContainer.GetExportedValue<IMouseDevice>();
            _clipboardDevice = CompositionContainer.GetExportedValue<IClipboardDevice>();
            _editorFormatMapService = CompositionContainer.GetExportedValue<IEditorFormatMapService>();
            _classificationFormatMapService = CompositionContainer.GetExportedValue<IClassificationFormatMapService>();
        }
Ejemplo n.º 49
0
		TextEditorFactoryService(ITextBufferFactoryService textBufferFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, ICommandService commandService, ISmartIndentationService smartIndentationService, [ImportMany] IEnumerable<Lazy<IWpfTextViewCreationListener, IDeferrableContentTypeAndTextViewRoleMetadata>> wpfTextViewCreationListeners, IFormattedTextSourceFactoryService formattedTextSourceFactoryService, IViewClassifierAggregatorService viewClassifierAggregatorService, ITextAndAdornmentSequencerFactoryService textAndAdornmentSequencerFactoryService, IClassificationFormatMapService classificationFormatMapService, IEditorFormatMapService editorFormatMapService, IAdornmentLayerDefinitionService adornmentLayerDefinitionService, ILineTransformProviderService lineTransformProviderService, IWpfTextViewMarginProviderCollectionProvider wpfTextViewMarginProviderCollectionProvider, IMenuService menuService, IEditorOperationsFactoryService editorOperationsFactoryService, ISpaceReservationStackProvider spaceReservationStackProvider, IWpfTextViewConnectionListenerServiceProvider wpfTextViewConnectionListenerServiceProvider, IBufferGraphFactoryService bufferGraphFactoryService, [ImportMany] IEnumerable<Lazy<ITextViewModelProvider, IContentTypeAndTextViewRoleMetadata>> textViewModelProviders, IContentTypeRegistryService contentTypeRegistryService, Lazy<ITextViewUndoManagerProvider> textViewUndoManagerProvider) {
			this.textBufferFactoryService = textBufferFactoryService;
			this.editorOptionsFactoryService = editorOptionsFactoryService;
			this.commandService = commandService;
			this.smartIndentationService = smartIndentationService;
			this.wpfTextViewCreationListeners = wpfTextViewCreationListeners.ToArray();
			this.formattedTextSourceFactoryService = formattedTextSourceFactoryService;
			this.viewClassifierAggregatorService = viewClassifierAggregatorService;
			this.textAndAdornmentSequencerFactoryService = textAndAdornmentSequencerFactoryService;
			this.classificationFormatMapService = classificationFormatMapService;
			this.editorFormatMapService = editorFormatMapService;
			this.adornmentLayerDefinitionService = adornmentLayerDefinitionService;
			this.lineTransformProviderService = lineTransformProviderService;
			this.wpfTextViewMarginProviderCollectionProvider = wpfTextViewMarginProviderCollectionProvider;
			this.menuService = menuService;
			this.editorOperationsFactoryService = editorOperationsFactoryService;
			this.spaceReservationStackProvider = spaceReservationStackProvider;
			this.wpfTextViewConnectionListenerServiceProvider = wpfTextViewConnectionListenerServiceProvider;
			this.bufferGraphFactoryService = bufferGraphFactoryService;
			this.textViewModelProviders = textViewModelProviders.ToArray();
			this.contentTypeRegistryService = contentTypeRegistryService;
			this.textViewUndoManagerProvider = textViewUndoManagerProvider;
		}
		ClassificationFormatMapServiceImpl(IThemeService themeService, IEditorFormatMapService editorFormatMapService, IEditorFormatDefinitionService editorFormatDefinitionService, IClassificationTypeRegistryService classificationTypeRegistryService)
			: base(themeService, editorFormatMapService, editorFormatDefinitionService, classificationTypeRegistryService) {
		}
Ejemplo n.º 51
0
		LineSeparatorServiceProvider(IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService) {
			this.viewTagAggregatorFactoryService = viewTagAggregatorFactoryService;
			this.editorFormatMapService = editorFormatMapService;
		}
Ejemplo n.º 52
0
 internal EasyMotionAdornmentFactory(IEasyMotionUtilProvider easyMotionUtilProvider, IEditorFormatMapService editorFormatMapService, IClassificationFormatMapService classificationFormatMapService)
 {
     _easyMotionUtilProvider = easyMotionUtilProvider;
     _editorFormatMapService = editorFormatMapService;
     _classificationFormatMapService = classificationFormatMapService;
 }
Ejemplo n.º 53
0
		public LineSeparatorService(IWpfTextView wpfTextView, IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService) {
			if (wpfTextView == null)
				throw new ArgumentNullException(nameof(wpfTextView));
			if (viewTagAggregatorFactoryService == null)
				throw new ArgumentNullException(nameof(viewTagAggregatorFactoryService));
			if (editorFormatMapService == null)
				throw new ArgumentNullException(nameof(editorFormatMapService));
			this.wpfTextView = wpfTextView;
			this.viewTagAggregatorFactoryService = viewTagAggregatorFactoryService;
			this.editorFormatMapService = editorFormatMapService;
			lineSeparatorElements = new List<LineSeparatorElement>();
			usedLines = new HashSet<object>();
			onRemovedDelegate = OnRemoved;
			wpfTextView.Closed += WpfTextView_Closed;
			wpfTextView.Options.OptionChanged += Options_OptionChanged;
			UpdateLineSeparator();
		}
Ejemplo n.º 54
0
        /// <summary>
        /// Creates a <see cref="MarginCore"/> for a given <see cref="IWpfTextView"/>.
        /// </summary>
        /// <param name="textView">The <see cref="IWpfTextView"/> to attach the margin to.</param>
        /// <param name="textDocumentFactoryService">Service that creates, loads, and disposes text documents.</param>
        /// <param name="vsServiceProvider">Visual Studio service provider.</param>
        /// <param name="formatMapService">Service that provides the <see cref="IEditorFormatMap"/>.</param>
        /// <param name="scrollMapFactoryService">Factory that creates or reuses an <see cref="IScrollMap"/> for an <see cref="ITextView"/>.</param>
        public MarginCore(IWpfTextView textView, ITextDocumentFactoryService textDocumentFactoryService, SVsServiceProvider vsServiceProvider, IEditorFormatMapService formatMapService, IScrollMapFactoryService scrollMapFactoryService)
        {
            Debug.WriteLine("Entering constructor.", Properties.Resources.ProductName);

            _textView = textView;
            if (!textDocumentFactoryService.TryGetTextDocument(_textView.TextBuffer, out _textDoc))
            {
                Debug.WriteLine("Can not retrieve TextDocument. Margin is disabled.", Properties.Resources.ProductName);
                _isEnabled = false;
                return;
            }

            _formatMap = formatMapService.GetEditorFormatMap(textView);
            _marginSettings = new MarginSettings(_formatMap);

            _scrollMap = scrollMapFactoryService.Create(textView);

            var dte = (DTE2)vsServiceProvider.GetService(typeof(DTE));
            _tfExt = dte.GetObject(typeof(TeamFoundationServerExt).FullName);
            Debug.Assert(_tfExt != null, "_tfExt is null.");
            _tfExt.ProjectContextChanged += OnTfExtProjectContextChanged;

            UpdateMargin();
        }
Ejemplo n.º 55
0
 internal BlockCaretFactoryService(IEditorFormatMapService formatMapService)
 {
     _formatMapService = formatMapService;
 }
 internal BackspaceNotificationMarginProvider(IVim vim, IVimApplicationSettings vimApplicationSettings, IEditorFormatMapService editorFormatMapService)
 {
     _vim = vim;
     _vimApplicationSettings = vimApplicationSettings;
     _editorFormatMapService = editorFormatMapService;
 }
Ejemplo n.º 57
0
		public GlyphMargin(IMenuService menuService, IWpfTextViewHost wpfTextViewHost, IViewTagAggregatorFactoryService viewTagAggregatorFactoryService, IEditorFormatMapService editorFormatMapService, Lazy<IGlyphMouseProcessorProvider, IGlyphMouseProcessorProviderMetadata>[] glyphMouseProcessorProviders, Lazy<IGlyphFactoryProvider, IGlyphMetadata>[] glyphFactoryProviders, IMarginContextMenuService marginContextMenuHandlerProviderService) {
			if (menuService == null)
				throw new ArgumentNullException(nameof(menuService));
			if (wpfTextViewHost == null)
				throw new ArgumentNullException(nameof(wpfTextViewHost));
			if (viewTagAggregatorFactoryService == null)
				throw new ArgumentNullException(nameof(viewTagAggregatorFactoryService));
			if (editorFormatMapService == null)
				throw new ArgumentNullException(nameof(editorFormatMapService));
			if (glyphMouseProcessorProviders == null)
				throw new ArgumentNullException(nameof(glyphMouseProcessorProviders));
			if (glyphFactoryProviders == null)
				throw new ArgumentNullException(nameof(glyphFactoryProviders));
			glyphFactories = new Dictionary<Type, GlyphFactoryInfo>();
			childCanvases = Array.Empty<Canvas>();
			this.wpfTextViewHost = wpfTextViewHost;
			this.viewTagAggregatorFactoryService = viewTagAggregatorFactoryService;
			this.editorFormatMapService = editorFormatMapService;
			lazyGlyphMouseProcessorProviders = glyphMouseProcessorProviders;
			lazyGlyphFactoryProviders = glyphFactoryProviders;

			var binding = new Binding {
				Path = new PropertyPath(BackgroundProperty),
				Source = this,
			};
			SetBinding(DsImage.BackgroundBrushProperty, binding);

			wpfTextViewHost.TextView.Options.OptionChanged += Options_OptionChanged;
			wpfTextViewHost.TextView.ZoomLevelChanged += TextView_ZoomLevelChanged;
			IsVisibleChanged += GlyphMargin_IsVisibleChanged;
			UpdateVisibility();
			Width = MARGIN_WIDTH;
			ClipToBounds = true;
			menuService.InitializeContextMenu(VisualElement, new Guid(MenuConstants.GUIDOBJ_GLYPHMARGIN_GUID), marginContextMenuHandlerProviderService.Create(wpfTextViewHost, this, PredefinedMarginNames.Glyph), null, new Guid(MenuConstants.GLYPHMARGIN_GUID));
		}
Ejemplo n.º 58
0
		CurrentLineHighlighterWpfTextViewCreationListener(IEditorFormatMapService editorFormatMapService) {
			this.editorFormatMapService = editorFormatMapService;
		}
Ejemplo n.º 59
0
 internal PasteFactoryService(IEditorFormatMapService formatMapService, IProtectedOperations protectedOperations)
 {
     _formatMapService = formatMapService;
     _protectedOperations = protectedOperations;
 }
 public DiagnosticStripeMarginProvider(IEditorFormatMapService editorFormatMapService) {
     _editorFormatMapService = editorFormatMapService;
 }