File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Sources/CodeEditSourceEditor/Controller
Tests/CodeEditSourceEditorTests Expand file tree Collapse file tree 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 {
254254 platformGuardedSystemCursor = false
255255 }
256256
257+ if let idx = highlightProviders. firstIndex ( where: { $0 is TreeSitterClient } ) ,
258+ let client = highlightProviders [ idx] as? TreeSitterClient {
259+ self . treeSitterClient = client
260+ }
261+
257262 self . textView = TextView (
258263 string: string,
259264 font: font,
Original file line number Diff line number Diff line change @@ -418,5 +418,14 @@ final class TextViewControllerTests: XCTestCase {
418418 XCTAssertEqual ( controller. cursorPositions [ 1 ] . line, 3 )
419419 XCTAssertEqual ( controller. cursorPositions [ 1 ] . column, 1 )
420420 }
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+ }
421430}
422431// swiftlint:enable all
You can’t perform that action at this time.
0 commit comments