CodeEditSourceEditor icon indicating copy to clipboard operation
CodeEditSourceEditor copied to clipboard

🧹 Capture names enum

Open lukepistrol opened this issue 2 years ago • 0 comments

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"
    // ...
}

lukepistrol avatar Jun 17 '22 21:06 lukepistrol