<commit_before>using JetBrains.ReSharper.Feature.Services.Daemon;
using JetBrains.ReSharper.Plugins.Unity.AsmDef.Daemon.Errors;
using JetBrains.ReSharper.Plugins.Unity.JsonNew.Psi.Tree;
using JetBrains.ReSharper.Plugins.Unity.Utils;
using JetBrains.ReSharper.Psi.Util;

#nullable enable

namespace JetBrains.ReSharper.Plugins.Unity.AsmDef.Feature.Services.Daemon
{
    [ElementProblemAnalyzer(typeof(IJsonNewLiteralExpression),
        HighlightingTypes = new[] { typeof(InvalidDefineConstraintExpressionError) })]
    public class VersionDefineProblemAnalyzer : AsmDefProblemAnalyzer<IJsonNewLiteralExpression>
    {
        protected override void Analyze(IJsonNewLiteralExpression element,
                                        ElementProblemAnalyzerData data,
                                        IHighlightingConsumer consumer)
        {
            if (element.IsVersionDefinesObjectDefineValue())
            {
                var symbol = element.GetUnquotedText();
                if (!DefineSymbolUtilities.IsValidVersionDefineSymbol(symbol))
                {
                    var range = symbol.Length == 0
                        ? element.GetHighlightingRange()
                        : element.GetUnquotedDocumentRange();
                    consumer.AddHighlighting(new InvalidVersionDefineSymbolError(element, range));
                }
            }
            else if (element.IsVersionDefinesObjectExpressionValue())
            {<commit_msg>Fix problem analyser declaration<commit_after>using JetBrains.ReSharper.Feature.Services.Daemon;
using JetBrains.ReSharper.Plugins.Unity.AsmDef.Daemon.Errors;
using JetBrains.ReSharper.Plugins.Unity.JsonNew.Psi.Tree;
using JetBrains.ReSharper.Plugins.Unity.Utils;
using JetBrains.ReSharper.Psi.Util;

#nullable enable

namespace JetBrains.ReSharper.Plugins.Unity.AsmDef.Feature.Services.Daemon
{
    [ElementProblemAnalyzer(typeof(IJsonNewLiteralExpression),
        HighlightingTypes = new[]
        {
            typeof(InvalidVersionDefineSymbolError), typeof(InvalidVersionDefineExpressionError)
        })]
    public class VersionDefineProblemAnalyzer : AsmDefProblemAnalyzer<IJsonNewLiteralExpression>
    {
        protected override void Analyze(IJsonNewLiteralExpression element,
                                        ElementProblemAnalyzerData data,
                                        IHighlightingConsumer consumer)
        {
            if (element.IsVersionDefinesObjectDefineValue())
            {
                var symbol = element.GetUnquotedText();
                if (!DefineSymbolUtilities.IsValidVersionDefineSymbol(symbol))
                {
                    var range = symbol.Length == 0
                        ? element.GetHighlightingRange()
                        : element.GetUnquotedDocumentRange();
                    consumer.AddHighlighting(new InvalidVersionDefineSymbolError(element, range));
                }
            }
            else if (element.IsVersionDefinesObjectExpressionValue())
            {
{'fraction_non_alphanumeric': 0.07296137339055794, 'fraction_numerical': 0.0006602839220864972, 'mean_word_length': 2.362930077691454, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4158835', 'n_tokens_mistral': 792, 'n_tokens_neox': 738, 'n_words': 104}