public int ProcessData(string aMessage, IVsHierarchy aHierarchy, OutputContentModel aOutputContent)
        {
            aOutputContent.Buffer.Add(aMessage);

            if (mErrorDetector.LlvmIsMissing(aMessage))
            {
                aOutputContent.MissingLLVM = true;
                return(VSConstants.S_FALSE);
            }

            var text = String.Join("\n", aOutputContent.Buffer.ToList()) + "\n";

            if (mErrorDetector.Detect(text, out Match aMatchResult))
            {
                GetOutputAndErrors(text, aHierarchy, out string outputText, out List <TaskErrorModel> aDetectedErrors);
                aOutputContent.Text = outputText;
                aOutputContent.Errors.UnionWith(aDetectedErrors);
                aOutputContent.Buffer.Clear();
                return(VSConstants.S_OK);
            }
            else if (kBufferSize <= aOutputContent.Buffer.Count)
            {
                aOutputContent.Text = aOutputContent.Buffer[0];
                aOutputContent.Buffer.RemoveAt(0);
                return(VSConstants.S_OK);
            }

            return(VSConstants.S_FALSE);
        }
예제 #2
0
        private void Process(string message)
        {
            outputContent.Buffer.Add(message);

            if (errorDetector.LlvmIsMissing(message))
            {
                outputContent.MissingLLVM = true;
                return;
            }

            if (errorDetector.HasEncodingError(message))
            {
                outputContent.HasEncodingError = true;
                return;
            }

            var text = String.Join("\n", outputContent.Buffer.ToList()) + "\n";

            if (errorDetector.Detect(text, ErrorParserConstants.kErrorMessageRegex, out _))
            {
                GetErrors(text, null, out List <TaskErrorModel> aDetectedErrors);
                outputContent.Errors.UnionWith(aDetectedErrors);
                outputContent.Buffer.Clear();
            }
            else if (kBufferSize <= outputContent.Buffer.Count)
            {
                outputContent.Buffer.RemoveAt(0);
            }
        }