/// <summary> /// Constructor /// </summary> /// <param name="syntaxRoot">Syntax root</param> /// <param name="semanticModel">Semantic model</param> /// <param name="workspace">Workspace</param> /// <param name="roslynClassificationTypes">Classification types</param> /// <param name="defaultClassificationType">Default classification type if a token can't be classified or null to not use anything</param> /// <param name="cancellationToken">Cancellation token</param> public RoslynClassifier(SyntaxNode syntaxRoot, SemanticModel semanticModel, Workspace workspace, RoslynClassificationTypes roslynClassificationTypes, IClassificationType defaultClassificationType, CancellationToken cancellationToken) { this.syntaxRoot = syntaxRoot; this.semanticModel = semanticModel; this.workspace = workspace; this.roslynClassificationTypes = roslynClassificationTypes; this.defaultClassificationType = defaultClassificationType; this.cancellationToken = cancellationToken; }
/// <summary> /// Constructor /// </summary> /// <param name="syntaxRoot">Syntax root</param> /// <param name="semanticModel">Semantic model</param> /// <param name="workspace">Workspace</param> /// <param name="roslynClassificationTypes">Classification types</param> /// <param name="defaultClassificationType">Default classification type if a token can't be classified or null to not use anything</param> /// <param name="cancellationToken">Cancellation token</param> #pragma warning disable 0618 // Type or member is obsolete public RoslynClassifier(SyntaxNode syntaxRoot, SemanticModel semanticModel, Workspace workspace, RoslynClassificationTypes roslynClassificationTypes, IClassificationType defaultClassificationType, CancellationToken cancellationToken) { #pragma warning restore 0618 // Type or member is obsolete this.syntaxRoot = syntaxRoot; this.semanticModel = semanticModel; this.workspace = workspace; this.roslynClassificationTypes = new RoslynClassificationTypes2(roslynClassificationTypes); this.defaultColor = defaultClassificationType; this.cancellationToken = cancellationToken; }
#pragma warning restore 1591 // Missing XML comment for publicly visible type or member #pragma warning disable 0618 // Type or member is obsolete internal RoslynClassificationTypes2(RoslynClassificationTypes roslynClassificationTypes) { #pragma warning restore 0618 // Type or member is obsolete Comment = roslynClassificationTypes.Comment; Delegate = roslynClassificationTypes.Delegate; Enum = roslynClassificationTypes.Enum; EnumField = roslynClassificationTypes.EnumField; ExcludedCode = roslynClassificationTypes.ExcludedCode; ExtensionMethod = roslynClassificationTypes.ExtensionMethod; InstanceEvent = roslynClassificationTypes.InstanceEvent; InstanceField = roslynClassificationTypes.InstanceField; InstanceMethod = roslynClassificationTypes.InstanceMethod; InstanceProperty = roslynClassificationTypes.InstanceProperty; Interface = roslynClassificationTypes.Interface; Keyword = roslynClassificationTypes.Keyword; Label = roslynClassificationTypes.Label; LiteralField = roslynClassificationTypes.LiteralField; Local = roslynClassificationTypes.Local; MethodGenericParameter = roslynClassificationTypes.MethodGenericParameter; Module = roslynClassificationTypes.Module; Namespace = roslynClassificationTypes.Namespace; Number = roslynClassificationTypes.Number; Operator = roslynClassificationTypes.Operator; Parameter = roslynClassificationTypes.Parameter; PreprocessorKeyword = roslynClassificationTypes.PreprocessorKeyword; PreprocessorText = roslynClassificationTypes.PreprocessorText; Punctuation = roslynClassificationTypes.Punctuation; SealedType = roslynClassificationTypes.SealedType; StaticEvent = roslynClassificationTypes.StaticEvent; StaticField = roslynClassificationTypes.StaticField; StaticMethod = roslynClassificationTypes.StaticMethod; StaticProperty = roslynClassificationTypes.StaticProperty; StaticType = roslynClassificationTypes.StaticType; String = roslynClassificationTypes.String; Text = roslynClassificationTypes.Text; Type = roslynClassificationTypes.Type; TypeGenericParameter = roslynClassificationTypes.TypeGenericParameter; ValueType = roslynClassificationTypes.ValueType; VerbatimString = roslynClassificationTypes.VerbatimString; XmlDocCommentAttributeName = roslynClassificationTypes.XmlDocCommentAttributeName; XmlDocCommentAttributeQuotes = roslynClassificationTypes.XmlDocCommentAttributeQuotes; XmlDocCommentAttributeValue = roslynClassificationTypes.XmlDocCommentAttributeValue; XmlDocCommentCDataSection = roslynClassificationTypes.XmlDocCommentCDataSection; XmlDocCommentComment = roslynClassificationTypes.XmlDocCommentComment; XmlDocCommentDelimiter = roslynClassificationTypes.XmlDocCommentDelimiter; XmlDocCommentEntityReference = roslynClassificationTypes.XmlDocCommentEntityReference; XmlDocCommentName = roslynClassificationTypes.XmlDocCommentName; XmlDocCommentProcessingInstruction = roslynClassificationTypes.XmlDocCommentProcessingInstruction; XmlDocCommentText = roslynClassificationTypes.XmlDocCommentText; XmlLiteralAttributeName = roslynClassificationTypes.XmlLiteralAttributeName; XmlLiteralAttributeQuotes = roslynClassificationTypes.XmlLiteralAttributeQuotes; XmlLiteralAttributeValue = roslynClassificationTypes.XmlLiteralAttributeValue; XmlLiteralCDataSection = roslynClassificationTypes.XmlLiteralCDataSection; XmlLiteralComment = roslynClassificationTypes.XmlLiteralComment; XmlLiteralDelimiter = roslynClassificationTypes.XmlLiteralDelimiter; XmlLiteralEmbeddedExpression = roslynClassificationTypes.XmlLiteralEmbeddedExpression; XmlLiteralEntityReference = roslynClassificationTypes.XmlLiteralEntityReference; XmlLiteralName = roslynClassificationTypes.XmlLiteralName; XmlLiteralProcessingInstruction = roslynClassificationTypes.XmlLiteralProcessingInstruction; XmlLiteralText = roslynClassificationTypes.XmlLiteralText; }