Ejemplo n.º 1
0
 CSharpLanguageCompilerProvider(ICodeEditorProvider codeEditorProvider, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService, ITextViewUndoManagerProvider textViewUndoManagerProvider)
 {
     this.codeEditorProvider           = codeEditorProvider;
     this.docFactory                   = docFactory;
     this.roslynDocumentChangedService = roslynDocumentChangedService;
     this.textViewUndoManagerProvider  = textViewUndoManagerProvider;
 }
Ejemplo n.º 2
0
 protected RoslynLanguageCompiler(CompilationKind kind, ICodeEditorProvider codeEditorProvider, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService, ITextViewUndoManagerProvider textViewUndoManagerProvider)
 {
     this.codeEditorProvider           = codeEditorProvider ?? throw new ArgumentNullException(nameof(codeEditorProvider));
     this.docFactory                   = docFactory ?? throw new ArgumentNullException(nameof(docFactory));
     this.roslynDocumentChangedService = roslynDocumentChangedService ?? throw new ArgumentNullException(nameof(roslynDocumentChangedService));
     this.textViewUndoManagerProvider  = textViewUndoManagerProvider ?? throw new ArgumentNullException(nameof(textViewUndoManagerProvider));
     documents = new List <RoslynCodeDocument>();
 }
 VisualBasicLanguageCompilerProvider(VisualBasicCompilerSettings visualBasicCompilerSettings, ICodeEditorProvider codeEditorProvider, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService, ITextViewUndoManagerProvider textViewUndoManagerProvider)
 {
     this.visualBasicCompilerSettings = visualBasicCompilerSettings;
     this.codeEditorProvider          = codeEditorProvider;
     this.docFactory = docFactory;
     this.roslynDocumentChangedService = roslynDocumentChangedService;
     this.textViewUndoManagerProvider  = textViewUndoManagerProvider;
 }
Ejemplo n.º 4
0
 public TextViewUndoManager(IDsWpfTextView textView, ITextViewUndoManagerProvider textViewUndoManagerProvider, ITextBufferUndoManagerProvider textBufferUndoManagerProvider)
 {
     TextView = textView ?? throw new ArgumentNullException(nameof(textView));
     this.textViewUndoManagerProvider   = textViewUndoManagerProvider ?? throw new ArgumentNullException(nameof(textViewUndoManagerProvider));
     this.textBufferUndoManagerProvider = textBufferUndoManagerProvider ?? throw new ArgumentNullException(nameof(textBufferUndoManagerProvider));
     textBufferUndoManager       = textBufferUndoManagerProvider.GetTextBufferUndoManager(TextView.TextBuffer);
     undoRedoCommandTargetFilter = new UndoRedoCommandTargetFilter(this);
     TextView.CommandTarget.AddFilter(undoRedoCommandTargetFilter, CommandTargetFilterOrder.UndoRedo);
     TextView.Closed += TextView_Closed;
 }
Ejemplo n.º 5
0
 protected RoslynLanguageCompiler(CompilationKind kind, ICodeEditorProvider codeEditorProvider, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService, ITextViewUndoManagerProvider textViewUndoManagerProvider)
 {
     this.codeEditorProvider           = codeEditorProvider ?? throw new ArgumentNullException(nameof(codeEditorProvider));
     this.docFactory                   = docFactory ?? throw new ArgumentNullException(nameof(docFactory));
     this.roslynDocumentChangedService = roslynDocumentChangedService ?? throw new ArgumentNullException(nameof(roslynDocumentChangedService));
     this.textViewUndoManagerProvider  = textViewUndoManagerProvider ?? throw new ArgumentNullException(nameof(textViewUndoManagerProvider));
     DefaultOutputKind                 = GetDefaultOutputKind(kind);
     documents       = new List <RoslynCodeDocument>();
     projectId       = ProjectId.CreateNewId();
     loadedDocuments = new HashSet <DocumentId>();
 }
Ejemplo n.º 6
0
		ReplEditorProvider(IDsTextEditorFactoryService dsTextEditorFactoryService, IContentTypeRegistryService contentTypeRegistryService, ITextBufferFactoryService textBufferFactoryService, IEditorOperationsFactoryService editorOperationsFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, IClassificationTypeRegistryService classificationTypeRegistryService, IThemeClassificationTypeService themeClassificationTypeService, IPickSaveFilename pickSaveFilename, ITextViewUndoManagerProvider textViewUndoManagerProvider) {
			this.dsTextEditorFactoryService = dsTextEditorFactoryService;
			this.contentTypeRegistryService = contentTypeRegistryService;
			this.textBufferFactoryService = textBufferFactoryService;
			this.editorOperationsFactoryService = editorOperationsFactoryService;
			this.editorOptionsFactoryService = editorOptionsFactoryService;
			this.classificationTypeRegistryService = classificationTypeRegistryService;
			this.themeClassificationTypeService = themeClassificationTypeService;
			this.pickSaveFilename = pickSaveFilename;
			this.textViewUndoManagerProvider = textViewUndoManagerProvider;
		}
