コード例 #1
0
ファイル: DocumentProvider.cs プロジェクト: XieShuquan/roslyn
        /// <summary>
        /// Creates a document provider.
        /// </summary>
        /// <param name="projectContainer">Project container for the documents.</param>
        /// <param name="serviceProvider">Service provider</param>
        /// <param name="documentTrackingService">An optional <see cref="VisualStudioDocumentTrackingService"/> to track active and visible documents.</param>
        public DocumentProvider(
            IVisualStudioHostProjectContainer projectContainer,
            IServiceProvider serviceProvider,
            VisualStudioDocumentTrackingService documentTrackingService)
        {
            var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));

            _projectContainer = projectContainer;
            this._documentTrackingServiceOpt = documentTrackingService;
            this._runningDocumentTable = (IVsRunningDocumentTable4)serviceProvider.GetService(typeof(SVsRunningDocumentTable));
            this._editorAdaptersFactoryService = componentModel.GetService<IVsEditorAdaptersFactoryService>();
            this._contentTypeRegistryService = componentModel.GetService<IContentTypeRegistryService>();
            _textUndoHistoryRegistry = componentModel.GetService<ITextUndoHistoryRegistry>();
            _textManager = (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager));

            _fileChangeService = (IVsFileChangeEx)serviceProvider.GetService(typeof(SVsFileChangeEx));

            var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            if (shell == null)
            {
                // This can happen only in tests, bail out.
                return;
            }

            var runningDocumentTableForEvents = (IVsRunningDocumentTable)_runningDocumentTable;
            Marshal.ThrowExceptionForHR(runningDocumentTableForEvents.AdviseRunningDocTableEvents(new RunningDocTableEventsSink(this), out _runningDocumentTableEventCookie));
        }
コード例 #2
0
 public EditorTextFactoryService(
         ITextBufferFactoryService textBufferFactoryService,
         IContentTypeRegistryService contentTypeRegistryService)
 {
     _textBufferFactory = textBufferFactoryService;
     _unknownContentType = contentTypeRegistryService.UnknownContentType;
 }
コード例 #3
0
 public VsInteractiveWindowEditorFactoryService(IVsEditorAdaptersFactoryService adaptersFactory, IContentTypeRegistryService contentTypeRegistry, [ImportMany]IEnumerable<Lazy<IVsInteractiveWindowOleCommandTargetProvider, ContentTypeMetadata>> oleCommandTargetProviders)
 {
     _adapterFactory = adaptersFactory;
     _provider = (IOleServiceProvider)InteractiveWindowPackage.GetGlobalService(typeof(IOleServiceProvider));
     _contentTypeRegistry = contentTypeRegistry;
     _oleCommandTargetProviders = oleCommandTargetProviders;
 }
コード例 #4
0
		public static CodeEditorOptions TryCreate(ITextViewOptionsGroup group, IContentTypeRegistryService contentTypeRegistryService, ICodeEditorOptionsDefinitionMetadata md) {
			if (group == null)
				throw new ArgumentNullException(nameof(group));
			if (contentTypeRegistryService == null)
				throw new ArgumentNullException(nameof(contentTypeRegistryService));
			if (md == null)
				throw new ArgumentNullException(nameof(md));

			if (md.ContentType == null)
				return null;
			var contentType = contentTypeRegistryService.GetContentType(md.ContentType);
			if (contentType == null)
				return null;

			if (md.Guid == null)
				return null;
			Guid guid;
			if (!Guid.TryParse(md.Guid, out guid))
				return null;

			if (md.LanguageName == null)
				return null;

			return new CodeEditorOptions(group, contentType, guid, md.LanguageName);
		}
コード例 #5
0
		TextViewOptionsGroupService(ISettingsService settingsService, IContentTypeRegistryService contentTypeRegistryService, [ImportMany] IEnumerable<Lazy<ITextViewOptionsGroupNameProvider, ITextViewOptionsGroupNameProviderMetadata>> textViewOptionsGroupNameProviders, [ImportMany] IEnumerable<Lazy<IContentTypeOptionDefinitionProvider, IContentTypeOptionDefinitionProviderMetadata>> contentTypeOptionDefinitionProviders) {
			nameToGroup = new Dictionary<string, TextViewOptionsGroup>(StringComparer.Ordinal);
			this.contentTypeRegistryService = contentTypeRegistryService;
			this.textViewOptionsGroupNameProviders = textViewOptionsGroupNameProviders.OrderBy(a => a.Metadata.Order).ToArray();
			this.contentTypeOptionDefinitionProviders = contentTypeOptionDefinitionProviders.OrderBy(a => a.Metadata.Order).ToArray();
			optionsStorage = new OptionsStorage(settingsService);
		}
