public IDaemonStageProcess CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            if (process == null)
                throw new ArgumentNullException("process");

            return new MakeEnumComparisonTypeSafeDaemonStageProcess(process);
        }
Пример #2
0
	    /// <summary>
	    /// Creates a code analysis process corresponding to this stage for analysing a file.
	    /// </summary>
	    /// <returns>Code analysis process to be executed or <c>null</c> if this stage is not available for this file.</returns>
	    public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind) {
		    var t4File = process.SourceFile.GetTheOnlyPsiFile(T4Language.Instance) as IT4File;
			if (t4File == null)
				return EmptyList<IDaemonStageProcess>.InstanceList;

		    return new[] { CreateProcess(process, t4File) };
	    }
        /// <summary>
        /// This method provides a <see cref="IDaemonStageProcess"/> instance which is assigned to highlighting a single document
        /// </summary>
        public IDaemonStageProcess CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind kind)
        {
            if (process == null)
            throw new ArgumentNullException("process");

              return new InjectionHappyDetectorDaemonStageProcess(process, settings.GetValue((InjectionHappyDetectorSettings s) => s.MaximumParameters));
        }
        /// <summary>
        /// This method provides a <see cref="IDaemonStageProcess"/> instance which is assigned to highlighting a single document
        /// </summary>
        public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind kind)
        {
            if (process == null)
                throw new ArgumentNullException("process");

            return new List<IDaemonStageProcess> { new ComplexityAnalysisDaemonStageProcess(process, 0) };
        }
 public ContainerRegistrationAnalysisStageProcess(IDaemonProcess process, IContextBoundSettingsStore settingsStore, ITypeUsageManager typeUsageManager, IPatternManager patternManager)
 {
     this.process = process;
     this.settingsStore = settingsStore;
     this.typeUsageManager = typeUsageManager;
     this.patternManager = patternManager;
 }
        /// <summary>
        /// This method provides a <see cref="IDaemonStageProcess"/> instance which is assigned to highlighting a single document.
        /// </summary>
        protected override IDaemonStageProcess CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind, ICSharpFile file)
        {
            if (process == null)
                throw new ArgumentNullException("process");

            return new CloneDetectionDaemonStageProcess(process);
        }
Пример #7
0
		public override ITreeRange Format(
			ITreeNode firstElement,
			ITreeNode lastElement,
			CodeFormatProfile profile,
			IProgressIndicator progressIndicator,
			IContextBoundSettingsStore overrideSettingsStore = null,
			IPotentSettingsTracker settingsTracker = null)
			=> new TreeRange(firstElement, lastElement);
 public NancyDaemonStageProcess(SearchDomainFactory searchDomainFactory, [NotNull] IDaemonProcess daemonProcess,
     [CanBeNull] CollectUsagesStageProcess collectUsagesStageProcess, IContextBoundSettingsStore settingsStore)
 {
     DaemonProcess = daemonProcess;
     this.searchDomainFactory = searchDomainFactory;
     this.collectUsagesStageProcess = collectUsagesStageProcess;
     this.settingsStore = settingsStore;
 }
    public IFileStructure Run(IDaemonProcess process, IPsiSourceFile psiSourceFile, IContextBoundSettingsStore settingsStore, IFile file)
    {
      var psiFile = file as IPsiFile;
      if (psiFile == null)
        return null;

      return new PsiFileStructure(psiFile, settingsStore);
    }
        public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            IFile psiFile = process.SourceFile.GetTheOnlyPsiFile(RazorCSharpLanguage.Instance);
            if (psiFile == null)
                return Enumerable.Empty<IDaemonStageProcess>();

            return new[] { new UseOfSemicolonLiteralInRazorSyntaxDaemonProcess(process) };
        }
 public override IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
 {
   if (!IsSupported(process.SourceFile))
   {
     return EmptyList<IDaemonStageProcess>.InstanceList;
   }
   return new List<IDaemonStageProcess> { new IdentifierHighlighterProcess(process, settings) };
 }
