public void OpenDocument(DocumentId documentId, SourceTextContainer textContainer) => this.OnDocumentOpened(documentId, textContainer);
public static IEnumerable <Document> GetRelatedDocuments(this SourceTextContainer container) => TextExtensions.GetRelatedDocuments(container);
private void ApplyDocumentToBuffer(TextDocument document, SpanChange spanSource, out SourceTextContainer container, out TextDocument documentBackedByTextBuffer) { var contentTypeService = document.Project.LanguageServices.GetService <IContentTypeLanguageService>(); var contentType = contentTypeService.GetDefaultContentType(); TextView.TextBuffer.ChangeContentType(contentType, null); var documentText = document.GetTextAsync().Result.ToString(); SpanToShow = spanSource.GetSpan(); using (var edit = TextView.TextBuffer.CreateEdit()) { edit.Replace(new Span(0, TextView.TextBuffer.CurrentSnapshot.Length), documentText); edit.ApplyAndLogExceptions(); } container = TextView.TextBuffer.AsTextContainer(); documentBackedByTextBuffer = document.WithText(container.CurrentText); }
internal void OnDocumentContextUpdated_NoSerializationLock(DocumentId documentId, SourceTextContainer container) { DocumentId oldActiveContextDocumentId; using (_stateLock.DisposableWait()) { oldActiveContextDocumentId = _bufferToDocumentInCurrentContextMap[container]; if (documentId == oldActiveContextDocumentId) { return; } UpdateCurrentContextMapping_NoLock(container, documentId, isCurrentContext: true); } // fire and forget this.RaiseDocumentActiveContextChangedEventAsync(container, oldActiveContextDocumentId: oldActiveContextDocumentId, newActiveContextDocumentId: documentId); }
public static ITextBuffer TryGetTextBuffer(this SourceTextContainer textContainer) { return(Shared.Text.Extensions.TryGetTextBuffer(textContainer)); }
public SourceTextLoader(SourceTextContainer textContainer, string?filePath) { _textContainer = textContainer; _filePath = filePath; }
private static WorkspaceRegistration CreateRegistration(SourceTextContainer container) => new WorkspaceRegistration();
public void OpenDocument(DocumentId documentId, SourceTextContainer textContainer) { base.OnDocumentOpened(documentId, textContainer, true); }
public static ITextBuffer TryGetTextBuffer(this SourceTextContainer textContainer) { return(SourceTextHelper.Instance.TryGetTextBuffer(textContainer)); }
public new Task OnDocumentOpenedAsync(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true) { return(base.OnDocumentOpenedAsync(documentId, textContainer, isCurrentContext)); }
public new void RegisterText(SourceTextContainer text) { base.RegisterText(text); }
internal TextContainerLoader(SourceTextContainer container, VersionStamp version, string filePath) { this.container = container; this.version = version; this.filePath = filePath; }
public new void OnDocumentOpened(DocumentId documentId, SourceTextContainer textContainer, bool isCurrentContext = true) => base.OnDocumentOpened(documentId, textContainer, isCurrentContext);