Пример #1
0
        void _document_FileActionOccurred(object sender, TextDocumentFileActionEventArgs e)
        {
            try {
                if (e.FileActionType == FileActionTypes.DocumentRenamed)
                {
                    var doc = (ITextDocument)sender;

                    CodeModelCache.CreateIfNeeded((ITextDocument)sender, _buffer, _dte);
                    _filename = doc.FilePath.ToLower();
                    CodeModelCache.TryUpdateCache(e.FilePath.ToLower(), RaiseTagsChanged, new NormalizedSnapshotSpanCollection());
                }
            }
            catch (Exception ex)
            {
                Logger.Write("DocActionOccurred" + ex);
            }
        }
Пример #2
0
 private void buffer_ChangedLowPriority(object sender, TextContentChangedEventArgs e)
 {
     try
     {
         if (_document == null)
         {
             return;
         }
         if (_document.FilePath == null)
         {
             return;
         }
         CodeModelCache.TryUpdateCache(_document.FilePath.ToLower(), RaiseTagsChanged,
                                       new NormalizedSnapshotSpanCollection());
     }
     catch (Exception ex)
     {
         Logger.Write("BufferChangedLowPriority" + ex);
     }
 }