示例#1
0
        public static List <ErrorLine> DetectErrorLines(TextDocument document)
        {
            List <ErrorLine> errorLines = new List <ErrorLine>();

            bool commandSectionCheckRequired = DocumentHelper.DocumentContainsSections(document);

            foreach (DocumentLine processedLine in document.Lines)
            {
                string processedLineText = document.GetText(processedLine.Offset, processedLine.Length);

                if (LineHelper.IsEmptyLine(processedLineText))
                {
                    continue;
                }

                ErrorLine error = FindErrorsInLine(document, processedLine, processedLineText, commandSectionCheckRequired);

                if (error != null)
                {
                    errorLines.Add(error);
                }
            }

            return(errorLines);
        }