Beispiel #1
0
            private void ProcessIndexCapture(SyntaxTrivia syntaxTrivia, Capture capture, string setName)
            {
                var charStr = capture.Value;

                if (int.TryParse(charStr, out int charIndex) == false)
                {
                    throw new FormatException($"Comment '{syntaxTrivia.Text}' contains a completion test directive with an invalid character index '{charStr}'. Please specify a valid 32-bit integer.");
                }

                // this is the position of the end of the comment
                var commentEndPosition = PositionHelper.GetPosition(this.lineStarts, syntaxTrivia.GetEndPosition());

                // the trigger should apply to the char index at the next line
                var triggerPosition = new Position(commentEndPosition.Line + 1, charIndex);

                this.triggers.Add(new CompletionTrigger(triggerPosition, setName));
            }