Beispiel #1
0
        private static Dictionary<PythonLanguageVersion, Tokenizer> _tokenizers;    // tokenizer for each version, shared between all buffers

        internal PythonClassifier(PythonClassifierProvider provider, ITextBuffer buffer) {
            buffer.Changed += BufferChanged;
            buffer.ContentTypeChanged += BufferContentTypeChanged;

            _tokenCache = new TokenCache();
            _provider = provider;
            _buffer = buffer;

            var analyzer = _buffer.GetAnalyzer(provider._serviceProvider);
            Debug.Assert(analyzer != null);
            _version = analyzer.InterpreterFactory.GetLanguageVersion();
        }