Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/foundation #14

Merged
merged 32 commits into from
May 29, 2023
Merged

Dev/foundation #14

merged 32 commits into from
May 29, 2023

Conversation

Wouter01
Copy link
Member

@Wouter01 Wouter01 commented May 23, 2023

Description

This PR adds a base API for integrating extensions with CodeEdit. It offers the following:

  • API to create a running extension
  • API to create settings
  • API to create sidebars
  • some other APIs that aren't working yet
  • testing for LSP integration
  • limited docC docs

It also adds Swiftlint to this package.

See CodeEditApp/CodeEdit#1274 for CodeEditKit integration in CodeEdit

Note that the extension system is a WIP and is by no means done yet. Therefore, no docs will be added until the API gets stable.

Also note that a lot of these features aren't polished yet, but that isn't the goal of this PR. Instead, the goal is to have a base API and implementation that can be improved upon in the future.

Example API:

@main
final class SidebarExtensionExample: CodeEditExtension {
    var description: String = ""

    var entitlements: [Entitlement] = []
}

extension SidebarExtensionExample: SettingsExtension {
    var settings: some View {
        Toggle("Toggle 1", isOn: .constant(true))

        Toggle("Toggle 2", isOn: .constant(false))
    }
}

extension SidebarExtensionExample: SidebarExtension {
    var sidebars: some Sidebar {
        Inspector(id: "umbrellaInspector") {
            Form {
                Text("Hello, world!")
                Button("Print") {
                    NSLog("Print")
                }
                Button("Warning") {
                    Logger(subsystem: "DummyExt", category: "").warning("Warning")
                }

                Button("Info") {
                    Logger(subsystem: "DummyExt", category: "").info("Info")
                }

                Button("Fault") {
                    Logger(subsystem: "DummyExt", category: "").fault("Fault")
                }
            }
            .formStyle(.grouped)
        }
        .help("Umbrella Inspector")
        .icon("umbrella")

        Navigator(id: "carrotNavigator") {
            Form {
                Text("Hello, world!")
            }
            .formStyle(.grouped)
        }
        .help("Carrot Navigator")
        .icon("carrot")
    }
}

Related Issues

Checklist

  • I read and understood the contributing guide as well as the code of conduct
  • The issues this PR addresses are related to each other
  • My changes generate no new warnings
  • My code builds and runs on my machine
  • My changes are all related to the related issue above
  • I documented my code

Signed-off-by: Wouter01 <wouterhennen@gmail.com>
- Added extension Navigators to CodeEdit Window
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
- Added default body implementation
- Added ObservableObject requirement
- Moved from @main struct to @main final class

Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Wouter01 and others added 6 commits May 23, 2023 14:15
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
@Wouter01 Wouter01 marked this pull request as ready for review May 23, 2023 13:12
@Wouter01 Wouter01 self-assigned this May 23, 2023
@Wouter01 Wouter01 added documentation Improvements or additions to documentation enhancement New feature or request labels May 23, 2023
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
@austincondiff austincondiff merged commit 96baa07 into main May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: 👀 In Review
Development

Successfully merging this pull request may close these issues.

2 participants