示例#1
0
        internal static ICocoaTextView CreateShrunkenTextView(
            ICocoaTextEditorFactoryService textEditorFactoryService,
            ITextBuffer finalBuffer)
        {
            var roles = textEditorFactoryService.CreateTextViewRoleSet(OutliningRegionTextViewRole);
            var view  = textEditorFactoryService.CreateTextView(finalBuffer, roles);

            view.Background = NSColor.Clear.CGColor;

            const double HorizontalCorrection = 8.0;
            const double VerticalCorrection   = 4.0;

            // Force the view to render, measuring its size in the process.
            view.DisplayTextLineContainingBufferPosition(
                new SnapshotPoint(view.TextSnapshot, 0),
                0,
                ViewRelativePosition.Top,
                double.MaxValue,
                double.MaxValue);

            view.VisualElement.SetFrameSize(new CGSize(view.MaxTextRightCoordinate + HorizontalCorrection, view.TextViewLines.LastVisibleLine.Bottom + VerticalCorrection));

            // Zoom out a bit to shrink the text.
            view.ZoomLevel *= 0.75;

            return(view);
        }
示例#2
0
 public PreviewFactoryService(
     IThreadingContext threadingContext,
     ITextBufferFactoryService textBufferFactoryService,
     IContentTypeRegistryService contentTypeRegistryService,
     IProjectionBufferFactoryService projectionBufferFactoryService,
     ICocoaTextEditorFactoryService textEditorFactoryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     ITextDifferencingSelectorService differenceSelectorService,
     IDifferenceBufferFactoryService differenceBufferService,
     ICocoaDifferenceViewerFactoryService differenceViewerService
     )
     : base(
         threadingContext,
         textBufferFactoryService,
         contentTypeRegistryService,
         projectionBufferFactoryService,
         editorOptionsFactoryService,
         differenceSelectorService,
         differenceBufferService,
         textEditorFactoryService.CreateTextViewRoleSet(
             TextViewRoles.PreviewRole,
             PredefinedTextViewRoles.Analyzable
             )
         )
 {
     _differenceViewerService = differenceViewerService;
 }
 public CocoaDifferenceViewElementFactory(
     ICocoaDifferenceViewerFactoryService diffFactory,
     ICocoaTextEditorFactoryService textEditorFactoryService)
 {
     _diffFactory    = diffFactory;
     _previewRoleSet = textEditorFactoryService.CreateTextViewRoleSet(PredefinedTextViewRoles.Analyzable);
 }
        public PreviewFactoryService(
            IThreadingContext threadingContext,
            ITextBufferFactoryService textBufferFactoryService,
            IContentTypeRegistryService contentTypeRegistryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            ICocoaTextEditorFactoryService textEditorFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextDifferencingSelectorService differenceSelectorService,
            IDifferenceBufferFactoryService differenceBufferService,
            ICocoaDifferenceViewerFactoryService differenceViewerService)
            : base(threadingContext)
        {
            Contract.ThrowIfFalse(ThreadingContext.HasMainThread);

            _textBufferFactoryService       = textBufferFactoryService;
            _contentTypeRegistryService     = contentTypeRegistryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService    = editorOptionsFactoryService;
            _differenceSelectorService      = differenceSelectorService;
            _differenceBufferService        = differenceBufferService;
            _differenceViewerService        = differenceViewerService;

            _previewRoleSet = textEditorFactoryService.CreateTextViewRoleSet(
                TextViewRoles.PreviewRole, PredefinedTextViewRoles.Analyzable);
        }
示例#5
0
        public RoslynBlockTag(
#pragma warning disable IDE0060 // Remove unused parameter
            IThreadingContext threadingContext,
#pragma warning restore IDE0060 // Remove unused parameter
            ICocoaTextEditorFactoryService textEditorFactoryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            IBlockTag parent,
            ITextSnapshot snapshot,
            BlockSpan blockSpan) :
            base(span: blockSpan.TextSpan.ToSnapshotSpan(snapshot),
                 statementSpan: blockSpan.HintSpan.ToSnapshotSpan(snapshot),
                 parent: parent,
                 type: blockSpan.Type,
                 isCollapsible: blockSpan.IsCollapsible,
                 isDefaultCollapsed: blockSpan.IsDefaultCollapsed,
                 isImplementation: blockSpan.AutoCollapse,
                 collapsedForm: null,
                 collapsedHintForm: null)
        {
            _state = new BlockTagState(
                textEditorFactoryService, projectionBufferFactoryService,
                editorOptionsFactoryService, snapshot, blockSpan);
            Level = parent == null ? 0 : parent.Level + 1;
        }
 public VisualStudioForMacStructureTaggerProvider(
     IThreadingContext threadingContext,
     IForegroundNotificationService notificationService,
     ICocoaTextEditorFactoryService textEditorFactoryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     IProjectionBufferFactoryService projectionBufferFactoryService,
     IAsynchronousOperationListenerProvider listenerProvider)
     : base(threadingContext, notificationService, textEditorFactoryService, editorOptionsFactoryService, projectionBufferFactoryService, listenerProvider)
 {
 }
示例#7
0
 public VimCocoaHost(
     ITextBufferFactoryService textBufferFactoryService,
     ICocoaTextEditorFactoryService textEditorFactoryService,
     ISmartIndentationService smartIndentationService,
     IExtensionAdapterBroker extensionAdapterBroker)
 {
     VimTrace.TraceSwitch.Level = System.Diagnostics.TraceLevel.Verbose;
     Console.WriteLine("Loaded");
     _textBufferFactoryService = textBufferFactoryService;
     _textEditorFactoryService = textEditorFactoryService;
     _smartIndentationService  = smartIndentationService;
     _extensionAdapterBroker   = extensionAdapterBroker;
 }
示例#8
0
 protected AbstractStructureTaggerProvider(
     IThreadingContext threadingContext,
     IForegroundNotificationService notificationService,
     ICocoaTextEditorFactoryService textEditorFactoryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     IProjectionBufferFactoryService projectionBufferFactoryService,
     IAsynchronousOperationListenerProvider listenerProvider)
     : base(threadingContext, listenerProvider.GetListener(FeatureAttribute.Outlining), notificationService)
 {
     TextEditorFactoryService       = textEditorFactoryService;
     EditorOptionsFactoryService    = editorOptionsFactoryService;
     ProjectionBufferFactoryService = projectionBufferFactoryService;
 }
示例#9
0
        public BlockTagState(
            ICocoaTextEditorFactoryService textEditorFactoryService,
            IProjectionBufferFactoryService projectionBufferFactoryService,
            IEditorOptionsFactoryService editorOptionsFactoryService,
            ITextSnapshot snapshot,
            BlockSpan blockSpan)
        {
            _textEditorFactoryService       = textEditorFactoryService;
            _projectionBufferFactoryService = projectionBufferFactoryService;
            _editorOptionsFactoryService    = editorOptionsFactoryService;
            _subjectBuffer = snapshot.TextBuffer;
            BlockSpan      = blockSpan;

            _hintSpan = snapshot.CreateTrackingSpan(BlockSpan.HintSpan.ToSpan(), SpanTrackingMode.EdgeExclusive);
        }