Пример #12
0
        public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            IFile psiFile = process.SourceFile.GetNonInjectedPsiFile(JavaScriptLanguage.Instance);
            if (psiFile == null)
                yield return null;

            yield return new DaemonStageProcess(process);
        }
    public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
    {
      IFile psiFile = process.SourceFile.GetNonInjectedPsiFile<CSharpLanguage>();
      if (psiFile == null)
        return Enumerable.Empty<IDaemonStageProcess>();

      return new [] { new UseInt16MaxValueLiteralDaemonProcess(process) };
    }
        public ContainerRegistrationAnalysisStageProcess(IDaemonProcess process, IContextBoundSettingsStore settingsStore, ITypeUsageManager typeUsageManager, SolutionAnalyzer solutionAnalyzer)
        {
            this.process = process;
            this.settingsStore = settingsStore;
            this.typeUsageManager = typeUsageManager;

            cachedComponentRegistrations = solutionAnalyzer.Analyze().ToList();
        }
        public bool AcceptTyping(char c, ITextControl textControl, IContextBoundSettingsStore boundSettingsStore)
        {
            if (c == ':') return true;

            if (EmojiCompletionContextProvider.IsEmojiChar(c))
                return this.MatchText(textControl, 1, text => text[0] == ':');

            return false;
        }
    public InspectionsProcess(IDaemonProcess process, IContextBoundSettingsStore settings)
      : base(process, settings)
    {
      process.SourceFile.PrimaryPsiLanguage.Is<PsiLanguage>();
      process.GetStageProcess<PsiFileIndexProcess>();

      myDeclarations = new Dictionary<string, List<IDeclaration>>();
      VisitFile(process.SourceFile.GetPsiFile<PsiLanguage>(new DocumentRange(process.SourceFile.Document, 0)) as IPsiFile);
    }
		public IParameterInfoContext CreateContext(ISolution solution, IDocument document, int caretOffset, int expectedLParenthOffset, char invocationChar,
			IContextBoundSettingsStore contextBoundSettingsStore) {
			IParameterInfoContextFactory factory = _csParameterInfoContextFactory.Value;
			IParameterInfoContext context = factory != null
				? factory.CreateContext(solution, document, caretOffset, expectedLParenthOffset, invocationChar, contextBoundSettingsStore)
				: null;

			return Enhance(context, solution, contextBoundSettingsStore);
		}
        public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            if (process == null)
                throw new ArgumentNullException("process");

            return new[]
               {
                 new FakeDaemonStageProcess(process)
               };
        }
 protected override IDaemonStageProcess CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings,
     DaemonProcessKind processKind, ICSharpFile file)
 {
     if (processKind == DaemonProcessKind.VISIBLE_DOCUMENT &&
         settings.GetValue(HighlightingSettingsAccessor.ColorUsageHighlightingEnabled))
     {
         return new UnityColorHighlighterProcess(process, settings, file);
     }
     return null;
 }
        public override IDaemonStageProcess CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            if (!IsSupported(process.SourceFile))
                return null;

            var collectUsagesStageProcess = process.GetStageProcess<CollectUsagesStageProcess>();
            var typeUsageManager = new TypeUsageManager(collectUsagesStageProcess);

            return new ContainerRegistrationAnalysisStageProcess(process, settings, typeUsageManager, solutionAnalyzer);
        }
        public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            if (!IsSupported(process.SourceFile))
                return Enumerable.Empty<IDaemonStageProcess>();

            process.SourceFile.GetPsiServices().Files.AssertAllDocumentAreCommitted();

            return process.SourceFile.GetPsiFiles<AngularJsLanguage>()
                .SelectNotNull(file => CreateProcess(process, settings, processKind, (IJavaScriptFile)file));
        }
        public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            if (process == null)
                throw new ArgumentNullException("process");

            return new[]
               {
                 new MockMetricsDaemonStageProcess(process, settings.GetValue((MockMetricsSettings s) => s.ArrangeAmount))
               };
        }
 public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process,
     IContextBoundSettingsStore settings, DaemonProcessKind processKind)
 {
     if (process == null)
         throw new ArgumentNullException("process");
     return new[]
     {
         new DisposableFunctionDaemonStageProcess(process,
             settings.GetValue((DisposePluginSettings s) => s.MaxLevel))
     };
 }