コード例 #6
0
        public VsInteractiveWindowCommandFilter(IVsEditorAdaptersFactoryService adapterFactory, IInteractiveWindow window, IVsTextView textViewAdapter, IVsTextBuffer bufferAdapter, IEnumerable<Lazy<IVsInteractiveWindowOleCommandTargetProvider, ContentTypeMetadata>> oleCommandTargetProviders, IContentTypeRegistryService contentTypeRegistry)
        {
            _window = window;
            _oleCommandTargetProviders = oleCommandTargetProviders;
            _contentTypeRegistry = contentTypeRegistry;

            this.textViewAdapter = textViewAdapter;

            // make us a code window so we'll have the same colors as a normal code window.
            IVsTextEditorPropertyContainer propContainer;
            ErrorHandler.ThrowOnFailure(((IVsTextEditorPropertyCategoryContainer)textViewAdapter).GetPropertyCategory(Microsoft.VisualStudio.Editor.DefGuidList.guidEditPropCategoryViewMasterSettings, out propContainer));
            propContainer.SetProperty(VSEDITPROPID.VSEDITPROPID_ViewComposite_AllCodeWindowDefaults, true);
            propContainer.SetProperty(VSEDITPROPID.VSEDITPROPID_ViewGlobalOpt_AutoScrollCaretOnTextEntry, true);

            // editor services are initialized in textViewAdapter.Initialize - hook underneath them:
            _preEditorCommandFilter = new CommandFilter(this, CommandFilterLayer.PreEditor);
            ErrorHandler.ThrowOnFailure(textViewAdapter.AddCommandFilter(_preEditorCommandFilter, out _editorCommandFilter));

            textViewAdapter.Initialize(
                (IVsTextLines)bufferAdapter,
                IntPtr.Zero,
                (uint)TextViewInitFlags.VIF_HSCROLL | (uint)TextViewInitFlags.VIF_VSCROLL | (uint)TextViewInitFlags3.VIF_NO_HWND_SUPPORT,
                new[] { new INITVIEW { fSelectionMargin = 0, fWidgetMargin = 0, fVirtualSpace = 0, fDragDropMove = 1 } });

            // disable change tracking because everything will be changed
            var textViewHost = adapterFactory.GetWpfTextViewHost(textViewAdapter);

            _preLanguageCommandFilter = new CommandFilter(this, CommandFilterLayer.PreLanguage);
            ErrorHandler.ThrowOnFailure(textViewAdapter.AddCommandFilter(_preLanguageCommandFilter, out _editorServicesCommandFilter));

            _textViewHost = textViewHost;
        }
コード例 #7
0
        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));
        }
コード例 #8
0
 public InteractiveWindowProvider(
     IContentTypeRegistryService contentTypeRegistry,
     ITextBufferFactoryService bufferFactory,
     IProjectionBufferFactoryService projectionBufferFactory,
     IEditorOperationsFactoryService editorOperationsFactory,
     ITextBufferUndoManagerProvider textBufferUndoManagerProvider,
     ITextEditorFactoryService editorFactory,
     IRtfBuilderService rtfBuilderService,
     IIntellisenseSessionStackMapService intellisenseSessionStackMap,
     ISmartIndentationService smartIndenterService,
     IInteractiveWindowEditorFactoryService windowFactoryService,
     IWaitIndicator waitIndicator)
 {
     _contentTypeRegistry = contentTypeRegistry;
     _bufferFactory = bufferFactory;
     _projectionBufferFactory = projectionBufferFactory;
     _editorOperationsFactory = editorOperationsFactory;
     _textBufferUndoManagerProvider = textBufferUndoManagerProvider;
     _editorFactory = editorFactory;
     _rtfBuilderService = rtfBuilderService;
     _intellisenseSessionStackMap = intellisenseSessionStackMap;
     _smartIndenterService = smartIndenterService;
     _windowFactoryService = windowFactoryService;
     _waitIndicator = waitIndicator;
 }
コード例 #9
0
ファイル: AboutScreen.cs プロジェクト: manojdjoshi/dnSpy
		AboutScreenMenuItem(IDocumentViewerContentFactoryProvider documentViewerContentFactoryProvider, IDocumentTabService documentTabService, IAppWindow appWindow, IExtensionService extensionService, IContentTypeRegistryService contentTypeRegistryService) {
			this.documentViewerContentFactoryProvider = documentViewerContentFactoryProvider;
			this.documentTabService = documentTabService;
			this.appWindow = appWindow;
			this.extensionService = extensionService;
			aboutContentType = contentTypeRegistryService.GetContentType(ContentTypes.AboutDnSpy);
		}
コード例 #10
0
ファイル: MarkdownCodeTest.cs プロジェクト: Microsoft/RTVS
 public MarkdownCodeTest(MarkdownEditorMefCatalogFixture catalogFixture) {
     _exportProvider = catalogFixture.CreateExportProvider();
     _crs = _exportProvider.GetExportedValue<IClassificationTypeRegistryService>();
     _ctrs = _exportProvider.GetExportedValue<IContentTypeRegistryService>();
     _cnp = _exportProvider.GetExports<IClassificationNameProvider, IComponentContentTypes>();
     _tbfs = _exportProvider.GetExportedValue<ITextBufferFactoryService>();
 }
コード例 #11
0
 internal TextStructureNavigatorProvider(
     ITextStructureNavigatorSelectorService selectorService,
     IContentTypeRegistryService contentTypeService,
     IWaitIndicator waitIndicator)
     : base(selectorService, contentTypeService, waitIndicator)
 {
 }
コード例 #12
0
        public JadeClassifierProvider(IClassificationTypeRegistryService registryService,   
            ITextBufferFactoryService bufferFact,
            IContentTypeRegistryService contentTypeService,
            [ImportMany(typeof(ITaggerProvider))]Lazy<ITaggerProvider, TaggerProviderMetadata>[] taggerProviders,
            [ImportMany(typeof(IClassifierProvider))]Lazy<IClassifierProvider, IClassifierProviderMetadata>[] classifierProviders) {
            ClassificationRegistryService = registryService;
            BufferFactoryService = bufferFact;
            JsContentType = contentTypeService.GetContentType(NodejsConstants.JavaScript);
            CssContentType = contentTypeService.GetContentType(NodejsConstants.CSS);

            var jsTagger = taggerProviders.Where(
                provider =>
                    provider.Metadata.ContentTypes.Contains(NodejsConstants.JavaScript) &&
                    provider.Metadata.TagTypes.Any(tagType => tagType.IsSubclassOf(typeof(ClassificationTag)))
            ).FirstOrDefault();
            if (JsTaggerProvider != null) {
                JsTaggerProvider = jsTagger.Value;
            }

            var cssTagger = classifierProviders.Where(
                provider => provider.Metadata.ContentTypes.Any(x => x.Equals("css", StringComparison.OrdinalIgnoreCase))
            ).FirstOrDefault();
            if (cssTagger != null) {
                CssClassifierProvider = cssTagger.Value;
            }
        }
