CodeEditApp/CodeEditSourceEditor

Repository files navigation

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.

social-cover-textview

GitHub releaseGithub TestsGitHub Repo starsGitHub forksDiscord Badge

Important

CodeEditSourceEditor is currently in development and it is not ready for production use.
Please check back later for updates on this project. Contributors are welcome as we build out the features mentioned above!

This package is fully documented here.

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
        )
    }
}

See this issue CodeEditApp/CodeEditLanguages#10 on CodeEditLanguages for more information on supported languages.

Special thanks to Matt Massicotte for the great work he's done!

PackageSourceAuthor
SwiftTreeSitterMatt Massicotte

Licensed under the MIT license.

        CodeEdit        

CodeEditTextView

CodeEditLanguages

CodeEditCLI

     CodeEditKit     

About

A code editor view written in Swift powered by tree-sitter.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 27

Languages