private AvalonEditSourceText(RoslynSourceTextContainerAdapter container, SourceText sourceText) { _container = container; _sourceText = sourceText; }
public CodeEditorViewAdapterCSharp(AltaxoWorkspaceBase workspace, Microsoft.CodeAnalysis.DocumentId documentID, RoslynSourceTextContainerAdapter sourceText) { Workspace = workspace ?? throw new ArgumentNullException(nameof(workspace)); DocumentId = documentID ?? throw new ArgumentNullException(nameof(documentID)); SourceTextAdapter = sourceText ?? throw new ArgumentNullException(nameof(sourceText)); _roslynHost = workspace.RoslynHost; SourceTextAdapter.TextChanged += EhSourceTextAdapter_TextChanged; HighlightingColorizer = new SemanticHighlighting.SemanticHighlightingColorizer(Workspace, DocumentId); QuickInfoProvider = _roslynHost.GetService <QuickInfo.IQuickInfoProvider>(); FoldingStrategy = new SyntaxTreeFoldingStrategy(); BraceMatchingService = _roslynHost.GetService <IBraceMatchingService>(); ReferenceHighlightService = new ReferenceHighlighting.CSharp.CSharpDocumentHighlightsService(); CompletionProvider = new Completion.CodeEditorCompletionProvider(_roslynHost, Workspace, DocumentId); RenamingService = new Renaming.RenamingService(); IndentationStrategy = new ICSharpCode.AvalonEdit.Indentation.CSharp.CSharpIndentationStrategy(); LiveDocumentFormatter = new LiveDocumentFormatterCSharp(); ExternalHelpProvider = new ExternalHelp.ExternalHelpProvider(); Workspace.SubscribeToDiagnosticsUpdateNotification(DocumentId, EhDiagnosticsUpdated); }
public AvalonEditSourceText(RoslynSourceTextContainerAdapter container, string text) : this(container, From(text)) { }