Пример #24
0
    public override IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
    {
      if (!IsSupported(process.SourceFile))
        return EmptyList<IDaemonStageProcess>.InstanceList;

      var factory = myServices.TryGetService<IPsiInspectionsProcessFactory>(process.SourceFile.LanguageType);
      if (factory == null)
        return EmptyList<IDaemonStageProcess>.InstanceList;

      return new List<IDaemonStageProcess> { factory.CreateInspectionsProcess(process, settings) };
    }
    /// <summary>
    /// This method provides a <see cref="IDaemonStageProcess"/> instance which is assigned to highlighting a single document
    /// </summary>
    public IEnumerable<IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind kind)
    {
      if (process == null)
        throw new ArgumentNullException("process");

      return new[]
               {
                 new ComplexityAnalysisDaemonStageProcess(
                   process, settings.GetValue((ComplexityAnalysisSettings s) => s.Threshold))
               };
    }
        public ExceptionalDaemonStageProcess(ICSharpFile file, IContextBoundSettingsStore settings)
            : base(ServiceLocator.Process, file)
        {
            _settings = settings;

            #if R2016_1 || R2016_2
            _consumer = new FilteringHighlightingConsumer(this, _settings, file);
            #else
            _consumer = new DefaultHighlightingConsumer(this, _settings);
            #endif
        }
        public ClassUsageTextStyleProvider(Lifetime lifetime, IThreading threading, IHighlighterCustomization highlighterCustomization,
                                           DefaultTextControlSchemeManager textControlSchemeManager, HighlightingSettingsManager highlightingSettingsManager, 
                                           ISettingsStore settingsStore)
        {
            this.threading = threading;
            this.highlighterCustomization = highlighterCustomization;
            this.highlightingSettingsManager = highlightingSettingsManager;
            this.settingsStore = settingsStore.BindToContextLive(lifetime, ContextRange.ApplicationWide);

            textControlSchemeManager.ColorsChanged.Advise(lifetime, Refresh);
        }
Пример #28
0
        protected override IDaemonStageProcess CreateProcess(
        IDaemonProcess process,
        IContextBoundSettingsStore settings,
        DaemonProcessKind processKind,
        ICSharpFile file)
        {
            var testFile = file.ToTestFile();
              if (testFile == null)
            return null;

              return new TestFileDaemonStageProcess(process, testFile, _testFileAnalyzers);
        }
    public bool AcceptTyping(char c, ITextControl textControl, IContextBoundSettingsStore boundSettingsStore)
    {
      if (!IsIdentStart(c))
      {
        return false;
      }

      if (!myPsiIntellisenseManager.GetAutoppopupEnabled(boundSettingsStore))
      {
        return false;
      }
      return true;
      //return textControl.Caret.Offset() == 1 || this.MatchText(textControl, 1, text => !IsIdentStart(text[0]));
    }
        public CleanCodeDaemonStageProcess(IDaemonProcess daemonProcess, ICSharpFile file, IContextBoundSettingsStore settingsStore)
            : base(daemonProcess, file)
        {
            this.settingsStore = settingsStore;

            // Simple checks.
            methodTooLongCheck = new MethodTooLongCheck(settingsStore);
            classTooBigCheck = new ClassTooBigCheck(settingsStore);
            tooManyArgumentsCheck = new TooManyMethodArgumentsCheck(settingsStore);
            excessiveIndentationCheck = new ExcessiveIndentationCheck(settingsStore);
            tooManyDependenciesCheck = new TooManyDependenciesCheck(settingsStore);
            methodNamesNotMeaningfulCheck = new MethodNamesNotMeaningfulCheck(settingsStore);
            tooManyChainedReferencesCheck = new TooManyChainedReferencesCheck(settingsStore);
        }
Пример #31
0
 public ShaderLabSyntaxHighlightingProcess([NotNull] IDaemonProcess process,
                                           [NotNull] IContextBoundSettingsStore settingsStore, [NotNull] IFile file)
     : base(process, settingsStore, file)
 {
 }
