RequireJsNet.Compressor.AutoDependency.ScriptProcessor.EnsureHasRange C# (CSharp) Method

EnsureHasRange() private method

private EnsureHasRange ( SyntaxNode node, List lineList ) : void
node SyntaxNode
lineList List
return void
        private void EnsureHasRange(SyntaxNode node, List<ScriptLine> lineList)
        {
            if (node == null || node.Range != null)
            {
                return;
            }

            var location = node.Location;
            var startLine = lineList[location.Start.Line - 1];
            var endLine = lineList[location.End.Line - 1];
            var startingIndex = startLine.StartingIndex + location.Start.Column;
            var endIndex = endLine.StartingIndex + location.End.Column;
            node.Range = new[] { startingIndex, endIndex };
        }