Skip to content

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

License

Notifications You must be signed in to change notification settings

bishabosha/CodeEditTextView

This branch is 1 commit ahead of, 70 commits behind CodeEditApp/CodeEditSourceEditor:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4f1a156 · Apr 29, 2023
Mar 10, 2023
Oct 4, 2022
Apr 26, 2023
Apr 25, 2023
Oct 4, 2022
Jun 2, 2022
May 30, 2022
Jun 24, 2022
Apr 29, 2023
Apr 29, 2023
Mar 16, 2023

Repository files navigation

CodeEditTextView

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

⚠️ CodeEditTextView 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 CodeEditTextView

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 { 
        CodeEditTextView(
            $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 both Marcin Krzyzanowski & Matt Massicotte for the great work they've done!

Package Source Author
STTextView GitHub Marcin Krzyzanowski
SwiftTreeSitter GitHub Matt Massicotte

License

Licensed under the MIT license.

Related Repositories

        CodeEdit        

     CodeEditKit     

CodeEditLanguages

    CodeEdit CLI    

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Swift 100.0%