446 instantiations of SourceSpan
Microsoft.AspNetCore.Mvc.Razor.Extensions.UnitTests (6)
InjectTargetExtensionTest.cs (2)
53TypeSource = new SourceSpan( 59MemberSource = new SourceSpan(
ModelExpressionPassTest.cs (2)
90Assert.Equal(new SourceSpan("test.cshtml", 51, 1, 8, 3), source); 126Assert.Equal(new SourceSpan("test.cshtml", 52, 1, 9, 3), source);
RazorPageDocumentClassifierPassTest.cs (2)
31var sourceSpan = new SourceSpan( 63var sourceSpan = new SourceSpan(
Microsoft.AspNetCore.Razor.Language.Legacy.UnitTests (7)
Legacy\ImplicitExpressionEditHandlerTest.cs (7)
20var change = new SourceChange(new SourceSpan(6, 1), string.Empty); 34var change = new SourceChange(new SourceSpan(5, 1), string.Empty); 48var change = new SourceChange(new SourceSpan(5, 2), string.Empty); 62var change = new SourceChange(new SourceSpan(3, 3), string.Empty); 409var change = new SourceChange(new SourceSpan(3, 0), text); 423var change = new SourceChange(new SourceSpan(6, 0), " World"); 437var change = new SourceChange(new SourceSpan(6, 0), " World");
Microsoft.AspNetCore.Razor.Language.UnitTests (112)
CodeGeneration\CSharpCodeWriterTest.cs (1)
287var mappingLocation = new SourceSpan(filePath, 10, 4, 3, 9);
CodeGeneration\DesignTimeNodeWriterTest.cs (11)
51var originalSpan = new SourceSpan("test.cshtml", 0, 0, 0, 6); 52var generatedSpan = new SourceSpan(null, 38 + Environment.NewLine.Length * 3, 3, 0, 6); 87var originalSpan = new SourceSpan("test.cshtml", 0, 0, 0, 6); 88var generatedSpan = new SourceSpan(null, 38 + Environment.NewLine.Length * 3, 3, 0, 6); 151Source = new SourceSpan("test.cshtml", 0, 0, 0, 3), 215Source = new SourceSpan("test.cshtml", 8, 0, 8, 3), 254Source = new SourceSpan("test.cshtml", 0, 0, 0, 3) 311Source = new SourceSpan("test.cshtml", 0, 0, 0, 13) 345Source = new SourceSpan("test.cshtml", 0, 0, 0, 17) 494Source = new SourceSpan(fileName, 0, 0, 0, 3) 541builder.Add(IntermediateNodeFactory.CSharpToken("i++", new SourceSpan(fileName, 0, 2, 3, 6, 1, 2)));
CodeGeneration\LiteralRuntimeNodeWriterTest.cs (4)
20builder.Add(IntermediateNodeFactory.CSharpToken("i++", new SourceSpan("test.cshtml", 0, 0, 0, 3, 0, 3))); 51builder.Add(IntermediateNodeFactory.CSharpToken("i++;", new SourceSpan("test.cshtml", 0, 0, 0, 4, 0, 4))); 52builder.Add(IntermediateNodeFactory.CSharpToken("j++;", new SourceSpan("test.cshtml", 5, 0, 5, 4, 0, 9))); 53builder.Add(IntermediateNodeFactory.CSharpToken("k++;", new SourceSpan("test.cshtml", 10, 0, 10, 4, 0, 14)));
CodeGeneration\RuntimeNodeWriterTest.cs (7)
55Source = new SourceSpan("test.cshtml", 0, 0, 0, 3) 86Source = new SourceSpan("test.cshtml", 0, 0, 0, 3), 144builder.Add(IntermediateNodeFactory.CSharpToken("i++", new SourceSpan("test.cshtml", 0, 0, 0, 3, 0, 3))); 205builder.Add(IntermediateNodeFactory.CSharpToken("i", new SourceSpan("test.cshtml", 0, 0, 0, 1, 0, 1))); 209builder.Add(IntermediateNodeFactory.CSharpToken("++", new SourceSpan("test.cshtml", 2, 0, 2, 2, 0, 4))); 290.Add(IntermediateNodeFactory.CSharpToken("if (true) { }", new SourceSpan("test.cshtml", 0, 0, 0, 13))); 321.Add(IntermediateNodeFactory.CSharpToken(" if (true) { }", new SourceSpan("test.cshtml", 0, 0, 0, 17)));
DefaultRazorCSharpLoweringPhaseTest.cs (1)
73new SourceSpan("SomeFile.cshtml", 11, 0, 11, 1));
DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs (1)
178var expectedSourceLocation = new SourceSpan(codeDocument.Source.FilePath, 1, 0, 1, 12);
DefaultRazorTagHelperBinderPhaseTest.cs (8)
29new SourceSpan(new SourceLocation(14 + Environment.NewLine.Length, 1, 14), contentLength: 1)), 31new SourceSpan(new SourceLocation(14 + Environment.NewLine.Length, 1, 14), contentLength: 1), "\"") 58new SourceSpan(new SourceLocation(17 + Environment.NewLine.Length, 1, 17), contentLength: 1)), 60new SourceSpan(new SourceLocation(17 + Environment.NewLine.Length, 1, 17), contentLength: 1), "\"") 87new SourceSpan(new SourceLocation(17 + Environment.NewLine.Length, 1, 17), contentLength: 1)), 89new SourceSpan(new SourceLocation(17 + Environment.NewLine.Length, 1, 17), contentLength: 1), "tagHelperPrefix", '\"', "\""), 478new SourceSpan(SourceLocation.Zero, contentLength: 1)); 480new SourceSpan(new SourceLocation((Environment.NewLine.Length * 2) + 30, 2, 1), contentLength: 4), "form");
DefaultTagHelperResolutionPhaseTest.cs (9)
15var first = new SourceSpan(filePath, absoluteIndex: 10, lineIndex: 2, characterIndex: 5, length: 3, lineCount: 0, endCharacterIndex: 8); 16var last = new SourceSpan(filePath, absoluteIndex: 15, lineIndex: 2, characterIndex: 10, length: 4, lineCount: 0, endCharacterIndex: 14); 37var first = new SourceSpan(filePath, absoluteIndex: 0, lineIndex: 1, characterIndex: 0, length: 10, lineCount: 1, endCharacterIndex: 5); 39var last = new SourceSpan(filePath, absoluteIndex: 20, lineIndex: 3, characterIndex: 2, length: 5, lineCount: 0, endCharacterIndex: 7); 59var first = new SourceSpan(filePath, absoluteIndex: 5, lineIndex: 0, characterIndex: 5, length: 3, lineCount: 0, endCharacterIndex: 8); 61var last = new SourceSpan(filePath, absoluteIndex: 8, lineIndex: 0, characterIndex: 8, length: 4, lineCount: 0, endCharacterIndex: 12); 78var span = new SourceSpan(filePath, absoluteIndex: 10, lineIndex: 1, characterIndex: 3, length: 5, lineCount: 0, endCharacterIndex: 8); 96var first = new SourceSpan(filePath: null, absoluteIndex: 0, lineIndex: 0, characterIndex: 0, length: 3, lineCount: 0, endCharacterIndex: 3); 97var last = new SourceSpan(filePath: null, absoluteIndex: 5, lineIndex: 0, characterIndex: 5, length: 2, lineCount: 0, endCharacterIndex: 7);
Extensions\DefaultTagHelperTargetExtensionTest.cs (4)
54private static readonly SourceSpan Span = new SourceSpan("test.cshtml", 15, 2, 5, 2); 408var expectedLocation = new SourceSpan(100, 10); 430var expectedLocation = new SourceSpan(100, 10); 452var expectedLocation = new SourceSpan(100, 10);
Extensions\DesignTimeDirectiveTargetExtensionTest.cs (6)
48Source = new SourceSpan("test.cshtml", 0, 0, 0, 5), 89Source = new SourceSpan("test.cshtml", 0, 0, 0, 5), 130Source = new SourceSpan("test.cshtml", 0, 0, 0, 5), 171Source = new SourceSpan("test.cshtml", 0, 0, 0, 5), 177Source = new SourceSpan("test.cshtml", 0, 0, 0, 5), 229Source = new SourceSpan("test.cshtml", 0, 0, 0, 5),
Legacy\CodeBlockEditHandlerTest.cs (19)
21var change = new SourceChange(new SourceSpan(0, 5), "H3ll0"); 35var change = new SourceChange(new SourceSpan(0, 5), "H3ll0"); 49var change = new SourceChange(new SourceSpan(6, 1), "!"); 63var change = new SourceChange(new SourceSpan(6, 1), "<"); 77var change = new SourceChange(new SourceSpan(6, 1), "@*"); 91var change = new SourceChange(new SourceSpan(0, 0), "{"); 105var change = new SourceChange(new SourceSpan(0, 5), string.Empty); 119var change = new SourceChange(new SourceSpan(0, 5), string.Empty); 133var change = new SourceChange(new SourceSpan(5, 3), string.Empty); 147var change = new SourceChange(new SourceSpan(0, 0), "hello"); 161var change = new SourceChange(new SourceSpan(0, 5), string.Empty); 175var change = new SourceChange(new SourceSpan(5, 7), string.Empty); 188var change = new SourceChange(new SourceSpan(0, 0), "hello"); 201var change = new SourceChange(new SourceSpan(0, 0), "{"); 214var change = new SourceChange(new SourceSpan(0, 0), "@"); 227var change = new SourceChange(new SourceSpan(0, 0), "<"); 240var change = new SourceChange(new SourceSpan(0, 2), string.Empty); 259var change = new SourceChange(new SourceSpan(0, 0), content); 274var change = new SourceChange(new SourceSpan(0, 0), content);
Legacy\CSharpCodeParserTest.cs (3)
24new SourceSpan(directiveLocation, length), SyntaxConstants.CSharp.TagHelperPrefixKeyword, character, prefix); 170new SourceSpan(new SourceLocation(1, 2, 3), errorLength), directiveText); 187new SourceSpan(
RazorDiagnosticTest.cs (14)
17var span = new SourceSpan("test.cs", 15, 1, 8, 5); 33var span = new SourceSpan("test.cs", 15, 1, 8, 5); 49var span = new SourceSpan("test.cs", 15, 1, 8, 5); 65var span = new SourceSpan("test.cs", 15, 1, 8, 5); 82var span = new SourceSpan("test.cs", 15, 1, 8, 5); 98var span = new SourceSpan("test.cs", 15, 1, 8, 5); 114var span = new SourceSpan("test.cs", 15, 1, 8, 5); 131var span1 = new SourceSpan("test.cs", 15, 1, 8, 5); 132var span2 = new SourceSpan("test.cs", 15, 1, 8, 3); 150var span = new SourceSpan("test.cs", 15, 1, 8, 5); 167var span = new SourceSpan("test.cs", 15, 1, 8, 5); 184var span1 = new SourceSpan("test.cs", 15, 1, 8, 5); 185var span2 = new SourceSpan("test.cs", 15, 1, 8, 3); 203var span = new SourceSpan("test.cs", 15, 1, 8, 5);
SourceSpanTest.cs (24)
18new SourceSpan(new SourceLocation(1, 2, 3), 4), 19new SourceSpan(new SourceLocation(5, 6, 7), 8)); 22new SourceSpan(new SourceLocation(1, 2, 3), 4), 23new SourceSpan(new SourceLocation(5, 6, 7), 8)); 36new SourceSpan(new SourceLocation(1, 2, 3), 4), 37new SourceSpan(new SourceLocation(5, 6, 7), 8)); 40new SourceSpan(new SourceLocation(1, 2, 3), 5), 41new SourceSpan(new SourceLocation(5, 6, 7), 9)); 52new SourceSpan(new SourceLocation(1, 2, 3), 4), 53new SourceSpan(new SourceLocation(5, 6, 7), 8)); 56new SourceSpan(new SourceLocation(1, 2, 3), 4), 57new SourceSpan(new SourceLocation(5, 6, 8), 8)); 68new SourceSpan(new SourceLocation(1, 2, 3), 4), 69new SourceSpan(new SourceLocation(5, 6, 8), 8)); 72new SourceSpan(new SourceLocation(1, 2, 3), 4), 73new SourceSpan(new SourceLocation(5, 6, 7), 8)); 84new SourceSpan(new SourceLocation(1, 2, 3), 4), 85new SourceSpan(new SourceLocation(5, 5, 7), 8)); 88new SourceSpan(new SourceLocation(1, 1, 3), 4), 89new SourceSpan(new SourceLocation(5, 6, 7), 8)); 100new SourceSpan(new SourceLocation(1, 2, 3), 4), 101new SourceSpan(new SourceLocation(4, 6, 7), 8)); 104new SourceSpan(new SourceLocation(1, 2, 3), 4), 105new SourceSpan(new SourceLocation(5, 6, 7), 9));
Microsoft.CodeAnalysis.Razor.Compiler (120)
CSharp\TextSpanExtensions.cs (1)
15return new SourceSpan(filePath: null, absoluteIndex: textSpan.Start, lineIndex: -1, characterIndex: -1, length: textSpan.Length);
Language\CodeGeneration\CodeRenderingContext.cs (1)
141var generatedLocation = new SourceSpan(
Language\Components\ComponentBindLoweringPass.cs (1)
1092return new SourceSpan(span.FilePath,
Language\Components\ComponentDesignTimeNodeWriter.cs (1)
691attributeSourceSpan = new SourceSpan(attributeSourceSpan.FilePath, attributeSourceSpan.AbsoluteIndex + offset, attributeSourceSpan.LineIndex, attributeSourceSpan.CharacterIndex + offset, node.PropertyName.Length, attributeSourceSpan.LineCount, attributeSourceSpan.CharacterIndex + offset + node.PropertyName.Length);
Language\DefaultDirectiveSyntaxTreePass.cs (1)
85var error = RazorDiagnosticFactory.CreateParsing_SectionsCannotBeNested(new SourceSpan(directiveStart, errorLength));
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (5)
900node.Source = new SourceSpan( 932return new SourceSpan( 945return new SourceSpan( 961return new SourceSpan( 1020node.Source = new SourceSpan(
Language\DefaultTagHelperResolutionPhase.cs (6)
823return new SourceSpan( 854new SourceSpan(filePath, exprStart, atLoc.Line, atLoc.Character, 1, 0, atLoc.Character + 1))); 865new SourceSpan(filePath, exprStart, loc.Line, loc.Character, exprLength, 0, loc.Character + exprLength))); 886new SourceSpan(filePath, parenStart, openLoc.Line, openLoc.Character, 1, 0, openLoc.Character + 1))); 898new SourceSpan(filePath, innerStart, innerLoc.Line, innerLoc.Character, innerLen, 0, innerLoc.Character + innerLen))); 906new SourceSpan(filePath, closePos, closeLoc.Line, closeLoc.Character, 1, 0, closeLoc.Character + 1)));
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (12)
598var valueSource = new SourceSpan( 676var emptySource = new SourceSpan(atSrc.FilePath, transAbsIdx, atSrc.LineIndex, transCharIdx, 0, 0, transCharIdx); 679var transSource = new SourceSpan(atSrc.FilePath, transAbsIdx, atSrc.LineIndex, transCharIdx, 1, 0, transCharIdx + 1); 691var openSource = new SourceSpan(innerSource.FilePath, openAbsIndex, innerSource.LineIndex, openCharIndex, 1, 0, openCharIndex + 1); 704var closeSource = new SourceSpan(lastSource.FilePath, closeAbsIndex, lastSource.LineIndex, closeCharIndex, 1, 0, closeCharIndex + 1); 740var openParenSource = new SourceSpan( 766var closeParenSource = new SourceSpan( 864return new SourceSpan( 1322expr.Source = new SourceSpan(exprSource.FilePath, contentStart, openLoc.Line, openLoc.Character, contentLength, 0, closeLoc.Character + 1); 1328var contentSpan = new SourceSpan( 1436emptySpan = new SourceSpan(nextSrc.FilePath, nextSrc.AbsoluteIndex, loc.Line, loc.Character, 0, 0, loc.Character); 1613diagSource = new SourceSpan(
Language\Legacy\CSharpCodeParser.cs (40)
354new SourceSpan(CurrentStart, CurrentToken.Content.Length)); 412new SourceSpan(CurrentStart, CurrentToken.Content.Length))); 418new SourceSpan(CurrentStart, contentLength: 1 /* end of file */))); 424new SourceSpan(CurrentStart, CurrentToken.Content.Length), 468new SourceSpan(block.Start, contentLength: 1 /* ( */), block.Name, ")", "(")); 725new SourceSpan(block.Start, contentLength: 1 /* { OR } */), block.Name, "}", "{")); 852new SourceSpan(location, contentLength: 1 /* @ */))); 890new SourceSpan(block.Start, contentLength: 1 /* { OR } */), block.Name, "}", "{")); 952new SourceSpan(CurrentStart, contentLength: 1 /* { */))); 1077new SourceSpan(CurrentStart, contentLength: 1 /* @ */))); 1153new SourceSpan(CurrentStart, contentLength: 1 /* @ */))); 1214new SourceSpan(CurrentStart, currentDirective.Length), currentDirective)); 1238new SourceSpan(directiveStart, errorLength), 1350new SourceSpan(keywordStartLocation, keywordLength), keyword)); 1372new SourceSpan(valueStartLocation.Value, rawValue.Length), keyword)); 1461new SourceSpan(directiveLocation, Math.Max(text?.Length ?? 0, 1)), text ?? string.Empty)); 1517new SourceSpan(directiveLocation, prefix.Length), 1577new SourceSpan(CurrentStart, CurrentToken.Content.Length), descriptor.Directive)); 1630new SourceSpan(CurrentStart, contentLength: 1), 1644new SourceSpan(CurrentStart, CurrentToken.Content.Length), descriptor.Directive)); 1656new SourceSpan(CurrentStart, identifierLength), descriptor.Directive)); 1673new SourceSpan(CurrentStart, CurrentToken.Content.Length), descriptor.Directive)); 1688new SourceSpan(CurrentStart, CurrentToken.Content.Length), descriptor.Directive)); 1703new SourceSpan(CurrentStart, CurrentToken.Content.Length), descriptor.Directive)); 1721new SourceSpan(CurrentStart, CurrentToken.Content.Length), descriptor.Directive)); 1742new SourceSpan(CurrentStart, CurrentToken.Content.Length), descriptor.Directive, CurrentToken.Content, lastSeenMemberIdentifier ?? string.Empty)); 1772new SourceSpan(CurrentStart, CurrentToken.Content.Length), 1795new SourceSpan(CurrentStart, identifierLength), descriptor.Directive)); 1835new SourceSpan(CurrentStart, CurrentToken.Content.Length), 1950new SourceSpan(directiveStart, errorLength), descriptor.Directive)); 2023new SourceSpan(CurrentStart, contentLength: 1 /* { */), descriptor.Directive, "{")); 2029new SourceSpan(CurrentStart, CurrentToken.Content.Length), descriptor.Directive, "{")); 2059new SourceSpan(startingBraceLocation, contentLength: 1 /* } */), descriptor.Directive, "}", "{")); 2221new SourceSpan(CurrentStart, CurrentToken.Content.Length))); 2229new SourceSpan(CurrentStart, contentLength: 2 /* @: */))); 2237new SourceSpan(CurrentStart, contentLength: 2 /* @@ */))); 2499new SourceSpan(block.Start, block.Name.Length))); 2747new SourceSpan(CurrentStart, CurrentToken.Content.Length), CurrentToken.Content)); 2930new SourceSpan(start, contentLength: 1 /* { OR } */), 3007new SourceSpan(start, contentLength: 1 /* { OR } */),
Language\Legacy\HtmlMarkupParser.cs (8)
160new SourceSpan(CurrentStart, CurrentToken.Content.Length))); 338new SourceSpan( 559new SourceSpan(SourceLocationTracker.Advance(endTagStartLocation, "</"), Math.Max(endTagName.Length, 1)), endTagName)); 575new SourceSpan( 695new SourceSpan( 821new SourceSpan(textLocation, contentLength: 4 /* text */))); 976new SourceSpan(textLocation, contentLength: 4 /* text */))); 1553new SourceSpan(SourceLocationTracker.Advance(tagStart, "</"), ScriptTagName.Length),
Language\Legacy\NativeCSharpTokenizer.cs (3)
561new SourceSpan(CurrentStart, contentLength: 1 /* end of file */))); 591new SourceSpan(CurrentStart, contentLength: 1 /* " */))); 608new SourceSpan(CurrentStart, contentLength: 1 /* end of file */)));
Language\Legacy\RoslynCSharpTokenizer.cs (7)
393new SourceSpan(CurrentStart, contentLength: expectedPrefix?.Length ?? 0 /* " */))); 500new SourceSpan(CurrentStart, contentLength: 1 /* end of file */))); 528new SourceSpan(CurrentStart, contentLength: trivia.FullSpan.Length))); 546new SourceSpan(CurrentStart, contentLength: trivia.FullSpan.Length))); 556new SourceSpan(CurrentStart, contentLength: directiveTrivia.FullSpan.Length))); 590new SourceSpan( 603new SourceSpan(
Language\Legacy\TagHelperBlockRewriter.cs (3)
113var location = new SourceSpan(codeBlock.GetSourceLocation(source), codeBlock.Width); 190var errorLocation = new SourceSpan(attributeNameLocation, result.AttributeName.Length); 200var errorLocation = new SourceSpan(attributeNameLocation, result.AttributeName.Length);
Language\Legacy\TagHelperParseTreeRewriter.cs (9)
142var source = new SourceSpan(SourceLocationTracker.Advance(startTag.GetSourceLocation(_source), "<"), tagName.Length); 187new SourceSpan(SourceLocationTracker.Advance(endTag.GetSourceLocation(_source), "</"), tagName.Length), tagName)); 368new SourceSpan(SourceLocationTracker.Advance(endTag.GetSourceLocation(_source), "</"), tagName.Length), 493new SourceSpan(tagBlock.GetSourceLocation(_source), tagBlock.Width), 515new SourceSpan(errorStart, tagName.Length), tagName)); 532new SourceSpan(errorStart, tagName.Length), tagName)); 587new SourceSpan(errorStart, length), 705new SourceSpan(errorStart, tagName.Length), 723new SourceSpan(errorStart, tagName.Length),
Language\Legacy\TokenizerBackedParser.cs (2)
385new SourceSpan(start, contentLength: 2 /* @* */)); 395new SourceSpan(start, contentLength: 2 /* @* */));
Language\SourceChange.cs (1)
31Span = new SourceSpan(absoluteIndex, length);
Language\SourceSpan.cs (10)
14public static readonly SourceSpan Undefined = new SourceSpan(SourceLocation.Undefined, 0); 101return new SourceSpan(FilePath, AbsoluteIndex + Length, LineIndex, characterIndex: EndCharacterIndex, length: 0, lineCount: 0, EndCharacterIndex); 106return new SourceSpan(FilePath, AbsoluteIndex + startIndex, LineIndex, CharacterIndex + startIndex, length, LineCount, endCharacterIndex: CharacterIndex + startIndex + length); 130public readonly SourceSpan WithFilePath(string filePath) => new(filePath, AbsoluteIndex, LineIndex, CharacterIndex, Length, LineCount, EndCharacterIndex); 131public readonly SourceSpan WithAbsoluteIndex(int absoluteIndex) => new(FilePath, absoluteIndex, LineIndex, CharacterIndex, Length, LineCount, EndCharacterIndex); 132public readonly SourceSpan WithLineIndex(int lineIndex) => new(FilePath, AbsoluteIndex, lineIndex, CharacterIndex, Length, LineCount, EndCharacterIndex); 133public readonly SourceSpan WithCharacterIndex(int characterIndex) => new(FilePath, AbsoluteIndex, LineIndex, characterIndex, Length, LineCount, EndCharacterIndex); 134public readonly SourceSpan WithLength(int length) => new(FilePath, AbsoluteIndex, LineIndex, CharacterIndex, length, LineCount, EndCharacterIndex); 135public readonly SourceSpan WithLineCount(int lineCount) => new(FilePath, AbsoluteIndex, LineIndex, CharacterIndex, Length, lineCount, EndCharacterIndex); 136public readonly SourceSpan WithEndCharacterIndex(int endCharacterIndex) => new(FilePath, AbsoluteIndex, LineIndex, CharacterIndex, Length, LineCount, endCharacterIndex);
Language\SpanComputer.cs (1)
115return new SourceSpan(source.FilePath, absoluteIndex: start, startLinePosition.Line, startLinePosition.Character, length, lineCount, endLinePosition.Character);
Language\Syntax\SyntaxNodeExtensions.cs (2)
123return new SourceSpan(location.FilePath, location.AbsoluteIndex, location.LineIndex, location.CharacterIndex, node.Width, lineCount, endLocation.Character); 131return new SourceSpan(location.FilePath, location.AbsoluteIndex, location.LineIndex, location.CharacterIndex, token.Width, lineCount, endLocation.Character);
Mvc\InjectDirective.cs (1)
92typeSpan = new SourceSpan(typeSpan.Value.FilePath, typeSpan.Value.AbsoluteIndex, typeSpan.Value.LineIndex, typeSpan.Value.CharacterIndex, typeSpan.Value.Length - tModel.Length, typeSpan.Value.LineCount, typeSpan.Value.EndCharacterIndex - tModel.Length);
Mvc\RazorExtensionsDiagnosticFactory.cs (5)
22new SourceSpan(SourceLocation.Undefined, contentLength: 0), 35new SourceSpan(SourceLocation.Undefined, contentLength: 0), 48new SourceSpan(SourceLocation.Undefined, contentLength: 0), 61new SourceSpan(SourceLocation.Undefined, contentLength: 0), 73new SourceSpan(SourceLocation.Undefined, contentLength: 0),
Microsoft.NET.Sdk.Razor.SourceGenerators.UnitTests (1)
RazorDiagnosticTest.cs (1)
32var span = new SourceSpan("some-file", 100, 1, 5, 10);
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (100)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Diagnostics\RazorDiagnosticHelperTest.cs (4)
63var sourceSpan = new SourceSpan(3, 0, 3, 4); 80var sourceSpan = new SourceSpan(5, 0, 5, 4); 96var sourceSpan = new SourceSpan(sourceText.Length + 5, 0, sourceText.Length + 5, 4); 112var sourceSpan = new SourceSpan(6, 0, 6, 15);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Mapping\RazorEditServiceTest.cs (2)
1291var csharpSourceSpan = new SourceSpan( 1298var razorSourceSpan = new SourceSpan(
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\RazorDocumentMappingServiceTest.cs (94)
31sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 54sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 77sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 101sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 125sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 149sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 174new SourceMapping(new SourceSpan(4, 8), new SourceSpan(6, 8)), // DateTime 175new SourceMapping(new SourceSpan(12, 4), new SourceSpan(14, 4)) // .Now 200new SourceMapping(new SourceSpan(4, 8), new SourceSpan(6, 8)), // DateTime 201new SourceMapping(new SourceSpan(12, 4), new SourceSpan(14, 4)) // .Now 225sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 250new SourceMapping(new SourceSpan(4, 8), new SourceSpan(6, 8)), // DateTime 251new SourceMapping(new SourceSpan(12, 4), new SourceSpan(14, 4)) // .Now 275sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 299sourceMappings: [new SourceMapping(new SourceSpan(26, 12), new SourceSpan(25, 12))]); 323new SourceMapping(new SourceSpan(2, 11), new SourceSpan(0, 11)), 324new SourceMapping(new SourceSpan(35, 1), new SourceSpan(30, 1)) 349sourceMappings: [new SourceMapping(new SourceSpan(2, 11), new SourceSpan(0, 11))]); 373sourceMappings: [new SourceMapping(new SourceSpan(2, 11), new SourceSpan(0, 11))]); 409sourceMappings: [new(new(30, 1), new(2, 1)), new(new(28, 2), new(30, 2))]); 436sourceMappings: [new SourceMapping(new SourceSpan(2, 100), new SourceSpan(0, 100))]); 458new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 459new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 484new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 485new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 510new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 511new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 535sourceMappings: [new SourceMapping(new SourceSpan(2, 100), new SourceSpan(2, 100))]); 557new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 558new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 583new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 584new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 609new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 610new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 635new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 636new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 662new SourceMapping(new SourceSpan(2, 4), new SourceSpan(3, 4)), 685new SourceMapping(new SourceSpan(2, 5), new SourceSpan(3, 5)), 708new SourceMapping(new SourceSpan(2, 6), new SourceSpan(3, 6)), 730sourceMappings: [new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1))]); 752new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 753new SourceMapping(new SourceSpan(19, 10), new SourceSpan(5, 10)), 754new SourceMapping(new SourceSpan(16, 3), new SourceSpan(11, 3)) 785new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 786new SourceMapping(new SourceSpan(16, 3), new SourceSpan(11, 3)), 787new SourceMapping(new SourceSpan(19, 10), new SourceSpan(5, 10))
Microsoft.VisualStudioCode.RazorExtension.UnitTests (100)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Diagnostics\RazorDiagnosticHelperTest.cs (4)
63var sourceSpan = new SourceSpan(3, 0, 3, 4); 80var sourceSpan = new SourceSpan(5, 0, 5, 4); 96var sourceSpan = new SourceSpan(sourceText.Length + 5, 0, sourceText.Length + 5, 4); 112var sourceSpan = new SourceSpan(6, 0, 6, 15);
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Mapping\RazorEditServiceTest.cs (2)
1291var csharpSourceSpan = new SourceSpan( 1298var razorSourceSpan = new SourceSpan(
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\RazorDocumentMappingServiceTest.cs (94)
31sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 54sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 77sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 101sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 125sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 149sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 174new SourceMapping(new SourceSpan(4, 8), new SourceSpan(6, 8)), // DateTime 175new SourceMapping(new SourceSpan(12, 4), new SourceSpan(14, 4)) // .Now 200new SourceMapping(new SourceSpan(4, 8), new SourceSpan(6, 8)), // DateTime 201new SourceMapping(new SourceSpan(12, 4), new SourceSpan(14, 4)) // .Now 225sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 250new SourceMapping(new SourceSpan(4, 8), new SourceSpan(6, 8)), // DateTime 251new SourceMapping(new SourceSpan(12, 4), new SourceSpan(14, 4)) // .Now 275sourceMappings: [new SourceMapping(new SourceSpan(4, 12), new SourceSpan(6, 12))]); 299sourceMappings: [new SourceMapping(new SourceSpan(26, 12), new SourceSpan(25, 12))]); 323new SourceMapping(new SourceSpan(2, 11), new SourceSpan(0, 11)), 324new SourceMapping(new SourceSpan(35, 1), new SourceSpan(30, 1)) 349sourceMappings: [new SourceMapping(new SourceSpan(2, 11), new SourceSpan(0, 11))]); 373sourceMappings: [new SourceMapping(new SourceSpan(2, 11), new SourceSpan(0, 11))]); 409sourceMappings: [new(new(30, 1), new(2, 1)), new(new(28, 2), new(30, 2))]); 436sourceMappings: [new SourceMapping(new SourceSpan(2, 100), new SourceSpan(0, 100))]); 458new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 459new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 484new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 485new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 510new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 511new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 535sourceMappings: [new SourceMapping(new SourceSpan(2, 100), new SourceSpan(2, 100))]); 557new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 558new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 583new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 584new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 609new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 610new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 635new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 636new SourceMapping(new SourceSpan(16, 19), new SourceSpan(11, 19)) 662new SourceMapping(new SourceSpan(2, 4), new SourceSpan(3, 4)), 685new SourceMapping(new SourceSpan(2, 5), new SourceSpan(3, 5)), 708new SourceMapping(new SourceSpan(2, 6), new SourceSpan(3, 6)), 730sourceMappings: [new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1))]); 752new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 753new SourceMapping(new SourceSpan(19, 10), new SourceSpan(5, 10)), 754new SourceMapping(new SourceSpan(16, 3), new SourceSpan(11, 3)) 785new SourceMapping(new SourceSpan(0, 1), new SourceSpan(0, 1)), 786new SourceMapping(new SourceSpan(16, 3), new SourceSpan(11, 3)), 787new SourceMapping(new SourceSpan(19, 10), new SourceSpan(5, 10))
442 references to SourceSpan
Microsoft.AspNetCore.Mvc.Razor.Extensions.UnitTests (4)
ModelExpressionPassTest.cs (2)
89var source = Assert.NotNull(originalNode.Source); 125var source = Assert.NotNull(originalNode.Source);
RazorPageDocumentClassifierPassTest.cs (2)
31var sourceSpan = new SourceSpan( 63var sourceSpan = new SourceSpan(
Microsoft.AspNetCore.Razor.Language.UnitTests (44)
CodeGeneration\CodeRenderingContextTest.cs (6)
21var diagnostic = RazorDiagnostic.Create(descriptor, SourceSpan.Undefined, "param"); 52var diagnostic = RazorDiagnostic.Create(descriptor, SourceSpan.Undefined, "param"); 81SourceSpan.Undefined); 84SourceSpan.Undefined); 87SourceSpan.Undefined); 90SourceSpan.Undefined);
CodeGeneration\CSharpCodeWriterTest.cs (1)
287var mappingLocation = new SourceSpan(filePath, 10, 4, 3, 9);
CodeGeneration\DesignTimeNodeWriterTest.cs (4)
51var originalSpan = new SourceSpan("test.cshtml", 0, 0, 0, 6); 52var generatedSpan = new SourceSpan(null, 38 + Environment.NewLine.Length * 3, 3, 0, 6); 87var originalSpan = new SourceSpan("test.cshtml", 0, 0, 0, 6); 88var generatedSpan = new SourceSpan(null, 38 + Environment.NewLine.Length * 3, 3, 0, 6);
DefaultRazorIntermediateNodeLoweringPhaseIntegrationTest.cs (1)
178var expectedSourceLocation = new SourceSpan(codeDocument.Source.FilePath, 1, 0, 1, 12);
DefaultTagHelperResolutionPhaseTest.cs (14)
15var first = new SourceSpan(filePath, absoluteIndex: 10, lineIndex: 2, characterIndex: 5, length: 3, lineCount: 0, endCharacterIndex: 8); 16var last = new SourceSpan(filePath, absoluteIndex: 15, lineIndex: 2, characterIndex: 10, length: 4, lineCount: 0, endCharacterIndex: 14); 19var result = DefaultTagHelperResolutionPhase.MergeSourceSpans(first, last); 37var first = new SourceSpan(filePath, absoluteIndex: 0, lineIndex: 1, characterIndex: 0, length: 10, lineCount: 1, endCharacterIndex: 5); 39var last = new SourceSpan(filePath, absoluteIndex: 20, lineIndex: 3, characterIndex: 2, length: 5, lineCount: 0, endCharacterIndex: 7); 42var result = DefaultTagHelperResolutionPhase.MergeSourceSpans(first, last); 59var first = new SourceSpan(filePath, absoluteIndex: 5, lineIndex: 0, characterIndex: 5, length: 3, lineCount: 0, endCharacterIndex: 8); 61var last = new SourceSpan(filePath, absoluteIndex: 8, lineIndex: 0, characterIndex: 8, length: 4, lineCount: 0, endCharacterIndex: 12); 64var result = DefaultTagHelperResolutionPhase.MergeSourceSpans(first, last); 78var span = new SourceSpan(filePath, absoluteIndex: 10, lineIndex: 1, characterIndex: 3, length: 5, lineCount: 0, endCharacterIndex: 8); 81var result = DefaultTagHelperResolutionPhase.MergeSourceSpans(span, span); 96var first = new SourceSpan(filePath: null, absoluteIndex: 0, lineIndex: 0, characterIndex: 0, length: 3, lineCount: 0, endCharacterIndex: 3); 97var last = new SourceSpan(filePath: null, absoluteIndex: 5, lineIndex: 0, characterIndex: 5, length: 2, lineCount: 0, endCharacterIndex: 7); 100var result = DefaultTagHelperResolutionPhase.MergeSourceSpans(first, last);
Extensions\DefaultTagHelperTargetExtensionTest.cs (4)
54private static readonly SourceSpan Span = new SourceSpan("test.cshtml", 15, 2, 5, 2); 408var expectedLocation = new SourceSpan(100, 10); 430var expectedLocation = new SourceSpan(100, 10); 452var expectedLocation = new SourceSpan(100, 10);
RazorDiagnosticTest.cs (14)
17var span = new SourceSpan("test.cs", 15, 1, 8, 5); 33var span = new SourceSpan("test.cs", 15, 1, 8, 5); 49var span = new SourceSpan("test.cs", 15, 1, 8, 5); 65var span = new SourceSpan("test.cs", 15, 1, 8, 5); 82var span = new SourceSpan("test.cs", 15, 1, 8, 5); 98var span = new SourceSpan("test.cs", 15, 1, 8, 5); 114var span = new SourceSpan("test.cs", 15, 1, 8, 5); 131var span1 = new SourceSpan("test.cs", 15, 1, 8, 5); 132var span2 = new SourceSpan("test.cs", 15, 1, 8, 3); 150var span = new SourceSpan("test.cs", 15, 1, 8, 5); 167var span = new SourceSpan("test.cs", 15, 1, 8, 5); 184var span1 = new SourceSpan("test.cs", 15, 1, 8, 5); 185var span2 = new SourceSpan("test.cs", 15, 1, 8, 3); 203var span = new SourceSpan("test.cs", 15, 1, 8, 5);
Microsoft.AspNetCore.Razor.Test.Common (4)
Language\IntegrationTests\IntegrationTestBase.cs (1)
496var sourceSpan = span.GetSourceSpan(codeDocument.Source);
Language\IntegrationTests\IntermediateNodeWriter.cs (1)
316protected void WriteSourceRange(SourceSpan sourceRange)
Language\IntegrationTests\SourceMappingsSerializer.cs (2)
37private static void AppendMappingLocation(StringBuilder builder, SourceSpan location, string content) 46private static string GetCodeForSpan(SourceSpan location, SourceText content)
Microsoft.CodeAnalysis.Razor.Compiler (341)
CSharp\SourceSpanExtensions.cs (1)
13public static TextSpan AsTextSpan(this SourceSpan sourceSpan)
CSharp\TextSpanExtensions.cs (1)
13public static SourceSpan AsSourceSpan(this TextSpan textSpan)
Language\CodeGeneration\CodeRenderingContext.cs (3)
116if (node.Source is not SourceSpan nodeSource) 124public void AddSourceMappingFor(SourceSpan source, int offset = 0) 141var generatedLocation = new SourceSpan(
Language\CodeGeneration\CodeRenderingContextExtensions.cs (8)
13this CodeRenderingContext context, SourceSpan? span, bool suppressLineDefaultAndHidden = false) 18return span is SourceSpan spanValue && !spanValue.FilePath.IsNullOrEmpty() 24this CodeRenderingContext context, SourceSpan? span, int characterOffset = 0, bool suppressLineDefaultAndHidden = false) 27return span is SourceSpan spanValue && !spanValue.FilePath.IsNullOrEmpty() 35private readonly SourceSpan _span; 42SourceSpan span, 56public static LinePragmaScope Standard(CodeRenderingContext context, SourceSpan span, bool suppressLineDefaultAndHidden) 68public static LinePragmaScope Enhanced(CodeRenderingContext context, SourceSpan span, int characterOffset, bool suppressLineDefaultAndHidden)
Language\CodeGeneration\CodeWriterExtensions.cs (10)
80public static CodeWriter WritePadding(this CodeWriter writer, int offset, SourceSpan? span, CodeRenderingContext context) 303public static CodeWriter WriteEnhancedLineNumberDirective(this CodeWriter writer, SourceSpan span, int characterOffset, bool ensurePathBackslashes) 325public static CodeWriter WriteLineNumberDirective(this CodeWriter writer, SourceSpan span, bool ensurePathBackslashes) 526SourceSpan? typeSpan = null, 527SourceSpan? nameSpan = null, 556SourceSpan? typeSpan, 557SourceSpan? nameSpan, 566static void WriteToken(CodeWriter writer, string content, SourceSpan? span, CodeRenderingContext context) 658public static CSharpCodeWritingScope BuildNamespace(this CodeWriter writer, string? name, SourceSpan? span, CodeRenderingContext context) 796static void WriteWithPragma(string content, CodeRenderingContext context, SourceSpan source)
Language\CodeGeneration\DesignTimeNodeWriter.cs (2)
108if (node.Source is SourceSpan nodeSource) 210if (token.Source is not SourceSpan tokenSource)
Language\Components\ComponentBindLoweringPass.cs (2)
1077private static SourceSpan? GetOriginalPropertySpan(IntermediateNode node) 1088if (originalSpan is SourceSpan span)
Language\Components\ComponentDesignTimeNodeWriter.cs (3)
192if (node.Source is SourceSpan nodeSource && !isWhiteSpace) 690var attributeSourceSpan = (SourceSpan)node.OriginalAttributeSpan;
Language\Components\ComponentDiagnosticFactory.cs (42)
23public static RazorDiagnostic Create_UnsupportedTagHelperDirective(SourceSpan? source) 33public static RazorDiagnostic Create_CodeBlockInAttribute(SourceSpan? source, string expression) 41public static RazorDiagnostic Create_UnclosedTag(SourceSpan? span, string tagName) 49public static RazorDiagnostic Create_UnexpectedClosingTag(SourceSpan? span, string tagName) 57public static RazorDiagnostic Create_UnexpectedClosingTagForVoidElement(SourceSpan? span, string tagName) 65public static RazorDiagnostic Create_InvalidHtmlContent(SourceSpan? span, string text) 73public static RazorDiagnostic Create_MultipleComponents(SourceSpan? span, string tagName, IEnumerable<TagHelperDescriptor> components) 86public static RazorDiagnostic Create_AmbiguousComponentSelection(SourceSpan? span, string tagName, TagHelperDescriptor genericComponent, TagHelperDescriptor nonGenericComponent) 108public static RazorDiagnostic CreatePageDirective_CannotBeImported(SourceSpan source) 120public static RazorDiagnostic CreatePageDirective_MustSpecifyRoute(SourceSpan? source) 129SourceSpan? source, string attribute, IEnumerable<TagHelperDirectiveAttributeIntermediateNode> attributes) 141public static RazorDiagnostic CreateEventHandler_Duplicates(SourceSpan? source, string attribute, TagHelperDirectiveAttributeIntermediateNode[] attributes) 154public static RazorDiagnostic CreateBindAttribute_InvalidSyntax(SourceSpan? source, string attribute) 164public static RazorDiagnostic Create_DisallowedScriptTag(SourceSpan? source) 172public static RazorDiagnostic Create_TemplateInvalidLocation(SourceSpan? source) 180public static RazorDiagnostic Create_ChildContentSetByAttributeAndBody(SourceSpan? source, string attribute) 189public static RazorDiagnostic Create_ChildContentMixedWithExplicitChildContent(SourceSpan? source, ComponentIntermediateNode component) 201public static RazorDiagnostic Create_ChildContentHasInvalidAttribute(SourceSpan? source, string attribute, string element) 209public static RazorDiagnostic Create_ChildContentHasInvalidParameter(SourceSpan? source, string attribute, string element) 219SourceSpan? source, 245SourceSpan? source, 262SourceSpan? source, 277public static RazorDiagnostic Create_ChildContentHasInvalidParameterOnComponent(SourceSpan? source, string attribute, string element) 285public static RazorDiagnostic Create_UnsupportedComponentImportContent(SourceSpan? source) 293public static RazorDiagnostic CreateBindAttributeParameter_MissingBind(SourceSpan? source, string attribute) 304public static RazorDiagnostic Create_DuplicateMarkupAttribute(string attributeName, SourceSpan? source = null) 313public static RazorDiagnostic Create_DuplicateMarkupAttributeDirective(string attributeName, string directiveAttributeName, SourceSpan? source = null) 321public static RazorDiagnostic Create_DuplicateComponentParameter(string attributeName, SourceSpan? source = null) 330public static RazorDiagnostic Create_DuplicateComponentParameterDirective(string attributeName, string directiveAttributeName, SourceSpan? source = null) 338public static RazorDiagnostic Create_ComponentNamesCannotStartWithLowerCase(string componentName, SourceSpan? source = null) 346public static RazorDiagnostic Create_UnexpectedMarkupElement(string elementName, SourceSpan? source = null) 354public static RazorDiagnostic Create_InconsistentStartAndEndTagName(string startTagName, string endTagName, SourceSpan? source = null) 362public static RazorDiagnostic CreateEventHandlerParameter_Duplicates(SourceSpan? source, string attribute, TagHelperDirectiveAttributeParameterIntermediateNode[] attributes) 374public static RazorDiagnostic CreateBindAttributeParameter_UseBindGet(SourceSpan? source, string attribute) 383public static RazorDiagnostic CreateBindAttributeParameter_MissingBindGet(SourceSpan? source, string attribute) 391public static RazorDiagnostic CreateBindAttribute_MissingBindSet(SourceSpan? source, string attributeGet, string attributeSet) 399public static RazorDiagnostic CreateBindAttributeParameter_InvalidSyntaxBindAndBindGet(SourceSpan? source, string attribute) 407public static RazorDiagnostic CreateBindAttributeParameter_InvalidSyntaxBindSetAfter(SourceSpan? source, string attribute) 415public static RazorDiagnostic CreateBindAttributeParameter_UnsupportedSyntaxBindGetSet(SourceSpan? source, string attribute) 425public static RazorDiagnostic CreateFormName_NotAForm(SourceSpan? source) 433public static RazorDiagnostic CreateAttribute_ValidOnlyOnComponent(SourceSpan? source, string attribute) 441public static RazorDiagnostic CreateRenderModeAttribute_ComponentDeclaredRenderMode(SourceSpan? source, string component)
Language\Components\ComponentInjectIntermediateNode.cs (4)
22public ComponentInjectIntermediateNode(string typeName, string memberName, SourceSpan? typeSpan, SourceSpan? memberSpan, bool isMalformed) 35public SourceSpan? TypeSpan { get; } 37public SourceSpan? MemberSpan { get; }
Language\Components\ComponentLoweringPass.cs (1)
570private ComponentChildContentIntermediateNode RewriteChildContent(BoundAttributeDescriptor attribute, SourceSpan? source, IntermediateNodeCollection children)
Language\Components\ComponentNodeWriter.cs (2)
387var attributeSourceSpan = (SourceSpan)(attribute.PropertySpan ?? attribute.OriginalAttributeSpan);
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (5)
266public UsingReference(string @namespace, SourceSpan? source, bool hasExplicitSemicolon) 274public SourceSpan? Source { get; } 529protected SourceSpan? BuildSourceSpanFromNode(SyntaxNode node) 898if (node.Source is SourceSpan source) 916protected SourceSpan? ComputeAttributeValueSourceSpan(MarkupAttributeBlockSyntax node)
Language\DefaultTagHelperResolutionPhase.ComponentTagHelperResolver.cs (14)
67SourceSpan? valueSourceSpan, 196if (directiveNameSpan is SourceSpan ns && attributeName.StartsWith('@')) 205if (match.IsParameterMatch && directiveAttributeName.HasParameter && parameterOriginalSpan is SourceSpan ps) 552SourceSpan? firstSpan = null; 553SourceSpan? lastSpan = null; 583SourceSpan? mergedSpan = null; 823SourceSpan? fallbackSource) 869if (directiveNameSpan is SourceSpan nameSpan && attributeName.StartsWith('@')) 1017private static SourceSpan? ComputeAttributeNameSpan(HtmlAttributeIntermediateNode htmlAttr) 1019if (htmlAttr.Source is not SourceSpan attrSource) 1048private static SourceSpan? ComputeAttributeValueSpan(HtmlAttributeIntermediateNode htmlAttr) 1051if (htmlAttr.Children is [{ Source: SourceSpan childSource }, ..]) 1061if (lastChild.Source is SourceSpan lastSource) 1076if (htmlAttr.Source is not SourceSpan attrSource)
Language\DefaultTagHelperResolutionPhase.cs (38)
335if (diagSource is SourceSpan ds) 342if (elementNode is { HasMissingEndCloseAngle: true, EndTagSpan: SourceSpan endDs }) 355if (diagSource is SourceSpan ds) 372if (diagSource is SourceSpan ds) 432if (current.Source is SourceSpan cs && next.Source is SourceSpan ns) 507child.Source ?? SourceSpan.Undefined, childTagName, parentTagName, allowedChildrenString)); 522child.Source ?? SourceSpan.Undefined, childTagName, parentTagName, allowedChildrenString)); 534child.Source ?? SourceSpan.Undefined, parentTagName, allowedChildrenString)); 543child.Source ?? SourceSpan.Undefined, parentTagName, allowedChildrenString)); 652SourceSpan? source, 777private static SourceSpan? ComputeValueSource(HtmlAttributeIntermediateNode htmlAttr) 779SourceSpan? result = null; 788if (token.Source is SourceSpan tokenSource) 794else if (child.Source is SourceSpan childSource) 802private static SourceSpan MergeSpans(SourceSpan a, SourceSpan b) 806var first = a.AbsoluteIndex <= b.AbsoluteIndex ? a : b; 807var last = a.AbsoluteIndex + a.Length >= b.AbsoluteIndex + b.Length ? a : b; 819internal static SourceSpan MergeSourceSpans(SourceSpan first, SourceSpan last) 916SourceSpan expressionSource, 934private static (string Content, SourceSpan? Source) CollectAttributeValueContent(HtmlAttributeValueIntermediateNode attrValue) 963private static HtmlContentIntermediateNode CreateEmptyHtmlContent(SourceSpan? source) 975private static CSharpIntermediateToken CreateEmptyCSharpToken(SourceSpan? source) 1001private static SourceSpan? ExtendSpanBackward(SourceSpan? source, int prefixLength) 1017private static (string Content, SourceSpan? MergedSpan) CollectUnresolvedLiteralContent( 1019SourceSpan? valueSourceSpan) 1022SourceSpan? firstSpan = null; 1023SourceSpan? lastSpan = null; 1101if (elementNode.EndTagSpan is SourceSpan ets) 1110if (diagSource is SourceSpan ds) 1157elementNode.Source ?? SourceSpan.Undefined, 1264SourceSpan? valueSourceSpan, 1306SourceSpan? valueSourceSpan,
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (43)
21SourceSpan? valueSourceSpan, 159unresolvedAttr.AttributeNameSpan ?? SourceSpan.Undefined, attributeName, tagHelperNode.TagName, propertyType!)); 184unresolvedAttr.AttributeNameSpan ?? SourceSpan.Undefined, attributeName, tagHelperNode.TagName, propertyType!)); 573if (htmlAttr.Source is SourceSpan attrSource && sourceDocument != null) 598var valueSource = new SourceSpan( 617SourceSpan? lastAtTokenSource = null; 627if (intermediateToken.Content == "@" && intermediateToken.Source is SourceSpan src) 629if (lastAtTokenSource is SourceSpan last && last.AbsoluteIndex == src.AbsoluteIndex) 656if (attrContent == "@" && tokenSource is SourceSpan ats) 658if (lastAtTokenSource is SourceSpan last && last.AbsoluteIndex == ats.AbsoluteIndex) 671if (lastAtTokenSource is SourceSpan atSrc) 676var emptySource = new SourceSpan(atSrc.FilePath, transAbsIdx, atSrc.LineIndex, transCharIdx, 0, 0, transCharIdx); 679var transSource = new SourceSpan(atSrc.FilePath, transAbsIdx, atSrc.LineIndex, transCharIdx, 1, 0, transCharIdx + 1); 687if (firstInnerChild.Source is SourceSpan innerSource) 691var openSource = new SourceSpan(innerSource.FilePath, openAbsIndex, innerSource.LineIndex, openCharIndex, 1, 0, openCharIndex + 1); 700if (lastInnerChild.Source is SourceSpan lastSource) 704var closeSource = new SourceSpan(lastSource.FilePath, closeAbsIndex, lastSource.LineIndex, closeCharIndex, 1, 0, closeCharIndex + 1); 720if (htmlAttr.Source is SourceSpan attrSource && sourceDocument != null) 740var openParenSource = new SourceSpan( 766var closeParenSource = new SourceSpan( 851private static SourceSpan? ComputeEmptyValueSource(HtmlAttributeIntermediateNode htmlAttr) 853if (htmlAttr.Source is not SourceSpan attrSource) 1135if (current.Source is SourceSpan currentSource && next.Source is SourceSpan nextSource) 1218if (a.Source is SourceSpan aSource && b.Source is SourceSpan bSource) 1230SourceSpan? valueSourceSpan, 1328var contentSpan = new SourceSpan( 1344SourceSpan? firstSpan = null; 1345SourceSpan? lastSpan = null; 1392SourceSpan vss, 1432SourceSpan? emptySpan = null; 1472using var pendingLiteralParts = new PooledArrayBuilder<(string text, SourceSpan? source)>(); 1473SourceSpan? pendingFirstSpan = null; 1474SourceSpan? pendingLastSpan = null; 1565ref PooledArrayBuilder<(string text, SourceSpan? source)> pendingParts, 1566ref SourceSpan? pendingFirstSpan, 1567ref SourceSpan? pendingLastSpan) 1602codeChild.Source ?? elementNode.Source ?? SourceSpan.Undefined, elementNode.TagName)); 1610var diagSource = exprChild.Source ?? elementNode.Source ?? SourceSpan.Undefined; 1638ref SourceSpan? firstSpan, 1639ref SourceSpan? lastSpan)
Language\Extensions\DefaultTagHelperTargetExtension.cs (2)
506SourceSpan? span) 519SourceSpan? span)
Language\Intermediate\BaseTypeWithModel.cs (2)
17public BaseTypeWithModel(string baseType, SourceSpan? location = null) 27if (location is SourceSpan span)
Language\Intermediate\ComponentAttributeIntermediateNode.cs (2)
34public SourceSpan? PropertySpan { get; set; } 38public SourceSpan? OriginalAttributeSpan { get; set; }
Language\Intermediate\ComponentIntermediateNode.cs (1)
52public SourceSpan StartTagSpan { get; init; }
Language\Intermediate\CSharpIntermediateToken.cs (2)
8public CSharpIntermediateToken(string content, SourceSpan? source) 13internal CSharpIntermediateToken(LazyContent content, SourceSpan? source)
Language\Intermediate\HtmlIntermediateToken.cs (2)
8public HtmlIntermediateToken(string content, SourceSpan? source) 13internal HtmlIntermediateToken(LazyContent content, SourceSpan? source)
Language\Intermediate\IntermediateNode.cs (1)
22public SourceSpan? Source { get; set; }
Language\Intermediate\IntermediateNodeFactory.cs (4)
10public static CSharpIntermediateToken CSharpToken(string content, SourceSpan? source = null) 13public static CSharpIntermediateToken CSharpToken<T>(T arg, Func<T, string> contentFactory, SourceSpan? source = null) 16public static HtmlIntermediateToken HtmlToken(string content, SourceSpan? source = null) 19public static HtmlIntermediateToken HtmlToken<T>(T arg, Func<T, string> contentFactory, SourceSpan? source = null)
Language\Intermediate\IntermediateToken.cs (2)
17protected IntermediateToken(string content, SourceSpan? source) 28private protected IntermediateToken(LazyContent content, SourceSpan? source)
Language\Intermediate\TagHelperDirectiveAttributeIntermediateNode.cs (1)
16public SourceSpan? OriginalAttributeSpan { get; init; }
Language\Intermediate\TagHelperDirectiveAttributeParameterIntermediateNode.cs (1)
14public SourceSpan? OriginalAttributeSpan { get; init; }
Language\Intermediate\TagHelperIntermediateNode.cs (1)
16public SourceSpan? StartTagSpan { get; init; }
Language\Intermediate\TagHelperPropertyIntermediateNode.cs (1)
13public SourceSpan? OriginalAttributeSpan { get; init; }
Language\Intermediate\TypeParameter.cs (2)
21public TypeParameter(string name, SourceSpan? nameSource, string? constraints, SourceSpan? constraintsSource)
Language\Intermediate\UnresolvedAttributeIntermediateNode.cs (2)
27public SourceSpan? ValueSourceSpan { get; set; } 39public SourceSpan? AttributeNameSpan { get; set; }
Language\Intermediate\UnresolvedElementIntermediateNode.cs (3)
32public SourceSpan? EndTagSpan { get; set; } 38public SourceSpan? StartTagNameSpan { get; set; } 41public SourceSpan? StartTagSpan { get; set; }
Language\Legacy\ClassifiedSpanInternal.cs (4)
12public ClassifiedSpanInternal(SourceSpan span, SourceSpan blockSpan, SpanKindInternal spanKind, BlockKindInternal blockKind, AcceptedCharactersInternal acceptedCharacters) 28public SourceSpan BlockSpan { get; } 30public SourceSpan Span { get; }
Language\Legacy\ClassifiedSpanVisitor.cs (8)
24private SourceSpan? _currentBlockSpan; 233var sourceSpan = spanComputer.ToSourceSpan(_source); 270var sourceSpan = spanComputer.ToSourceSpan(_source); 399private readonly SourceSpan? _previousBlockSpan = visitor._currentBlockSpan; 410private SourceSpan CurrentBlockSpan 422var nodeSpan = node.GetSourceSpan(_source); 440var tokenSpan = token.GetSourceSpan(_source); 445private void AddSpan(SourceSpan span, SpanKindInternal kind, AcceptedCharactersInternal acceptedCharacters)
Language\Legacy\TagHelperBlockRewriter.cs (4)
113var location = new SourceSpan(codeBlock.GetSourceLocation(source), codeBlock.Width); 126var location = contentChild.GetSourceSpan(source); 190var errorLocation = new SourceSpan(attributeNameLocation, result.AttributeName.Length); 200var errorLocation = new SourceSpan(attributeNameLocation, result.AttributeName.Length);
Language\Legacy\TagHelperParseTreeRewriter.cs (1)
142var source = new SourceSpan(SourceLocationTracker.Advance(startTag.GetSourceLocation(_source), "<"), tagName.Length);
Language\Legacy\TagHelperSpanInternal.cs (1)
6internal readonly record struct TagHelperSpanInternal(SourceSpan Span, TagHelperBinding Binding)
Language\NamespaceComputer.cs (6)
24out SourceSpan? namespaceSpan) 37if (TryGetNamespaceFromDirective(codeDocument, considerImports, out var directiveNamespaceName, out var directiveNamespaceSpan)) 184out SourceSpan namespaceSpan) 221private SourceSpan _lastNamespaceSpan; 226out SourceSpan namespaceSpan) 237namespaceSpan = SourceSpan.Undefined;
Language\RazorCodeDocument.cs (1)
303out SourceSpan? namespaceSpan)
Language\RazorCodeDocumentExtensions.cs (1)
39out SourceSpan? namespaceSpan)
Language\RazorDiagnostic.cs (7)
18public SourceSpan Span { get; } 22private RazorDiagnostic(RazorDiagnosticDescriptor descriptor, SourceSpan? span, object[]? args) 25Span = span ?? SourceSpan.Undefined; 32public static RazorDiagnostic Create(RazorDiagnosticDescriptor descriptor, SourceSpan? span) 38public static RazorDiagnostic Create(RazorDiagnosticDescriptor descriptor, SourceSpan? span, params object[] args) 57var span = Span; 115var span = diagnostic.Span;
Language\RazorDiagnosticFactory.cs (60)
36public static RazorDiagnostic CreateParsing_UnterminatedStringLiteral(SourceSpan location) 44public static RazorDiagnostic CreateParsing_BlockCommentNotTerminated(SourceSpan location) 52public static RazorDiagnostic CreateParsing_HelperDirectiveNotAvailable(SourceSpan location) 60public static RazorDiagnostic CreateParsing_UnexpectedWhiteSpaceAtStartOfCodeBlock(SourceSpan location) 68public static RazorDiagnostic CreateParsing_UnexpectedEndOfFileAtStartOfCodeBlock(SourceSpan location) 76public static RazorDiagnostic CreateParsing_UnexpectedCharacterAtStartOfCodeBlock(SourceSpan location, string content) 84public static RazorDiagnostic CreateParsing_ExpectedEndOfBlockBeforeEOF(SourceSpan location, string blockName, string closeBlock, string openBlock) 92public static RazorDiagnostic CreateParsing_ReservedWord(SourceSpan location, string content) 100public static RazorDiagnostic CreateParsing_SingleLineControlFlowStatementsCannotContainMarkup(SourceSpan location) 108public static RazorDiagnostic CreateParsing_AtInCodeMustBeFollowedByColonParenOrIdentifierStart(SourceSpan location) 116public static RazorDiagnostic CreateParsing_UnexpectedNestedCodeBlock(SourceSpan location) 124public static RazorDiagnostic CreateParsing_DirectiveTokensMustBeSeparatedByWhitespace(SourceSpan location, string directiveName) 132public static RazorDiagnostic CreateParsing_UnexpectedEOFAfterDirective(SourceSpan location, string directiveName, string expectedToken) 140public static RazorDiagnostic CreateParsing_DirectiveExpectsTypeName(SourceSpan location, string directiveName) 148public static RazorDiagnostic CreateParsing_DirectiveExpectsNamespace(SourceSpan location, string directiveName) 156public static RazorDiagnostic CreateParsing_DirectiveExpectsIdentifier(SourceSpan location, string directiveName) 164public static RazorDiagnostic CreateParsing_DirectiveExpectsQuotedStringLiteral(SourceSpan location, string directiveName) 172public static RazorDiagnostic CreateParsing_UnexpectedDirectiveLiteral(SourceSpan location, string directiveName, string expected) 180public static RazorDiagnostic CreateParsing_DirectiveMustHaveValue(SourceSpan location, string directiveName) 188public static RazorDiagnostic CreateParsing_IncompleteQuotesAroundDirective(SourceSpan location, string directiveName) 196public static RazorDiagnostic CreateParsing_InvalidTagHelperPrefixValue(SourceSpan location, string directiveName, char character, string prefix) 204public static RazorDiagnostic CreateParsing_MarkupBlockMustStartWithTag(SourceSpan location) 212public static RazorDiagnostic CreateParsing_OuterTagMissingName(SourceSpan location) 220public static RazorDiagnostic CreateParsing_TextTagCannotContainAttributes(SourceSpan location) 228public static RazorDiagnostic CreateParsing_UnfinishedTag(SourceSpan location, string tagName) 236public static RazorDiagnostic CreateParsing_MissingEndTag(SourceSpan location, string tagName) 244public static RazorDiagnostic CreateParsing_UnexpectedEndTag(SourceSpan location, string tagName) 252public static RazorDiagnostic CreateParsing_ExpectedCloseBracketBeforeEOF(SourceSpan location, string openBrace, string closeBrace) 260public static RazorDiagnostic CreateParsing_RazorCommentNotTerminated(SourceSpan location) 268public static RazorDiagnostic CreateParsing_TagHelperIndexerAttributeNameMustIncludeKey(SourceSpan location, string attributeName, string tagName) 276public static RazorDiagnostic CreateParsing_TagHelperAttributeListMustBeWellFormed(SourceSpan location) 284public static RazorDiagnostic CreateParsing_TagHelpersCannotHaveCSharpInTagDeclaration(SourceSpan location, string tagName) 292public static RazorDiagnostic CreateParsing_TagHelperAttributesMustHaveAName(SourceSpan location, string tagName) 300public static RazorDiagnostic CreateParsing_TagHelperMustNotHaveAnEndTag(SourceSpan location, string tagName, string displayName, TagStructure tagStructure) 308public static RazorDiagnostic CreateParsing_TagHelperFoundMalformedTagHelper(SourceSpan location, string tagName) 316public static RazorDiagnostic CreateParsing_TagHelperMissingCloseAngle(SourceSpan location, string tagName) 324public static RazorDiagnostic CreateParsing_InvalidTagHelperLookupText(SourceSpan location, string lookupText) 332public static RazorDiagnostic CreateParsing_DirectiveExpectsCSharpAttribute(SourceSpan location, string directiveName) 340public static RazorDiagnostic CreateParsing_DirectiveExpectsBooleanLiteral(SourceSpan location, string directiveName) 348public static RazorDiagnostic CreateParsing_GenericTypeParameterIdentifierMismatch(SourceSpan location, string directiveName, string constraintIdentifier, string originalMember) 356public static RazorDiagnostic CreateParsing_UnexpectedIdentifier(SourceSpan location, string content, params string[] options) 364public static RazorDiagnostic CreateParsing_DirectiveExpectsIdentifierOrExpression(SourceSpan location, string directiveName) 372public static RazorDiagnostic CreateParsing_VoidElement(SourceSpan location, string tagName) 380public static RazorDiagnostic CreateParsing_PreprocessorDirectivesMustBeAtTheStartOfLine(SourceSpan location) 388public static RazorDiagnostic CreateParsing_PossibleMisplacedPreprocessorDirective(SourceSpan location) 396public static RazorDiagnostic CreateParsing_DefineAndUndefNotAllowed(SourceSpan location) 418public static RazorDiagnostic CreateParsing_DuplicateDirective(SourceSpan location, string directive) 426public static RazorDiagnostic CreateParsing_SectionsCannotBeNested(SourceSpan location) 434public static RazorDiagnostic CreateParsing_InlineMarkupBlocksCannotBeNested(SourceSpan location) 442public static RazorDiagnostic CreateParsing_NamespaceImportAndTypeAliasCannotExistWithinCodeBlock(SourceSpan location) 450public static RazorDiagnostic CreateParsing_DirectiveMustAppearAtStartOfLine(SourceSpan location, string directiveName) 458public static RazorDiagnostic CreateTagHelper_CodeBlocksNotSupportedInAttributes(SourceSpan? location) 466public static RazorDiagnostic CreateTagHelper_InlineMarkupBlocksNotSupportedInAttributes(SourceSpan? location, string expectedTypeName) 474public static RazorDiagnostic CreateTagHelper_EmptyBoundAttribute(SourceSpan location, string attributeName, string tagName, string propertyTypeName) 482public static RazorDiagnostic CreateTagHelper_CannotHaveNonTagContent(SourceSpan location, string tagName, string allowedChildren) 490public static RazorDiagnostic CreateTagHelper_InvalidNestedTag(SourceSpan location, string tagName, string parent, string allowedChildren) 498public static RazorDiagnostic CreateTagHelper_InconsistentTagStructure(SourceSpan location, string firstDescriptor, string secondDescriptor, string tagName) 512public static RazorDiagnostic CreateComponent_EditorRequiredParameterNotSpecified(SourceSpan? location, string tagName, string parameterName) 675public static RazorDiagnostic CreateRewriter_InsufficientStack(SourceSpan? location = null) 689public static RazorDiagnostic CreateCssRewriting_ImportNotAllowed(SourceSpan location)
Language\SourceChange.cs (2)
35public SourceChange(SourceSpan span, string newText) 52public SourceSpan Span { get; }
Language\SourceLocation.cs (1)
90public static SourceLocation FromSpan(SourceSpan? span)
Language\SourceMapping.cs (4)
14public SourceMapping(SourceSpan originalSpan, SourceSpan generatedSpan) 20public SourceSpan OriginalSpan { get; } 22public SourceSpan GeneratedSpan { get; }
Language\SourceSpan.cs (18)
12public readonly struct SourceSpan : IEquatable<SourceSpan> 14public static readonly SourceSpan Undefined = new SourceSpan(SourceLocation.Undefined, 0); 61public bool Equals(SourceSpan other) 73return obj is SourceSpan span && Equals(span); 99internal readonly SourceSpan GetZeroWidthEndSpan() 104internal readonly SourceSpan Slice(int startIndex, int length) 109public static bool operator ==(SourceSpan left, SourceSpan right) 114public static bool operator !=(SourceSpan left, SourceSpan right) 119public readonly int CompareByStartThenLength(SourceSpan other) 130public readonly SourceSpan WithFilePath(string filePath) => new(filePath, AbsoluteIndex, LineIndex, CharacterIndex, Length, LineCount, EndCharacterIndex); 131public readonly SourceSpan WithAbsoluteIndex(int absoluteIndex) => new(FilePath, absoluteIndex, LineIndex, CharacterIndex, Length, LineCount, EndCharacterIndex); 132public readonly SourceSpan WithLineIndex(int lineIndex) => new(FilePath, AbsoluteIndex, lineIndex, CharacterIndex, Length, LineCount, EndCharacterIndex); 133public readonly SourceSpan WithCharacterIndex(int characterIndex) => new(FilePath, AbsoluteIndex, LineIndex, characterIndex, Length, LineCount, EndCharacterIndex); 134public readonly SourceSpan WithLength(int length) => new(FilePath, AbsoluteIndex, LineIndex, CharacterIndex, length, LineCount, EndCharacterIndex); 135public readonly SourceSpan WithLineCount(int lineCount) => new(FilePath, AbsoluteIndex, LineIndex, CharacterIndex, Length, lineCount, EndCharacterIndex); 136public readonly SourceSpan WithEndCharacterIndex(int endCharacterIndex) => new(FilePath, AbsoluteIndex, LineIndex, CharacterIndex, Length, LineCount, endCharacterIndex);
Language\SpanComputer.cs (2)
11/// Helper that can be used to efficiently build up a <see cref="SourceSpan"/> or 94public readonly SourceSpan ToSourceSpan(RazorSourceDocument source)
Language\Syntax\SyntaxNodeExtensions.cs (2)
118public static SourceSpan GetSourceSpan(this SyntaxNode node, RazorSourceDocument source) 126public static SourceSpan GetSourceSpan(this SyntaxToken token, RazorSourceDocument source)
Mvc.Version2_X\InstrumentationPass.cs (2)
62public InstrumentationItem(IntermediateNode node, IntermediateNode parent, bool isLiteral, SourceSpan source) 76public SourceSpan Source { get; }
Mvc\InjectIntermediateNode.cs (2)
17public SourceSpan? TypeSource { get; set; } 21public SourceSpan? MemberSource { get; set; }
Mvc\PageDirective.cs (3)
27private PageDirective(string routeTemplate, IntermediateNode directiveNode, SourceSpan? source) 38public SourceSpan? Source { get; } 67SourceSpan? sourceSpan = null;
Mvc\RazorExtensionsDiagnosticFactory.cs (2)
83public static RazorDiagnostic CreatePageDirective_CannotBeImported(SourceSpan source) 95public static RazorDiagnostic CreatePageDirective_MustExistAtTheTopOfFile(SourceSpan source)
SourceGenerators\Diagnostics\RazorDiagnostics.cs (2)
107var span = razorDiagnostic.Span; 110if (span == SourceSpan.Undefined)
Microsoft.CodeAnalysis.Razor.Workspaces (32)
Diagnostics\RazorDiagnosticHelper.cs (2)
73internal static LspRange? ConvertSpanToRange(SourceSpan sourceSpan, SourceText sourceText) 75if (sourceSpan == SourceSpan.Undefined)
DocumentMapping\AbstractDocumentMappingService.cs (6)
125var generatedSpan = mapping.GeneratedSpan; 172var originalSpan = mapping.OriginalSpan; 310bool Overlaps(TextSpan generatedRangeAsSpan, SourceSpan span) 318bool IntersectsWith(int position, SourceSpan span) 373var originalSpanBeforeGeneratedRange = mappingBeforeGeneratedRange.OriginalSpan; 381var originalSpanAfterGeneratedRange = mappingAfterGeneratedRange.OriginalSpan;
Extensions\LspExtensions_SourceText.cs (1)
21public static LspRange GetRange(this SourceText text, SourceSpan span)
Extensions\RazorCodeDocumentExtensions.CachedData.cs (4)
26private ImmutableArray<SourceSpan>? _tagHelperSpans; 42public ImmutableArray<SourceSpan> GetOrComputeTagHelperSpans(CancellationToken cancellationToken) 54static ImmutableArray<SourceSpan> ComputeTagHelperSpans(RazorSyntaxTree syntaxTree) 56using var builder = new PooledArrayBuilder<SourceSpan>();
Extensions\RazorCodeDocumentExtensions.cs (6)
42SourceSpan? minGeneratedSpan = null; 43SourceSpan? maxGeneratedSpan = null; 113private static ImmutableArray<SourceSpan> GetTagHelperSpans(RazorCodeDocument document) 118ImmutableArray<SourceSpan> tagHelperSpans, 127var span = classifiedSpan.Span; 166foreach (var span in tagHelperSpans)
Extensions\RazorCodeDocumentExtensions_ClassifiedSpans.cs (6)
23private record struct ClassifiedSpan(SourceSpan Span, SpanKind Kind); 261var sourceSpan = spanComputer.ToSourceSpan(_source); 298var sourceSpan = spanComputer.ToSourceSpan(_source); 436var nodeSpan = node.GetSourceSpan(_source); 448var tokenSpan = token.GetSourceSpan(_source); 453private void AddSpan(SourceSpan span, SpanKind kind)
Extensions\SourceSpanExtensions.cs (2)
11public static TextSpan ToTextSpan(this SourceSpan span) 14public static LinePositionSpan ToLinePositionSpan(this SourceSpan span)
Extensions\SourceTextExtensions.cs (1)
42public static LinePositionSpan GetLinePositionSpan(this SourceText text, SourceSpan span)
Formatting\Passes\CSharpFormattingPass.CSharpDocumentGenerator.cs (3)
101private static string GetAdditionalLineComment(SourceSpan originalSpan) 219var originalSpan = sourceMappings[iMapping].OriginalSpan; 267private void AddAdditionalLineFormattingContent(StringBuilder additionalLinesBuilder, RazorSyntaxNode node, SourceSpan originalSpan)
Formatting\RazorFormattingService.cs (1)
89if (codeDocument.GetRequiredCSharpDocument().Diagnostics.Any(d => d.Span != SourceSpan.Undefined && span.OverlapsWith(sourceText.GetLinePositionSpan(d.Span))))
Microsoft.NET.Sdk.Razor.SourceGenerators.UnitTests (1)
RazorDiagnosticTest.cs (1)
32var span = new SourceSpan("some-file", 100, 1, 5, 10);
Microsoft.VisualStudio.LanguageServices.Razor.UnitTests (8)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Diagnostics\RazorDiagnosticHelperTest.cs (6)
63var sourceSpan = new SourceSpan(3, 0, 3, 4); 80var sourceSpan = new SourceSpan(5, 0, 5, 4); 96var sourceSpan = new SourceSpan(sourceText.Length + 5, 0, sourceText.Length + 5, 4); 112var sourceSpan = new SourceSpan(6, 0, 6, 15); 127var sourceSpan = SourceSpan.Undefined;
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Mapping\RazorEditServiceTest.cs (2)
1291var csharpSourceSpan = new SourceSpan( 1298var razorSourceSpan = new SourceSpan(
Microsoft.VisualStudioCode.RazorExtension.UnitTests (8)
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Diagnostics\RazorDiagnosticHelperTest.cs (6)
63var sourceSpan = new SourceSpan(3, 0, 3, 4); 80var sourceSpan = new SourceSpan(5, 0, 5, 4); 96var sourceSpan = new SourceSpan(sourceText.Length + 5, 0, sourceText.Length + 5, 4); 112var sourceSpan = new SourceSpan(6, 0, 6, 15); 127var sourceSpan = SourceSpan.Undefined;
src\Razor\src\Razor\test\Microsoft.CodeAnalysis.Razor.CohostingShared.UnitTests\Mapping\RazorEditServiceTest.cs (2)
1291var csharpSourceSpan = new SourceSpan( 1298var razorSourceSpan = new SourceSpan(