Exemple #1
0
        // Internal for testing
        internal void RazorBufferDisposed(ITextBuffer textBuffer)
        {
            if (textBuffer is null)
            {
                throw new ArgumentNullException(nameof(textBuffer));
            }

            StopMonitoringDocumentForRenames(textBuffer);

            // If we don't know about this document we'll no-op
            _lspDocumentManager.UntrackDocument(textBuffer);
        }
        // Internal for testing
        internal void TextDocumentFactory_TextDocumentDisposed(object sender, TextDocumentEventArgs args)
        {
            if (args is null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            // Do a lighter check to see if we care about this document.
            if (IsRazorFilePath(args.TextDocument.FilePath))
            {
                // If we don't know about this document we'll no-op
                _lspDocumentManager.UntrackDocument(args.TextDocument.TextBuffer);
            }
        }
Exemple #3
0
        // Internal for testing
        internal void TextDocumentFactory_TextDocumentDisposed(object sender, TextDocumentEventArgs args)
        {
            if (args is null)
            {
                throw new ArgumentNullException(nameof(args));
            }

            // Do a lighter check to see if we care about this document.
            if (IsRazorFilePath(args.TextDocument.FilePath))
            {
                // If we don't know about this document we'll no-op
                _lspDocumentManager.UntrackDocument(args.TextDocument.TextBuffer);

                if (_lspEditorFeatureDetector.IsRemoteClient() &&
                    args.TextDocument.TextBuffer.Properties.ContainsProperty(FilePathPropertyKey))
                {
                    // We no longer want to watch for guest buffer changes.
                    args.TextDocument.TextBuffer.Properties.RemoveProperty(FilePathPropertyKey);
                    args.TextDocument.TextBuffer.ChangedHighPriority -= RazorGuestBuffer_Changed;
                }
            }
        }