Пример #32
0
            public ShaderLabErrorStageProcess(IDaemonProcess process, DaemonProcessKind processKind, ElementProblemAnalyzerRegistrar elementProblemAnalyzerRegistrar, IContextBoundSettingsStore settings, IShaderLabFile file)
                : base(process, settings, file)
            {
                var elementProblemAnalyzerData = new ElementProblemAnalyzerData(file, settings, ElementProblemAnalyzerRunKind.FullDaemon);

                elementProblemAnalyzerData.SetDaemonProcess(process, processKind);
                myElementAnalyzerDispatcher = elementProblemAnalyzerRegistrar.CreateDispatcher(elementProblemAnalyzerData);
            }
 public AutopopupType IsEnabledInSettings(IContextBoundSettingsStore settingsStore, ITextControl textControl)
 {
     return(AutopopupType.HardAutopopup);
 }
Пример #34
0
 protected override bool HighlightingPredicate(IHighlighting highlighting, IPsiSourceFile sourceFile, IContextBoundSettingsStore settingsStore)
 => highlighting is ArgumentExceptionConstructorArgumentWarning;
Пример #35
0
 public override IEnumerable <IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
 {
     if (!IsSupported(process.SourceFile))
     {
         return(EmptyList <IDaemonStageProcess> .InstanceList);
     }
     return(new List <IDaemonStageProcess> {
         new SmartResolverProcess(process)
     });
 }
Пример #36
0
 /// <summary>
 /// Check the error stripe indicator necessity for this stage after processing given <paramref name="sourceFile"/>
 /// </summary>
 public abstract ErrorStripeRequest NeedsErrorStripe(IPsiSourceFile sourceFile, IContextBoundSettingsStore settingsStore);
 public IdentifierSpellCheckHighlighting(IDeclaration declaration, LexerToken token,
                                         ISolution solution, ISpellChecker spellChecker, IContextBoundSettingsStore settingsStore)
     : base(GetRange(declaration), token.Value, solution, spellChecker, settingsStore)
 {
     _lexerToken  = token;
     _declaration = declaration;
 }
 protected abstract IDaemonStageProcess CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind, IJsonNewFile file);
Пример #39
0
        /// <summary>
        /// Creates a code analysis process corresponding to this stage for analysing a file.
        /// </summary>
        /// <returns>Code analysis process to be executed or <c>null</c> if this stage is not available for this file.</returns>
        public IEnumerable <IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            var t4File = process.SourceFile.GetTheOnlyPsiFile(T4Language.Instance) as IT4File;

            if (t4File == null)
            {
                return(EmptyList <IDaemonStageProcess> .InstanceList);
            }

            return(new[] { CreateProcess(process, t4File) });
        }
        public IEnumerable <IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind)
        {
            if (!IsSupported(process.SourceFile))
            {
                return(EmptyList <IDaemonStageProcess> .Instance);
            }

            if (!ShouldRunOnGenerated && process.SourceFile.Properties.IsGeneratedFile)
            {
                return(EmptyList <IDaemonStageProcess> .Instance);
            }

            process.SourceFile.GetPsiServices().Files.AssertAllDocumentAreCommitted();

            var files = process.SourceFile.GetPsiFiles <JsonNewLanguage>();

            return(files.SelectNotNull(file => CreateProcess(process, settings, processKind, (IJsonNewFile)file)));
        }
        /// <summary>
        /// Initializes a new instance of the StyleCopStageProcess class, using the specified <see cref="IDaemonProcess"/> .
        /// </summary>
        /// <param name="lifetime">
        /// The <see cref="Lifetime"/> of the owning <see cref="IDaemonProcess"/>
        /// </param>
        /// <param name="apiPool">
        /// A reference to the StyleCop runner.
        /// </param>
        /// <param name="daemon">
        /// A reference to the <see cref="IDaemon"/> manager.
        /// </param>
        /// <param name="daemonProcess">
        /// <see cref="IDaemonProcess"/> to execute within.
        /// </param>
        /// <param name="threading">
        /// A reference to the <see cref="IThreading"/> instance for timed actions.
        /// </param>
        /// <param name="settings">
        /// The current settings.
        /// </param>
        /// <param name="file">
        /// The file to analyze.
        /// </param>
        public StyleCopStageProcess(Lifetime lifetime, StyleCopApiPool apiPool, IDaemon daemon, IDaemonProcess daemonProcess, IThreading threading, IContextBoundSettingsStore settings, ICSharpFile file)
        {
            StyleCopTrace.In(daemonProcess, file);

            this.lifetime      = lifetime;
            this.apiPool       = apiPool;
            this.daemon        = daemon;
            this.daemonProcess = daemonProcess;
            this.threading     = threading;
            this.settings      = settings;
            this.file          = file;

            StyleCopTrace.Out();
        }