コード例 #13
0
ファイル: DocumentProvider.cs プロジェクト: Rickinio/roslyn
        public DocumentProvider(
            IVisualStudioHostProjectContainer projectContainer,
            IServiceProvider serviceProvider,
            bool signUpForFileChangeNotification)
        {
            var componentModel = (IComponentModel)serviceProvider.GetService(typeof(SComponentModel));

            _projectContainer = projectContainer;
            this.RunningDocumentTable = (IVsRunningDocumentTable4)serviceProvider.GetService(typeof(SVsRunningDocumentTable));
            this.EditorAdaptersFactoryService = componentModel.GetService<IVsEditorAdaptersFactoryService>();
            this.ContentTypeRegistryService = componentModel.GetService<IContentTypeRegistryService>();
            _textUndoHistoryRegistry = componentModel.GetService<ITextUndoHistoryRegistry>();
            _textManager = (IVsTextManager)serviceProvider.GetService(typeof(SVsTextManager));

            // In the CodeSense scenario we will receive file change notifications from the native
            // Language Services, so we don't want to sign up for them ourselves.
            if (signUpForFileChangeNotification)
            {
                _fileChangeService = (IVsFileChangeEx)serviceProvider.GetService(typeof(SVsFileChangeEx));
            }

            var shell = (IVsShell)serviceProvider.GetService(typeof(SVsShell));
            if (shell == null)
            {
                // This can happen only in tests, bail out.
                return;
            }

            int installed;
            Marshal.ThrowExceptionForHR(shell.IsPackageInstalled(Guids.RoslynPackageId, out installed));
            IsRoslynPackageInstalled = installed != 0;

            var runningDocumentTableForEvents = (IVsRunningDocumentTable)RunningDocumentTable;
            Marshal.ThrowExceptionForHR(runningDocumentTableForEvents.AdviseRunningDocTableEvents(new RunningDocTableEventsSink(this), out _runningDocumentTableEventCookie));
        }
コード例 #14
0
ファイル: Utils.cs プロジェクト: ChaosinaCan/BraceCompleter
        private Utils()
        {
            _dte = (DTE)ServiceProvider.GlobalProvider.GetService(typeof(DTE));

            IComponentModel componentModel = (IComponentModel)Package.GetGlobalService(
                typeof(SComponentModel));
            _contentTypeRegistryService = componentModel.GetService<IContentTypeRegistryService>();
        }
コード例 #15
0
 public VsRInteractiveWindowComponentContainerFactory(
     Lazy<IVsInteractiveWindowFactory> vsInteractiveWindowFactory,
     IContentTypeRegistryService contentTypeRegistryService,
     ICoreShell shell) {
     _vsInteractiveWindowFactoryLazy = vsInteractiveWindowFactory;
     _contentTypeRegistryService = contentTypeRegistryService;
     _shell = shell;
 }
コード例 #16
0
 public RHistoryIntegrationTest(RComponentsMefCatalogFixture catalog) {
     _exportProvider = catalog.CreateExportProvider();
     _textBufferFactory = _exportProvider.GetExportedValue<ITextBufferFactoryService>();
     _textEditorFactory = _exportProvider.GetExportedValue<ITextEditorFactoryService>();
     _workflowProvider = _exportProvider.GetExportedValue<IRInteractiveWorkflowProvider>();
     _contentTypeRegistryService = _exportProvider.GetExportedValue<IContentTypeRegistryService>();
     _historyVisualComponentContainerFactory = _exportProvider.GetExportedValue<IRHistoryVisualComponentContainerFactory>();
 }
コード例 #17
0
 public TestInteractiveCommandHandler(
     IInteractiveWindow interactiveWindow,
     IContentTypeRegistryService contentTypeRegistryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService)
     : base(contentTypeRegistryService, editorOptionsFactoryService, editorOperationsFactoryService)
 {
     _interactiveWindow = interactiveWindow;
 }
コード例 #18
0
 public CSharpInteractiveCommandHandler(
     CSharpVsInteractiveWindowProvider interactiveWindowProvider,
     IContentTypeRegistryService contentTypeRegistryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService)
     : base(contentTypeRegistryService, editorOptionsFactoryService, editorOperationsFactoryService)
 {
     _interactiveWindowProvider = interactiveWindowProvider;
 }
コード例 #19
0
		TextBufferFactoryService(IContentTypeRegistryService contentTypeRegistryService) {
			this.contentTypeRegistryService = contentTypeRegistryService;
			InertContentType = contentTypeRegistryService.GetContentType(ContentTypes.Inert);
			PlaintextContentType = contentTypeRegistryService.GetContentType(ContentTypes.PlainText);
			TextContentType = contentTypeRegistryService.GetContentType(ContentTypes.Text);
			Debug.Assert(InertContentType != null);
			Debug.Assert(PlaintextContentType != null);
			Debug.Assert(TextContentType != null);
		}
コード例 #20
0
        protected AbstractEditorFactory(Package package)
        {
            _package = package ?? throw new ArgumentNullException(nameof(package));
            _componentModel = (IComponentModel)ServiceProvider.GetService(typeof(SComponentModel));

            _editorAdaptersFactoryService = _componentModel.GetService<IVsEditorAdaptersFactoryService>();
            _contentTypeRegistryService = _componentModel.GetService<IContentTypeRegistryService>();
            _waitIndicator = _componentModel.GetService<IWaitIndicator>();
        }
コード例 #21
0
        public SendHistoryToSourceCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflow interactiveWorkflow, IContentTypeRegistryService contentTypeRegistry, IActiveWpfTextViewTracker textViewTracker)
            : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdSendHistoryToSource, false) {

            _textViewTracker = textViewTracker;
            _interactiveWorkflow = interactiveWorkflow;
            _history = historyProvider.GetAssociatedRHistory(textView);

            _contentTypes.Add(contentTypeRegistry.GetContentType(RContentTypeDefinition.ContentType));
            _contentTypes.Add(contentTypeRegistry.GetContentType(MdProjectionContentTypeDefinition.ContentType));
        }
