-
-
Notifications
You must be signed in to change notification settings - Fork 36
Closed
Description
When trying to run the README/documentation example code, an exception is raised when running
let swiftConfig = try! LanguageConfiguration(tree_sitter_swift(), name: "Swift")The error is that it can't read the queries directory
Fatal error: 'try!' expression unexpectedly raised an error: SwiftTreeSitter.LanguageConfigurationError.queryDirectoryNotReadable(file:///path/to/build/directory/TreeSitterSwift_TreeSitterSwift.bundle/Contents/Resources/queries/
My best guess is that something changed in a recent macOS version regarding the output structure of bundle resources. When inspecting the actual file, TreeSitterSwift_TreeSitterSwift.bundle/queries exists with all the query files. This would thus work correctly if the platform was any other Apple platform based on the conditional compilation here:
swift-tree-sitter/Sources/SwiftTreeSitter/LanguageConfiguration.swift
Lines 125 to 129 in 114a515
| #if os(iOS) || os(tvOS) || os(visionOS) || os(watchOS) | |
| return bundlePath?.appendingPathComponent("queries", isDirectory: true) | |
| #else | |
| return bundlePath?.appendingPathComponent("Contents/Resources/queries", isDirectory: true) | |
| #endif |
Metadata
Metadata
Assignees
Labels
No labels