Skip to content

[SourceLocation] Add some doc-comments to VirtualFile type #2903

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Sources/SwiftSyntax/SourceLocation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,9 @@ private struct SortedArray<Element>: RandomAccessCollection {
extension SortedArray: Sendable where Element: Sendable {}

/// Represent a virtual file region in the source file.
///
/// This type corresponds to `swift::SourceManager::VirtualFile` in the compiler,
/// and is used for populating the virtual file information in it.
@_spi(Compiler)
public struct VirtualFile: Sendable {
/// Start position of the virtual file region
Expand All @@ -487,7 +490,8 @@ public struct VirtualFile: Sendable {
public var fileName: String
/// Line number offset from the physical line number.
public var lineOffset: Int
/// The position of the filename literal.
/// The position of the file name string literal in the `#sourceLocation` directive.
/// This can be used to diagnose the file name in the compiler.
public var fileNamePosition: AbsolutePosition
}

Expand Down