CodeEditSourceEditor

0.12.0

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

What's New

0.12.0

2025-04-24T20:34:05Z

What's Changed

Minor version bump due to a new variable in the CodeEditSourceEditor and TextViewController initializers.

This version introduces our new Minimap! The minimap gives a high-level summary of code, and by defaults is placed on the right-hand side of the editor. This can be disabled/enabled using a new parameter showMinimap. This release also includes a fix for the multi-line indentation shortcut, fixing an issue where selections did not work correctly when selecting multiple lines.

New Contributors

Full Changelog: 0.11.0...0.12.0

CodeEditSourceEditor

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 release Github Tests Documentation GitHub Repo stars GitHub forks Discord 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!

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 CodeEditApp/CodeEditLanguages#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.

Related Repositories

        CodeEdit        

CodeEditTextView

CodeEditLanguages

CodeEditCLI

     CodeEditKit     

Description

  • Swift Tools 5.9.0
View More Packages from this Author

Dependencies

Last updated: Wed May 14 2025 17:55:38 GMT-0900 (Hawaii-Aleutian Daylight Time)