Пример #42
0
        public UnitySolutionHelper(ISettingsStore settingsStore)
        {
            IContextBoundSettingsStore boundSettings = settingsStore.BindToContextTransient(ContextRange.ApplicationWide);

            m_unitySettings = boundSettings.GetKey <UnitySettings>(SettingsOptimization.DoMeSlowly);
        }
Пример #43
0
 public override ErrorStripeRequest NeedsErrorStripe(IPsiSourceFile sourceFile, IContextBoundSettingsStore settings)
 {
     return(ErrorStripeRequest.STRIPE_AND_ERRORS);
 }
 protected override PresenterOptions GetPresenterOptions(IContextBoundSettingsStore settings, AnnotationsDisplayKind showAnnotations)
 => PresenterOptions.ForParameterInfo(settings, showAnnotations.ToAttributesDisplayKind());
Пример #45
0
 protected override IDaemonStageProcess CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings,
                                                      DaemonProcessKind processKind, IShaderLabFile file)
 {
     return(new ShaderLabErrorStageProcess(process, processKind, myElementProblemAnalyzerRegistrar, settings, file));
 }
        public IEnumerable <IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings,
                                                               DaemonProcessKind processKind)
        {
            var services = process.SourceFile.GetPsiServices();

            services.Files.AssertAllDocumentAreCommitted();
            var languageManager = services.LanguageManager;
            var files           = process.SourceFile.GetPsiFiles <ShaderLabLanguage>();
            var processes       = new List <IDaemonStageProcess>();

            foreach (var file in files)
            {
                var manager = languageManager.TryGetService <ShaderLabSyntaxHighlightingManager>(file.Language);
                if (manager != null)
                {
                    processes.Add(manager.CreateProcess(process, settings, file));
                }
            }
            return(processes);
        }
Пример #47
0
 protected override IDaemonStageProcess CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind processKind, ICSharpFile file)
 {
     return(new T4CSharpHighlightingProcess(process, settings, file));
 }
 public abstract RiderSyntaxHighlightingProcessBase CreateProcess(IDaemonProcess process,
                                                                  IContextBoundSettingsStore settings, IFile getPrimaryPsiFile);
 protected override bool HighlightingPredicate(IHighlighting highlighting, IPsiSourceFile sourceFile, IContextBoundSettingsStore settingsStore)
 => highlighting is InternalConstructorVisibilityHighlighting;
 public ErrorStripeRequest NeedsErrorStripe(IPsiSourceFile sourceFile, IContextBoundSettingsStore settings)
 {
     // We want to add markers to the right-side stripe as well as contribute to document errors
     return(ErrorStripeRequest.STRIPE_AND_ERRORS);
 }
 protected virtual bool HighlightingPredicate(IHighlighting highlighting, IPsiSourceFile sourceFile, IContextBoundSettingsStore settingsStore)
 {
     return(true);
 }
Пример #52
0
 protected override bool HighlightingPredicate(
     IHighlighting highlighting,
     [NotNull] IPsiSourceFile sourceFile,
     [CanBeNull] IContextBoundSettingsStore settingsStore
     ) => base.HighlightingPredicate(highlighting, sourceFile, settingsStore) &&
 !(highlighting is RedundantDisableWarningCommentWarning);
 protected override void ConfigureForTestCopStrategy(IContextBoundSettingsStore settingsStore)
 {
     MultipleTestProjectToSingleCodeProjectViaProjectName.ClassToTestFileNavigationTests.SetupTestCopSettings(settingsStore);
 }
 public override RiderSyntaxHighlightingProcessBase CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings,
                                                                  IFile file)
 {
     return(new ShaderLabSyntaxHighlightingProcess(process, settings, file));
 }
 protected override bool HighlightingPredicate(IHighlighting highlighting, IPsiSourceFile sourceFile, IContextBoundSettingsStore settingsStore)
 => highlighting is RedundantAssertionStatementHighlighting;
 public ErrorStripeRequest NeedsErrorStripe(IPsiSourceFile sourceFile, IContextBoundSettingsStore settingsStore)
 {
     return(ErrorStripeRequest.NONE);
 }
