コード例 #1
0
        public IndentationResult GetIndentation(Document document, int lineNumber, FormattingOptions.IndentStyle indentStyle, CancellationToken cancellationToken)
        {
            var result = _service.GetDesiredIndentation(document, lineNumber, cancellationToken);

            if (result.HasValue)
            {
                return(new IndentationResult(result.Value.BasePosition, result.Value.Offset));
            }
            else
            {
                return(default);
コード例 #2
0
        public IndentationResult?GetDesiredIndentation(Document document, int lineNumber, CancellationToken cancellationToken)
        {
            var result = _service.GetDesiredIndentation(document, lineNumber, cancellationToken);

            if (result.HasValue)
            {
                return(new IndentationResult(result.Value.BasePosition, result.Value.Offset));
            }
            else
            {
                return(null);
            }
        }