1 write to FilePath
Microsoft.CodeAnalysis.Razor.Compiler (1)
Language\SourceSpan.cs (1)
37FilePath = filePath;
67 references to FilePath
Microsoft.AspNetCore.Razor.Language.UnitTests (4)
DefaultTagHelperResolutionPhaseTest.cs (3)
22Assert.Equal(filePath, result.FilePath); 45Assert.Equal(filePath, result.FilePath); 103Assert.Null(result.FilePath);
SourceChangeTest.cs (1)
24Assert.Null(change.Span.FilePath);
Microsoft.AspNetCore.Razor.Test.Common (3)
Language\IntegrationTests\IntermediateNodeWriter.cs (3)
328if (sourceRange.FilePath != null) 330var fileName = sourceRange.FilePath[(sourceRange.FilePath.LastIndexOf('/') + 1)..];
Microsoft.CodeAnalysis.Razor.Compiler (60)
Language\CodeGeneration\CodeRenderingContext.cs (1)
127!string.Equals(SourceDocument.FilePath, source.FilePath, StringComparison.OrdinalIgnoreCase))
Language\CodeGeneration\CodeRenderingContextExtensions.cs (3)
18return span is SourceSpan spanValue && !spanValue.FilePath.IsNullOrEmpty() 27return span is SourceSpan spanValue && !spanValue.FilePath.IsNullOrEmpty() 131_span.FilePath,
Language\CodeGeneration\CodeWriterExtensions.cs (3)
88!string.Equals(context.SourceDocument.FilePath, span.Value.FilePath, StringComparison.OrdinalIgnoreCase)) 322return writer.Write("\"").WriteFilePath(span.FilePath, ensurePathBackslashes).WriteLine("\""); 336.WriteFilePath(span.FilePath, ensurePathBackslashes)
Language\CodeGeneration\DesignTimeNodeWriter.cs (1)
21if (node.Source is { FilePath: not null } sourceSpan)
Language\CodeGeneration\RuntimeNodeWriter.cs (1)
39if (node.Source is { FilePath: not null } sourceSpan)
Language\Components\ComponentBindLoweringPass.cs (1)
1092return new SourceSpan(span.FilePath,
Language\Components\ComponentDesignTimeNodeWriter.cs (3)
70if (node.Source is { FilePath: not null } sourceSpan) 691attributeSourceSpan = new SourceSpan(attributeSourceSpan.FilePath, attributeSourceSpan.AbsoluteIndex + offset, attributeSourceSpan.LineIndex, attributeSourceSpan.CharacterIndex + offset, node.PropertyName.Length, attributeSourceSpan.LineCount, attributeSourceSpan.CharacterIndex + offset + node.PropertyName.Length); 1169if (token.Source?.FilePath == null)
Language\Components\ComponentDiagnosticFactory.cs (1)
110var fileName = Path.GetFileName(source.FilePath);
Language\Components\ComponentRuntimeNodeWriter.cs (2)
318if (node.Source is { FilePath: not null } sourceSpan) 1223if (token.Source?.FilePath == null)
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (7)
158if (usingReference.Source is { FilePath: null } && // the default import has null file path 901source.FilePath, 1021sourceRangeStart.Value.FilePath ?? SourceDocument.FilePath, 1583existingHtmlContent.Source.Value.FilePath == source.Value.FilePath && 1948existingHtmlContent.Source.Value.FilePath == source.Value.FilePath &&
Language\DefaultTagHelperResolutionPhase.cs (1)
824first.FilePath,
Language\DefaultTagHelperResolutionPhase.LegacyTagHelperResolver.cs (14)
599attrSource.FilePath, valueStart, attrSource.LineIndex, valueCharIndex, 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); 741attrSource.FilePath, openParenAbsIndex, attrSource.LineIndex, openParenCharIndex, 767attrSource.FilePath, closeParenAbsIndex, attrSource.LineIndex, closeParenCharIndex, 865attrSource.FilePath, 1220return aSource.FilePath == bSource.FilePath && 1322expr.Source = new SourceSpan(exprSource.FilePath, contentStart, openLoc.Line, openLoc.Character, contentLength, 0, closeLoc.Character + 1); 1329exprSource.FilePath, 1436emptySpan = new SourceSpan(nextSrc.FilePath, nextSrc.AbsoluteIndex, loc.Line, loc.Character, 0, 0, loc.Character); 1614diagSource.FilePath,
Language\Extensions\DesignTimeDirectiveTargetExtension.cs (1)
42node.Source.Value.FilePath,
Language\NamespaceComputer.cs (1)
44var directiveDirectorySpan = NormalizeDirectory(directiveNamespaceSpan.FilePath);
Language\RazorDiagnostic.cs (2)
58builder.Append(span.FilePath); 121return $"{span.FilePath}({span.LineIndex + 1},{span.CharacterIndex + 1}): {severity} {id}: {message}";
Language\SourceLocation.cs (1)
94new SourceLocation(span.Value.FilePath, span.Value.AbsoluteIndex, span.Value.LineIndex, span.Value.CharacterIndex);
Language\SourceSpan.cs (12)
64string.Equals(FilePath, other.FilePath, StringComparison.Ordinal) && 79hash.Add(FilePath, StringComparer.Ordinal); 96FilePath); 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); 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);
Mvc.Version2_X\NamespaceDirective.cs (1)
85var directiveSource = NormalizeDirectory(directive.Source?.FilePath);
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\InjectTargetExtension.cs (1)
28if (!context.Options.DesignTime && !string.IsNullOrWhiteSpace(node.TypeSource?.FilePath))
Mvc\RazorExtensionsDiagnosticFactory.cs (1)
85var fileName = Path.GetFileName(source.FilePath);
SourceGenerators\Diagnostics\RazorDiagnostics.cs (1)
122span.FilePath,