File tree 2 files changed +14
-0
lines changed
Sources/CodeEditSourceEditor/Controller
Tests/CodeEditSourceEditorTests
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,11 @@ public class TextViewController: NSViewController {
254
254
platformGuardedSystemCursor = false
255
255
}
256
256
257
+ if let idx = highlightProviders. firstIndex ( where: { $0 is TreeSitterClient } ) ,
258
+ let client = highlightProviders [ idx] as? TreeSitterClient {
259
+ self . treeSitterClient = client
260
+ }
261
+
257
262
self . textView = TextView (
258
263
string: string,
259
264
font: font,
Original file line number Diff line number Diff line change @@ -418,5 +418,14 @@ final class TextViewControllerTests: XCTestCase {
418
418
XCTAssertEqual ( controller. cursorPositions [ 1 ] . line, 3 )
419
419
XCTAssertEqual ( controller. cursorPositions [ 1 ] . column, 1 )
420
420
}
421
+
422
+ // MARK: - TreeSitterClient
423
+
424
+ func test_treeSitterSetUp( ) {
425
+ // Set up with a user-initiated `TreeSitterClient` should still use that client for things like tag
426
+ // completion.
427
+ let controller = Mock . textViewController ( theme: Mock . theme ( ) )
428
+ XCTAssertNotNil ( controller. treeSitterClient)
429
+ }
421
430
}
422
431
// swiftlint:enable all
You can’t perform that action at this time.
0 commit comments