Example #1
0
        internal static ClassificationTypeDefinition OperatorClassificationDefinition = null; // Set via MEF

        #endregion

        #region IDlrClassifierProvider

        public IClassifier GetClassifier(ITextBuffer buffer)
        {
            if (_categoryMap == null)
            {
                _categoryMap = FillCategoryMap(_classificationRegistry);
            }

            NodejsClassifier res;

            if (!buffer.Properties.TryGetProperty <NodejsClassifier>(typeof(NodejsClassifier), out res) &&
                buffer.ContentType.IsOfType(ContentType.TypeName))
            {
                res = new NodejsClassifier(this, buffer);
                buffer.Properties.AddProperty(typeof(NodejsClassifier), res);
            }

            return(res);
        }
 public CompletionSource(ITextBuffer textBuffer, NodejsClassifier classifier, IServiceProvider serviceProvider, IGlyphService glyphService) {
     _textBuffer = textBuffer;
     _classifier = classifier;
     _glyphService = glyphService;
 }
        internal static ClassificationTypeDefinition OperatorClassificationDefinition = null; // Set via MEF

        #endregion

        #region IDlrClassifierProvider

        public IClassifier GetClassifier(ITextBuffer buffer) {
            if (_categoryMap == null) {
                _categoryMap = FillCategoryMap(_classificationRegistry);
            }

            NodejsClassifier res;
            if (!buffer.Properties.TryGetProperty<NodejsClassifier>(typeof(NodejsClassifier), out res) &&
                buffer.ContentType.IsOfType(ContentType.TypeName)) {
                res = new NodejsClassifier(this, buffer);
                buffer.Properties.AddProperty(typeof(NodejsClassifier), res);
            }

            return res;
        }