Skip to content

Commit 49c81a5

Browse files
committed
NFC: Remove a couple of unused functions
1 parent 69150c2 commit 49c81a5

File tree

2 files changed

+0
-41
lines changed

2 files changed

+0
-41
lines changed

Sources/SKUtilities/LineTable.swift

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -115,30 +115,6 @@ extension LineTable {
115115
self.replace(fromLine: fromLine, utf16Offset: fromOff, toLine: toLine, utf16Offset: toOff, with: replacement)
116116
}
117117

118-
/// Replace the line table's `content` in the given range and update the line data.
119-
///
120-
/// - parameter fromLine: Starting line number (zero-based).
121-
/// - parameter fromOff: Starting UTF-8 column offset (zero-based).
122-
/// - parameter toLine: Ending line number (zero-based).
123-
/// - parameter toOff: Ending UTF-8 column offset (zero-based).
124-
/// - parameter replacement: The new text for the given range.
125-
@inlinable
126-
mutating package func replace(
127-
fromLine: Int,
128-
utf8Offset fromOff: Int,
129-
toLine: Int,
130-
utf8Offset toOff: Int,
131-
with replacement: String
132-
) {
133-
let start = content.utf8.index(impl[fromLine], offsetBy: fromOff)
134-
let end = content.utf8.index(impl[toLine], offsetBy: toOff)
135-
136-
var newText = self.content
137-
newText.replaceSubrange(start..<end, with: replacement)
138-
139-
self = LineTable(newText)
140-
}
141-
142118
/// Replace the line table's `content` in the given range and update the line data.
143119
///
144120
/// - parameter fromLine: Starting line number (zero-based).

Sources/SwiftSourceKitPlugin/CodeCompletion/Connection.swift

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -145,23 +145,6 @@ final class Connection {
145145
sourcekitd.ideApi.set_file_contents(impl, path, document.lineTable.content)
146146
}
147147

148-
func editDocument(path: String, edit: TextEdit) {
149-
guard let document = documents[path] else {
150-
logger.error("Document at '\(path)' is not open")
151-
return
152-
}
153-
154-
document.lineTable.replace(
155-
fromLine: edit.range.lowerBound.line - 1,
156-
utf8Offset: edit.range.lowerBound.utf8Column - 1,
157-
toLine: edit.range.upperBound.line - 1,
158-
utf8Offset: edit.range.upperBound.utf8Column - 1,
159-
with: edit.newText
160-
)
161-
162-
sourcekitd.ideApi.set_file_contents(impl, path, document.lineTable.content)
163-
}
164-
165148
func closeDocument(path: String) {
166149
if documents[path] == nil {
167150
logger.error("Document at '\(path)' was not open")

0 commit comments

Comments
 (0)