private PythonTextBufferInfo(PythonEditorServices services, ITextBuffer buffer) { Services = services; Buffer = buffer; _eventSinks = new ConcurrentDictionary <object, IPythonTextBufferInfoEventSink>(); _filename = new Lazy <string>(GetOrCreateFilename); _bufferId = -1; ITextDocument doc; if (Buffer.Properties.TryGetProperty(typeof(ITextDocument), out doc)) { Document = doc; Document.EncodingChanged += Document_EncodingChanged; } Buffer.ContentTypeChanged += Buffer_ContentTypeChanged; Buffer.Changed += Buffer_TextContentChanged; Buffer.ChangedLowPriority += Buffer_TextContentChangedLowPriority; }
private PythonTextBufferInfo(PythonEditorServices services, ITextBuffer buffer) { Services = services; Buffer = buffer; _eventSinks = new ConcurrentDictionary <object, IPythonTextBufferInfoEventSink>(); _filename = new Lazy <string>(GetOrCreateFilename); _documentUri = new Lazy <Uri>(GetOrCreateDocumentUri); _tokenCache = new TokenCache(); _defaultLanguageVersion = PythonLanguageVersion.None; ITextDocument doc; if (Buffer.Properties.TryGetProperty(typeof(ITextDocument), out doc)) { Document = doc; Document.EncodingChanged += Document_EncodingChanged; } Buffer.ContentTypeChanged += Buffer_ContentTypeChanged; Buffer.Changed += Buffer_TextContentChanged; Buffer.ChangedLowPriority += Buffer_TextContentChangedLowPriority; if (Buffer is ITextBuffer2 buffer2) { _hasChangedOnBackground = true; buffer2.ChangedOnBackground += Buffer_TextContentChangedOnBackground; } _locationTracker = new LocationTracker(Buffer.CurrentSnapshot); #if BUFFERINFO_TRACING _traceLog = new AnalysisLogWriter( PathUtils.GetAvailableFilename(System.IO.Path.GetTempPath(), "PythonTools_Buffer_{0}_{1:yyyyMMddHHmmss}".FormatInvariant(PathUtils.GetFileOrDirectoryName(_filename.Value), DateTime.Now), ".log"), false, false, cacheSize: 1 ); #endif }
public BraceMatcher(PythonEditorServices editorServices, ITextView view) { _textView = view; _editorServices = editorServices; }
public ReplWindowCreationListener([Import] PythonEditorServices editorServices) { _editorServices = editorServices; }