コード例 #22
0
ファイル: MdEditorDocument.cs プロジェクト: Microsoft/RTVS
        public MdEditorDocument(ITextBuffer textBuffer, IProjectionBufferFactoryService projectionBufferFactoryService, IContentTypeRegistryService contentTypeRegistryService, ICoreShell coreShell) {

            this.TextBuffer = textBuffer;
            ServiceManager.AddService(this, TextBuffer, coreShell);

            _projectionBufferManager = new ProjectionBufferManager(textBuffer, 
                        projectionBufferFactoryService, contentTypeRegistryService,
                        coreShell, MdProjectionContentTypeDefinition.ContentType, RContentTypeDefinition.ContentType);
            ContainedLanguageHandler = _rLanguageHandler = new RLanguageHandler(textBuffer, _projectionBufferManager, coreShell);
        }
コード例 #23
0
 public PythonAnalysisClassifierProvider(IContentTypeRegistryService contentTypeRegistryService, [Import(typeof(SVsServiceProvider))]IServiceProvider serviceProvider) {
     _type = contentTypeRegistryService.GetContentType(PythonCoreConstants.ContentType);
     _serviceProvider = serviceProvider;
     var options = serviceProvider.GetPythonToolsService()?.AdvancedOptions;
     if (options != null) {
         options.Changed += AdvancedOptions_Changed;
         _colorNames = options.ColorNames;
         _colorNamesWithAnalysis = options.ColorNamesWithAnalysis;
     }
 }
コード例 #24
0
        public VsRHistoryCommandFactory(IRHistoryProvider historyProvider,
            IRInteractiveWorkflowProvider interactiveWorkflowProvider,
            IContentTypeRegistryService contentTypeRegistry,
            IActiveWpfTextViewTracker textViewTracker) {

            _historyProvider = historyProvider;
            _interactiveWorkflowProvider = interactiveWorkflowProvider;
            _contentTypeRegistry = contentTypeRegistry;
            _textViewTracker = textViewTracker;
        }
コード例 #25
0
		DecompileDocumentTabContentFactory(IDsDocumentService documentService, IDocumentTreeNodeDecompiler documentTreeNodeDecompiler, IDecompilerService decompilerService, IDecompilationCache decompilationCache, IMethodAnnotations methodAnnotations, IContentTypeRegistryService contentTypeRegistryService, IDocumentViewerContentFactoryProvider documentViewerContentFactoryProvider, IDocumentWriterService documentWriterService) {
			DocumentService = documentService;
			DocumentTreeNodeDecompiler = documentTreeNodeDecompiler;
			DecompilerService = decompilerService;
			DecompilationCache = decompilationCache;
			MethodAnnotations = methodAnnotations;
			ContentTypeRegistryService = contentTypeRegistryService;
			DocumentViewerContentFactoryProvider = documentViewerContentFactoryProvider;
			DocumentWriterService = documentWriterService;
		}
コード例 #26
0
 public VsImmediateWindowProvider(
     SVsServiceProvider serviceProvider,
     IVsInteractiveWindowFactory interactiveWindowFactory,
     IViewClassifierAggregatorService classifierAggregator,
     IContentTypeRegistryService contentTypeRegistry,
     VisualStudioWorkspace workspace)
 {
     _vsInteractiveWindowFactory = interactiveWindowFactory;
     _vsDebugger = (IVsDebugger)serviceProvider.GetService(typeof(IVsDebugger));
 }
コード例 #27
0
 public ClassifiableDeferredContent(
     IList<SymbolDisplayPart> content,
     ITextBufferFactoryService textBufferFactoryService,
     IContentTypeRegistryService contentTypeRegistryService,
     ClassificationTypeMap typeMap)
 {
     this.ClassifiableContent = content;
     _textBufferFactoryService = textBufferFactoryService;
     _contentTypeRegistryService = contentTypeRegistryService;
     _typeMap = typeMap;
 }
コード例 #28
0
 public RHistoryProvider(ITextBufferFactoryService textBufferFactory, IContentTypeRegistryService contentTypeRegistryService, IFileSystem fileSystem, IEditorOperationsFactoryService editorOperationsFactory, IRtfBuilderService rtfBuilderService, ITextSearchService2 textSearchService, IRSettings settings) {
     _textBufferFactory = textBufferFactory;
     _fileSystem = fileSystem;
     _editorOperationsFactory = editorOperationsFactory;
     _rtfBuilderService = rtfBuilderService;
     _textSearchService = textSearchService;
     _settings = settings;
     _rtfBuilderService = rtfBuilderService;
     _contentType = contentTypeRegistryService.GetContentType(RHistoryContentTypeDefinition.ContentType);
     _histories = new Dictionary<ITextBuffer, IRHistory>();
 }
コード例 #29
0
 public CSharpInteractiveCommandHandler(
     CSharpVsInteractiveWindowProvider interactiveWindowProvider,
     IContentTypeRegistryService contentTypeRegistryService,
     IEditorOptionsFactoryService editorOptionsFactoryService,
     IEditorOperationsFactoryService editorOperationsFactoryService,
     IWaitIndicator waitIndicator)
     : base(contentTypeRegistryService, editorOptionsFactoryService, editorOperationsFactoryService, waitIndicator)
 {
     _interactiveWindowProvider = interactiveWindowProvider;
     _sendToInteractiveSubmissionProvider = new CSharpSendToInteractiveSubmissionProvider();
 }
コード例 #30
0
 public CSharpVsInteractiveWindowProvider(
     SVsServiceProvider serviceProvider,
     IVsInteractiveWindowFactory interactiveWindowFactory,
     IViewClassifierAggregatorService classifierAggregator,
     IContentTypeRegistryService contentTypeRegistry,
     IInteractiveWindowCommandsFactory commandsFactory,
     [ImportMany]IInteractiveWindowCommand[] commands,
     VisualStudioWorkspace workspace)
     : base(serviceProvider, interactiveWindowFactory, classifierAggregator, contentTypeRegistry, commandsFactory, commands, workspace)
 {
 }