Ejemplo n.º 7
0
 ReplEditorProvider(IDsTextEditorFactoryService dsTextEditorFactoryService, IContentTypeRegistryService contentTypeRegistryService, ITextBufferFactoryService textBufferFactoryService, IEditorOperationsFactoryService editorOperationsFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, IClassificationTypeRegistryService classificationTypeRegistryService, IThemeClassificationTypeService themeClassificationTypeService, IPickSaveFilename pickSaveFilename, ITextViewUndoManagerProvider textViewUndoManagerProvider)
 {
     this.dsTextEditorFactoryService        = dsTextEditorFactoryService;
     this.contentTypeRegistryService        = contentTypeRegistryService;
     this.textBufferFactoryService          = textBufferFactoryService;
     this.editorOperationsFactoryService    = editorOperationsFactoryService;
     this.editorOptionsFactoryService       = editorOptionsFactoryService;
     this.classificationTypeRegistryService = classificationTypeRegistryService;
     this.themeClassificationTypeService    = themeClassificationTypeService;
     this.pickSaveFilename            = pickSaveFilename;
     this.textViewUndoManagerProvider = textViewUndoManagerProvider;
 }
Ejemplo n.º 8
0
		public TextViewUndoManager(IDsWpfTextView textView, ITextViewUndoManagerProvider textViewUndoManagerProvider, ITextBufferUndoManagerProvider textBufferUndoManagerProvider) {
			if (textView == null)
				throw new ArgumentNullException(nameof(textView));
			if (textViewUndoManagerProvider == null)
				throw new ArgumentNullException(nameof(textViewUndoManagerProvider));
			if (textBufferUndoManagerProvider == null)
				throw new ArgumentNullException(nameof(textBufferUndoManagerProvider));
			TextView = textView;
			this.textViewUndoManagerProvider = textViewUndoManagerProvider;
			this.textBufferUndoManagerProvider = textBufferUndoManagerProvider;
			textBufferUndoManager = textBufferUndoManagerProvider.GetTextBufferUndoManager(TextView.TextBuffer);
			undoRedoCommandTargetFilter = new UndoRedoCommandTargetFilter(this);
			TextView.CommandTarget.AddFilter(undoRedoCommandTargetFilter, CommandTargetFilterOrder.UndoRedo);
			TextView.Closed += TextView_Closed;
		}
Ejemplo n.º 9
0
		protected RoslynLanguageCompiler(CompilationKind kind, ICodeEditorProvider codeEditorProvider, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService, ITextViewUndoManagerProvider textViewUndoManagerProvider) {
			if (codeEditorProvider == null)
				throw new ArgumentNullException(nameof(codeEditorProvider));
			if (docFactory == null)
				throw new ArgumentNullException(nameof(docFactory));
			if (roslynDocumentChangedService == null)
				throw new ArgumentNullException(nameof(roslynDocumentChangedService));
			if (textViewUndoManagerProvider == null)
				throw new ArgumentNullException(nameof(textViewUndoManagerProvider));
			this.codeEditorProvider = codeEditorProvider;
			this.docFactory = docFactory;
			this.roslynDocumentChangedService = roslynDocumentChangedService;
			this.textViewUndoManagerProvider = textViewUndoManagerProvider;
			documents = new List<RoslynCodeDocument>();
		}
