Skip to content

Commit d8fbd7c

Browse files
committed
Add empty()
1 parent 9db6704 commit d8fbd7c

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

Tool/Sources/FocusedCodeFinder/ActiveDocumentContext.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,21 @@ public struct ActiveDocumentContext {
8080
self.includes = includes
8181
self.focusedContext = focusedContext
8282
}
83+
84+
public static func empty() -> ActiveDocumentContext {
85+
.init(
86+
documentURL: .init(fileURLWithPath: "/"),
87+
relativePath: "",
88+
language: .builtIn(.swift),
89+
fileContent: "",
90+
lines: [],
91+
selectedCode: "",
92+
selectionRange: .outOfScope,
93+
lineAnnotations: [],
94+
imports: [],
95+
includes: []
96+
)
97+
}
8398

8499
public mutating func moveToFocusedCode() {
85100
moveToCodeContainingRange(selectionRange)

0 commit comments

Comments
 (0)