Skip to content

Commit d7f8616

Browse files
committed
feat: add Identifiable protocol support to Language and Themes enums
- Add Identifiable conformance to Language enum with id property - Add Identifiable conformance to Themes enum with id property - This enables better SwiftUI integration for list views and selection
1 parent 2b7aa59 commit d7f8616

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Sources/CodeMirror/Language.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
// Created by wong on 8/13/25.
66
//
77

8-
public enum Language: String, CaseIterable, Hashable {
8+
public enum Language: String, CaseIterable, Hashable, Identifiable {
9+
public var id: String { rawValue }
910
case troff1 = "1"
1011
case troff2 = "2"
1112
case troff3 = "3"

Sources/CodeMirror/Themes.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
// Created by wong on 8/13/25.
66
//
77

8-
public enum Themes: String, CaseIterable, Hashable {
8+
public enum Themes: String, CaseIterable, Hashable, Identifiable {
9+
public var id: String { rawValue }
910
case abcdef
1011
case abyss
1112
case androidstudio

0 commit comments

Comments
 (0)