Awesome
<p align="center"> <img src="https://github.com/CodeEditApp/CodeEditTextView/blob/main/.github/CodeEditSourceEditor-Icon-128@2x.png?raw=true" height="128"> <h1 align="center">CodeEditSourceEditor</h1> </p> <p align="center"> <a aria-label="Follow CodeEdit on Twitter" href="https://twitter.com/CodeEditApp" target="_blank"> <img alt="" src="https://img.shields.io/badge/Follow%20@CodeEditApp-black.svg?style=for-the-badge&logo=Twitter"> </a> <a aria-label="Join the community on Discord" href="https://discord.gg/vChUXVf9Em" target="_blank"> <img alt="" src="https://img.shields.io/badge/Join%20the%20community-black.svg?style=for-the-badge&logo=Discord"> </a> <a aria-label="Read the Documentation" href="https://codeeditapp.github.io/CodeEditSourceEditor/documentation/codeeditsourceeditor/" target="_blank"> <img alt="" src="https://img.shields.io/badge/Documentation-black.svg?style=for-the-badge&logo=readthedocs&logoColor=blue"> </a> </p>An Xcode-inspired code editor view written in Swift powered by tree-sitter for CodeEdit. Features include syntax highlighting (based on the provided theme), code completion, find and replace, text diff, validation, current line highlighting, minimap, inline messages (warnings and errors), bracket matching, and more.
<img width="1012" alt="social-cover-textview" src="https://user-images.githubusercontent.com/806104/194083584-91555dce-ad4c-4066-922e-1eab889134be.png">[!IMPORTANT] CodeEditSourceEditor is currently in development and it is not ready for production use. <br> Please check back later for updates on this project. Contributors are welcome as we build out the features mentioned above!
Documentation
This package is fully documented here.
Usage
import CodeEditSourceEditor
struct ContentView: View {
@State var text = "let x = 1.0"
@State var theme = EditorTheme(...)
@State var font = NSFont.monospacedSystemFont(ofSize: 11, weight: .regular)
@State var tabWidth = 4
@State var lineHeight = 1.2
@State var editorOverscroll = 0.3
var body: some View {
CodeEditSourceEditor(
$text,
language: .swift,
theme: $theme,
font: $font,
tabWidth: $tabWidth,
lineHeight: $lineHeight,
editorOverscroll: $editorOverscroll
)
}
}
Currently Supported Languages
See this issue https://github.com/CodeEditApp/CodeEditLanguages/issues/10 on CodeEditLanguages
for more information on supported languages.
Dependencies
Special thanks to Matt Massicotte for the great work he's done!
Package | Source | Author |
---|---|---|
SwiftTreeSitter | GitHub | Matt Massicotte |
License
Licensed under the MIT license.