コード例 #31
0
 LogEditorProvider(IDnSpyTextEditorFactoryService dnSpyTextEditorFactoryService, IContentTypeRegistryService contentTypeRegistryService, ITextBufferFactoryService textBufferFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService)
 {
     this.dnSpyTextEditorFactoryService = dnSpyTextEditorFactoryService;
     this.contentTypeRegistryService    = contentTypeRegistryService;
     this.textBufferFactoryService      = textBufferFactoryService;
     this.editorOptionsFactoryService   = editorOptionsFactoryService;
 }
コード例 #32
0
 public PythonClassifierProvider(IContentTypeRegistryService contentTypeRegistryService, [Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
 {
     _type            = contentTypeRegistryService.GetContentType(PythonCoreConstants.ContentType);
     _serviceProvider = serviceProvider;
 }
 public InteractiveCommandContentTypeLanguageService(IContentTypeRegistryService contentTypeRegistry)
 => _contentTypeRegistry = contentTypeRegistry;
コード例 #34
0
 public VBLspContentTypeLanguageService(IContentTypeRegistryService contentTypeRegistry)
 {
     _contentTypeRegistry = contentTypeRegistry;
 }
コード例 #35
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;
 }
コード例 #36
0
 SignatureHelpPresenterProvider(ITextBufferFactoryService textBufferFactoryService, IContentTypeRegistryService contentTypeRegistryService, IClassifierAggregatorService classifierAggregatorService, IClassificationFormatMapService classificationFormatMapService)
 {
     this.textBufferFactoryService       = textBufferFactoryService;
     this.contentTypeRegistryService     = contentTypeRegistryService;
     this.classifierAggregatorService    = classifierAggregatorService;
     this.classificationFormatMapService = classificationFormatMapService;
 }
コード例 #37
0
        protected override void Initialize()
        {
            base.Initialize();

            IComponentModel                 compMod         = GetService(typeof(SComponentModel)) as IComponentModel;
            ITextBufferFactoryService       bufferFactory   = compMod.GetService <ITextBufferFactoryService>();
            ITextEditorFactoryService       editorFactory   = compMod.GetService <ITextEditorFactoryService>();
            IVsEditorAdaptersFactoryService adapterFactory  = compMod.GetService <IVsEditorAdaptersFactoryService>();
            IContentTypeRegistryService     registryService = compMod.GetService <IContentTypeRegistryService>();

            completionBroker = compMod.GetService <ICompletionBroker>();

            textView = adapterFactory.CreateVsTextViewAdapter(GetService(typeof(IOleServiceProvider)) as IOleServiceProvider);
            IVsTextBuffer textBuffer        = adapterFactory.CreateVsTextBufferAdapter(GetService(typeof(IOleServiceProvider)) as IOleServiceProvider);
            uint          textViewInitFlags = (uint)TextViewInitFlags.VIF_DEFAULT
                                              | (uint)TextViewInitFlags.VIF_HSCROLL
                                              | (uint)TextViewInitFlags.VIF_VSCROLL;

            textBuffer.InitializeContent("", 0);
            textView.Initialize(textBuffer as IVsTextLines, IntPtr.Zero, textViewInitFlags, null);

            // Create Dev10 objects
            _textView     = adapterFactory.GetWpfTextView(textView);
            mefTextBuffer = adapterFactory.GetDataBuffer(textBuffer);

            IVsUserData userData = textView as IVsUserData;

            if (userData != null)
            {
                Guid   g = Microsoft.VisualStudio.Editor.DefGuidList.guidIWpfTextViewHost;
                object obj;
                int    hr = userData.GetData(ref g, out obj);
                if (hr == VSConstants.S_OK)
                {
                    _textViewHost = obj as IWpfTextViewHost;
                }
            }


            //Initialize the history
            history = new HistoryBuffer();

            // Create the stream on top of the text buffer.
            textStream = new TextBufferStream(mefTextBuffer);

            // Initialize the engine.
            InitializeEngine();

            IContentType ipContentType = registryService.GetContentType(PyContentTypeDefinition.ConsoleContentType);

            mefTextBuffer.ChangeContentType(ipContentType, null);

            adapterFactory.GetWpfTextView(textView).Caret.MoveTo(new SnapshotPoint(mefTextBuffer.CurrentSnapshot, mefTextBuffer.CurrentSnapshot.Length));

            // Set the title of the window.
            this.Caption = Resources.ToolWindowTitle;

            // Set the icon of the toolwindow.
            this.BitmapResourceID = 301;
            this.BitmapIndex      = 0;

            return;
        }
コード例 #38
0
 AboutScreenMenuItem(IDocumentViewerContentFactoryProvider documentViewerContentFactoryProvider, IDocumentTabService documentTabService, IAppWindow appWindow, IExtensionService extensionService, IContentTypeRegistryService contentTypeRegistryService)
 {
     this.documentViewerContentFactoryProvider = documentViewerContentFactoryProvider;
     this.documentTabService = documentTabService;
     this.appWindow          = appWindow;
     this.extensionService   = extensionService;
     aboutContentType        = contentTypeRegistryService.GetContentType(ContentTypes.AboutDnSpy);
 }
コード例 #39
0
 public CSharpLspContentTypeLanguageService(IContentTypeRegistryService contentTypeRegistry)
 => _contentTypeRegistry = contentTypeRegistry;
コード例 #40
0
 public NodejsClassifierProvider(IContentTypeRegistryService contentTypeRegistryService)
 {
     _type = contentTypeRegistryService.GetContentType(NodejsConstants.Nodejs);
 }
        private static IProjectionBuffer CreateProjectionBuffer(
            IProjectionBufferFactoryService factoryService,
            IContentTypeRegistryService registryService,
            IEditorOptions editorOptions,
            ITextSnapshot snapshot,
            string separator,
            object?suffixOpt,
            bool trim,
            params LineSpan[] exposedLineSpans)
        {
            var spans = new List <object>();

            if (exposedLineSpans.Length > 0)
            {
                if (exposedLineSpans[0].Start > 0 && !string.IsNullOrEmpty(separator))
                {
                    spans.Add(separator);
                    spans.Add(editorOptions.GetNewLineCharacter());
                }

                var snapshotSpanRanges = CreateSnapshotSpanRanges(snapshot, exposedLineSpans);
                var indentColumn       = trim
                    ? DetermineIndentationColumn(editorOptions, snapshotSpanRanges.Flatten())
                    : 0;

                foreach (var snapshotSpanRange in snapshotSpanRanges)
                {
                    foreach (var snapshotSpan in snapshotSpanRange)
                    {
                        var line           = snapshotSpan.Snapshot.GetLineFromPosition(snapshotSpan.Start);
                        var indentPosition = line.GetLineOffsetFromColumn(indentColumn, editorOptions) + line.Start;
                        var mappedSpan     = new SnapshotSpan(snapshotSpan.Snapshot,
                                                              Span.FromBounds(indentPosition, snapshotSpan.End));

                        var trackingSpan = mappedSpan.CreateTrackingSpan(SpanTrackingMode.EdgeExclusive);

                        spans.Add(trackingSpan);

                        // Add a newline between every line.
                        if (snapshotSpan != snapshotSpanRange.Last())
                        {
                            spans.Add(editorOptions.GetNewLineCharacter());
                        }
                    }

                    // Add a separator between every set of lines.
                    if (snapshotSpanRange != snapshotSpanRanges.Last())
                    {
                        spans.Add(editorOptions.GetNewLineCharacter());
                        spans.Add(separator);
                        spans.Add(editorOptions.GetNewLineCharacter());
                    }
                }

                if (snapshot.GetLineNumberFromPosition(snapshotSpanRanges.Last().Last().End) < snapshot.LineCount - 1)
                {
                    spans.Add(editorOptions.GetNewLineCharacter());
                    spans.Add(separator);
                }
            }

            if (suffixOpt != null)
            {
                if (spans.Count >= 0)
                {
                    if (!separator.Equals(spans.Last()))
                    {
                        spans.Add(editorOptions.GetNewLineCharacter());
                        spans.Add(separator);
                    }

                    spans.Add(editorOptions.GetNewLineCharacter());
                }

                spans.Add(suffixOpt);
            }

            return(factoryService.CreateProjectionBuffer(
                       projectionEditResolver: null,
                       sourceSpans: spans,
                       options: ProjectionBufferOptions.None,
                       contentType: registryService.GetContentType(RoslynPreviewContentType)));
        }
コード例 #42
0
 TextParagraphPropertiesFactoryServiceSelector(IContentTypeRegistryService contentTypeRegistryService, [ImportMany] IEnumerable <Lazy <ITextParagraphPropertiesFactoryService, IContentTypeMetadata> > textParagraphPropertiesFactoryServices)
 {
     this.contentTypeRegistryService             = contentTypeRegistryService;
     this.textParagraphPropertiesFactoryServices = textParagraphPropertiesFactoryServices.ToArray();
 }
コード例 #43
0
 public ProviderSelector(IContentTypeRegistryService contentTypeRegistryService, IEnumerable <Lazy <TProvider, TProviderMetadata> > providers)
 {
     this.contentTypeRegistryService = contentTypeRegistryService ?? throw new ArgumentNullException(nameof(contentTypeRegistryService));
     dict           = new Dictionary <IContentType, Lazy <TProvider, TProviderMetadata>[]>();
     this.providers = providers.ToArray();
 }
コード例 #44
0
 public CompletionTextElementProvider(ITextClassifierAggregatorService textClassifierAggregatorService, IClassificationFormatMap classificationFormatMap, IContentTypeRegistryService contentTypeRegistryService)
 {
     if (textClassifierAggregatorService == null)
     {
         throw new ArgumentNullException(nameof(textClassifierAggregatorService));
     }
     if (classificationFormatMap == null)
     {
         throw new ArgumentNullException(nameof(classificationFormatMap));
     }
     if (contentTypeRegistryService == null)
     {
         throw new ArgumentNullException(nameof(contentTypeRegistryService));
     }
     this.textClassifierAggregatorService = textClassifierAggregatorService;
     this.classificationFormatMap         = classificationFormatMap;
     this.contentTypeRegistryService      = contentTypeRegistryService;
     this.toClassifier = new Dictionary <IContentType, ITextClassifier>();
 }
コード例 #45
0
 protected abstract InteractiveEvaluator CreateInteractiveEvaluator(
     SVsServiceProvider serviceProvider,
     IViewClassifierAggregatorService classifierAggregator,
     IContentTypeRegistryService contentTypeRegistry,
     VisualStudioWorkspace workspace);
コード例 #46
0
        public VsInteractiveWindowCommandFilter(IVsEditorAdaptersFactoryService adapterFactory, IInteractiveWindow window, IVsTextView textViewAdapter, IVsTextBuffer bufferAdapter, IEnumerable <Lazy <IVsInteractiveWindowOleCommandTargetProvider, ContentTypeMetadata> > oleCommandTargetProviders, IContentTypeRegistryService contentTypeRegistry)
        {
            _window = window;
            _oleCommandTargetProviders = oleCommandTargetProviders;
            _contentTypeRegistry       = contentTypeRegistry;

            this.textViewAdapter = textViewAdapter;

            // make us a code window so we'll have the same colors as a normal code window.
            IVsTextEditorPropertyContainer propContainer;

            ErrorHandler.ThrowOnFailure(((IVsTextEditorPropertyCategoryContainer)textViewAdapter).GetPropertyCategory(Microsoft.VisualStudio.Editor.DefGuidList.guidEditPropCategoryViewMasterSettings, out propContainer));
            propContainer.SetProperty(VSEDITPROPID.VSEDITPROPID_ViewComposite_AllCodeWindowDefaults, true);
            propContainer.SetProperty(VSEDITPROPID.VSEDITPROPID_ViewGlobalOpt_AutoScrollCaretOnTextEntry, true);

            // editor services are initialized in textViewAdapter.Initialize - hook underneath them:
            _preEditorCommandFilter = new CommandFilter(this, CommandFilterLayer.PreEditor);
            ErrorHandler.ThrowOnFailure(textViewAdapter.AddCommandFilter(_preEditorCommandFilter, out _editorCommandFilter));

            textViewAdapter.Initialize(
                (IVsTextLines)bufferAdapter,
                IntPtr.Zero,
                (uint)TextViewInitFlags.VIF_HSCROLL | (uint)TextViewInitFlags.VIF_VSCROLL | (uint)TextViewInitFlags3.VIF_NO_HWND_SUPPORT,
                new[] { new INITVIEW {
                            fSelectionMargin = 0, fWidgetMargin = 0, fVirtualSpace = 0, fDragDropMove = 1
                        } });

            // disable change tracking because everything will be changed
            var textViewHost = adapterFactory.GetWpfTextViewHost(textViewAdapter);

            _preLanguageCommandFilter = new CommandFilter(this, CommandFilterLayer.PreLanguage);
            ErrorHandler.ThrowOnFailure(textViewAdapter.AddCommandFilter(_preLanguageCommandFilter, out _editorServicesCommandFilter));

            _textViewHost = textViewHost;
        }
コード例 #47
0
        OutputWindowOptionsService(ITextViewOptionsGroupService textViewOptionsGroupService, IContentTypeRegistryService contentTypeRegistryService)
        {
            var group = textViewOptionsGroupService.GetGroup(PredefinedTextViewGroupNames.OutputWindow);

            group.TextViewOptionChanged += TextViewOptionsGroup_TextViewOptionChanged;
            Default = new OutputWindowOptions(group, contentTypeRegistryService.GetContentType(ContentTypes.Any));
        }
コード例 #48
0
        internal Commands(IInteractiveWindow window, string prefix, IEnumerable <IInteractiveWindowCommand> commands, IContentTypeRegistryService contentTypeRegistry = null, IStandardClassificationService classificationRegistry = null)
        {
            CommandPrefix = prefix;
            _window       = window;

            Dictionary <string, IInteractiveWindowCommand> commandsDict = new Dictionary <string, IInteractiveWindowCommand>();

            foreach (var command in commands)
            {
                int length = 0;
                foreach (var name in command.Names)
                {
                    if (commandsDict.ContainsKey(name))
                    {
                        throw new InvalidOperationException(string.Format(InteractiveWindowResources.DuplicateCommand, string.Join(_commandSeparator, command.Names)));
                    }
                    if (length != 0)
                    {
                        length += _commandSeparator.Length;
                    }
                    // plus the length of `#` for display purpose
                    length += name.Length + 1;

                    commandsDict[name] = command;
                }
                if (length == 0)
                {
                    throw new InvalidOperationException(string.Format(InteractiveWindowResources.MissingCommandName, command.GetType().Name));
                }
                _maxCommandNameLength = Math.Max(_maxCommandNameLength, length);
            }

            _commands = commandsDict;

            _classificationRegistry = classificationRegistry;

            if (contentTypeRegistry != null)
            {
                _commandContentType = contentTypeRegistry.GetContentType(PredefinedInteractiveCommandsContentTypes.InteractiveCommandContentTypeName);
            }

            if (window != null)
            {
                window.SubmissionBufferAdded += Window_SubmissionBufferAdded;
                window.Properties[typeof(IInteractiveWindowCommands)] = this;
            }
        }
コード例 #49
0
 CompletionToolTipProvider(IContentTypeRegistryService contentTypeRegistryService, ITaggedTextElementProviderService taggedTextElementProviderService)
 {
     contentType = contentTypeRegistryService.GetContentType(RoslynContentTypes.CompletionToolTipRoslyn);
     this.taggedTextElementProviderService = taggedTextElementProviderService;
 }
コード例 #50
0
 public TextBufferCloneService(ITextBufferFactoryService3 textBufferFactoryService, IContentTypeRegistryService contentTypeRegistryService)
 {
     _textBufferFactoryService = textBufferFactoryService;
     _unknownContentType       = contentTypeRegistryService.UnknownContentType;
 }
コード例 #51
0
 public TextBufferCloneServiceFactory(
     ITextBufferFactoryService textBufferFactoryService,
     IContentTypeRegistryService contentTypeRegistry)
 {
     _singleton = new TextBufferCloneService((ITextBufferFactoryService3)textBufferFactoryService, contentTypeRegistry.UnknownContentType);
 }
コード例 #52
0
 SmartIndentationService(IContentTypeRegistryService contentTypeRegistryService, [ImportMany] IEnumerable <Lazy <ISmartIndentProvider, IContentTypeMetadata> > smartIndentProviders)
 {
     this.contentTypeRegistryService = contentTypeRegistryService;
     this.smartIndentProviders       = smartIndentProviders.ToArray();
 }
コード例 #53
0
 ClassifierTaggerProvider(IContentTypeRegistryService contentTypeRegistryService, [ImportMany] IEnumerable <Lazy <IClassifierProvider, INamedContentTypeMetadata> > classifierProviders)
 {
     this.contentTypeRegistryService = contentTypeRegistryService;
     this.classifierProviders        = classifierProviders.ToArray();
 }
コード例 #54
0
 public InteractiveCommandsFactory(IContentTypeRegistryService contentTypeRegistry, IStandardClassificationService classification)
 {
     this.contentTypeRegistry    = contentTypeRegistry;
     this.standardClassification = classification;
 }
コード例 #55
0
 EditValueProviderServiceImpl(IContentTypeRegistryService contentTypeRegistryService, ITextBufferFactoryService textBufferFactoryService, ITextEditorFactoryService textEditorFactoryService)
 {
     this.contentTypeRegistryService = contentTypeRegistryService;
     this.textBufferFactoryService   = textBufferFactoryService;
     this.textEditorFactoryService   = textEditorFactoryService;
 }
コード例 #56
0
        DocumentViewerOptionsService(ITextViewOptionsGroupService textViewOptionsGroupService, IContentTypeRegistryService contentTypeRegistryService)
        {
            var group = textViewOptionsGroupService.GetGroup(PredefinedTextViewGroupNames.DocumentViewer);

            Default = new DocumentViewerOptions(group, contentTypeRegistryService.GetContentType(ContentTypes.Any));
        }
コード例 #57
0
        public SendHistoryToSourceCommand(ITextView textView, IRHistoryProvider historyProvider, IRInteractiveWorkflowVisual interactiveWorkflow, IContentTypeRegistryService contentTypeRegistry, IActiveWpfTextViewTracker textViewTracker)
            : base(textView, RGuidList.RCmdSetGuid, RPackageCommandId.icmdSendHistoryToSource, false)
        {
            _textViewTracker     = textViewTracker;
            _interactiveWorkflow = interactiveWorkflow;
            _history             = historyProvider.GetAssociatedRHistory(textView);

            _contentTypes.Add(contentTypeRegistry.GetContentType(RContentTypeDefinition.ContentType));
            _contentTypes.Add(contentTypeRegistry.GetContentType(MdProjectionContentTypeDefinition.ContentType));
        }
コード例 #58
0
        public InteractiveWindow(
            IInteractiveWindowEditorFactoryService host,
            IContentTypeRegistryService contentTypeRegistry,
            ITextBufferFactoryService bufferFactory,
            IProjectionBufferFactoryService projectionBufferFactory,
            IEditorOperationsFactoryService editorOperationsFactory,
            ITextEditorFactoryService editorFactory,
            IRtfBuilderService rtfBuilderService,
            IIntellisenseSessionStackMapService intellisenseSessionStackMap,
            ISmartIndentationService smartIndenterService,
            IInteractiveEvaluator evaluator)
        {
            if (evaluator == null)
            {
                throw new ArgumentNullException(nameof(evaluator));
            }

            _dangerous_uiOnly = new UIThreadOnly(this, host);

            this.Properties = new PropertyCollection();
            _history        = new History();

            _intellisenseSessionStackMap = intellisenseSessionStackMap;
            _smartIndenterService        = smartIndenterService;

            var replContentType       = contentTypeRegistry.GetContentType(PredefinedInteractiveContentTypes.InteractiveContentTypeName);
            var replOutputContentType = contentTypeRegistry.GetContentType(PredefinedInteractiveContentTypes.InteractiveOutputContentTypeName);

            _outputBuffer        = bufferFactory.CreateTextBuffer(replOutputContentType);
            _standardInputBuffer = bufferFactory.CreateTextBuffer();
            _inertType           = bufferFactory.InertContentType;

            var projBuffer = projectionBufferFactory.CreateProjectionBuffer(
                new EditResolver(this),
                Array.Empty <object>(),
                ProjectionBufferOptions.None,
                replContentType);

            projBuffer.Properties.AddProperty(typeof(InteractiveWindow), this);

            _projectionBuffer = projBuffer;
            _dangerous_uiOnly.AppendNewOutputProjectionBuffer(); // Constructor runs on UI thread.
            projBuffer.Changed += new EventHandler <TextContentChangedEventArgs>(ProjectionBufferChanged);

            var roleSet = editorFactory.CreateTextViewRoleSet(
                PredefinedTextViewRoles.Analyzable,
                PredefinedTextViewRoles.Editable,
                PredefinedTextViewRoles.Interactive,
                PredefinedTextViewRoles.Zoomable,
                PredefinedInteractiveTextViewRoles.InteractiveTextViewRole);

            _textView = host.CreateTextView(this, projBuffer, roleSet);

            _textView.Caret.PositionChanged += CaretPositionChanged;

            _textView.Options.SetOptionValue(DefaultTextViewHostOptions.HorizontalScrollBarId, true);
            _textView.Options.SetOptionValue(DefaultTextViewHostOptions.LineNumberMarginId, false);
            _textView.Options.SetOptionValue(DefaultTextViewHostOptions.OutliningMarginId, false);
            _textView.Options.SetOptionValue(DefaultTextViewHostOptions.GlyphMarginId, false);
            _textView.Options.SetOptionValue(DefaultTextViewOptions.WordWrapStyleId, WordWrapStyles.None);

            _lineBreakString = _textView.Options.GetNewLineCharacter();
            _dangerous_uiOnly.EditorOperations = editorOperationsFactory.GetEditorOperations(_textView); // Constructor runs on UI thread.

            _buffer       = new OutputBuffer(this);
            _outputWriter = new InteractiveWindowWriter(this, spans: null);

            SortedSpans errorSpans = new SortedSpans();

            _errorOutputWriter = new InteractiveWindowWriter(this, errorSpans);
            OutputClassifierProvider.AttachToBuffer(_outputBuffer, errorSpans);

            _rtfBuilderService = rtfBuilderService;

            RequiresUIThread();
            evaluator.CurrentWindow = this;
            _evaluator = evaluator;
        }
 public CSHTMLFilePathToContentTypeProvider(
     IContentTypeRegistryService contentTypeRegistryService,
     LSPEditorFeatureDetector lspEditorFeatureDetector) : base(contentTypeRegistryService, lspEditorFeatureDetector)
 {
 }
コード例 #60
0
 public InteractiveWindowEditorsFactoryService(ITextBufferFactoryService textBufferFactoryService, ITextEditorFactoryService textEditorFactoryService, IContentTypeRegistryService contentTypeRegistry)
 {
     _textBufferFactoryService = textBufferFactoryService;
     _textEditorFactoryService = textEditorFactoryService;
     _contentTypeRegistry      = contentTypeRegistry;
 }