State up front that there are two products
When I try to compile the code, I get:
Cannot find type 'TextLocated' in scope
` import SwiftUI import CodeEditorView
struct MyCodeEditorView: View { @State private var text: String = "My awesome code..." @State private var position: CodeEditor.Position = CodeEditor.Position() @State private var messages: Set<TextLocated<Message>> = Set()
@Environment(\.colorScheme) private var colorScheme: ColorScheme
var body: some View {
CodeEditor(text: $text, position: $position, messages: $messages, language: .swift)
.environment(\.codeEditorTheme,
colorScheme == .dark ? Theme.defaultDark : Theme.defaultLight)
}
} `
The package includes two products: (1) CodeEditorView and (2) LanguageSupport. The missing symbol is located in the second product — i.e., you need to import that, too.
This needs to be better explained in the documentation. I will keep this issue open to remind me of that. (I'll also rename it.) Thanks for the feedback!