Ejemplo n.º 10
0
		public ReplEditor(ReplEditorOptions options, IDsTextEditorFactoryService dsTextEditorFactoryService, IContentTypeRegistryService contentTypeRegistryService, ITextBufferFactoryService textBufferFactoryService, IEditorOperationsFactoryService editorOperationsFactoryService, IEditorOptionsFactoryService editorOptionsFactoryService, IClassificationTypeRegistryService classificationTypeRegistryService, IThemeClassificationTypeService themeClassificationTypeService, IPickSaveFilename pickSaveFilename, ITextViewUndoManagerProvider textViewUndoManagerProvider) {
			dispatcher = Dispatcher.CurrentDispatcher;
			this.pickSaveFilename = pickSaveFilename;
			options = options?.Clone() ?? new ReplEditorOptions();
			options.CreateGuidObjects = CommonGuidObjectsProvider.Create(options.CreateGuidObjects, new GuidObjectsProvider(this));
			PrimaryPrompt = options.PrimaryPrompt;
			SecondaryPrompt = options.SecondaryPrompt;
			subBuffers = new List<ReplSubBuffer>();
			cachedColorsList = new CachedColorsList();
			TextClassificationType = classificationTypeRegistryService.GetClassificationType(ThemeClassificationTypeNames.Text);
			ReplPrompt1ClassificationType = classificationTypeRegistryService.GetClassificationType(ThemeClassificationTypeNames.ReplPrompt1);
			ReplPrompt2ClassificationType = classificationTypeRegistryService.GetClassificationType(ThemeClassificationTypeNames.ReplPrompt2);

			var contentType = contentTypeRegistryService.GetContentType(options.ContentType, options.ContentTypeString) ?? textBufferFactoryService.TextContentType;
			var textBuffer = textBufferFactoryService.CreateTextBuffer(contentType);
			CachedColorsListTaggerProvider.AddColorizer(textBuffer, cachedColorsList);
			var roles = dsTextEditorFactoryService.CreateTextViewRoleSet(options.Roles);
			var textView = dsTextEditorFactoryService.CreateTextView(textBuffer, roles, editorOptionsFactoryService.GlobalOptions, options);
			var wpfTextViewHost = dsTextEditorFactoryService.CreateTextViewHost(textView, false);
			this.wpfTextViewHost = wpfTextViewHost;
			wpfTextView = wpfTextViewHost.TextView;
			textViewUndoManager = textViewUndoManagerProvider.GetTextViewUndoManager(wpfTextView);
			ReplEditorUtils.AddInstance(this, wpfTextView);
			wpfTextView.Options.SetOptionValue(DefaultWpfViewOptions.AppearanceCategory, AppearanceCategoryConstants.TextEditor);
			wpfTextView.Options.SetOptionValue(DefaultTextViewOptions.DragDropEditingId, false);
			//TODO: ReplEditorOperations doesn't support virtual space
			wpfTextView.Options.SetOptionValue(DefaultTextViewOptions.UseVirtualSpaceId, false);
			//TODO: Support box selection
			wpfTextView.Options.SetOptionValue(DefaultDsTextViewOptions.AllowBoxSelectionId, false);
			wpfTextView.Options.OptionChanged += Options_OptionChanged;
			wpfTextView.TextBuffer.ChangedLowPriority += TextBuffer_ChangedLowPriority;
			wpfTextView.Closed += WpfTextView_Closed;
			wpfTextView.TextBuffer.Changed += TextBuffer_Changed;
			AddNewDocument();
			WriteOffsetOfPrompt(null, true);
			ReplEditorOperations = new ReplEditorOperations(this, wpfTextView, editorOperationsFactoryService);
			wpfTextView.VisualElement.Loaded += WpfTextView_Loaded;
			UpdateRefreshScreenOnChange();
			CustomLineNumberMargin.SetOwner(wpfTextView, new ReplCustomLineNumberMarginOwner(this, themeClassificationTypeService));
		}
Ejemplo n.º 11
0
 public CSharpLanguageCompiler(CompilationKind kind, ICodeEditorProvider codeEditorProvider, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService, ITextViewUndoManagerProvider textViewUndoManagerProvider)
     : base(kind, codeEditorProvider, docFactory, roslynDocumentChangedService, textViewUndoManagerProvider)
 {
 }
Ejemplo n.º 12
0
 public CSharpLanguageCompiler(CompilationKind kind, CSharpCompilerSettings csharpCompilerSettings, ICodeEditorProvider codeEditorProvider, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService, ITextViewUndoManagerProvider textViewUndoManagerProvider)
     : base(kind, codeEditorProvider, docFactory, roslynDocumentChangedService, textViewUndoManagerProvider) =>
     this.csharpCompilerSettings = csharpCompilerSettings ?? throw new ArgumentNullException(nameof(csharpCompilerSettings));
 public VisualBasicLanguageCompiler(ICodeEditorProvider codeEditorProvider, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService, ITextViewUndoManagerProvider textViewUndoManagerProvider)
     : base(codeEditorProvider, docFactory, roslynDocumentChangedService, textViewUndoManagerProvider)
 {
 }
		public VisualBasicLanguageCompiler(CompilationKind kind, ICodeEditorProvider codeEditorProvider, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService, ITextViewUndoManagerProvider textViewUndoManagerProvider)
			: base(kind, codeEditorProvider, docFactory, roslynDocumentChangedService, textViewUndoManagerProvider) {
		}
		VisualBasicLanguageCompilerCreator(ICodeEditorProvider codeEditorProvider, IRoslynDocumentationProviderFactory docFactory, IRoslynDocumentChangedService roslynDocumentChangedService, ITextViewUndoManagerProvider textViewUndoManagerProvider) {
			this.codeEditorProvider = codeEditorProvider;
			this.docFactory = docFactory;
			this.roslynDocumentChangedService = roslynDocumentChangedService;
			this.textViewUndoManagerProvider = textViewUndoManagerProvider;
		}