Пример #57
0
 protected abstract void MutateSettings(IContextBoundSettingsStore settingsStore);
Пример #58
0
 protected static void EnableAllXmlDocOptions(IContextBoundSettingsStore settingsStore)
 {
     settingsStore.SetValue((XmlDocInspectionsSettings s) => s.TypeAccessibility, AccessibilitySettingFlags.All);
     settingsStore.SetValue((XmlDocInspectionsSettings s) => s.TypeMemberAccessibility, AccessibilitySettingFlags.All);
 }
        public static void SpellCheck(IDocument document, ITokenNode token, ISpellChecker spellChecker,
                                      ISolution solution, DefaultHighlightingConsumer consumer, IContextBoundSettingsStore settingsStore, CommentSettings settings)
        {
            if (spellChecker == null)
            {
                return;
            }

            string buffer    = token.GetText();
            ILexer wordLexer = new WordLexer(buffer);

            wordLexer.Start();
            while (wordLexer.TokenType != null)
            {
                string tokenText = wordLexer.GetCurrTokenText();
                if (SpellCheckUtil.ShouldSpellCheck(tokenText, settings.CompiledWordsToIgnore) &&
                    !spellChecker.TestWord(tokenText, true))
                {
                    IClassMemberDeclaration containingElement =
                        token.GetContainingNode <IClassMemberDeclaration>(false);
                    if (containingElement == null ||
                        !IdentifierResolver.IsIdentifier(containingElement, solution, tokenText))
                    {
                        CamelHumpLexer camelHumpLexer = new CamelHumpLexer(buffer, wordLexer.TokenStart, wordLexer.TokenEnd);
                        foreach (LexerToken humpToken in camelHumpLexer)
                        {
                            if (SpellCheckUtil.ShouldSpellCheck(humpToken.Value, settings.CompiledWordsToIgnore) &&
                                !spellChecker.TestWord(humpToken.Value, true))
                            {
                                //int start = token.GetTreeStartOffset().Offset + wordLexer.TokenStart;
                                //int end = start + tokenText.Length;

                                //var range = new TextRange(start, end);
                                //var documentRange = new DocumentRange(document, range);
                                DocumentRange documentRange =
                                    token.GetContainingFile().TranslateRangeForHighlighting(token.GetTreeTextRange());
                                documentRange = documentRange.ExtendLeft(-wordLexer.TokenStart);
                                documentRange = documentRange.ExtendRight(-1 * (documentRange.GetText().Length - tokenText.Length));


                                TextRange textRange = new TextRange(humpToken.Start - wordLexer.TokenStart,
                                                                    humpToken.End - wordLexer.TokenStart);
                                //string word = document.GetText(range);
                                string word = documentRange.GetText();
                                consumer.AddHighlighting(
                                    new StringSpellCheckHighlighting(
                                        word,
                                        documentRange,
                                        humpToken.Value,
                                        textRange,
                                        solution,
                                        spellChecker,
                                        settingsStore),
                                    documentRange);
                                break;
                            }
                        }
                    }
                }

                wordLexer.Advance();
            }
        }
        /// <summary>
        /// This method provides a <see cref="IDaemonStageProcess"/> instance which is assigned to highlighting a single document
        /// </summary>
        public IEnumerable <IDaemonStageProcess> CreateProcess(IDaemonProcess process, IContextBoundSettingsStore settings, DaemonProcessKind kind)
        {
            if (process == null)
            {
                throw new ArgumentNullException("process");
            }

            return(new[]
            {
                new ComplexityAnalysisDaemonStageProcess(
                    process, settings.GetValue((ComplexityAnalysisSettings s) => s.Threshold))
            });
        }