CodeEditApp / CodeEditSourceEditor

A code editor view written in Swift powered by tree-sitter.
https://codeeditapp.github.io/CodeEditSourceEditor/documentation/codeeditsourceeditor
MIT License
517 stars 84 forks source link

🧹 Capture names enum #28

Closed lukepistrol closed 2 years ago

lukepistrol commented 2 years ago

As seen in the following code, currently the capture names are provided as string literals.

https://github.com/CodeEditApp/CodeEditTextView/blob/d5f5521a642c22895ecd561da94ff6319dbfe423/Sources/CodeEditTextView/STTextViewController%2BTreeSitter.swift#L79-L97

This should be changed to be an enum with a raw value of type String instead.

Example:

enum CaptureNames: String {
    case comment
    case variable
    case variableBuiltin = "variable.builtin"
    // ...
}