├── AppCast ├── .gitignore ├── appcast.xml ├── appcast_pre.xml ├── _plugins │ └── signature_filter.rb └── Gemfile ├── Resources └── dmgBackground.png ├── .github ├── CodeEdit-Icon-128@2x.png ├── scripts │ ├── remove_todos.sh │ ├── test_app.sh │ └── test_version_number.sh ├── workflows │ ├── CI-release-notes.yml │ ├── lint.yml │ ├── CI-pull-request.yml │ ├── release-drafter.yml │ ├── tests.yml │ ├── issue.yml │ ├── add-to-project.yml │ └── CI-pre-release.yml ├── release-drafter.yml ├── stale.yml ├── FUNDING.yml └── ISSUE_TEMPLATE │ └── feature_request.yml ├── CodeEdit ├── Assets.xcassets │ ├── Contents.json │ ├── Icons │ │ ├── Contents.json │ │ ├── GitHubIcon.imageset │ │ │ ├── GitHubIcon.png │ │ │ ├── GitHubIcon-Dark.png │ │ │ └── Contents.json │ │ ├── GitLabIcon.imageset │ │ │ ├── GitLabIcon.png │ │ │ ├── GitLabIcon-Dark.png │ │ │ └── Contents.json │ │ └── BitBucketIcon.imageset │ │ │ ├── BitBucketIcon.png │ │ │ └── Contents.json │ ├── Custom Colors │ │ ├── Contents.json │ │ ├── Amber.colorset │ │ │ └── Contents.json │ │ ├── CoolGray.colorset │ │ │ └── Contents.json │ │ ├── InspectorBackgroundColor.colorset │ │ │ └── Contents.json │ │ ├── Scarlet.colorset │ │ │ └── Contents.json │ │ ├── Steel.colorset │ │ │ └── Contents.json │ │ └── FolderBlue.colorset │ │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ ├── CodeEdit-128.png │ │ ├── CodeEdit-16.png │ │ ├── CodeEdit-256.png │ │ ├── CodeEdit-32.png │ │ ├── CodeEdit-512.png │ │ ├── CodeEdit-128@2x.png │ │ ├── CodeEdit-16@2x.png │ │ ├── CodeEdit-256@2x.png │ │ ├── CodeEdit-32@2x.png │ │ └── CodeEdit-512@2x.png │ ├── AppIconDev.appiconset │ │ ├── CodeEditDev-128.png │ │ ├── CodeEditDev-16.png │ │ ├── CodeEditDev-256.png │ │ ├── CodeEditDev-32.png │ │ ├── CodeEditDev-512.png │ │ ├── CodeEditDev-16@2x.png │ │ ├── CodeEditDev-32@2x.png │ │ ├── CodeEditDev-128@2x.png │ │ ├── CodeEditDev-256@2x.png │ │ └── CodeEditDev-512@2x.png │ ├── AppIconBeta.appiconset │ │ ├── CodeEditBeta-128.png │ │ ├── CodeEditBeta-16.png │ │ ├── CodeEditBeta-256.png │ │ ├── CodeEditBeta-32.png │ │ ├── CodeEditBeta-512.png │ │ ├── CodeEditBeta-128@2x.png │ │ ├── CodeEditBeta-16@2x.png │ │ ├── CodeEditBeta-256@2x.png │ │ ├── CodeEditBeta-32@2x.png │ │ └── CodeEditBeta-512@2x.png │ ├── AppIconAlpha.appiconset │ │ ├── CodeEditAlpha-128.png │ │ ├── CodeEditAlpha-16.png │ │ ├── CodeEditAlpha-256.png │ │ ├── CodeEditAlpha-32.png │ │ ├── CodeEditAlpha-512.png │ │ ├── CodeEditAlpha-128@2x.png │ │ ├── CodeEditAlpha-16@2x.png │ │ ├── CodeEditAlpha-256@2x.png │ │ ├── CodeEditAlpha-32@2x.png │ │ └── CodeEditAlpha-512@2x.png │ ├── AppIconPre.appiconset │ │ ├── CodeEdit-Icon-Pre-16.png │ │ ├── CodeEdit-Icon-Pre-32.png │ │ ├── CodeEdit-Icon-Pre-128.png │ │ ├── CodeEdit-Icon-Pre-256.png │ │ ├── CodeEdit-Icon-Pre-512.png │ │ ├── CodeEdit-Icon-Pre-128@2x.png │ │ ├── CodeEdit-Icon-Pre-16@2x.png │ │ ├── CodeEdit-Icon-Pre-256@2x.png │ │ ├── CodeEdit-Icon-Pre-32@2x.png │ │ └── CodeEdit-Icon-Pre-512@2x.png │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── line.3.horizontal.decrease.chevron.imageset │ │ ├── line.3.horizontal.decrease.chevron.pdf │ │ └── Contents.json │ └── line.3.horizontal.decrease.chevron.filled.imageset │ │ ├── line.3.horizontal.decrease.chevron.filled.pdf │ │ └── Contents.json ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── World.swift ├── Utils │ ├── Extensions │ │ ├── Text │ │ │ └── Font+Caption3.swift │ │ ├── URL │ │ │ ├── URL+absolutePath.swift │ │ │ ├── URL+FuzzySearchable.swift │ │ │ ├── URL+Filename.swift │ │ │ ├── URL+componentCompare.swift │ │ │ ├── URL+ResouceValues.swift │ │ │ └── URL+FindWorkspace.swift │ │ ├── Collection │ │ │ └── Collection+subscript_safe.swift │ │ ├── View │ │ │ ├── View+focusedValue.swift │ │ │ └── View+isHovering.swift │ │ ├── NSTableView │ │ │ └── NSTableView+Background.swift │ │ ├── TextView │ │ │ ├── TextView+SemanticTokenRangeProvider.swift │ │ │ └── TextView+LSPRange.swift │ │ ├── String │ │ │ ├── String+Character.swift │ │ │ ├── String+RemoveOccurrences.swift │ │ │ ├── String+ValidFileName.swift │ │ │ └── String+Ranges.swift │ │ ├── NSWindow │ │ │ └── NSWindow+Child.swift │ │ ├── Bundle │ │ │ └── Bundle+Info.swift │ │ └── NSApplication │ │ │ └── NSApp+openWindow.swift │ ├── Protocols │ │ └── SearchableSettingsPage.swift │ ├── DependencyInjection │ │ ├── ServiceType.swift │ │ └── ServiceWrapper.swift │ ├── Environment │ │ ├── Env+IsFullscreen.swift │ │ └── Env+Window.swift │ └── FocusedValues.swift ├── SceneID.swift ├── Features │ ├── Feedback │ │ ├── Model │ │ │ ├── FeedbackType.swift │ │ │ └── FeedbackIssueArea.swift │ │ └── HelperView │ │ │ └── FeedbackToolbar.swift │ ├── CodeEditExtension │ │ └── README.md │ ├── SourceControl │ │ ├── Models │ │ │ ├── GitStashEntry.swift │ │ │ ├── GitRemote.swift │ │ │ ├── GitBranchesGroup.swift │ │ │ ├── GitBranch.swift │ │ │ └── GitStatus.swift │ │ ├── Accounts │ │ │ ├── GitHub │ │ │ │ ├── GitHubOpenness.swift │ │ │ │ ├── GitHubAccount.swift │ │ │ │ ├── Model │ │ │ │ │ ├── GitHubComment.swift │ │ │ │ │ └── GitHubFiles.swift │ │ │ │ ├── GitHubPreviewHeader.swift │ │ │ │ └── Routers │ │ │ │ │ └── GitHubUserRouter.swift │ │ │ ├── Parameters.swift │ │ │ ├── GitLab │ │ │ │ ├── GitLabAccount.swift │ │ │ │ ├── Model │ │ │ │ │ ├── GitLabAvatarURL.swift │ │ │ │ │ ├── GitLabGroupAccess.swift │ │ │ │ │ ├── GitLabProjectAccess.swift │ │ │ │ │ ├── GitLabPermissions.swift │ │ │ │ │ ├── GitLabEvent.swift │ │ │ │ │ └── GitLabEventNote.swift │ │ │ │ └── Routers │ │ │ │ │ └── GitLabUserRouter.swift │ │ │ ├── Bitbucket │ │ │ │ ├── BitBucketAccount.swift │ │ │ │ └── Routers │ │ │ │ │ └── BitBucketUserRouter.swift │ │ │ └── Utils │ │ │ │ ├── String+PercentEncoding.swift │ │ │ │ └── String+QueryParameters.swift │ │ ├── Client │ │ │ ├── GitClient+Initiate.swift │ │ │ ├── GitClient+Fetch.swift │ │ │ ├── GitClient+Pull.swift │ │ │ ├── GitClient+Validate.swift │ │ │ ├── GitConfigRepresentable.swift │ │ │ ├── GitClient+Push.swift │ │ │ └── GitConfigExtensions.swift │ │ └── Clone │ │ │ └── ViewModels │ │ │ └── GitCheckoutBranchViewModel.swift │ ├── Settings │ │ ├── Pages │ │ │ ├── ThemeSettings │ │ │ │ └── Models │ │ │ │ │ └── Theme+FuzzySearchable.swift │ │ │ ├── SearchSettings │ │ │ │ └── SearchSettingsIgnoreGlobPatternItemView.swift │ │ │ ├── LocationsSettings │ │ │ │ └── Models │ │ │ │ │ └── LocationsSettings.swift │ │ │ ├── SourceControlSettings │ │ │ │ └── IgnoredFilesListView.swift │ │ │ ├── NavigationSettings │ │ │ │ └── NavigationSettingsView.swift │ │ │ └── GeneralSettings │ │ │ │ └── View+actionBar.swift │ │ ├── Models │ │ │ ├── SettingsInjector.swift │ │ │ ├── PageAndSettings.swift │ │ │ ├── SettingsSearchResult.swift │ │ │ ├── GlobPattern.swift │ │ │ └── SettingsSidebarFix.swift │ │ ├── SettingsWindow.swift │ │ └── Views │ │ │ ├── View+HideSidebarToggle.swift │ │ │ ├── View+ConstrainHeightToWindow.swift │ │ │ └── SettingsPageView.swift │ ├── InspectorArea │ │ ├── Views │ │ │ ├── NoSelectionInspectorView.swift │ │ │ ├── InspectorSection.swift │ │ │ └── InspectorField.swift │ │ ├── ViewModels │ │ │ └── InspectorAreaViewModel.swift │ │ └── HistoryInspector │ │ │ └── HistoryInspectorItemView.swift │ ├── LSP │ │ ├── Editor │ │ │ └── SemanticTokenMapRangeProvider.swift │ │ └── LanguageServer │ │ │ ├── Capabilities │ │ │ ├── LanguageServer+FoldingRange.swift │ │ │ ├── LanguageServer+DocumentSymbol.swift │ │ │ ├── LanguageServer+DocumentLink.swift │ │ │ ├── LanguageServer+Declaration.swift │ │ │ ├── LanguageServer+SignatureHelp.swift │ │ │ ├── LanguageServer+Hover.swift │ │ │ ├── LanguageServer+Implementation.swift │ │ │ ├── LanguageServer+TypeDefinition.swift │ │ │ ├── LanguageServer+SelectionRange.swift │ │ │ ├── LanguageServer+ColorPresentation.swift │ │ │ └── LanguageServer+References.swift │ │ │ └── LSPCache+Data.swift │ ├── StatusBar │ │ ├── Models │ │ │ └── ImageDimensions.swift │ │ ├── Views │ │ │ └── StatusBarItems │ │ │ │ ├── StatusBarLineEndSelector.swift │ │ │ │ ├── StatusBarEncodingSelector.swift │ │ │ │ ├── StatusBarBreakpointButton.swift │ │ │ │ ├── StatusBarMenuStyle.swift │ │ │ │ └── StatusBarIndentSelector.swift │ │ └── ViewModels │ │ │ └── StatusBarViewModel.swift │ ├── Keybindings │ │ └── default_keybindings.json │ ├── Extensions │ │ ├── codeedit.extension.appextensionpoint │ │ ├── ExtensionsManager.swift │ │ ├── ExtensionActivatorView.swift │ │ └── ExtensionManagerWindow.swift │ ├── TerminalEmulator │ │ └── codeedit_shell_integration_login.zsh │ ├── Documents │ │ ├── WorkspaceDocument │ │ │ ├── WorkspaceDocument+Listeners.swift │ │ │ └── WorkspaceStateKey.swift │ │ ├── Indexer │ │ │ └── FileHelper.swift │ │ └── CodeFileDocument │ │ │ └── FileEncoding.swift │ ├── About │ │ ├── Views │ │ │ └── AboutWindow.swift │ │ └── Acknowledgements │ │ │ └── Views │ │ │ ├── ParsePackagesResolved.swift │ │ │ └── AcknowledgementsView.swift │ ├── ActivityViewer │ │ ├── Models │ │ │ └── TaskNotificationModel.swift │ │ └── Tasks │ │ │ ├── ActiveTaskView.swift │ │ │ ├── DropdownMenuItemStyleModifier.swift │ │ │ ├── OptionMenuItemView.swift │ │ │ └── TaskView.swift │ ├── UtilityArea │ │ ├── Toolbar │ │ │ ├── UtilityAreaClearButton.swift │ │ │ ├── UtilityAreaSplitTerminalButton.swift │ │ │ └── UtilityAreaMaximizeButton.swift │ │ ├── ViewModels │ │ │ └── UtilityAreaTabViewModel.swift │ │ ├── Views │ │ │ ├── OSLogType+Color.swift │ │ │ ├── View+paneToolbar.swift │ │ │ └── UtilityAreaView.swift │ │ ├── DebugUtility │ │ │ └── TaskOutputView.swift │ │ └── Models │ │ │ └── UtilityAreaTerminal.swift │ ├── CodeEditUI │ │ └── Views │ │ │ ├── PanelDivider.swift │ │ │ ├── Divided.swift │ │ │ ├── SearchPanel.swift │ │ │ └── MenuWithButtonStyle.swift │ ├── Editor │ │ ├── Models │ │ │ └── Environment+ActiveEditor.swift │ │ ├── TabBar │ │ │ ├── Tabs │ │ │ │ └── Tab │ │ │ │ │ ├── Models │ │ │ │ │ ├── EditorTabRepresentable.swift │ │ │ │ │ └── EditorItemID.swift │ │ │ │ │ └── EditorTabButtonStyle.swift │ │ │ └── Views │ │ │ │ ├── EditorTabBarDivider.swift │ │ │ │ ├── EditorTabBarView.swift │ │ │ │ └── EditorTabBarAccessory.swift │ │ └── Views │ │ │ ├── WindowCodeFileView.swift │ │ │ └── LoadingFileView.swift │ ├── NavigatorArea │ │ ├── ViewModels │ │ │ └── NavigatorAreaViewModel.swift │ │ ├── SourceControlNavigator │ │ │ ├── Repository │ │ │ │ └── Models │ │ │ │ │ └── RepoOutlineGroupItem.swift │ │ │ └── Changes │ │ │ │ └── Views │ │ │ │ └── SourceControlNavigatorNoRemotesView.swift │ │ └── ProjectNavigator │ │ │ ├── ProjectNavigatorView.swift │ │ │ └── OutlineView │ │ │ └── ProjectNavigatorViewController+NSMenuDelegate.swift │ ├── SplitView │ │ ├── Model │ │ │ ├── Environment+SplitEditor.swift │ │ │ └── Environment+ContentInsets.swift │ │ └── Views │ │ │ ├── Variadic.swift │ │ │ └── SplitView.swift │ ├── WindowCommands │ │ ├── ExtensionCommands.swift │ │ ├── CodeEditCommands.swift │ │ ├── HelpCommands.swift │ │ ├── Utils │ │ │ ├── KeyWindowControllerObserver.swift │ │ │ └── FirstResponderPropertyWrapper.swift │ │ ├── MainCommands.swift │ │ └── WindowCommands.swift │ ├── CEWorkspaceSettings │ │ └── Models │ │ │ └── CEWorkspaceSettingsData+ProjectSettings.swift │ ├── Tasks │ │ └── Models │ │ │ └── CETaskStatus.swift │ ├── Welcome │ │ └── Views │ │ │ └── Resources │ │ │ └── en.lproj │ │ │ └── Localizable.strings │ ├── Search │ │ └── FuzzySearch │ │ │ ├── FuzzySearchModels.swift │ │ │ └── Collection+FuzzySearch.swift │ └── OpenQuickly │ │ └── Views │ │ └── OpenQuicklyPreviewView.swift ├── Localization │ └── Localized+Ex.swift ├── ShellIntegration │ ├── codeedit_shell_integration_profile.zsh │ └── codeedit_shell_integration_env.zsh ├── CodeEdit.entitlements └── CodeEditApp.swift ├── OpenWithCodeEdit ├── Media.xcassets │ ├── Contents.json │ └── icon.iconset │ │ ├── icon_128x128.png │ │ ├── icon_16x16.png │ │ ├── icon_256x256.png │ │ ├── icon_32x32.png │ │ ├── icon_512x512.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_256x256@2x.png │ │ └── icon_512x512@2x.png └── OpenWithCodeEdit.entitlements ├── Documentation.docc ├── CodeEditUI │ ├── Resources │ │ ├── BranchPicker_View.png │ │ ├── FontPicker_View.png │ │ ├── HelpButton_View.png │ │ └── SegmentedControl_View.png │ ├── HelpButton.md │ ├── SegmentedControl.md │ └── CodeEditUI.md ├── AppPreferences │ ├── Sections │ │ ├── GeneralPreferencesView.md │ │ ├── TerminalPreferencesView.md │ │ ├── KeybindingsPreferencesView.md │ │ ├── TextEditingPreferencesView.md │ │ ├── ThemePreferencesView.md │ │ ├── SourceControlPreferencesView.md │ │ └── AccountPreferencesView.md │ └── AppPreferences.md ├── Welcome │ └── Welcome Window.md ├── KeyChain │ └── CodeEditKeychain.md ├── FileManagement │ └── FileManagement.md ├── App Window │ ├── TabBarView.md │ ├── StatusBarView.md │ ├── UtilityAreaView.md │ ├── InspectorSidebarView.md │ └── App Window.md └── About │ └── About Window.md ├── CodeEditTests └── Features │ ├── CodeEditUI │ ├── __Snapshots__ │ │ ├── UnitTests │ │ │ ├── testEffectViewDark.1.png │ │ │ ├── testEffectViewLight.1.png │ │ │ ├── testHelpButtonDark.1.png │ │ │ ├── testHelpButtonLight.1.png │ │ │ ├── testBranchPickerDark.1.png │ │ │ ├── testBranchPickerLight.1.png │ │ │ ├── testFontPickerViewDark.1.png │ │ │ ├── testFontPickerViewLight.1.png │ │ │ ├── testSegmentedControlDark.1.png │ │ │ ├── testSegmentedControlLight.1.png │ │ │ ├── testSegmentedControlProminentDark.1.png │ │ │ └── testSegmentedControlProminentLight.1.png │ │ └── CodeEditUITests │ │ │ ├── testEffectViewDark.1.png │ │ │ ├── testHelpButtonDark.1.png │ │ │ ├── testBranchPickerDark.1.png │ │ │ ├── testBranchPickerLight.1.png │ │ │ ├── testEffectViewLight.1.png │ │ │ ├── testHelpButtonLight.1.png │ │ │ ├── testFontPickerViewDark.1.png │ │ │ ├── testFontPickerViewLight.1.png │ │ │ ├── testSegmentedControlDark.1.png │ │ │ ├── testSegmentedControlLight.1.png │ │ │ ├── testSegmentedControlProminentDark.1.png │ │ │ └── testSegmentedControlProminentLight.1.png │ └── CodeEditUITests-Bridging-Header.h │ ├── Welcome │ └── __Snapshots__ │ │ └── WelcomeTests │ │ ├── testRecentJSFileDarkSnapshot.1.png │ │ ├── testRecentJSFileLightSnapshot.1.png │ │ ├── testRecentProjectItemDarkSnapshot.1.png │ │ ├── testRecentProjectItemLightSnapshot.1.png │ │ ├── testWelcomeActionViewDarkSnapshot.1.png │ │ └── testWelcomeActionViewLightSnapshot.1.png │ ├── Acknowledgements │ └── AcknowledgementsTests.swift │ └── Documents │ └── Mocks │ └── NSHapticFeedbackPerformerMock.swift ├── CodeEdit.xcodeproj └── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ ├── WorkspaceSettings.xcsettings │ └── IDEWorkspaceChecks.plist ├── Configs ├── Pre.xcconfig ├── Beta.xcconfig ├── Debug.xcconfig ├── Alpha.xcconfig └── Release.xcconfig ├── CodeEditUITests └── Extensions │ └── XCUITest+waitForNonExistence.swift ├── .swiftlint.yml └── LICENSE.md /AppCast/.gitignore: -------------------------------------------------------------------------------- 1 | _site 2 | .sass-cache 3 | .jekyll-metadata 4 | -------------------------------------------------------------------------------- /AppCast/appcast.xml: -------------------------------------------------------------------------------- 1 | --- 2 | release_only: true 3 | --- 4 | {%include appcast.inc %} 5 | -------------------------------------------------------------------------------- /AppCast/appcast_pre.xml: -------------------------------------------------------------------------------- 1 | --- 2 | release_only: false 3 | --- 4 | {%include appcast.inc %} 5 | -------------------------------------------------------------------------------- /Resources/dmgBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/Resources/dmgBackground.png -------------------------------------------------------------------------------- /.github/CodeEdit-Icon-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/.github/CodeEdit-Icon-128@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Icons/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Custom Colors/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /CodeEdit/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /.github/scripts/remove_todos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | grep -rl TODO . | xargs sed -i 's/TODO/notaTODO/g' 3 | grep -rl FIXME . | xargs sed -i 's/FIXME/notaFIXME/g' 4 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-128.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-16.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-256.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-32.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-512.png -------------------------------------------------------------------------------- /Documentation.docc/CodeEditUI/Resources/BranchPicker_View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/Documentation.docc/CodeEditUI/Resources/BranchPicker_View.png -------------------------------------------------------------------------------- /Documentation.docc/CodeEditUI/Resources/FontPicker_View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/Documentation.docc/CodeEditUI/Resources/FontPicker_View.png -------------------------------------------------------------------------------- /Documentation.docc/CodeEditUI/Resources/HelpButton_View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/Documentation.docc/CodeEditUI/Resources/HelpButton_View.png -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_128x128.png -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_16x16.png -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_256x256.png -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_32x32.png -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_512x512.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-128@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-16@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-256@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-32@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIcon.appiconset/CodeEdit-512@2x.png -------------------------------------------------------------------------------- /CodeEdit/World.swift: -------------------------------------------------------------------------------- 1 | var currentWorld: World = .init() 2 | 3 | // Inspired by: https://vimeo.com/291588126 4 | struct World { 5 | var shellClient: ShellClient = .live() 6 | } 7 | -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-128.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-16.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-256.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-32.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-512.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Icons/GitHubIcon.imageset/GitHubIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/Icons/GitHubIcon.imageset/GitHubIcon.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Icons/GitLabIcon.imageset/GitLabIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/Icons/GitLabIcon.imageset/GitLabIcon.png -------------------------------------------------------------------------------- /Documentation.docc/AppPreferences/Sections/GeneralPreferencesView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/GeneralSettingsView`` 2 | 3 | ## Topics 4 | 5 | ### Model 6 | 7 | - ``Settings/GeneralSettings`` 8 | -------------------------------------------------------------------------------- /Documentation.docc/AppPreferences/Sections/TerminalPreferencesView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/TerminalSettingsView`` 2 | 3 | ## Topics 4 | 5 | ### Model 6 | 7 | - ``Settings/TerminalSettings`` 8 | -------------------------------------------------------------------------------- /Documentation.docc/CodeEditUI/Resources/SegmentedControl_View.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/Documentation.docc/CodeEditUI/Resources/SegmentedControl_View.png -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/OpenWithCodeEdit/Media.xcassets/icon.iconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-128.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-16.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-256.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-32.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-512.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-16@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-32@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-128.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-16.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-256.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-32.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-512.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-128@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-16@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-256@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-32@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconBeta.appiconset/CodeEditBeta-512@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-128@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-256@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconDev.appiconset/CodeEditDev-512@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-16.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-32.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Icons/BitBucketIcon.imageset/BitBucketIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/Icons/BitBucketIcon.imageset/BitBucketIcon.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Icons/GitHubIcon.imageset/GitHubIcon-Dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/Icons/GitHubIcon.imageset/GitHubIcon-Dark.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Icons/GitLabIcon.imageset/GitLabIcon-Dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/Icons/GitLabIcon.imageset/GitLabIcon-Dark.png -------------------------------------------------------------------------------- /Documentation.docc/AppPreferences/Sections/KeybindingsPreferencesView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/KeybindingsSettingsView`` 2 | 3 | ## Topics 4 | 5 | ### Model 6 | 7 | - ``Settings/KeybindingsSettings`` 8 | -------------------------------------------------------------------------------- /Documentation.docc/AppPreferences/Sections/TextEditingPreferencesView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/TextEditingSettingsView`` 2 | 3 | ## Topics 4 | 5 | ### Model 6 | 7 | - ``Settings/TextEditingSettings`` 8 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-128@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-16@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-256@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-32@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconAlpha.appiconset/CodeEditAlpha-512@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-128.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-256.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-512.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-128@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-16@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-256@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-32@2x.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/AppIconPre.appiconset/CodeEdit-Icon-Pre-512@2x.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testEffectViewDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testEffectViewDark.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testEffectViewLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testEffectViewLight.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testHelpButtonDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testHelpButtonDark.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testHelpButtonLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testHelpButtonLight.1.png -------------------------------------------------------------------------------- /CodeEdit.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testBranchPickerDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testBranchPickerDark.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testBranchPickerLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testBranchPickerLight.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testFontPickerViewDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testFontPickerViewDark.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testEffectViewDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testEffectViewDark.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testHelpButtonDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testHelpButtonDark.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testFontPickerViewLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testFontPickerViewLight.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testSegmentedControlDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testSegmentedControlDark.1.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testBranchPickerDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testBranchPickerDark.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testBranchPickerLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testBranchPickerLight.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testEffectViewLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testEffectViewLight.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testHelpButtonLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testHelpButtonLight.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testSegmentedControlLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testSegmentedControlLight.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testFontPickerViewDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testFontPickerViewDark.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testFontPickerViewLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testFontPickerViewLight.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testRecentJSFileDarkSnapshot.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testRecentJSFileDarkSnapshot.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testRecentJSFileLightSnapshot.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testRecentJSFileLightSnapshot.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testSegmentedControlDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testSegmentedControlDark.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testSegmentedControlLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testSegmentedControlLight.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testSegmentedControlProminentDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testSegmentedControlProminentDark.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testSegmentedControlProminentLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/UnitTests/testSegmentedControlProminentLight.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testRecentProjectItemDarkSnapshot.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testRecentProjectItemDarkSnapshot.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testRecentProjectItemLightSnapshot.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testRecentProjectItemLightSnapshot.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testWelcomeActionViewDarkSnapshot.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testWelcomeActionViewDarkSnapshot.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testWelcomeActionViewLightSnapshot.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/Welcome/__Snapshots__/WelcomeTests/testWelcomeActionViewLightSnapshot.1.png -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testSegmentedControlProminentDark.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testSegmentedControlProminentDark.1.png -------------------------------------------------------------------------------- /Documentation.docc/CodeEditUI/HelpButton.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/HelpButton`` 2 | 3 | ## Usage 4 | 5 | ```swift 6 | HelpButton { 7 | // an action to perform on click 8 | } 9 | ``` 10 | 11 | ## Preview 12 | 13 | ![Help Button](HelpButton_View.png) 14 | -------------------------------------------------------------------------------- /Documentation.docc/Welcome/Welcome Window.md: -------------------------------------------------------------------------------- 1 | # Welcome Window 2 | 3 | ## Topics 4 | 5 | ### Views 6 | 7 | - ``WelcomeWindowView`` 8 | - ``WelcomeView`` 9 | - ``WelcomeActionView`` 10 | 11 | - ``RecentProjectsView`` 12 | - ``RecentProjectItem`` 13 | -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testSegmentedControlProminentLight.1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEditTests/Features/CodeEditUI/__Snapshots__/CodeEditUITests/testSegmentedControlProminentLight.1.png -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/line.3.horizontal.decrease.chevron.imageset/line.3.horizontal.decrease.chevron.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/line.3.horizontal.decrease.chevron.imageset/line.3.horizontal.decrease.chevron.pdf -------------------------------------------------------------------------------- /Documentation.docc/KeyChain/CodeEditKeychain.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/CodeEditKeychain`` 2 | 3 | ## Topics 4 | 5 | ### Articles 6 | 7 | - 8 | 9 | ### Enumerations 10 | 11 | - ``CodeEditKeychainAccessOptions`` 12 | - ``CodeEditKeychainConstants`` 13 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Icons/BitBucketIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "BitBucketIcon.png", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/line.3.horizontal.decrease.chevron.filled.imageset/line.3.horizontal.decrease.chevron.filled.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamkin-skuf/CodeEdit/HEAD/CodeEdit/Assets.xcassets/line.3.horizontal.decrease.chevron.filled.imageset/line.3.horizontal.decrease.chevron.filled.pdf -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/Text/Font+Caption3.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Font+Caption3.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 19/01/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | extension Font { 11 | static var caption3: Font { .system(size: 11, weight: .medium) } 12 | } 13 | -------------------------------------------------------------------------------- /CodeEdit/SceneID.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SceneID.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 15/03/2023. 6 | // 7 | 8 | import Foundation 9 | 10 | enum SceneID: String, CaseIterable { 11 | case welcome 12 | case about 13 | case extensions 14 | case settings 15 | } 16 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Protocols/SearchableSettingsPage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SearchableSettingsPage.swift 3 | // CodeEdit 4 | // 5 | // Created by Raymond Vleeshouwer on 07/07/23. 6 | // 7 | 8 | import Foundation 9 | 10 | protocol SearchableSettingsPage { 11 | var searchKeys: [String] { get } 12 | } 13 | -------------------------------------------------------------------------------- /CodeEdit/Features/Feedback/Model/FeedbackType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FeedbackType.swift 3 | // CodeEditModules/Feedback 4 | // 5 | // Created by Nanashi Li on 2022/04/14. 6 | // 7 | 8 | import Foundation 9 | 10 | struct FeedbackType: Identifiable, Hashable { 11 | let name: String 12 | let id: String 13 | } 14 | -------------------------------------------------------------------------------- /CodeEdit/Features/CodeEditExtension/README.md: -------------------------------------------------------------------------------- 1 | # CodeEditExtension 2 | 3 | This module handles enything that is extension related. For example the loading and unloading of the extensions and interfacing with extensions. This module does NOT handle things related to the ExtensionStore. For that, please see `ExtensionsStore` 4 | -------------------------------------------------------------------------------- /CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Models/GitStashEntry.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitStashEntry.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/20/23. 6 | // 7 | 8 | import Foundation 9 | 10 | struct GitStashEntry: Hashable { 11 | let index: Int 12 | let message: String 13 | let date: Date 14 | } 15 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/URL/URL+absolutePath.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URL+LanguageServer.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 9/8/24. 6 | // 7 | 8 | import Foundation 9 | 10 | extension URL { 11 | var absolutePath: String { 12 | absoluteURL.path(percentEncoded: false) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CodeEdit/Features/Feedback/Model/FeedbackIssueArea.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FeedbackIssueArea.swift 3 | // CodeEditModules/Feedback 4 | // 5 | // Created by Nanashi Li on 2022/04/14. 6 | // 7 | 8 | import Foundation 9 | 10 | struct FeedbackIssueArea: Identifiable, Hashable { 11 | let name: String 12 | let id: String 13 | } 14 | -------------------------------------------------------------------------------- /CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Documentation.docc/AppPreferences/Sections/ThemePreferencesView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/ThemeSettingsView`` 2 | 3 | ## Topics 4 | 5 | ### Model 6 | 7 | - ``Settings/ThemeSettings`` 8 | - ``ThemeModel`` 9 | 10 | ### Views 11 | 12 | - ``PreviewThemeView`` 13 | - ``TerminalThemeView`` 14 | - ``EditorThemeView`` 15 | - ``ThemePreviewIcon`` 16 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitHub/GitHubOpenness.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitHubOpenness.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanshi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | enum GitHubOpenness: String, Codable { 11 | case open 12 | case closed 13 | case all 14 | } 15 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/URL/URL+FuzzySearchable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URL+FuzzySearchable.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 03.02.24. 6 | // 7 | 8 | import Foundation 9 | 10 | extension URL: FuzzySearchable { 11 | var searchableString: String { 12 | return self.lastPathComponent 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflows/CI-release-notes.yml: -------------------------------------------------------------------------------- 1 | name: Deploy Website on Release Note Changes 2 | 3 | on: 4 | release: 5 | types: [created, edited, deleted] 6 | 7 | jobs: 8 | deploy: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: Send deploy request to Vercel 12 | run: curl -X POST ${{ secrets.VERCEL_DEPLOY_URL }} 13 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/URL/URL+Filename.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URL+Filename.swift 3 | // CodeEdit 4 | // 5 | // Created by Axel Martinez on 5/8/24. 6 | // 7 | 8 | import Foundation 9 | 10 | extension URL { 11 | var fileName: String { 12 | self.lastPathComponent.trimmingCharacters(in: .whitespacesAndNewlines) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Documentation.docc/AppPreferences/Sections/SourceControlPreferencesView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/SourceControlSettingsView`` 2 | 3 | ## Topics 4 | 5 | ### Model 6 | 7 | - ``Settings/SourceControlSettings`` 8 | - ``IgnoredFiles`` 9 | 10 | ### Views 11 | 12 | - ``SourceControlGeneralView`` 13 | - ``SourceControlGitView`` 14 | - ``IgnoredFileView`` 15 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Pages/ThemeSettings/Models/Theme+FuzzySearchable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Theme+FuzzySearchable.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 14.08.24. 6 | // 7 | 8 | import Foundation 9 | 10 | extension Theme: FuzzySearchable { 11 | var searchableString: String { 12 | return id 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /CodeEdit/Features/InspectorArea/Views/NoSelectionInspectorView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NoSelectionView.swift 3 | // CodeEdit 4 | // 5 | // Created by Nanashi Li on 2022/04/18. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct NoSelectionInspectorView: View { 11 | var body: some View { 12 | CEContentUnavailableView("No Selection") 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: SwiftLint 2 | 3 | on: 4 | workflow_dispatch: 5 | workflow_call: 6 | 7 | jobs: 8 | SwiftLint: 9 | runs-on: [self-hosted, macOS] # ubuntu-latest 10 | steps: 11 | - uses: actions/checkout@v3 12 | - name: GitHub Action for SwiftLint 13 | run: swiftlint --reporter github-actions-logging --strict 14 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/Editor/SemanticTokenMapRangeProvider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SemanticTokenMapRangeProvider.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 12/19/24. 6 | // 7 | 8 | import Foundation 9 | 10 | @MainActor 11 | protocol SemanticTokenMapRangeProvider { 12 | func nsRangeFrom(line: UInt32, char: UInt32, length: UInt32) -> NSRange? 13 | } 14 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Models/GitRemote.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitRemote.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/17/23. 6 | // 7 | 8 | import Foundation 9 | 10 | struct GitRemote: Hashable { 11 | let name: String 12 | let pushLocation: String 13 | let fetchLocation: String 14 | var branches: [GitBranch] = [] 15 | } 16 | -------------------------------------------------------------------------------- /CodeEditTests/Features/CodeEditUI/CodeEditUITests-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // CodeEditUITests-Bridging-Header.h 3 | // CodeEditUITests 4 | // 5 | // Created by Matthijs Eikelenboom on 29/11/2022. 6 | // 7 | 8 | #ifndef CodeEditUITests_Bridging_Header_h 9 | #define CodeEditUITests_Bridging_Header_h 10 | 11 | 12 | #endif /* CodeEditUITests_Bridging_Header_h */ 13 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Client/GitClient+Initiate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitClient+Initiate.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/16/23. 6 | // 7 | 8 | import Foundation 9 | 10 | extension GitClient { 11 | /// Initiate Git repository 12 | func initiate() async throws { 13 | _ = try await run("init") 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /CodeEdit/Features/StatusBar/Models/ImageDimensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageDimensions.swift 3 | // CodeEdit 4 | // 5 | // Created by Paul Ebose on 2024/5/13. 6 | // 7 | 8 | import Foundation 9 | 10 | /// Helper struct used to store the (width x height) of the currently opened image. 11 | struct ImageDimensions { 12 | var width: Int 13 | var height: Int 14 | } 15 | -------------------------------------------------------------------------------- /Configs/Pre.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Pre.xcconfig 3 | // CodeEdit 4 | // 5 | // Created by Johnathan Baird on 3/11/24. 6 | // 7 | 8 | // Configuration settings file format documentation can be found at: 9 | // https://help.apple.com/xcode/#/dev745c5c974 10 | 11 | CE_APPICON_NAME = AppIconPre 12 | CE_VERSION_POSTFIX = -pre 13 | CE_COPYRIGHT = Copyright © 2022-2025 CodeEdit 14 | -------------------------------------------------------------------------------- /Configs/Beta.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Beta.xcconfig 3 | // CodeEdit 4 | // 5 | // Created by Lukas Pistrol on 14.01.23. 6 | // 7 | 8 | // Configuration settings file format documentation can be found at: 9 | // https://help.apple.com/xcode/#/dev745c5c974 10 | 11 | CE_APPICON_NAME = AppIconBeta 12 | CE_VERSION_POSTFIX = -beta 13 | CE_COPYRIGHT = Copyright © 2022-2025 CodeEdit 14 | -------------------------------------------------------------------------------- /Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Debug.xcconfig 3 | // CodeEdit 4 | // 5 | // Created by Lukas Pistrol on 14.01.23. 6 | // 7 | 8 | // Configuration settings file format documentation can be found at: 9 | // https://help.apple.com/xcode/#/dev745c5c974 10 | 11 | CE_APPICON_NAME = AppIconDev 12 | CE_VERSION_POSTFIX = -dev 13 | CE_COPYRIGHT = Copyright © 2022-2025 CodeEdit 14 | -------------------------------------------------------------------------------- /CodeEdit/Features/Keybindings/default_keybindings.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "copy", "name": "copy", "description": "Copy command", "context": "Global", "modifier": "command", "keybinding": "c" 4 | }, 5 | { 6 | "id": "paste", "name": "paste", "description": "Copy command", "context": "Global", "modifier": "command", "keybinding": "c" 7 | } 8 | 9 | ] 10 | -------------------------------------------------------------------------------- /Configs/Alpha.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Alpha.xcconfig 3 | // CodeEdit 4 | // 5 | // Created by Lukas Pistrol on 14.01.23. 6 | // 7 | 8 | // Configuration settings file format documentation can be found at: 9 | // https://help.apple.com/xcode/#/dev745c5c974 10 | 11 | CE_APPICON_NAME = AppIconAlpha 12 | CE_VERSION_POSTFIX = -alpha 13 | CE_COPYRIGHT = Copyright © 2022-2025 CodeEdit 14 | -------------------------------------------------------------------------------- /.github/workflows/CI-pull-request.yml: -------------------------------------------------------------------------------- 1 | name: CI - Pull Request 2 | on: 3 | pull_request: 4 | branches: 5 | - 'main' 6 | workflow_dispatch: 7 | jobs: 8 | swiftlint: 9 | name: SwiftLint 10 | uses: ./.github/workflows/lint.yml 11 | secrets: inherit 12 | test: 13 | name: Testing CodeEdit 14 | needs: swiftlint 15 | uses: ./.github/workflows/tests.yml 16 | secrets: inherit 17 | -------------------------------------------------------------------------------- /CodeEdit/Features/Extensions/codeedit.extension.appextensionpoint: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | codeedit.extension 6 | 7 | EXPresentsUserInterface 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Client/GitClient+Fetch.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitClient+Fetch.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/18/23. 6 | // 7 | 8 | import Foundation 9 | 10 | extension GitClient { 11 | /// Fetch changes to remote 12 | func fetchFromRemote() async throws { 13 | let command = "fetch" 14 | 15 | _ = try await self.run(command) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Documentation.docc/CodeEditUI/SegmentedControl.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/SegmentedControl`` 2 | 3 | ## Usage 4 | 5 | ```swift 6 | @State var selected: Int = 0 7 | var items: [String] = ["Tab 1", "Tab 2"] 8 | 9 | SegmentedControl($selected, options: items) 10 | ``` 11 | 12 | ## Preview 13 | 14 | ![Segmented Control](SegmentedControl_View.png) 15 | 16 | ## Topics 17 | 18 | ### Item 19 | 20 | - ``SegmentedControlItem`` 21 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Models/GitBranchesGroup.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitBranchesGroup.swift 3 | // CodeEdit 4 | // 5 | // Created by Federico Zivolo on 22/01/24. 6 | // 7 | 8 | import Foundation 9 | 10 | struct GitBranchesGroup: Hashable { 11 | let name: String 12 | var branches: [GitBranch] 13 | var shouldNest: Bool { 14 | branches.first?.name.hasPrefix(name + "/") ?? false 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CodeEdit/Features/TerminalEmulator/codeedit_shell_integration_login.zsh: -------------------------------------------------------------------------------- 1 | # Modified from Microsoft's VSCode. MIT License. 2 | # Permalink to original file: 3 | # https://github.com/microsoft/vscode/blob/60d7343892f10e0c5f09cb55a6a3f268eb0dd4fb/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-login.zsh 4 | 5 | ZDOTDIR=$USER_ZDOTDIR 6 | if [[ -o "login" && -f $ZDOTDIR/.zlogin ]]; then 7 | . $ZDOTDIR/.zlogin 8 | fi 9 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Pages/SearchSettings/SearchSettingsIgnoreGlobPatternItemView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SearchSettingsIgnoreGlobPatternItemView.swift 3 | // CodeEdit 4 | // 5 | // Created by Esteban on 12/10/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct SearchSettingsIgnoreGlobPatternItemView: View { 11 | @Binding var globPattern: String 12 | 13 | var body: some View { 14 | Text(globPattern) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | # Allow running it manually in case we forget to label a PR before merging 5 | workflow_dispatch: 6 | workflow_call: 7 | 8 | jobs: 9 | update_release_draft: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - id: release 13 | uses: release-drafter/release-drafter@v5 14 | env: 15 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 16 | -------------------------------------------------------------------------------- /CodeEdit/Localization/Localized+Ex.swift: -------------------------------------------------------------------------------- 1 | import SwiftUI 2 | 3 | extension String { 4 | func localized(_ custom: String? = nil) -> LocalizedStringKey { 5 | if let custom { 6 | return LocalizedStringKey(custom) 7 | } else { 8 | return LocalizedStringKey(self) 9 | } 10 | } 11 | } 12 | 13 | extension LocalizedStringKey { 14 | static let helloWorld = "Hello, world!".localized() 15 | } 16 | -------------------------------------------------------------------------------- /Documentation.docc/FileManagement/FileManagement.md: -------------------------------------------------------------------------------- 1 | # File Management 2 | 3 | Working with files and directories in CodeEdit. 4 | 5 | ## Overview 6 | 7 | CodeEdit manages files using three classes: 8 | - ``CEWorkspaceFile`` for representing files and other file system objects. 9 | - ``CEWorkspaceFileManager`` for loading, modifying, and listening to the file system. 10 | - ``CodeFileDocument`` for loading contents of files for editing. 11 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/line.3.horizontal.decrease.chevron.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "line.3.horizontal.decrease.chevron.pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | }, 12 | "properties" : { 13 | "preserves-vector-representation" : true, 14 | "template-rendering-intent" : "template" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | // 2 | // Release.xcconfig 3 | // CodeEdit 4 | // 5 | // Created by Lukas Pistrol on 14.01.23. 6 | // 7 | 8 | // Configuration settings file format documentation can be found at: 9 | // https://help.apple.com/xcode/#/dev745c5c974 10 | 11 | CE_APPICON_NAME = AppIcon 12 | // CE_VERSION_POSTFIX = // this is a placeholder since we don't want a postfix in final release 13 | CE_COPYRIGHT = Copyright © 2022-2025 CodeEdit 14 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/Parameters.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Parameters.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | enum GitSortDirection: String { 11 | case asc 12 | case desc 13 | } 14 | 15 | enum GitSortType: String { 16 | case created 17 | case updated 18 | case popularity 19 | case longRunning = "long-running" 20 | } 21 | -------------------------------------------------------------------------------- /AppCast/_plugins/signature_filter.rb: -------------------------------------------------------------------------------- 1 | module Jekyll 2 | module SignatureFilter 3 | def sparkle_signature(release_body) 4 | regex = //m 5 | signature = release_body.match(regex).named_captures["signature"] 6 | raise "Didn't find a signature in the release body." if signature.empty? 7 | signature 8 | end 9 | end 10 | end 11 | 12 | Liquid::Template.register_filter(Jekyll::SignatureFilter) -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/line.3.horizontal.decrease.chevron.filled.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "line.3.horizontal.decrease.chevron.filled.pdf", 5 | "idiom" : "universal" 6 | } 7 | ], 8 | "info" : { 9 | "author" : "xcode", 10 | "version" : 1 11 | }, 12 | "properties" : { 13 | "preserves-vector-representation" : true, 14 | "template-rendering-intent" : "template" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /CodeEdit/Features/Documents/WorkspaceDocument/WorkspaceDocument+Listeners.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WorkspaceDocument+CommandListeners.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 6/5/22. 6 | // 7 | 8 | import Foundation 9 | import Combine 10 | 11 | class WorkspaceNotificationModel: ObservableObject { 12 | 13 | @Published var highlightedFileItem: CEWorkspaceFile? 14 | 15 | init() { 16 | highlightedFileItem = nil 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/Collection/Collection+subscript_safe.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Collection+subscript_safe.swift 3 | // CodeEdit 4 | // 5 | // Created by Paul Ebose on 2024/07/05. 6 | // 7 | 8 | import Foundation 9 | 10 | extension Collection { 11 | /// Returns the element at the specified index if it is within bounds, otherwise nil. 12 | subscript (safe index: Index) -> Element? { 13 | indices.contains(index) ? self[index] : nil 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Tests 2 | on: 3 | workflow_dispatch: 4 | workflow_call: 5 | jobs: 6 | test: 7 | name: Testing CodeEdit 8 | runs-on: [self-hosted, macOS] 9 | steps: 10 | - name: Checkout repository 11 | uses: actions/checkout@v3 12 | - name: Check Version Number exists 13 | run: exec ./.github/scripts/test_version_number.sh 14 | - name: Testing App 15 | run: exec ./.github/scripts/test_app.sh arm 16 | -------------------------------------------------------------------------------- /CodeEdit/Features/Documents/WorkspaceDocument/WorkspaceStateKey.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WorkspaceStateKey.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 7/3/23. 6 | // 7 | 8 | enum WorkspaceStateKey: String { 9 | case utilityAreaCollapsed 10 | case utilityAreaMaximized 11 | case utilityAreaHeight 12 | case openTabs 13 | case workspaceWindowSize 14 | case splitViewWidth 15 | case navigatorCollapsed 16 | case inspectorCollapsed 17 | } 18 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/View/View+focusedValue.swift: -------------------------------------------------------------------------------- 1 | // 2 | // View+focusedValue.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 18/06/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | extension View { 11 | func focusedValue( 12 | _ keyPath: WritableKeyPath, 13 | disabled: Bool, 14 | _ value: Value 15 | ) -> some View { 16 | focusedValue(keyPath, disabled ? nil : value) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitLab/GitLabAccount.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitLabAccount.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | // TODO: DOCS (Nanashi Li) 11 | 12 | struct GitLabAccount { 13 | let configuration: GitRouterConfiguration 14 | 15 | init(_ config: GitRouterConfiguration = GitLabTokenConfiguration()) { 16 | configuration = config 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitHub/GitHubAccount.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitHubAccount.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | // TODO: DOCS (Nanashi Li) 11 | 12 | struct GitHubAccount { 13 | let configuration: GitHubTokenConfiguration 14 | 15 | init(_ config: GitHubTokenConfiguration = GitHubTokenConfiguration()) { 16 | configuration = config 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | categories: 2 | - title: '✨ Enhancements' 3 | labels: 4 | - 'enhancement' 5 | - 'feature' 6 | - title: '🐞 Bug Fixes' 7 | labels: 8 | - 'bugfix' 9 | - 'bug' 10 | - title: '🧰 Maintenance' 11 | label: 12 | - 'chore' 13 | - 'documentation' 14 | - 'dependencies' 15 | template: | 16 | 17 | 18 | ## Changes 19 | 20 | $CHANGES 21 | 22 | 23 | -------------------------------------------------------------------------------- /CodeEdit/ShellIntegration/codeedit_shell_integration_profile.zsh: -------------------------------------------------------------------------------- 1 | # Modified from Microsoft's VSCode. MIT License. 2 | # Permalink to original file: 3 | # https://github.com/microsoft/vscode/blob/60d7343892f10e0c5f09cb55a6a3f268eb0dd4fb/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-profile.zsh 4 | 5 | if [[ -o "login" && -f $USER_ZDOTDIR/.zprofile ]]; then 6 | CE_ZDOTDIR=$ZDOTDIR 7 | ZDOTDIR=$USER_ZDOTDIR 8 | . $USER_ZDOTDIR/.zprofile 9 | ZDOTDIR=$CE_ZDOTDIR 10 | fi 11 | -------------------------------------------------------------------------------- /Documentation.docc/App Window/TabBarView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/TabBarView`` 2 | 3 | ## Topics 4 | 5 | ### Articles 6 | 7 | - 8 | 9 | ### Model 10 | 11 | - ``EditorTabID`` 12 | - ``EditorTabRepresentable`` 13 | 14 | ### Components 15 | 16 | - ``EditorTabView`` 17 | - ``TabBarContextMenu`` 18 | - ``EditorTabButtonStyle`` 19 | - ``TabDivider`` 20 | - ``TabBarTopDivider`` 21 | - ``TabBarBottomDivider`` 22 | - ``TabBarAccessoryIcon`` 23 | - ``TabBarXcodeBackground`` 24 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Models/SettingsInjector.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsInjector.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 28/04/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct SettingsInjector: View { 11 | 12 | @ObservedObject var settings = Settings.shared 13 | 14 | @ViewBuilder var content: Content 15 | 16 | var body: some View { 17 | content 18 | .environment(\.settings, settings.preferences) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CodeEdit/Features/About/Views/AboutWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AboutWindow.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 14/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct AboutWindow: Scene { 11 | var body: some Scene { 12 | Window("", id: SceneID.about.rawValue) { 13 | AboutView() 14 | } 15 | .defaultSize(width: 530, height: 220) 16 | .windowResizability(.contentSize) 17 | .windowStyle(.hiddenTitleBar) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CodeEdit/Features/ActivityViewer/Models/TaskNotificationModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TaskNotificationModel.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 21.06.24. 6 | // 7 | 8 | import Foundation 9 | 10 | /// Represents a notifications or tasks, that are displayed in the activity viewer 11 | struct TaskNotificationModel: Equatable { 12 | var id: String 13 | var title: String 14 | var message: String? 15 | var percentage: Double? 16 | var isLoading: Bool = false 17 | } 18 | -------------------------------------------------------------------------------- /Documentation.docc/CodeEditUI/CodeEditUI.md: -------------------------------------------------------------------------------- 1 | # CodeEditUI 2 | 3 | A collection of reusable UI elements for `CodeEdit`. 4 | 5 | ## Overview 6 | 7 | This module contains UI elements that can be reused throughout the `CodeEdit` app. 8 | 9 | ## Topics 10 | 11 | ### Controls 12 | 13 | - ``ToolbarBranchPicker`` 14 | - ``HelpButton`` 15 | - ``SegmentedControl`` 16 | - ``SettingsTextEditor`` 17 | 18 | ### Other 19 | 20 | - ``EffectView`` 21 | - ``OverlayPanel`` 22 | - ``PressActions`` 23 | - ``PanelDivider`` 24 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Models/PageAndSettings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PageAndSettings.swift 3 | // CodeEdit 4 | // 5 | // Created by Raymond Vleeshouwer on 10/07/23. 6 | // 7 | 8 | import Foundation 9 | 10 | struct PageAndSettings: Identifiable, Equatable { 11 | let id: UUID = UUID() 12 | let page: SettingsPage 13 | let settings: [SettingsPage] 14 | 15 | init(_ page: SettingsPage) { 16 | self.page = page 17 | self.settings = SettingsData().propertiesOf(page.name) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitLab/Model/GitLabAvatarURL.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitLabAvatarURL.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | class GitLabAvatarURL: Codable { 11 | var url: URL? 12 | 13 | init(_ json: [String: AnyObject]) { 14 | if let urlString = json["url"] as? String, let urlFromString = URL(string: urlString) { 15 | url = urlFromString 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Icons/GitHubIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "GitHubIcon.png", 5 | "idiom" : "universal" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "dark" 12 | } 13 | ], 14 | "filename" : "GitHubIcon-Dark.png", 15 | "idiom" : "universal" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Icons/GitLabIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "GitLabIcon.png", 5 | "idiom" : "universal" 6 | }, 7 | { 8 | "appearances" : [ 9 | { 10 | "appearance" : "luminosity", 11 | "value" : "dark" 12 | } 13 | ], 14 | "filename" : "GitLabIcon-Dark.png", 15 | "idiom" : "universal" 16 | } 17 | ], 18 | "info" : { 19 | "author" : "xcode", 20 | "version" : 1 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/NSTableView/NSTableView+Background.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSTableView+Background.swift 3 | // CodeEdit 4 | // 5 | // Created by Lukas Pistrol on 20.04.22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | extension NSTableView { 11 | /// Allows to set a lists background color in SwiftUI 12 | override open func viewDidMoveToWindow() { 13 | super.viewDidMoveToWindow() 14 | 15 | backgroundColor = NSColor.clear 16 | enclosingScrollView?.drawsBackground = false 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Features/UtilityArea/Toolbar/UtilityAreaClearButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UtilityAreaClearButton.swift 3 | // CodeEdit 4 | // 5 | // Created by Stef Kors on 12/04/2022. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct UtilityAreaClearButton: View { 11 | var body: some View { 12 | Button { 13 | // Clear terminal 14 | } label: { 15 | Image(systemName: "trash") 16 | .foregroundColor(.secondary) 17 | } 18 | .buttonStyle(.plain) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CodeEdit/Features/UtilityArea/ViewModels/UtilityAreaTabViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UtilityAreaTabViewModel.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 5/31/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | class UtilityAreaTabViewModel: ObservableObject { 11 | @Published var leadingSidebarIsCollapsed: Bool = false 12 | 13 | @Published var trailingSidebarIsCollapsed: Bool = false 14 | 15 | @Published var hasLeadingSidebar: Bool = false 16 | 17 | @Published var hasTrailingSidebar: Bool = false 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Features/CodeEditUI/Views/PanelDivider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PanelDivider.swift 3 | // 4 | // 5 | // Created by Austin Condiff on 5/10/22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct PanelDivider: View { 11 | @Environment(\.colorScheme) 12 | private var colorScheme 13 | 14 | var body: some View { 15 | Divider() 16 | .opacity(0) 17 | .overlay( 18 | Color(.black) 19 | .opacity(colorScheme == .dark ? 0.65 : 0.13) 20 | ) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CodeEdit/Features/Editor/Models/Environment+ActiveEditor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Environment+ActiveEditor.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 06/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ActiveEditorEnvironmentKey: EnvironmentKey { 11 | static var defaultValue = false 12 | } 13 | 14 | extension EnvironmentValues { 15 | var isActiveEditor: Bool { 16 | get { self[ActiveEditorEnvironmentKey.self] } 17 | set { self[ActiveEditorEnvironmentKey.self] = newValue } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitLab/Model/GitLabGroupAccess.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitLabGroupAccess.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | class GitLabGroupAccess: Codable { 11 | var accessLevel: Int? 12 | var notificationLevel: Int? 13 | 14 | init(_ json: [String: AnyObject]) { 15 | accessLevel = json["access_level"] as? Int 16 | notificationLevel = json["notification_level"] as? Int 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /.github/scripts/test_app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ARCH="" 4 | 5 | if [ $# -eq 0 ]; then 6 | ARCH="x86_64" 7 | elif [ $1 = "arm" ]; then 8 | ARCH="arm64" 9 | fi 10 | 11 | echo "Building with arch: ${ARCH}" 12 | echo "SwiftLint Version: $(swiftlint --version)" 13 | 14 | export LC_CTYPE=en_US.UTF-8 15 | 16 | set -o pipefail && arch -"${ARCH}" xcodebuild \ 17 | -scheme CodeEdit \ 18 | -destination "platform=OS X,arch=${ARCH}" \ 19 | -skipPackagePluginValidation \ 20 | clean test | xcpretty 21 | -------------------------------------------------------------------------------- /CodeEdit/Features/InspectorArea/ViewModels/InspectorAreaViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InspectorAreaViewModel.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 9/23/23. 6 | // 7 | 8 | import Foundation 9 | 10 | class InspectorAreaViewModel: ObservableObject { 11 | @Published var selectedTab: InspectorTab? = .file 12 | /// The tab bar items in the Inspector 13 | @Published var tabItems: [InspectorTab] = [] 14 | 15 | func setInspectorTab(tab newTab: InspectorTab) { 16 | selectedTab = newTab 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Features/NavigatorArea/ViewModels/NavigatorAreaViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NavigatorAreaViewModel.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 7/23/23. 6 | // 7 | 8 | import Foundation 9 | 10 | class NavigatorAreaViewModel: ObservableObject { 11 | @Published var selectedTab: NavigatorTab? = .project 12 | /// The tab bar items in the Navigator 13 | @Published var tabItems: [NavigatorTab] = [] 14 | 15 | func setNavigatorTab(tab newTab: NavigatorTab) { 16 | selectedTab = newTab 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitLab/Model/GitLabProjectAccess.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitLabProjectAccess.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | class GitLabProjectAccess: Codable { 11 | var accessLevel: Int? 12 | var notificationLevel: Int? 13 | 14 | init(_ json: [String: AnyObject]) { 15 | accessLevel = json["access_level"] as? Int 16 | notificationLevel = json["notification_level"] as? Int 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarLineEndSelector.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarLineEndSelector.swift 3 | // CodeEditModules/StatusBar 4 | // 5 | // Created by Lukas Pistrol on 22.03.22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct StatusBarLineEndSelector: View { 11 | 12 | var body: some View { 13 | Menu { 14 | // LF, CRLF 15 | } label: { 16 | Text("LF") 17 | } 18 | .menuStyle(StatusBarMenuStyle()) 19 | .onHover { isHovering($0) } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CodeEdit/Features/UtilityArea/Toolbar/UtilityAreaSplitTerminalButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UtilityAreaSplitTerminalButton.swift 3 | // CodeEdit 4 | // 5 | // Created by Stef Kors on 14/04/2022. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct UtilityAreaSplitTerminalButton: View { 11 | var body: some View { 12 | Button { 13 | // todo 14 | } label: { 15 | Image(systemName: "square.split.2x1") 16 | .foregroundColor(.secondary) 17 | } 18 | .buttonStyle(.plain) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CodeEdit/Utils/DependencyInjection/ServiceType.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ServiceType.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 4/3/24. 6 | // 7 | 8 | /// Defines the type of service instantiation strategy. 9 | enum ServiceType { 10 | /// Returns a new singleton on the first call, then returns a cached one every other time 11 | case singleton 12 | /// Creates a new singleton reference each time and caches it, returning the newer singleton 13 | case newSingleton 14 | /// Creates a new singleton 15 | case new 16 | } 17 | -------------------------------------------------------------------------------- /Documentation.docc/AppPreferences/Sections/AccountPreferencesView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/AccountSettingsView`` 2 | 3 | ## Topics 4 | 5 | ### Model 6 | 7 | - ``Settings/AccountsSettings`` 8 | - ``SourceControlAccounts`` 9 | - ``SourceControlProvider`` 10 | 11 | ### Views 12 | 13 | - ``AccountListItemView`` 14 | - ``AccountSelectionDialog`` 15 | - ``GitAccountItem`` 16 | - ``GitAccountItemView`` 17 | 18 | ### Login Views 19 | 20 | - ``GitLabHostedLoginView`` 21 | - ``GitLabLoginView`` 22 | - ``GitHubLoginView`` 23 | - ``GitHubEnterpriseLoginView`` 24 | -------------------------------------------------------------------------------- /Documentation.docc/App Window/StatusBarView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/StatusBarView`` 2 | 3 | ## Topics 4 | 5 | ### Model 6 | 7 | - ``ImageDimensions`` 8 | 9 | ### View Model 10 | 11 | - ``StatusBarViewModel`` 12 | 13 | ### View Modifiers 14 | 15 | - ``UpdateStatusBarInfo`` 16 | 17 | ### Items 18 | 19 | - ``StatusBarMenuStyle`` 20 | - ``StatusBarBreakpointButton`` 21 | - ``StatusBarIndentSelector`` 22 | - ``StatusBarEncodingSelector`` 23 | - ``StatusBarLineEndSelector`` 24 | - ``StatusBarToggleUtilityAreaButton`` 25 | - ``StatusBarCursorPositionLabel`` 26 | -------------------------------------------------------------------------------- /CodeEdit/CodeEdit.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.application-groups 6 | 7 | app.codeedit.CodeEdit.shared 8 | $(TeamIdentifierPrefix) 9 | 10 | com.apple.security.cs.allow-jit 11 | 12 | com.apple.security.cs.disable-library-validation 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarEncodingSelector.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarEncodingSelector.swift 3 | // CodeEditModules/StatusBar 4 | // 5 | // Created by Lukas Pistrol on 22.03.22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct StatusBarEncodingSelector: View { 11 | 12 | var body: some View { 13 | Menu { 14 | // UTF 8, ASCII, ... 15 | } label: { 16 | Text("UTF 8") 17 | } 18 | .menuStyle(StatusBarMenuStyle()) 19 | .onHover { isHovering($0) } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github/workflows/issue.yml: -------------------------------------------------------------------------------- 1 | name: Labeling new issue 2 | on: 3 | issues: 4 | types: ['opened'] 5 | jobs: 6 | build: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: Renato66/auto-label@v2 10 | with: 11 | repo-token: ${{ secrets.GITHUB_TOKEN }} 12 | ignore-comments: true 13 | labels-synonyms: '{"bug":["error","need fix","not working"],"enhancement":["upgrade"],"question":["help"]}' 14 | labels-not-allowed: '["good first issue", "priority"]' 15 | default-labels: '["triage needed"]' 16 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Environment/Env+IsFullscreen.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Env+IsFullscreen.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 14/01/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | private struct WorkspaceFullscreenStateEnvironmentKey: EnvironmentKey { 11 | static let defaultValue: Bool = false 12 | } 13 | 14 | extension EnvironmentValues { 15 | var isFullscreen: Bool { 16 | get { self[WorkspaceFullscreenStateEnvironmentKey.self] } 17 | set { self[WorkspaceFullscreenStateEnvironmentKey.self] = newValue } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /OpenWithCodeEdit/OpenWithCodeEdit.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.application-groups 8 | 9 | app.codeedit.CodeEdit.shared 10 | $(TeamIdentifierPrefix) 11 | 12 | com.apple.security.files.user-selected.read-only 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /CodeEdit/Features/SplitView/Model/Environment+SplitEditor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Environment+SplitEditor.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 16/02/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct SplitEditorEnvironmentKey: EnvironmentKey { 11 | static var defaultValue: (Edge, Editor) -> Void = { _, _ in } 12 | } 13 | 14 | extension EnvironmentValues { 15 | var splitEditor: SplitEditorEnvironmentKey.Value { 16 | get { self[SplitEditorEnvironmentKey.self] } 17 | set { self[SplitEditorEnvironmentKey.self] = newValue } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CodeEdit/ShellIntegration/codeedit_shell_integration_env.zsh: -------------------------------------------------------------------------------- 1 | # Modified from Microsoft's VSCode. MIT License. 2 | # Permalink to original file: 3 | # https://github.com/microsoft/vscode/blob/60d7343892f10e0c5f09cb55a6a3f268eb0dd4fb/src/vs/workbench/contrib/terminal/browser/media/shellIntegration-env.zsh 4 | 5 | if [[ -f $USER_ZDOTDIR/.zshenv ]]; then 6 | CE_ZDOTDIR=$ZDOTDIR 7 | ZDOTDIR=$USER_ZDOTDIR 8 | 9 | # prevent recursion 10 | if [[ $USER_ZDOTDIR != $CE_ZDOTDIR ]]; then 11 | . $USER_ZDOTDIR/.zshenv 12 | fi 13 | 14 | USER_ZDOTDIR=$ZDOTDIR 15 | ZDOTDIR=$CE_ZDOTDIR 16 | fi 17 | -------------------------------------------------------------------------------- /CodeEdit/Features/Extensions/ExtensionsManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExtensionManager.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 30/12/2022. 6 | // 7 | 8 | import Foundation 9 | import SwiftUI 10 | import ExtensionFoundation 11 | import CodeEditKit 12 | import ConcurrencyPlus 13 | 14 | final class ExtensionManager: ObservableObject { 15 | 16 | static var shared = ExtensionManager() 17 | 18 | @Published var extensions: [ExtensionInfo] = [] 19 | 20 | init() { 21 | ExtensionDiscovery.shared.$extensions.assign(to: &$extensions) 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /Documentation.docc/About/About Window.md: -------------------------------------------------------------------------------- 1 | # About Window 2 | 3 | The About Window displays general information about the app and acknowledgements to external dependencies. 4 | 5 | ## Topics 6 | 7 | ### About View 8 | 9 | - ``AboutView`` 10 | - ``AboutWindow`` 11 | 12 | ### Acknowledgements 13 | 14 | - ``AcknowledgementsView`` 15 | - ``AcknowledgementsViewModel`` 16 | - ``AcknowledgementsViewWindowController`` 17 | - ``AcknowledgementRowView`` 18 | 19 | - ``AcknowledgementObject`` 20 | - ``AcknowledgementDependency`` 21 | - ``AcknowledgementPackageState`` 22 | - ``AcknowledgementPin`` 23 | -------------------------------------------------------------------------------- /Documentation.docc/App Window/UtilityAreaView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/UtilityAreaView`` 2 | 3 | ## Topics 4 | 5 | ### Model 6 | 7 | - ``UtilityAreaTab`` 8 | 9 | ### View Model 10 | 11 | - ``UtilityAreaViewModel`` 12 | - ``UtilityAreaTabViewModel`` 13 | 14 | ### Utility 15 | 16 | - ``UtilityAreaTerminal`` 17 | - ``UtilityAreaTerminalTab`` 18 | - ``UtilityAreaDebugView`` 19 | - ``UtilityAreaOutputView`` 20 | 21 | ### Toolbar 22 | 23 | - ``UtilityAreaView`` 24 | - ``UtilityAreaSplitTerminalButton`` 25 | - ``UtilityAreaMaximizeButton`` 26 | - ``UtilityAreaClearButton`` 27 | - ``UtilityAreaFilterTextField`` 28 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Models/SettingsSearchResult.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsSearchResult.swift 3 | // CodeEdit 4 | // 5 | // Created by Raymond Vleeshouwer on 17/06/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | // TODO: Extend this struct further to support setting "flashing" 11 | final class SettingsSearchResult: Identifiable { 12 | let id: UUID = UUID() 13 | let pageFound: Bool 14 | let pages: [SettingsPage] 15 | 16 | init( 17 | pageFound: Bool, 18 | pages: [SettingsPage] 19 | ) { 20 | self.pageFound = pageFound 21 | self.pages = pages 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Environment/Env+Window.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Env+Window.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 14/01/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct WindowBox { 11 | weak var value: NSWindow? 12 | } 13 | 14 | struct NSWindowEnvironmentKey: EnvironmentKey { 15 | typealias Value = WindowBox 16 | static var defaultValue = WindowBox(value: nil) 17 | } 18 | 19 | extension EnvironmentValues { 20 | var window: WindowBox { 21 | get { self[NSWindowEnvironmentKey.self] } 22 | set { self[NSWindowEnvironmentKey.self] = newValue } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CodeEdit/Features/UtilityArea/Views/OSLogType+Color.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OSLogType+Color.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 22/05/2023. 6 | // 7 | 8 | import OSLog 9 | import SwiftUI 10 | 11 | extension OSLogType { 12 | var color: Color { 13 | switch self { 14 | case .error: 15 | return .orange 16 | case .debug, .default: 17 | return .primary 18 | case .fault: 19 | return .red 20 | case .info: 21 | return .cyan 22 | default: 23 | return .green 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/URL/URL+componentCompare.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URL+componentCompare.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 10/22/24. 6 | // 7 | 8 | import Foundation 9 | 10 | extension URL { 11 | /// Compare a URL using its path components. 12 | /// - Parameter other: The URL to compare to 13 | /// - Returns: `true` if the URL points to the same path on disk. Regardless of query parameters, trailing 14 | /// slashes, etc. 15 | func componentCompare(_ other: URL) -> Bool { 16 | return self.pathComponents == other.pathComponents 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Features/WindowCommands/ExtensionCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExtensionCommands.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 24/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | import CodeEditKit 10 | 11 | struct ExtensionCommands: Commands { 12 | @FocusedObject var manager: ExtensionManager? 13 | 14 | @Environment(\.openWindow) 15 | var openWindow 16 | 17 | var body: some Commands { 18 | CommandMenu("Extensions") { 19 | Button("Open Extensions Window") { 20 | openWindow(sceneID: .extensions) 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CodeEdit/Features/Editor/TabBar/Tabs/Tab/Models/EditorTabRepresentable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EditorTabRepresentable.swift 3 | // 4 | // 5 | // Created by Pavel Kasila on 30.04.22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// Protocol for data passed to EditorTabView to conform to 11 | protocol EditorTabRepresentable { 12 | /// Unique tab identifier 13 | var tabID: EditorTabID { get } 14 | /// String to be shown as tab's title 15 | var name: String { get } 16 | /// Image to be shown as tab's icon 17 | var icon: Image { get } 18 | /// Color of the tab's icon 19 | var iconColor: Color { get } 20 | } 21 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/Bitbucket/BitBucketAccount.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BitBucketAccount.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | // TODO: DOCS (Nanashi Li) 11 | 12 | struct BitBucketAccount { 13 | let configuration: BitBucketTokenConfiguration 14 | 15 | init(_ config: BitBucketTokenConfiguration = BitBucketTokenConfiguration()) { 16 | configuration = config 17 | } 18 | } 19 | 20 | extension GitRouter { 21 | internal var URLRequest: Foundation.URLRequest? { 22 | request() 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitLab/Model/GitLabPermissions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Permissions.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | class GitLabPermissions: Codable { 11 | var projectAccess: GitLabProjectAccess? 12 | var groupAccess: GitLabGroupAccess? 13 | 14 | init(_ json: [String: AnyObject]) { 15 | projectAccess = GitLabProjectAccess(json["project_access"] as? [String: AnyObject] ?? [:]) 16 | groupAccess = GitLabGroupAccess(json["group_access"] as? [String: AnyObject] ?? [:]) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Features/UtilityArea/DebugUtility/TaskOutputView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TaskOutputView.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 27.06.24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct TaskOutputView: View { 11 | @ObservedObject var activeTask: CEActiveTask 12 | var body: some View { 13 | VStack(alignment: .leading) { 14 | Text(activeTask.output) 15 | .fontDesign(.monospaced) 16 | .textSelection(.enabled) 17 | } 18 | .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading) 19 | .padding(10) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/TextView/TextView+SemanticTokenRangeProvider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TextView+SemanticTokenRangeProvider.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 12/19/24. 6 | // 7 | 8 | import Foundation 9 | import CodeEditTextView 10 | 11 | extension TextView: SemanticTokenMapRangeProvider { 12 | func nsRangeFrom(line: UInt32, char: UInt32, length: UInt32) -> NSRange? { 13 | guard let line = layoutManager.textLineForIndex(Int(line)) else { 14 | return nil 15 | } 16 | return NSRange(location: line.range.location + Int(char), length: Int(length)) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /CodeEdit/Features/NavigatorArea/SourceControlNavigator/Repository/Models/RepoOutlineGroupItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RepoOutlineGroupItem.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/29/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct RepoOutlineGroupItem: Hashable, Identifiable { 11 | var id: String 12 | var label: String 13 | var description: String? 14 | var systemImage: String? 15 | var symbolImage: String? 16 | var imageColor: Color? 17 | var children: [RepoOutlineGroupItem]? 18 | var branch: GitBranch? 19 | var stashEntry: GitStashEntry? 20 | var remote: GitRemote? 21 | } 22 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Client/GitClient+Pull.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitClient+Pull.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/18/23. 6 | // 7 | 8 | import Foundation 9 | 10 | extension GitClient { 11 | /// Pull changes from remote 12 | func pullFromRemote(remote: String? = nil, branch: String? = nil, rebase: Bool = false) async throws { 13 | var command = "pull \(rebase ? "--rebase" : "--no-rebase")" 14 | 15 | if let remote = remote, let branch = branch { 16 | command += " \(remote) \(branch)" 17 | } 18 | 19 | _ = try await self.run(command) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Pages/LocationsSettings/Models/LocationsSettings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LocationsSettings.swift 3 | // CodeEdit 4 | // 5 | // Created by Raymond Vleeshouwer on 24/06/23. 6 | // 7 | 8 | import Foundation 9 | 10 | extension SettingsData { 11 | 12 | struct LocationsSettings: SearchableSettingsPage { 13 | 14 | /// The search keys 15 | var searchKeys: [String] { 16 | [ 17 | "Settings Location", 18 | "Themes Location", 19 | "Extensions Location" 20 | ] 21 | .map { NSLocalizedString($0, comment: "") } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.github/workflows/add-to-project.yml: -------------------------------------------------------------------------------- 1 | name: Add new issues to project 2 | 3 | on: 4 | issues: 5 | types: 6 | - opened 7 | 8 | jobs: 9 | add-to-project: 10 | name: Add new issues labeled with enhancement or bug to project 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/add-to-project@v0.4.0 14 | with: 15 | # You can target a repository in a different organization 16 | # to the issue 17 | project-url: https://github.com/orgs/CodeEditApp/projects/3 18 | github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} 19 | labeled: enhancement, bug 20 | label-operator: OR 21 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Pages/SourceControlSettings/IgnoredFilesListView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IgnoredFilesListView.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/1/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct IgnoredFilesListView: View { 11 | @StateObject private var model = IgnorePatternModel() 12 | 13 | var body: some View { 14 | GlobPatternList( 15 | patterns: $model.patterns, 16 | selection: $model.selection, 17 | addPattern: model.addPattern, 18 | removePatterns: model.removePatterns, 19 | emptyMessage: "No ignored files" 20 | ) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CodeEdit/Features/UtilityArea/Views/View+paneToolbar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // View+paneToolbar.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 5/31/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | extension View { 11 | /// Clips and adds a bottom toolbar to the view. 12 | /// - Parameter content: The content of the toolbar. 13 | func paneToolbar(@ViewBuilder content: () -> Content) -> some View { 14 | self 15 | .clipped() 16 | .safeAreaInset(edge: .bottom, spacing: 0) { 17 | PaneToolbar { 18 | content() 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/String/String+Character.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+Character.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 24.11.23. 6 | // 7 | 8 | import Foundation 9 | 10 | extension String { 11 | /// Retrieves the character at the specified index within the string. 12 | /// - Parameter index: The index of the character to retrieve. 13 | /// - Returns: The character at the specified index. 14 | func character(at index: Int) -> Character? { 15 | guard index < self.count else { 16 | return nil 17 | } 18 | 19 | return self[self.index(self.startIndex, offsetBy: index)] 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitHub/Model/GitHubComment.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitHubComment.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | struct GitHubComment: Codable { 11 | let id: Int 12 | let url: URL 13 | let htmlURL: URL 14 | let body: String 15 | let user: GitHubUser 16 | let createdAt: Date 17 | let updatedAt: Date 18 | 19 | enum CodingKeys: String, CodingKey { 20 | case id, url, body, user 21 | case htmlURL = "html_url" 22 | case createdAt = "created_at" 23 | case updatedAt = "updated_at" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEditTests/Features/Acknowledgements/AcknowledgementsTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AcknowledgementsTests.swift 3 | // CodeEditTests 4 | // 5 | // Created by Lukas Pistrol on 14.01.23. 6 | // 7 | 8 | import XCTest 9 | @testable import CodeEdit 10 | 11 | final class AcknowledgementsTests: XCTestCase { 12 | 13 | var model: AcknowledgementsViewModel! 14 | 15 | override func setUpWithError() throws { 16 | model = .init() 17 | } 18 | 19 | override func tearDownWithError() throws { 20 | model = nil 21 | } 22 | 23 | func testAcknowledgementsNotEmpty() throws { 24 | XCTAssertFalse(model.acknowledgements.isEmpty) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/String/String+RemoveOccurrences.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+RemoveOccurrences.swift 3 | // CodeEditModules/CodeEditUtils 4 | // 5 | // Created by Lukas Pistrol on 24.04.22. 6 | // 7 | 8 | import Foundation 9 | 10 | extension String { 11 | 12 | /// Removes all `new-line` characters in a `String` 13 | /// - Returns: A String 14 | func removingNewLines() -> String { 15 | self.replacingOccurrences(of: "\n", with: "") 16 | } 17 | 18 | /// Removes all `space` characters in a `String` 19 | /// - Returns: A String 20 | func removingSpaces() -> String { 21 | self.replacingOccurrences(of: " ", with: "") 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Models/GlobPattern.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GlobPattern.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/2/24. 6 | // 7 | 8 | import Foundation 9 | 10 | /// A simple model that associates a UUID with a glob pattern string. 11 | /// 12 | /// This type does not interpret or validate the glob pattern itself. 13 | /// It is simply an identifier (`id`) and the glob pattern string (`value`) associated with it. 14 | struct GlobPattern: Identifiable, Hashable, Decodable, Encodable { 15 | /// Ephemeral UUID used to uniquely identify this instance in the UI 16 | var id = UUID() 17 | 18 | /// The Glob Pattern string 19 | var value: String 20 | } 21 | -------------------------------------------------------------------------------- /CodeEdit/Features/NavigatorArea/ProjectNavigator/ProjectNavigatorView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProjectNavigatorView.swift 3 | // CodeEdit 4 | // 5 | // Created by Lukas Pistrol on 25.03.22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// # Project Navigator - Sidebar 11 | /// 12 | /// A list that functions as a project navigator, showing collapsible folders 13 | /// and files. 14 | /// 15 | /// When selecting a file it will open in the editor. 16 | /// 17 | struct ProjectNavigatorView: View { 18 | var body: some View { 19 | ProjectNavigatorOutlineView() 20 | .safeAreaInset(edge: .bottom, spacing: 0) { 21 | ProjectNavigatorToolbarBottom() 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Models/GitBranch.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitBranch.swift 3 | // CodeEdit 4 | // 5 | // Created by Albert Vinizhanau on 10/20/23. 6 | // 7 | 8 | import Foundation 9 | 10 | struct GitBranch: Hashable, Identifiable { 11 | let name: String 12 | let longName: String 13 | let upstream: String? 14 | let ahead: Int 15 | let behind: Int 16 | 17 | var id: String { 18 | longName 19 | } 20 | 21 | /// Is local branch 22 | var isLocal: Bool { 23 | return longName.hasPrefix("refs/heads/") 24 | } 25 | 26 | /// Is remote branch 27 | var isRemote: Bool { 28 | return longName.hasPrefix("refs/remotes/") 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CodeEdit/Features/WindowCommands/CodeEditCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CodeEditCommands.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 11/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct CodeEditCommands: Commands { 11 | @AppSettings(\.sourceControl.general.sourceControlIsEnabled) 12 | private var sourceControlIsEnabled 13 | 14 | var body: some Commands { 15 | MainCommands() 16 | FileCommands() 17 | ViewCommands() 18 | FindCommands() 19 | NavigateCommands() 20 | if sourceControlIsEnabled { SourceControlCommands() } 21 | ExtensionCommands() 22 | WindowCommands() 23 | HelpCommands() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEdit/Features/Editor/TabBar/Views/EditorTabBarDivider.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EditorTabBarDivider.swift 3 | // CodeEdit 4 | // 5 | // Created by Lingxi Li on 4/22/22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// The vertical divider between tab bar items. 11 | struct EditorTabDivider: View { 12 | @Environment(\.colorScheme) 13 | var colorScheme 14 | 15 | let width: CGFloat = 1 16 | 17 | var body: some View { 18 | Rectangle() 19 | .frame(width: width) 20 | .padding(.vertical, 8) 21 | .foregroundColor( 22 | Color(nsColor: colorScheme == .dark ? .white : .black) 23 | .opacity(0.12) 24 | ) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CodeEdit/Features/UtilityArea/Toolbar/UtilityAreaMaximizeButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UtilityAreaMaximizeButton.swift 3 | // CodeEdit 4 | // 5 | // Created by Stef Kors on 12/04/2022. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct UtilityAreaMaximizeButton: View { 11 | @EnvironmentObject private var utilityAreaViewModel: UtilityAreaViewModel 12 | 13 | var body: some View { 14 | Button { 15 | utilityAreaViewModel.isMaximized.toggle() 16 | } label: { 17 | Image(systemName: "arrowtriangle.up.square") 18 | .foregroundColor(utilityAreaViewModel.isMaximized ? .accentColor : .secondary) 19 | } 20 | .buttonStyle(.plain) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CodeEdit/Features/WindowCommands/HelpCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HelpCommands.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 14/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct HelpCommands: Commands { 11 | var body: some Commands { 12 | CommandGroup(after: .help) { 13 | Button("What's New in CodeEdit") { 14 | 15 | } 16 | .disabled(true) 17 | 18 | Button("Release Notes") { 19 | } 20 | .disabled(true) 21 | 22 | Button("Report an Issue") { 23 | NSApp.sendAction(#selector(AppDelegate.openFeedback(_:)), to: nil, from: nil) 24 | } 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CodeEdit/Features/Feedback/HelperView/FeedbackToolbar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FeedbackToolbar.swift 3 | // CodeEditModules/Feedback 4 | // 5 | // Created by Nanashi Li on 2022/04/14. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct FeedbackToolbar: View { 11 | 12 | private var content: () -> T 13 | 14 | init( 15 | bgColor: Color = Color(NSColor.controlBackgroundColor), 16 | @ViewBuilder content: @escaping () -> T 17 | ) { 18 | self.content = content 19 | } 20 | 21 | var body: some View { 22 | ZStack { 23 | HStack { 24 | content() 25 | .padding(.horizontal, 8) 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CodeEdit/Features/Editor/Views/WindowCodeFileView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WindowCodeFileView.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 3/19/23. 6 | // 7 | 8 | import Foundation 9 | import SwiftUI 10 | 11 | /// View that fixes [#1158](https://github.com/CodeEditApp/CodeEdit/issues/1158) 12 | /// # Should **not** be used other than in a single file window. 13 | struct WindowCodeFileView: View { 14 | var codeFile: CodeFileDocument 15 | 16 | var body: some View { 17 | if let utType = codeFile.utType, utType.conforms(to: .text) { 18 | CodeFileView(codeFile: codeFile) 19 | } else { 20 | NonTextFileView(fileDocument: codeFile) 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /.github/workflows/CI-pre-release.yml: -------------------------------------------------------------------------------- 1 | name: CI - Pre Release 2 | on: 3 | workflow_dispatch: 4 | jobs: 5 | swiftlint: 6 | name: SwiftLint 7 | uses: ./.github/workflows/lint.yml 8 | secrets: inherit 9 | test: 10 | name: Testing CodeEdit 11 | needs: swiftlint 12 | uses: ./.github/workflows/tests.yml 13 | secrets: inherit 14 | deploy: 15 | if: github.repository_owner == 'CodeEditApp' 16 | name: Deploying CodeEdit [Prerelease] 17 | needs: [swiftlint, test] 18 | uses: ./.github/workflows/pre-release.yml 19 | secrets: inherit 20 | ReleaseDrafter: 21 | name: Release Drafter 22 | needs: [swiftlint, test, deploy] 23 | uses: ./.github/workflows/release-drafter.yml 24 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitHub/Model/GitHubFiles.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitHubFiles.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | // TODO: DOCS (Nanashi Li) 11 | 12 | class GitHubFile: Codable { 13 | private(set) var id: Int = -1 14 | var rawURL: URL? 15 | var filename: String? 16 | var type: String? 17 | var language: String? 18 | var size: Int? 19 | var content: String? 20 | 21 | enum CodingKeys: String, CodingKey { 22 | case rawURL = "raw_url" 23 | case filename 24 | case type 25 | case language 26 | case size 27 | case content 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+FoldingRange.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+FoldingRange.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | extension LanguageServer { 12 | func requestFoldingRange(for documentURI: String) async throws -> FoldingRangeResponse { 13 | do { 14 | let params = FoldingRangeParams(textDocument: TextDocumentIdentifier(uri: documentURI)) 15 | return try await lspInstance.foldingRange(params) 16 | } catch { 17 | logger.warning("requestFoldingRange: Error \(error)") 18 | throw error 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CodeEdit/Features/Editor/TabBar/Tabs/Tab/EditorTabButtonStyle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EditorTabButtonStyle.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 6/4/22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct EditorTabButtonStyle: ButtonStyle { 11 | @Environment(\.colorScheme) 12 | var colorScheme 13 | 14 | @Binding private var isPressing: Bool 15 | 16 | init(isPressing: Binding) { 17 | self._isPressing = isPressing 18 | } 19 | 20 | func makeBody(configuration: Configuration) -> some View { 21 | configuration.label 22 | .onChange(of: configuration.isPressed, perform: { isPressed in 23 | self.isPressing = isPressed 24 | }) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CodeEdit/Features/SplitView/Views/Variadic.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Variadic.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 05/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct Helper: _VariadicView_UnaryViewRoot { 11 | var _body: (_VariadicView.Children) -> Result 12 | 13 | func body(children: _VariadicView.Children) -> some View { 14 | _body(children) 15 | } 16 | } 17 | 18 | extension View { 19 | 20 | /// Exposes the children of a ViewBuilder so they can be accessed individually. 21 | func variadic(@ViewBuilder process: @escaping (_VariadicView.Children) -> R) -> some View { 22 | _VariadicView.Tree(Helper(_body: process), content: { self }) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CodeEdit/Features/Documents/Indexer/FileHelper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FileHelper.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 18.11.23. 6 | // 7 | 8 | import Foundation 9 | 10 | enum FileHelper { 11 | static func urlIsFolder(_ url: URL) -> Bool { 12 | var isDirectory: ObjCBool = false 13 | let exists = FileManager.default.fileExists(atPath: url.path, isDirectory: &isDirectory) 14 | return exists && isDirectory.boolValue 15 | } 16 | 17 | static func urlIsFile(_ url: URL) -> Bool { 18 | var isDirectory: ObjCBool = false 19 | let exists = FileManager.default.fileExists(atPath: url.path, isDirectory: &isDirectory) 20 | return exists && !isDirectory.boolValue 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CodeEditTests/Features/Documents/Mocks/NSHapticFeedbackPerformerMock.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSHapticFeedbackPerformerMock.swift 3 | // CodeEditTests 4 | // 5 | // Created by YAPRYNTSEV Aleksey on 31.12.2022. 6 | // 7 | 8 | import Cocoa 9 | 10 | final class NSHapticFeedbackPerformerMock: NSObject, NSHapticFeedbackPerformer { 11 | 12 | var invokedPerform: Bool { 13 | invokedPerformCount > 0 14 | } 15 | var invokedPerformCount = 0 16 | 17 | func perform( 18 | _ pattern: NSHapticFeedbackManager.FeedbackPattern, 19 | performanceTime: NSHapticFeedbackManager.PerformanceTime 20 | ) { 21 | invokedPerformCount += 1 22 | } 23 | 24 | func reset() { 25 | invokedPerformCount = 0 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CodeEdit/Features/Editor/TabBar/Tabs/Tab/Models/EditorItemID.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EditorTabID.swift 3 | // 4 | // 5 | // Created by Pavel Kasila on 30.04.22. 6 | // 7 | 8 | import Foundation 9 | 10 | /// Enum to represent item's ID to tab bar 11 | enum EditorTabID: Codable, Identifiable, Hashable { 12 | var id: String { 13 | switch self { 14 | case .codeEditor(let path): 15 | return "codeEditor_\(path)" 16 | case .extensionInstallation(let id): 17 | return "extensionInstallation_\(id.uuidString)" 18 | } 19 | } 20 | 21 | /// Represents code editor tab 22 | case codeEditor(String) 23 | 24 | /// Represents extension installation tab 25 | case extensionInstallation(UUID) 26 | } 27 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 60 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | # Label to use when marking an issue as stale 10 | staleLabel: wontfix 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Client/GitClient+Validate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitClient+Validate.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/29/23. 6 | // 7 | 8 | import Foundation 9 | 10 | extension GitClient { 11 | /// Determines if the current directory is a valid git repository. 12 | /// 13 | /// Runs `git rev-parse --is-inside-work-tree`. 14 | /// 15 | /// - Returns: True, if git finds a valid repository. 16 | func validate() async -> Bool { 17 | do { 18 | let output = try await run("rev-parse --is-inside-work-tree") 19 | return output.trimmingCharacters(in: .whitespacesAndNewlines) == "true" 20 | } catch { 21 | return false 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CodeEdit/Features/UtilityArea/Views/UtilityAreaView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UtilityAreaView.swift 3 | // CodeEdit 4 | // 5 | // Created by Lukas Pistrol on 22.03.22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct UtilityAreaView: View { 11 | @EnvironmentObject private var utilityAreaViewModel: UtilityAreaViewModel 12 | 13 | var body: some View { 14 | WorkspacePanelView( 15 | viewModel: utilityAreaViewModel, 16 | selectedTab: $utilityAreaViewModel.selectedTab, 17 | tabItems: $utilityAreaViewModel.tabItems, 18 | sidebarPosition: .side, 19 | darkDivider: true 20 | ) 21 | .accessibilityElement(children: .contain) 22 | .accessibilityLabel("Utility Area") 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [CodeEditApp, austincondiff] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: codeeditapp 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry 13 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 14 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/URL/URL+ResouceValues.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URL+ResouceValues.swift 3 | // CodeEdit 4 | // 5 | // Created by Axel Martinez on 27/6/24. 6 | // 7 | 8 | import Foundation 9 | import UniformTypeIdentifiers 10 | 11 | extension URL { 12 | fileprivate var resourceValues: URLResourceValues? { 13 | try? self.resourceValues(forKeys: [.isDirectoryKey, .isSymbolicLinkKey, .contentTypeKey]) 14 | } 15 | 16 | var isFolder: Bool { 17 | resourceValues?.isDirectory ?? false 18 | } 19 | 20 | var isSymbolicLink: Bool { 21 | resourceValues?.isSymbolicLink ?? false || (resourceValues?.contentType ?? .item) == .aliasFile 22 | } 23 | 24 | var contentType: UTType? { 25 | resourceValues?.contentType 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Documentation.docc/App Window/InspectorSidebarView.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/InspectorAreaView`` 2 | 3 | ## Topics 4 | 5 | ### Toolbars 6 | 7 | - ``InspectorAreaToolbarTop`` 8 | 9 | ### File Inspector 10 | 11 | - ``FileInspectorView`` 12 | - ``FileInspectorModel`` 13 | - ``FileLocation`` 14 | - ``IndentUsing`` 15 | - ``LanguageType`` 16 | - ``LineEndings`` 17 | - ``TextEncoding`` 18 | 19 | ### History Inspector 20 | 21 | - ``HistoryInspectorView`` 22 | - ``HistoryInspectorModel`` 23 | - ``HistoryInspectorItemView`` 24 | - ``HistoryInspectorNoHistoryView`` 25 | - ``HistoryPopoverView`` 26 | 27 | ### Quick Help Inspector 28 | 29 | - ``QuickHelpInspectorView`` 30 | 31 | ### No Selection 32 | 33 | - ``NoSelectionInspectorView`` 34 | 35 | ### File List 36 | 37 | - ``FileTypeList`` 38 | -------------------------------------------------------------------------------- /CodeEdit/Features/SplitView/Model/Environment+ContentInsets.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Environment+ContentInsets.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 24/02/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct EdgeInsetsEnvironmentKey: EnvironmentKey { 11 | static var defaultValue: EdgeInsets = EdgeInsets(top: 1, leading: 0, bottom: 0, trailing: 0) 12 | } 13 | 14 | extension EnvironmentValues { 15 | var edgeInsets: EdgeInsetsEnvironmentKey.Value { 16 | get { self[EdgeInsetsEnvironmentKey.self] } 17 | set { self[EdgeInsetsEnvironmentKey.self] = newValue } 18 | } 19 | } 20 | 21 | extension EdgeInsets { 22 | var nsEdgeInsets: NSEdgeInsets { 23 | .init(top: top, left: leading, bottom: bottom, right: trailing) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEdit/Features/ActivityViewer/Tasks/ActiveTaskView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ActiveTaskView.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 8/4/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | // We need to observe each active task individually because: 11 | // 1. Active tasks are nested inside TaskManager. 12 | // 2. Reference types (like objects) do not notify observers when their internal state changes. 13 | /// `ActiveTaskView` represents a single active task and observes its state. 14 | /// - Parameter activeTask: The active task to be displayed and observed. 15 | struct ActiveTaskView: View { 16 | @ObservedObject var activeTask: CEActiveTask 17 | 18 | var body: some View { 19 | TaskView(task: activeTask.task, status: activeTask.status) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CodeEdit/Features/CEWorkspaceSettings/Models/CEWorkspaceSettingsData+ProjectSettings.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProjectCEWorkspaceSettings.swift 3 | // CodeEdit 4 | // 5 | // Created by Axel Martinez on 27/3/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | class ProjectSettings: ObservableObject, Codable { 11 | var projectName: String = "" 12 | 13 | init() {} 14 | 15 | /// Explicit decoder init for setting default values when key is not present in `JSON` 16 | required init(from decoder: Decoder) throws { 17 | let container = try decoder.container(keyedBy: CodingKeys.self) 18 | self.projectName = try container.decodeIfPresent(String.self, forKey: .projectName) ?? "" 19 | } 20 | 21 | func isEmpty() -> Bool { 22 | projectName == "" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/String/String+ValidFileName.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+ValidFileName.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 1/13/25. 6 | // 7 | 8 | import Foundation 9 | 10 | extension CharacterSet { 11 | /// On macOS, valid file names must not contain the `NULL` or `:` characters. 12 | static var invalidFileNameCharacters: CharacterSet = CharacterSet(charactersIn: "\0:") 13 | } 14 | 15 | extension String { 16 | /// On macOS, valid file names must not contain the `NULL` or `:` characters, must be non-empty, and must be less 17 | /// than 256 UTF16 characters. 18 | var isValidFilename: Bool { 19 | !isEmpty && CharacterSet(charactersIn: self).isDisjoint(with: .invalidFileNameCharacters) && utf16.count < 256 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/URL/URL+FindWorkspace.swift: -------------------------------------------------------------------------------- 1 | // 2 | // URL+FindWorkspace.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 12/19/24. 6 | // 7 | 8 | import Foundation 9 | 10 | extension URL { 11 | /// Finds a workspace that contains the url. 12 | func findWorkspace() -> WorkspaceDocument? { 13 | CodeEditDocumentController.shared.documents.first(where: { doc in 14 | guard let workspace = doc as? WorkspaceDocument else { return false } 15 | // createIfNotFound is safe here because it will still exit if the file and the workspace 16 | // do not share a path prefix 17 | return workspace.workspaceFileManager?.getFile(absolutePath, createIfNotFound: true) != nil 18 | }) as? WorkspaceDocument 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Client/GitConfigRepresentable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitConfigRepresentable.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/16/24. 6 | // 7 | 8 | /// A protocol that provides a mechanism to represent and parse Git configuration values. 9 | /// 10 | /// Conforming types must be able to initialize from a Git configuration string 11 | /// and convert their value back to a Git-compatible string representation. 12 | protocol GitConfigRepresentable { 13 | /// Initializes a new instance from a Git configuration value string. 14 | /// - Parameter configValue: The configuration value string. 15 | init?(configValue: String) 16 | 17 | /// Converts the value to a Git-compatible configuration string. 18 | var asConfigValue: String { get } 19 | } 20 | -------------------------------------------------------------------------------- /CodeEdit/Utils/DependencyInjection/ServiceWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ServiceWrapper.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 4/3/24. 6 | // 7 | 8 | /// A property wrapper that provides access to a service instance. 9 | @propertyWrapper 10 | struct Service { 11 | var service: Service 12 | 13 | init(_ type: ServiceType = .singleton) { 14 | guard let service = ServiceContainer.resolve(type, Service.self) else { 15 | let serviceName = String(describing: Service.self) 16 | fatalError("No service of type \(serviceName) registered!") 17 | } 18 | 19 | self.service = service 20 | } 21 | 22 | var wrappedValue: Service { 23 | get { self.service } 24 | mutating set { service = newValue } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/String/String+Ranges.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+Ranges.swift 3 | // CodeEdit 4 | // 5 | // Created by Ziyuan Zhao on 2022/3/21. 6 | // 7 | 8 | import Foundation 9 | 10 | extension StringProtocol where Index == String.Index { 11 | func ranges( 12 | of substring: T, 13 | options: String.CompareOptions = [], 14 | locale: Locale? = nil 15 | ) -> [Range] { 16 | var ranges: [Range] = [] 17 | while let result = range( 18 | of: substring, 19 | options: options, 20 | range: (ranges.last?.upperBound ?? startIndex).. EXAppExtensionBrowserViewController { 13 | EXAppExtensionBrowserViewController() 14 | } 15 | 16 | func updateNSViewController(_ nsViewController: EXAppExtensionBrowserViewController, context: Context) { 17 | 18 | } 19 | 20 | func makeCoordinator() { 21 | 22 | } 23 | } 24 | 25 | struct ExtensionActivatorView_Previews: PreviewProvider { 26 | static var previews: some View { 27 | ExtensionActivatorView() 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/Utils/String+PercentEncoding.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+PercentEncoding.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | extension String { 11 | 12 | /// Percent-encodes a string to be URL-safe 13 | /// 14 | /// See https://useyourloaf.com/blog/how-to-percent-encode-a-url-string/ for more info 15 | /// - returns: An optional string, with percent encoding to match RFC3986 16 | func stringByAddingPercentEncodingForRFC3986() -> String? { 17 | let unreserved = "-._~/?" 18 | var allowed = CharacterSet.alphanumerics 19 | allowed.insert(charactersIn: unreserved) 20 | return addingPercentEncoding(withAllowedCharacters: allowed) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /.github/scripts/test_version_number.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # get the version number from the Info.plist file using agvtool 4 | VERS=$(xcrun agvtool mvers -terse1) 5 | 6 | # if the version number is empty, exit with an error 7 | if [ "$VERS" == "" ]; then 8 | echo "No version number found" 9 | echo "Make sure Info.plist has a CFBundleShortVersionString key" 10 | echo "" 11 | echo "If Info.plist does not have a CFBundleShortVersionString key, add the following to your Info.plist file:" 12 | echo "" 13 | echo "CFBundleShortVersionString" 14 | echo "0.0.1" 15 | echo "" 16 | echo "For more information see https://github.com/CodeEditApp/CodeEdit/pull/1006" 17 | exit 1 # exit with an error 18 | else 19 | echo "Version number is $VERS" 20 | exit 0 # exit with no error 21 | fi 22 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitHub/GitHubPreviewHeader.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitHubPreviewHeader.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | // TODO: DOCS (Nanashi Li) 11 | 12 | /// Some APIs provide additional data for new (preview) APIs if a custom header is added to the request. 13 | /// 14 | /// - Note: Preview APIs are subject to change. 15 | enum GitHubPreviewHeader { 16 | /// The `Reactions` preview header provides reactions in `Comment`s. 17 | case reactions 18 | 19 | var header: GitHTTPHeader { 20 | switch self { 21 | case .reactions: 22 | return GitHTTPHeader(headerField: "Accept", value: "application/vnd.github.squirrel-girl-preview") 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+DocumentSymbol.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+DocumentSymbol.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | extension LanguageServer { 12 | func requestSymbols(for documentURI: String) async throws -> DocumentSymbolResponse { 13 | do { 14 | let textDocumentIdentifier = TextDocumentIdentifier(uri: documentURI) 15 | let documentSymbolParams = DocumentSymbolParams(textDocument: textDocumentIdentifier) 16 | return try await lspInstance.documentSymbol(documentSymbolParams) 17 | } catch { 18 | logger.warning("requestSymbols: Error \(error)") 19 | throw error 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/TextView/TextView+LSPRange.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TextView+LSPRange.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 9/21/24. 6 | // 7 | 8 | import AppKit 9 | import CodeEditTextView 10 | import LanguageServerProtocol 11 | 12 | extension TextView { 13 | func lspRangeFrom(nsRange: NSRange) -> LSPRange? { 14 | guard let startLine = layoutManager.textLineForOffset(nsRange.location), 15 | let endLine = layoutManager.textLineForOffset(nsRange.max) else { 16 | return nil 17 | } 18 | return LSPRange( 19 | start: Position(line: startLine.index, character: nsRange.location - startLine.range.location), 20 | end: Position(line: endLine.index, character: nsRange.max - endLine.range.location) 21 | ) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Documentation.docc/AppPreferences/AppPreferences.md: -------------------------------------------------------------------------------- 1 | # ``CodeEdit/Settings`` 2 | 3 | ## Topics 4 | 5 | ### Getting Started 6 | 7 | - 8 | - 9 | 10 | ### Settings Model 11 | 12 | - ``SettingsModel`` 13 | - ``SoftwareUpdater`` 14 | 15 | ### Settings Section Views 16 | 17 | - ``GeneralSettingsView`` 18 | - ``ThemeSettingsView`` 19 | - ``TextEditingSettingsView`` 20 | - ``TerminalSettingsView`` 21 | - ``LocationsSettingsView`` 22 | - ``KeybindingsSettingsView`` 23 | - ``AccountSettingsView`` 24 | - ``SourceControlSettingsView`` 25 | - ``SettingsPlaceholderView`` 26 | 27 | ### Helper Views 28 | 29 | - ``SettingsContent`` 30 | - ``SettingsSection`` 31 | - ``SettingsColorPicker`` 32 | - ``SettingsToolbar`` 33 | 34 | ### Theme Settings Model 35 | 36 | - ``Theme`` 37 | - ``ThemeModel`` 38 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+DocumentLink.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+DocumentLink.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | // TODO: DocumentLinkParams IS MISSING `textDocument: TextDocumentIdentifier;` FIELD IN LSP LIBRARY 12 | 13 | extension LanguageServer { 14 | @available(*, deprecated, message: "Not functional, see comment.") 15 | func requestLinkResolve(_ documentLink: DocumentLink) async throws -> DocumentLink? { 16 | do { 17 | return try await lspInstance.documentLinkResolve(documentLink) 18 | } catch { 19 | logger.warning("requestDocumentLinkResolve: Error \(error)") 20 | throw error 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CodeEdit/Features/Editor/Views/LoadingFileView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoadingFileView.swift 3 | // CodeEdit 4 | // 5 | // Created by Paul Ebose on 2024/5/9. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// A placeholder view that shows a spinner and text. 11 | /// 12 | /// It optionally receives a file name. 13 | /// ```swift 14 | /// LoadingFileView(filename) 15 | /// LoadingFileView() 16 | /// ``` 17 | struct LoadingFileView: View { 18 | 19 | /// Name of file that is about to open. 20 | private var filename = "" 21 | 22 | init(_ filename: String = "") { 23 | self.filename = filename 24 | } 25 | 26 | var body: some View { 27 | VStack(spacing: 10) { 28 | Spacer() 29 | ProgressView() 30 | Text("Opening \(filename)...") 31 | Spacer() 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+Declaration.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+Declaration.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | extension LanguageServer { 12 | func requestGoToDeclaration(for documentURI: String, position: Position) async throws -> DeclarationResponse { 13 | do { 14 | let params = TextDocumentPositionParams( 15 | textDocument: TextDocumentIdentifier(uri: documentURI), 16 | position: position 17 | ) 18 | return try await lspInstance.declaration(params) 19 | } catch { 20 | logger.warning("requestGoToDeclaration: Error \(error)") 21 | throw error 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /CodeEdit/Features/WindowCommands/Utils/KeyWindowControllerObserver.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeyWindowControllerObserver.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 7/2/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct KeyWindowControllerObserver: ViewModifier { 11 | @Binding var windowController: CodeEditWindowController? 12 | 13 | func body(content: Content) -> some View { 14 | content.onReceive(NSApp.publisher(for: \.keyWindow)) { window in 15 | windowController = window?.windowController as? CodeEditWindowController 16 | } 17 | } 18 | } 19 | 20 | extension View { 21 | @ViewBuilder 22 | func observeWindowController(_ binding: Binding) -> some View { 23 | self.modifier(KeyWindowControllerObserver(windowController: binding)) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEdit/Features/ActivityViewer/Tasks/DropdownMenuItemStyleModifier.swift: -------------------------------------------------------------------------------- 1 | // 2 | // DropdownMenuItemStyleModifier.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 24.06.24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct DropdownMenuItemStyleModifier: ViewModifier { 11 | @State private var isHovering = false 12 | 13 | func body(content: Content) -> some View { 14 | content 15 | .background( 16 | isHovering 17 | ? AnyView(EffectView(.selection, blendingMode: .withinWindow, emphasized: true)) 18 | : AnyView(Color.clear) 19 | ) 20 | .foregroundColor(isHovering ? Color(NSColor.white) : .primary) 21 | .onHover(perform: { hovering in 22 | self.isHovering = hovering 23 | }) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEdit/Features/Tasks/Models/CETaskStatus.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CETaskStatus.swift 3 | // CodeEditTests 4 | // 5 | // Created by Tommy Ludwig on 24.06.24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// Enum to represent a task's status 11 | enum CETaskStatus { 12 | // default state 13 | case notRunning 14 | // User suspended the process 15 | case stopped 16 | case running 17 | // Processes finished with an error 18 | case failed 19 | // Processes finished without an error 20 | case finished 21 | 22 | var color: Color { 23 | switch self { 24 | case .notRunning: return Color.gray 25 | case .stopped: return Color.yellow 26 | case .running: return Color.orange 27 | case .failed: return Color.red 28 | case .finished: return Color.green 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CodeEdit/Features/Welcome/Views/Resources/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | // Welcome Screen 2 | "Welcome to CodeEdit" = "Welcome to CodeEdit"; 3 | "Version %@ (%@)" = "Version %@ (%@)"; 4 | "No Recent Projects" = "No Recent Projects"; 5 | 6 | // Welcome Screen - New File 7 | "Create a new file" = "Create a new file"; 8 | "Clone an existing project" = "Clone an existing project"; 9 | 10 | // Welcome Screen - Open File 11 | "Open a file or folder" = "Open a file or folder"; 12 | "Open an existing file or folder on your Mac" = "Open an existing file or folder on your Mac"; 13 | 14 | // Welcome Screen - SCM 15 | "Start working on something from a Git repository" = "Start working on something from a Git repository"; 16 | 17 | "Remove from Recent Projects" = "Remove from Recent Projects"; 18 | "Show in Finder" = "Show in Finder"; 19 | "Copy Path" = "Copy Path"; 20 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/SettingsWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsWindow.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 3/31/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct SettingsWindow: Scene { 11 | private let updater = SoftwareUpdater() 12 | 13 | var body: some Scene { 14 | Window("Settings", id: SceneID.settings.rawValue) { 15 | SettingsView(updater: updater) 16 | .frame(minWidth: 715, maxWidth: 715) 17 | .task { 18 | let window = NSApp.windows.first { $0.identifier?.rawValue == SceneID.settings.rawValue }! 19 | window.titlebarAppearsTransparent = true 20 | } 21 | } 22 | .windowStyle(.automatic) 23 | .windowToolbarStyle(.unified) 24 | .windowResizability(.contentSize) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/Utils/String+QueryParameters.swift: -------------------------------------------------------------------------------- 1 | // 2 | // String+QueryParameters.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | extension String { 11 | var bitbucketQueryParameters: [String: String] { 12 | let parametersArray = components(separatedBy: "&") 13 | var parameters = [String: String]() 14 | parametersArray.forEach { parameter in 15 | let keyValueArray = parameter.components(separatedBy: "=") 16 | let (key, value) = (keyValueArray.first, keyValueArray.last) 17 | if let key = key?.removingPercentEncoding, let value = value?.removingPercentEncoding { 18 | parameters[key] = value 19 | } 20 | } 21 | return parameters 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarBreakpointButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarBreakpointButton.swift 3 | // CodeEdit 4 | // 5 | // Created by Stef Kors on 14/04/2022. 6 | // 7 | 8 | import SwiftUI 9 | import CodeEditSymbols 10 | 11 | struct StatusBarBreakpointButton: View { 12 | @EnvironmentObject private var statusBarViewModel: StatusBarViewModel 13 | 14 | var body: some View { 15 | Button { 16 | statusBarViewModel.isBreakpointEnabled.toggle() 17 | } label: { 18 | if statusBarViewModel.isBreakpointEnabled { 19 | Image.breakpointFill 20 | .foregroundColor(.accentColor) 21 | } else { 22 | Image.breakpoint 23 | .foregroundColor(.secondary) 24 | } 25 | } 26 | .buttonStyle(.plain) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitLab/Routers/GitLabUserRouter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitLabUserRouter.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | enum GitLabUserRouter: GitRouter { 11 | case readAuthenticatedUser(GitRouterConfiguration) 12 | 13 | var configuration: GitRouterConfiguration? { 14 | switch self { 15 | case .readAuthenticatedUser(let config): return config 16 | } 17 | } 18 | 19 | var method: GitHTTPMethod { 20 | .GET 21 | } 22 | 23 | var encoding: GitHTTPEncoding { 24 | .url 25 | } 26 | 27 | var path: String { 28 | switch self { 29 | case .readAuthenticatedUser: 30 | return "user" 31 | } 32 | } 33 | 34 | var params: [String: Any] { 35 | [:] 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /CodeEdit/Features/StatusBar/ViewModels/StatusBarViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarViewModel.swift 3 | // CodeEdit 4 | // 5 | // Created by Paul Ebose on 2024/5/12. 6 | // 7 | 8 | import SwiftUI 9 | 10 | final class StatusBarViewModel: ObservableObject { 11 | 12 | /// The file size of the currently opened file. 13 | @Published var fileSize: Int? 14 | 15 | /// The dimensions (width x height) of the currently opened image. 16 | @Published var dimensions: ImageDimensions? 17 | 18 | /// Indicates whether the breakpoint is enabled or not. 19 | @Published var isBreakpointEnabled = true 20 | 21 | /// The font style of items shown in the status bar. 22 | private(set) var statusBarFont = Font.system(size: 11, weight: .medium) 23 | 24 | /// The color of the text shown in the status bar. 25 | private(set) var foregroundStyle = Color.secondary 26 | 27 | } 28 | -------------------------------------------------------------------------------- /CodeEdit/Features/Search/FuzzySearch/FuzzySearchModels.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FuzzySearchModels.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 03.02.24. 6 | // 7 | 8 | import Foundation 9 | 10 | /// FuzzySearchCharacters is used to normalise strings 11 | struct FuzzySearchCharacter { 12 | let content: String 13 | // normalised content is referring to a string that is case- and accent-insensitive 14 | let normalisedContent: String 15 | } 16 | 17 | /// FuzzySearchString is just made up by multiple characters, similar to a string, but also with normalised characters 18 | struct FuzzySearchString { 19 | var characters: [FuzzySearchCharacter] 20 | } 21 | 22 | /// FuzzySearchMatchResult represents an object that has undergone a fuzzy search using the fuzzyMatch function. 23 | struct FuzzySearchMatchResult { 24 | let weight: Int 25 | let matchedParts: [NSRange] 26 | } 27 | -------------------------------------------------------------------------------- /CodeEdit/Features/SplitView/Views/SplitView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SplitView.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 22/02/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct SplitView: View { 11 | var axis: Axis 12 | var content: Content 13 | 14 | init(axis: Axis, @ViewBuilder content: () -> Content) { 15 | self.axis = axis 16 | self.content = content() 17 | } 18 | 19 | @State var viewController: () -> SplitViewController? = { nil } 20 | 21 | var body: some View { 22 | VStack { 23 | content.variadic { children in 24 | SplitViewControllerView(axis: axis, children: children, viewController: $viewController) 25 | } 26 | } 27 | ._trait(SplitViewControllerLayoutValueKey.self, viewController) 28 | .accessibilityElement(children: .contain) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+SignatureHelp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+SignatureHelp.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | extension LanguageServer { 12 | /// Request signature information at a given cursor position 13 | func requestSignatureHelp(for documentURI: String, _ position: Position) async throws -> SignatureHelpResponse { 14 | do { 15 | let params = TextDocumentPositionParams( 16 | textDocument: TextDocumentIdentifier(uri: documentURI), 17 | position: position 18 | ) 19 | return try await lspInstance.signatureHelp(params) 20 | } catch { 21 | logger.warning("requestInlayHint: Error \(error)") 22 | throw error 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEdit/Features/UtilityArea/Models/UtilityAreaTerminal.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UtilityAreaTerminal.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 7/27/24. 6 | // 7 | 8 | import Foundation 9 | 10 | final class UtilityAreaTerminal: ObservableObject, Identifiable, Equatable { 11 | let id: UUID 12 | @Published var url: URL 13 | @Published var title: String 14 | @Published var terminalTitle: String 15 | @Published var shell: Shell? 16 | @Published var customTitle: Bool 17 | 18 | init(id: UUID, url: URL, title: String, shell: Shell?) { 19 | self.id = id 20 | self.title = title 21 | self.terminalTitle = title 22 | self.url = url 23 | self.shell = shell 24 | self.customTitle = false 25 | } 26 | 27 | static func == (lhs: UtilityAreaTerminal, rhs: UtilityAreaTerminal) -> Bool { 28 | lhs.id == rhs.id 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Models/GitStatus.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitType.swift 3 | // 4 | // 5 | // Created by Nanashi Li on 2022/05/20. 6 | // 7 | 8 | import Foundation 9 | 10 | enum GitStatus: String, Codable { 11 | case none = "." 12 | case modified = "M" 13 | case untracked = "?" 14 | case fileTypeChange = "T" 15 | case added = "A" 16 | case deleted = "D" 17 | case renamed = "R" 18 | case copied = "C" 19 | case unmerged = "U" 20 | 21 | var description: String { 22 | switch self { 23 | case .modified: return "M" 24 | case .untracked: return "U" 25 | case .fileTypeChange: return "T" 26 | case .added: return "A" 27 | case .deleted: return "D" 28 | case .renamed: return "R" 29 | case .copied: return "C" 30 | case .unmerged: return "U" 31 | case .none: return "" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Documentation.docc/App Window/App Window.md: -------------------------------------------------------------------------------- 1 | # App Window 2 | 3 | A collection of all the views that make up the main app window. 4 | 5 | ## Topics 6 | 7 | ### Window Controller 8 | 9 | - ``CodeEditWindowController`` 10 | - ``WorkspaceView`` 11 | 12 | ### Main Content 13 | 14 | - ``EditorAreaView`` 15 | - ``EditorAreaFileView`` 16 | - ``CodeFileView`` 17 | - ``NonTextFileView`` 18 | - ``AnyFileView`` 19 | - ``LoadingFileView`` 20 | - ``ImageFileView`` 21 | - ``PDFFileView`` 22 | 23 | ### JumpBar 24 | 25 | - ``JumpBarView`` 26 | - ``JumpBarComponent`` 27 | - ``JumpBarMenu`` 28 | - ``JumpBarMenuItem`` 29 | 30 | ### Navigator Sidebar 31 | 32 | - ``NavigatorSidebarView`` 33 | 34 | ### Inspector Sidebar 35 | 36 | - ``InspectorAreaView`` 37 | 38 | ### Status Bar 39 | 40 | - ``StatusBarView`` 41 | 42 | ### Tab Bar 43 | 44 | - ``TabBarView`` 45 | 46 | ### Terminal Emulator 47 | 48 | - ``TerminalEmulatorView`` 49 | -------------------------------------------------------------------------------- /CodeEdit/Features/Editor/TabBar/Views/EditorTabBarView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // EditorTabBarView.swift 3 | // CodeEdit 4 | // 5 | // Created by Lukas Pistrol and Lingxi Li on 17.03.22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct EditorTabBarView: View { 11 | /// The height of tab bar. 12 | /// I am not making it a private variable because it may need to be used in outside views. 13 | static let height = 28.0 14 | 15 | var body: some View { 16 | HStack(alignment: .center, spacing: 0) { 17 | EditorTabBarLeadingAccessories() 18 | EditorTabs() 19 | .accessibilityElement(children: .contain) 20 | .accessibilityLabel("Tab Bar") 21 | .accessibilityIdentifier("TabBar") 22 | EditorTabBarTrailingAccessories() 23 | } 24 | .frame(height: EditorTabBarView.height) 25 | .padding(.leading, -1) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Pages/NavigationSettings/NavigationSettingsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NavigationSettingsView.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 3/4/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct NavigationSettingsView: View { 11 | @AppSettings(\.navigation) 12 | var settings 13 | 14 | var body: some View { 15 | SettingsForm { 16 | Section { 17 | navigationStyle 18 | } 19 | } 20 | } 21 | } 22 | 23 | private extension NavigationSettingsView { 24 | private var navigationStyle: some View { 25 | Picker("Navigation Style", selection: $settings.navigationStyle) { 26 | Text("Open in Tabs") 27 | .tag(SettingsData.NavigationStyle.openInTabs) 28 | Text("Open in Place") 29 | .tag(SettingsData.NavigationStyle.openInPlace) 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CodeEdit/Features/CodeEditUI/Views/Divided.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Divided.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/18/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct Divided: View { 11 | var content: Content 12 | 13 | init(@ViewBuilder content: () -> Content) { 14 | self.content = content() 15 | } 16 | 17 | var body: some View { 18 | _VariadicView.Tree(DividedLayout()) { 19 | content 20 | } 21 | } 22 | 23 | struct DividedLayout: _VariadicView_MultiViewRoot { 24 | @ViewBuilder 25 | func body(children: _VariadicView.Children) -> some View { 26 | let last = children.last?.id 27 | 28 | ForEach(children) { child in 29 | child 30 | 31 | if child.id != last { 32 | Divider() 33 | } 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Custom Colors/Amber.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.133", 9 | "green" : "0.635", 10 | "red" : "0.784" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "display-p3", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0.302", 27 | "green" : "0.812", 28 | "red" : "0.961" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Custom Colors/CoolGray.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.553", 9 | "green" : "0.541", 10 | "red" : "0.518" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "display-p3", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0.549", 27 | "green" : "0.537", 28 | "red" : "0.525" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Custom Colors/InspectorBackgroundColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "srgb", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0xF7", 9 | "green" : "0xF5", 10 | "red" : "0xF4" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "srgb", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0x25", 27 | "green" : "0x1F", 28 | "red" : "0x1C" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Custom Colors/Scarlet.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.176", 9 | "green" : "0.303", 10 | "red" : "0.956" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "display-p3", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0.376", 27 | "green" : "0.475", 28 | "red" : "0.960" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Custom Colors/Steel.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.522", 9 | "green" : "0.463", 10 | "red" : "0.373" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "display-p3", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0.749", 27 | "green" : "0.690", 28 | "red" : "0.585" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeEdit/Assets.xcassets/Custom Colors/FolderBlue.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "color" : { 5 | "color-space" : "display-p3", 6 | "components" : { 7 | "alpha" : "1.000", 8 | "blue" : "0.973", 9 | "green" : "0.698", 10 | "red" : "0.125" 11 | } 12 | }, 13 | "idiom" : "universal" 14 | }, 15 | { 16 | "appearances" : [ 17 | { 18 | "appearance" : "luminosity", 19 | "value" : "dark" 20 | } 21 | ], 22 | "color" : { 23 | "color-space" : "display-p3", 24 | "components" : { 25 | "alpha" : "1.000", 26 | "blue" : "0.859", 27 | "green" : "0.698", 28 | "red" : "0.365" 29 | } 30 | }, 31 | "idiom" : "universal" 32 | } 33 | ], 34 | "info" : { 35 | "author" : "xcode", 36 | "version" : 1 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+Hover.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+Hover.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | extension LanguageServer { 12 | /// The hover request is sent from the client to the server to request hover 13 | /// information at a given text document position. 14 | func requestHover(for documentURI: String, _ position: Position) async throws -> HoverResponse { 15 | do { 16 | let params = TextDocumentPositionParams( 17 | textDocument: TextDocumentIdentifier(uri: documentURI), 18 | position: position 19 | ) 20 | return try await lspInstance.hover(params) 21 | } catch { 22 | logger.warning("requestHover: Error \(error)") 23 | throw error 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+Implementation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+Implementation.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | extension LanguageServer { 12 | /// Resolve the implementation location of a symbol at a given text document position 13 | func requestImplementation(for documentURI: String, _ position: Position) async throws -> ImplementationResponse { 14 | do { 15 | let params = TextDocumentPositionParams( 16 | textDocument: TextDocumentIdentifier(uri: documentURI), 17 | position: position 18 | ) 19 | return try await lspInstance.implementation(params) 20 | } catch { 21 | logger.warning("requestImplementation: Error \(error)") 22 | throw error 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+TypeDefinition.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+TypeDefinition.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | extension LanguageServer { 12 | /// Resolve the type definition location of a symbol at a given text document position 13 | func requestTypeDefinition(for documentURI: String, _ position: Position) async throws -> TypeDefinitionResponse { 14 | do { 15 | let params = TextDocumentPositionParams( 16 | textDocument: TextDocumentIdentifier(uri: documentURI), 17 | position: position 18 | ) 19 | return try await lspInstance.typeDefinition(params) 20 | } catch { 21 | logger.warning("requestTypeDefinition: Error \(error)") 22 | throw error 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEdit/Features/WindowCommands/MainCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MainCommands.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 13/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | import Sparkle 10 | 11 | struct MainCommands: Commands { 12 | @Environment(\.openWindow) 13 | var openWindow 14 | 15 | var body: some Commands { 16 | CommandGroup(replacing: .appInfo) { 17 | Button("About CodeEdit") { 18 | openWindow(sceneID: .about) 19 | } 20 | 21 | Button("Check for updates...") { 22 | NSApp.sendAction(#selector(SPUStandardUpdaterController.checkForUpdates(_:)), to: nil, from: nil) 23 | } 24 | } 25 | 26 | CommandGroup(replacing: .appSettings) { 27 | Button("Settings...") { 28 | openWindow(sceneID: .settings) 29 | } 30 | .keyboardShortcut(",") 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Models/SettingsSidebarFix.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingsSidebarFix.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 13/04/2023. 6 | // 7 | 8 | import AppKit 9 | 10 | extension NSSplitViewItem { 11 | @objc fileprivate var canCollapseSwizzled: Bool { 12 | if let check = self.viewController.view.window?.isSettingsWindow, check { 13 | return false 14 | } 15 | return self.canCollapseSwizzled 16 | } 17 | 18 | static func swizzle() { 19 | let origSelector = #selector(getter: NSSplitViewItem.canCollapse) 20 | let swizzledSelector = #selector(getter: canCollapseSwizzled) 21 | let originalMethodSet = class_getInstanceMethod(self as AnyClass, origSelector) 22 | let swizzledMethodSet = class_getInstanceMethod(self as AnyClass, swizzledSelector) 23 | 24 | method_exchangeImplementations(originalMethodSet!, swizzledMethodSet!) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CodeEditUITests/Extensions/XCUITest+waitForNonExistence.swift: -------------------------------------------------------------------------------- 1 | // 2 | // XCUITest+waitForNonExistence.swift 3 | // CodeEditUITests 4 | // 5 | // Created by Khan Winter on 1/7/25. 6 | // 7 | 8 | import XCTest 9 | 10 | // Backport to Xcode 15, this exists in Xcode 16. 11 | 12 | extension XCUIElement { 13 | /// Waits the specified amount of time for the element’s `exists` property to become `false`. 14 | /// - Parameter timeout: The amount of time to wait. 15 | /// - Returns: `false` if the timeout expires without the element coming out of existence. 16 | func waitForNonExistence(timeout: TimeInterval) -> Bool { 17 | let predicate = NSPredicate(format: "exists == false") 18 | switch XCTWaiter.wait(for: [XCTNSPredicateExpectation(predicate: predicate, object: self)], timeout: timeout) { 19 | case .completed: 20 | return true 21 | default: 22 | return false 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEdit/Features/ActivityViewer/Tasks/OptionMenuItemView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OptionMenuItemView.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 24.06.24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct OptionMenuItemView: View { 11 | var label: String 12 | var action: () -> Void 13 | 14 | var body: some View { 15 | HStack { 16 | Text(label) 17 | Spacer() 18 | } 19 | .padding(.vertical, 4) 20 | .padding(.horizontal, 28) 21 | .modifier(DropdownMenuItemStyleModifier()) 22 | .clipShape(RoundedRectangle(cornerRadius: 5)) 23 | .onTapGesture { 24 | action() 25 | } 26 | .accessibilityElement() 27 | .accessibilityAction { 28 | action() 29 | } 30 | .accessibilityLabel(label) 31 | } 32 | } 33 | 34 | #Preview { 35 | OptionMenuItemView(label: "Test") { 36 | print("test") 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeEdit/Features/InspectorArea/HistoryInspector/HistoryInspectorItemView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HistoryInspectorItemView.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 12/27/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct HistoryInspectorItemView: View { 11 | var commit: GitCommit 12 | 13 | @Binding var selection: GitCommit? 14 | 15 | private var showPopup: Binding { 16 | Binding { 17 | selection == commit 18 | } set: { newValue in 19 | if newValue { 20 | selection = commit 21 | } else if selection == commit { 22 | selection = nil 23 | } 24 | } 25 | } 26 | 27 | var body: some View { 28 | CommitListItemView(commit: commit, showRef: false) 29 | .instantPopover(isPresented: showPopup, arrowEdge: .leading) { 30 | HistoryPopoverView(commit: commit) 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarMenuStyle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarMenuStyle.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 3/24/23 6 | // 7 | 8 | import SwiftUI 9 | import CodeEditSymbols 10 | 11 | struct StatusBarMenuStyle: MenuStyle { 12 | @Environment(\.controlActiveState) 13 | private var controlActive 14 | 15 | @Environment(\.colorScheme) 16 | private var colorScheme 17 | 18 | func makeBody(configuration: Configuration) -> some View { 19 | Menu(configuration) 20 | .controlSize(.small) 21 | .menuStyle(.borderlessButton) 22 | .opacity(controlActive == .inactive 23 | ? colorScheme == .dark ? 0.66 : 1 24 | : colorScheme == .dark ? 0.54 : 0.72) 25 | .fixedSize() 26 | } 27 | } 28 | 29 | extension MenuStyle where Self == StatusBarMenuStyle { 30 | static var statusBar: StatusBarMenuStyle { .init() } 31 | } 32 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/NSWindow/NSWindow+Child.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSWindow+Child.swift 3 | // CodeEdit 4 | // 5 | // Created by Axel Martinez on 8/4/24. 6 | // 7 | 8 | import AppKit 9 | 10 | extension NSWindow { 11 | func addCenteredChildWindow(_ childWindow: NSWindow, over parentWindow: NSWindow) { 12 | let parentFrame = parentWindow.frame 13 | let parentCenterX = parentFrame.origin.x + (parentFrame.size.width / 2) 14 | let parentCenterY = parentFrame.origin.y + (parentFrame.size.height / 2) 15 | 16 | let childWidth = childWindow.frame.size.width 17 | let childHeight = childWindow.frame.size.height 18 | let newChildOriginX = parentCenterX - (childWidth / 2) 19 | let newChildOriginY = parentCenterY - (childHeight / 2) 20 | 21 | childWindow.setFrameOrigin(NSPoint(x: newChildOriginX, y: newChildOriginY)) 22 | 23 | parentWindow.addChildWindow(childWindow, ordered: .above) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /CodeEdit/Utils/FocusedValues.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FocusedValues.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 18/06/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | extension FocusedValues { 11 | var navigationSplitViewVisibility: Binding? { 12 | get { self[NavSplitViewVisibilityFocusedValueKey.self] } 13 | set { self[NavSplitViewVisibilityFocusedValueKey.self] = newValue } 14 | } 15 | 16 | var inspectorVisibility: Binding? { 17 | get { self[InspectorVisibilityFocusedValueKey.self] } 18 | set { self[InspectorVisibilityFocusedValueKey.self] = newValue } 19 | } 20 | 21 | private struct NavSplitViewVisibilityFocusedValueKey: FocusedValueKey { 22 | typealias Value = Binding 23 | } 24 | 25 | private struct InspectorVisibilityFocusedValueKey: FocusedValueKey { 26 | typealias Value = Binding 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+SelectionRange.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+SelectionRange.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | extension LanguageServer { 12 | /// Setup and test the validity of a rename operation at a given location 13 | func requestSelectionRange(for documentURI: String, positions: [Position]) async throws -> SelectionRangeResponse { 14 | do { 15 | let params = SelectionRangeParams( 16 | workDoneToken: nil, 17 | textDocument: TextDocumentIdentifier(uri: documentURI), 18 | positions: positions 19 | ) 20 | return try await lspInstance.selectionRange(params) 21 | } catch { 22 | logger.warning("requestSelectionRange: Error \(error)") 23 | throw error 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Views/View+HideSidebarToggle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // View+HideSidebarToggle.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 4/5/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | extension View { 11 | func hideSidebarToggle() -> some View { 12 | modifier(HideSidebarToggleViewModifier()) 13 | } 14 | } 15 | 16 | struct HideSidebarToggleViewModifier: ViewModifier { 17 | func body(content: Content) -> some View { 18 | content 19 | .task { 20 | let window = NSApp.windows.first { $0.identifier?.rawValue == SceneID.settings.rawValue }! 21 | let sidebaritem = "com.apple.SwiftUI.navigationSplitView.toggleSidebar" 22 | let index = window.toolbar?.items.firstIndex { $0.itemIdentifier.rawValue == sidebaritem } 23 | if let index { 24 | window.toolbar?.removeItem(at: index) 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CodeEdit/Features/WindowCommands/WindowCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WindowCommands.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 13/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct WindowCommands: Commands { 11 | @Environment(\.openWindow) 12 | var openWindow 13 | 14 | var body: some Commands { 15 | CommandGroup(replacing: .singleWindowList) { 16 | Button("Welcome to CodeEdit") { 17 | openWindow(sceneID: .welcome) 18 | } 19 | .keyboardShortcut("1", modifiers: [.shift, .command]) 20 | 21 | Button("About CodeEdit") { 22 | openWindow(sceneID: .about) 23 | } 24 | .keyboardShortcut("2", modifiers: [.shift, .command]) 25 | 26 | Button("Manage Extensions") { 27 | openWindow(sceneID: .extensions) 28 | } 29 | .keyboardShortcut("3", modifiers: [.shift, .command]) 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/Bundle/Bundle+Info.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Bundle+Info.swift 3 | // CodeEditModules/CodeEditUtils 4 | // 5 | // Created by Lukas Pistrol on 01.05.22. 6 | // 7 | 8 | import Foundation 9 | 10 | extension Bundle { 11 | 12 | static var copyrightString: String? { 13 | Bundle.main.object(forInfoDictionaryKey: "NSHumanReadableCopyright") as? String 14 | } 15 | 16 | /// Returns the main bundle's version string if available (e.g. 1.0.0) 17 | static var versionString: String? { 18 | Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String 19 | } 20 | 21 | /// Returns the main bundle's build string if available (e.g. 123) 22 | static var buildString: String? { 23 | Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String 24 | } 25 | 26 | static var versionPostfix: String? { 27 | Bundle.main.object(forInfoDictionaryKey: "CE_VERSION_POSTFIX") as? String 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: ✨ Feature request 2 | description: Suggest an idea for this project 3 | title: ✨ 4 | labels: enhancement 5 | 6 | body: 7 | - type: textarea 8 | attributes: 9 | label: Description 10 | placeholder: >- 11 | A clear and concise description of what you would like to happen... 12 | validations: 13 | required: true 14 | 15 | - type: textarea 16 | attributes: 17 | label: Alternatives Considered 18 | placeholder: >- 19 | Any alternative solutions or features you've considered... 20 | 21 | - type: textarea 22 | attributes: 23 | label: Additional Context 24 | placeholder: >- 25 | Any other context or considerations about the feature request... 26 | 27 | - type: textarea 28 | attributes: 29 | label: Screenshots 30 | placeholder: >- 31 | If applicable, please provide relevant screenshots or screen recordings... 32 | -------------------------------------------------------------------------------- /CodeEdit/Features/Editor/TabBar/Views/EditorTabBarAccessory.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TabBarAccessory.swift 3 | // CodeEdit 4 | // 5 | // Created by Lingxi Li on 4/28/22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// Accessory icon's view for tab bar. 11 | struct EditorTabBarAccessoryIcon: View { 12 | /// Unifies icon font for tab bar accessories. 13 | static let iconFont = Font.system(size: 14, weight: .regular, design: .default) 14 | 15 | private let icon: Image 16 | private let isActive: Bool 17 | private let action: () -> Void 18 | 19 | init(icon: Image, isActive: Bool = false, action: @escaping () -> Void) { 20 | self.icon = icon 21 | self.isActive = isActive 22 | self.action = action 23 | } 24 | 25 | var body: some View { 26 | Button( 27 | action: action, 28 | label: { 29 | icon 30 | } 31 | ) 32 | .buttonStyle(.icon(isActive: isActive, size: 24)) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /CodeEdit/Features/Documents/CodeFileDocument/FileEncoding.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FileEncoding.swift 3 | // CodeEdit 4 | // 5 | // Created by Khan Winter on 5/31/24. 6 | // 7 | 8 | import Foundation 9 | 10 | enum FileEncoding: CaseIterable { 11 | case utf8 12 | case utf16BE 13 | case utf16LE 14 | 15 | var nsValue: UInt { 16 | switch self { 17 | case .utf8: 18 | return NSUTF8StringEncoding 19 | case .utf16BE: 20 | return NSUTF16BigEndianStringEncoding 21 | case .utf16LE: 22 | return NSUTF16LittleEndianStringEncoding 23 | } 24 | } 25 | 26 | init?(_ int: UInt) { 27 | switch int { 28 | case NSUTF8StringEncoding: 29 | self = .utf8 30 | case NSUTF16BigEndianStringEncoding: 31 | self = .utf16BE 32 | case NSUTF16LittleEndianStringEncoding: 33 | self = .utf16LE 34 | default: 35 | return nil 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: 2 | - todo 3 | - trailing_comma 4 | - nesting 5 | 6 | type_name: 7 | excluded: 8 | - ID 9 | 10 | identifier_name: 11 | allowed_symbols: ["$", "_"] 12 | excluded: 13 | - id 14 | - vc 15 | 16 | # paths to ignore during linting. 17 | excluded: 18 | - CodeEditModules/.build # Where Swift Package Manager checks out dependency sources 19 | - DerivedData 20 | 21 | opt_in_rules: 22 | - attributes 23 | - empty_count 24 | - closure_spacing 25 | - contains_over_first_not_nil 26 | - missing_docs 27 | # - implicit_return 28 | - modifier_order 29 | - convenience_type 30 | - pattern_matching_keywords 31 | - multiline_parameters_brackets 32 | - multiline_arguments_brackets 33 | 34 | custom_rules: 35 | spaces_over_tabs: 36 | included: ".*\\.swift" 37 | name: "Spaces over Tabs" 38 | regex: "\t" 39 | message: "Prefer spaces for indents over tabs. See Xcode setting: 'Text Editing' -> 'Indentation'" 40 | severity: warning 41 | -------------------------------------------------------------------------------- /CodeEdit/Features/WindowCommands/Utils/FirstResponderPropertyWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FirstResponderPropertyWrapper.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 14/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// A property wrapper which allows for easy access to the current first responder. 11 | /// This differs from the SwiftUI Focus System, as you get AppKit NSResponders, which you can call methods on. 12 | /// It can also be easily checked if the current first selector accepts some event. 13 | @propertyWrapper 14 | struct FirstResponder: DynamicProperty { 15 | @StateObject var helper = HelperClass() 16 | 17 | var wrappedValue: NSResponder? { 18 | helper.responder 19 | } 20 | 21 | class HelperClass: ObservableObject { 22 | @Published var responder: NSResponder? = NSApp.keyWindow?.firstResponder 23 | 24 | init() { 25 | NSApp.publisher(for: \.keyWindow?.firstResponder).assign(to: &$responder) 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Pages/GeneralSettings/View+actionBar.swift: -------------------------------------------------------------------------------- 1 | // 2 | // View+actionBar.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 9/18/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | extension View { 11 | func actionBar(@ViewBuilder content: () -> Content) -> some View { 12 | self 13 | .padding(.bottom, 24) 14 | .overlay(alignment: .bottom) { 15 | VStack(spacing: -1) { 16 | Divider() 17 | HStack(spacing: 0) { 18 | content() 19 | .buttonStyle(.icon(font: Font.system(size: 11, weight: .medium), size: 24)) 20 | } 21 | .frame(height: 16) 22 | .padding(.vertical, 4) 23 | .frame(maxWidth: .infinity, alignment: .leading) 24 | } 25 | .frame(height: 24) 26 | .background(.separator) 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /AppCast/Gemfile: -------------------------------------------------------------------------------- 1 | source "https://rubygems.org" 2 | 3 | # Hello! This is where you manage which Jekyll version is used to run. 4 | # When you want to use a different version, change it below, save the 5 | # file and run `bundle install`. Run Jekyll with `bundle exec`, like so: 6 | # 7 | # bundle exec jekyll serve 8 | # 9 | # This will help ensure the proper Jekyll version is running. 10 | # Happy Jekylling! 11 | gem "jekyll", "~> 3.9.0" 12 | 13 | gem "jekyll-github-metadata", group: :jekyll_plugins 14 | 15 | # Windows does not include zoneinfo files, so bundle the tzinfo-data gem 16 | # and associated library. 17 | install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do 18 | gem "tzinfo", "~> 1.2" 19 | gem "tzinfo-data" 20 | end 21 | 22 | # Performance-booster for watching directories on Windows 23 | gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform? 24 | 25 | # kramdown v2 ships without the gfm parser by default. If you're using 26 | # kramdown v1, comment out this line. 27 | gem "kramdown-parser-gfm" 28 | 29 | -------------------------------------------------------------------------------- /CodeEdit/Features/NavigatorArea/SourceControlNavigator/Changes/Views/SourceControlNavigatorNoRemotesView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SourceControlNavigatorNoRemotesView.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/17/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct SourceControlNavigatorNoRemotesView: View { 11 | @EnvironmentObject var sourceControlManager: SourceControlManager 12 | 13 | var body: some View { 14 | VStack(spacing: 0) { 15 | HStack { 16 | Label( 17 | title: { 18 | Text("No remotes") 19 | }, icon: { 20 | Image(systemName: "network") 21 | .foregroundColor(.secondary) 22 | } 23 | ) 24 | Spacer() 25 | Button("Add") { 26 | sourceControlManager.addExistingRemoteSheetIsPresented = true 27 | } 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/LSPCache+Data.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LSPCache+Data.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 6/23/24. 6 | // 7 | 8 | import Foundation 9 | 10 | struct NoExtraData: Hashable { } 11 | 12 | struct CacheKey: Hashable { 13 | let uri: String 14 | let requestType: String 15 | let extraData: AnyHashable? 16 | 17 | init(uri: String, requestType: String, extraData: AnyHashable? = nil) { 18 | self.uri = uri 19 | self.requestType = requestType 20 | self.extraData = extraData 21 | } 22 | 23 | static func == (lhs: CacheKey, rhs: CacheKey) -> Bool { 24 | return lhs.uri == rhs.uri && 25 | lhs.requestType == rhs.requestType && 26 | lhs.extraData == rhs.extraData 27 | } 28 | 29 | func hash(into hasher: inout Hasher) { 30 | hasher.combine(uri) 31 | hasher.combine(requestType) 32 | if let extraData = extraData { 33 | hasher.combine(extraData) 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+ColorPresentation.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+ColorPresentation.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | extension LanguageServer { 12 | func requestColorPresentation( 13 | for documentURI: String, 14 | color: Color, 15 | range: LSPRange 16 | ) async throws -> ColorPresentationResponse { 17 | do { 18 | let params = ColorPresentationParams( 19 | workDoneToken: nil, 20 | partialResultToken: nil, 21 | textDocument: TextDocumentIdentifier(uri: documentURI), 22 | color: color, 23 | range: range 24 | ) 25 | return try await lspInstance.colorPresentation(params) 26 | } catch { 27 | logger.warning("requestColorPresentation: Error \(error)") 28 | throw error 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /CodeEdit/Features/About/Acknowledgements/Views/ParsePackagesResolved.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ParsePackagesResolved.swift 3 | // CodeEditModules/Acknowledgements 4 | // 5 | // Created by Shivesh M M on 4/4/22. 6 | // 7 | 8 | import Foundation 9 | 10 | struct AcknowledgementDependency: Decodable { 11 | var name: String 12 | var repositoryLink: String 13 | var version: String 14 | var repositoryURL: URL { 15 | URL(string: repositoryLink)! 16 | } 17 | } 18 | 19 | // MARK: - Object 20 | struct AcknowledgementObject: Codable { 21 | let pins: [AcknowledgementPin] 22 | } 23 | 24 | // MARK: - Pin 25 | struct AcknowledgementPin: Codable { 26 | let identity: String 27 | let location: String 28 | let state: AcknowledgementPackageState 29 | 30 | var name: String { 31 | location.split(separator: "/").last?.replacingOccurrences(of: ".git", with: "") ?? identity 32 | } 33 | } 34 | 35 | // MARK: - State 36 | struct AcknowledgementPackageState: Codable { 37 | let revision: String 38 | let version: String? 39 | } 40 | -------------------------------------------------------------------------------- /CodeEdit/Features/Extensions/ExtensionManagerWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ExtensionManagerWindow.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 24/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ExtensionManagerWindow: Scene { 11 | @ObservedObject var manager = ExtensionManager.shared 12 | 13 | @State var selection = Set() 14 | 15 | var body: some Scene { 16 | Window("Extensions", id: SceneID.extensions.rawValue) { 17 | NavigationSplitView { 18 | ExtensionsListView(selection: $selection) 19 | } detail: { 20 | switch selection.count { 21 | case 0: 22 | Text("Select an extension") 23 | case 1: 24 | ExtensionDetailView(ext: selection.first!) 25 | default: 26 | Text("\(selection.count) selected") 27 | } 28 | } 29 | .environmentObject(manager) 30 | .focusedObject(manager) 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CodeEdit/Features/LSP/LanguageServer/Capabilities/LanguageServer+References.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LanguageServer+References.swift 3 | // CodeEdit 4 | // 5 | // Created by Abe Malla on 2/7/24. 6 | // 7 | 8 | import Foundation 9 | import LanguageServerProtocol 10 | 11 | extension LanguageServer { 12 | /// Resolve project-wide references for the symbol denoted by the given text document position 13 | func requestFindReferences( 14 | for documentURI: String, 15 | _ position: Position, 16 | _ includeDeclaration: Bool = false 17 | ) async throws -> ReferenceResponse { 18 | do { 19 | let params = ReferenceParams( 20 | textDocument: TextDocumentIdentifier(uri: documentURI), 21 | position: position, 22 | includeDeclaration: includeDeclaration 23 | ) 24 | return try await lspInstance.references(params) 25 | } catch { 26 | logger.warning("requestFindReferences: Error \(error)") 27 | throw error 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Views/View+ConstrainHeightToWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // View+ConstrainHeightToWindow.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 4/3/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | extension NSWindow { 11 | var isSettingsWindow: Bool { 12 | self.identifier?.rawValue == SceneID.settings.rawValue 13 | } 14 | } 15 | 16 | extension NSApplication { 17 | var settingsWindow: NSWindow? { 18 | NSApp.windows.first { $0.isSettingsWindow } 19 | } 20 | } 21 | 22 | extension View { 23 | func constrainHeightToWindow() -> some View { 24 | modifier(ConstrainHeightToWindowViewModifier()) 25 | } 26 | } 27 | 28 | struct ConstrainHeightToWindowViewModifier: ViewModifier { 29 | @State var height: CGFloat = 100 30 | 31 | func body(content: Content) -> some View { 32 | content 33 | .frame(height: height-100) 34 | .onReceive(NSApp.settingsWindow!.publisher(for: \.frame)) { newValue in 35 | height = newValue.height 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/Bitbucket/Routers/BitBucketUserRouter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BitBucketUserRouter.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | enum BitBucketUserRouter: GitRouter { 11 | case readAuthenticatedUser(GitRouterConfiguration) 12 | case readEmails(GitRouterConfiguration) 13 | 14 | var configuration: GitRouterConfiguration? { 15 | switch self { 16 | case .readAuthenticatedUser(let config): return config 17 | case .readEmails(let config): return config 18 | } 19 | } 20 | 21 | var method: GitHTTPMethod { 22 | .GET 23 | } 24 | 25 | var encoding: GitHTTPEncoding { 26 | .url 27 | } 28 | 29 | var path: String { 30 | switch self { 31 | case .readAuthenticatedUser: 32 | return "user" 33 | case .readEmails: 34 | return "user/emails" 35 | } 36 | } 37 | 38 | var params: [String: Any] { 39 | [:] 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CodeEdit/Features/ActivityViewer/Tasks/TaskView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TaskView.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 8/4/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// `TaskView` represents a single active task and observes its state. 11 | /// - Parameter task: The task to be displayed and observed. 12 | /// - Parameter status: The status of the task to be displayed. 13 | struct TaskView: View { 14 | @ObservedObject var task: CETask 15 | var status: CETaskStatus 16 | 17 | var body: some View { 18 | HStack(spacing: 5) { 19 | Image(systemName: "gearshape") 20 | Text(task.name) 21 | .frame(minWidth: 0) 22 | Spacer(minLength: 0) 23 | } 24 | .padding(.trailing, 7.5) 25 | .overlay(alignment: .trailing) { 26 | Circle() 27 | .fill(status.color) 28 | .frame(width: 5, height: 5) 29 | .padding(.trailing, 2.5) 30 | } 31 | .accessibilityElement() 32 | .accessibilityLabel(task.name) 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitHub/Routers/GitHubUserRouter.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitHubUserRouter.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanshi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | enum GitHubUserRouter: GitRouter { 11 | case readAuthenticatedUser(GitRouterConfiguration) 12 | case readUser(String, GitRouterConfiguration) 13 | 14 | var configuration: GitRouterConfiguration? { 15 | switch self { 16 | case let .readAuthenticatedUser(config): return config 17 | case let .readUser(_, config): return config 18 | } 19 | } 20 | 21 | var method: GitHTTPMethod { 22 | .GET 23 | } 24 | 25 | var encoding: GitHTTPEncoding { 26 | .url 27 | } 28 | 29 | var path: String { 30 | switch self { 31 | case .readAuthenticatedUser: 32 | return "user" 33 | case let .readUser(username, _): 34 | return "users/\(username)" 35 | } 36 | } 37 | 38 | var params: [String: Any] { 39 | [:] 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CodeEdit/Utils/Extensions/NSApplication/NSApp+openWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSApp+openWindow.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 14/03/2023. 6 | // 7 | 8 | import AppKit 9 | import SwiftUI 10 | 11 | extension OpenWindowAction { 12 | func callAsFunction(sceneID: SceneID) { 13 | callAsFunction(id: sceneID.rawValue) 14 | } 15 | } 16 | 17 | extension NSApplication { 18 | func closeWindow(_ id: SceneID) { 19 | windows.first { $0.identifier?.rawValue == id.rawValue }?.close() 20 | } 21 | 22 | func closeWindow(_ ids: SceneID...) { 23 | ids.forEach { id in 24 | windows.first { $0.identifier?.rawValue == id.rawValue }?.close() 25 | } 26 | } 27 | 28 | func findWindow(_ id: SceneID) -> NSWindow? { 29 | windows.first { $0.identifier?.rawValue == id.rawValue } 30 | } 31 | 32 | var openSwiftUIWindows: Int { 33 | NSApp 34 | .windows 35 | .compactMap(\.identifier?.rawValue) 36 | .compactMap { SceneID(rawValue: $0) } 37 | .count 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /CodeEdit/Features/CodeEditUI/Views/SearchPanel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SearchPanel.swift 3 | // CodeEditModules/CodeEditUI 4 | // 5 | // Created by Pavel Kasila on 20.03.22. 6 | // 7 | 8 | import Cocoa 9 | 10 | final class SearchPanel: NSPanel, NSWindowDelegate { 11 | init() { 12 | super.init( 13 | contentRect: NSRect(x: 0, y: 0, width: 500, height: 48), 14 | styleMask: [.fullSizeContentView, .titled, .resizable], 15 | backing: .buffered, defer: false 16 | ) 17 | self.delegate = self 18 | self.center() 19 | self.titlebarAppearsTransparent = true 20 | self.isMovableByWindowBackground = true 21 | } 22 | 23 | override func standardWindowButton(_ button: NSWindow.ButtonType) -> NSButton? { 24 | let button = super.standardWindowButton(button) 25 | button?.isHidden = true 26 | return button 27 | } 28 | 29 | func windowDidResignKey(_ notification: Notification) { 30 | if let panel = notification.object as? SearchPanel { 31 | panel.close() 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /CodeEdit/Features/OpenQuickly/Views/OpenQuicklyPreviewView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OpenQuicklyPreviewView.swift 3 | // CodeEditModules/QuickOpen 4 | // 5 | // Created by Pavel Kasila on 20.03.22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct OpenQuicklyPreviewView: View { 11 | 12 | private let queue = DispatchQueue(label: "app.codeedit.CodeEdit.quickOpen.preview") 13 | private let item: CEWorkspaceFile 14 | 15 | @ObservedObject var document: CodeFileDocument 16 | 17 | init(item: CEWorkspaceFile) { 18 | self.item = item 19 | let doc = try? CodeFileDocument( 20 | for: item.url, 21 | withContentsOf: item.url, 22 | ofType: item.contentType?.identifier ?? "public.source-code" 23 | ) 24 | self._document = .init(wrappedValue: doc ?? .init()) 25 | } 26 | 27 | var body: some View { 28 | if let utType = document.utType, utType.conforms(to: .text) { 29 | CodeFileView(codeFile: document, isEditable: false) 30 | } else { 31 | NonTextFileView(fileDocument: document) 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /CodeEdit/Features/StatusBar/Views/StatusBarItems/StatusBarIndentSelector.swift: -------------------------------------------------------------------------------- 1 | // 2 | // StatusBarIndentSelector.swift 3 | // CodeEditModules/StatusBar 4 | // 5 | // Created by Lukas Pistrol on 22.03.22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct StatusBarIndentSelector: View { 11 | @AppSettings(\.textEditing.defaultTabWidth) 12 | var defaultTabWidth 13 | 14 | var body: some View { 15 | Menu { 16 | Button {} label: { 17 | Text("Use Tabs") 18 | }.disabled(true) 19 | 20 | Button {} label: { 21 | Text("Use Spaces") 22 | }.disabled(true) 23 | 24 | Divider() 25 | 26 | Picker("Tab Width", selection: $defaultTabWidth) { 27 | ForEach(2..<9) { index in 28 | Text("\(index) Spaces") 29 | .tag(index) 30 | } 31 | } 32 | } label: { 33 | Text("\(defaultTabWidth) Spaces") 34 | } 35 | .menuStyle(StatusBarMenuStyle()) 36 | .onHover { isHovering($0) } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Client/GitClient+Push.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitClient+Push.swift 3 | // CodeEdit 4 | // 5 | // Created by Albert Vinizhanau on 10/20/23. 6 | // 7 | 8 | import Foundation 9 | 10 | extension GitClient { 11 | /// Push changes to remote 12 | func pushToRemote( 13 | remote: String? = nil, 14 | branch: String? = nil, 15 | setUpstream: Bool? = false, 16 | force: Bool? = false, 17 | tags: Bool? = false 18 | ) async throws { 19 | var command = "push" 20 | if let remote, let branch { 21 | if setUpstream == true { 22 | command += " --set-upstream" 23 | } 24 | if force == true { 25 | command += " --force" 26 | } 27 | if tags == true { 28 | command += " --tags" 29 | } 30 | command += " \(remote) \(branch)" 31 | } 32 | 33 | let output = try await self.run(command) 34 | 35 | if output.contains("rejected") { 36 | throw GitClientError.outputError(output) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /CodeEdit/Features/About/Acknowledgements/Views/AcknowledgementsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AcknowledgementsView.swift 3 | // CodeEditModules/Acknowledgements 4 | // 5 | // Created by Shivesh M M on 4/4/22. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct AcknowledgementsView: View { 11 | @StateObject var model = AcknowledgementsViewModel() 12 | @Binding var aboutMode: AboutMode 13 | var namespace: Namespace.ID 14 | 15 | var body: some View { 16 | AboutDetailView(title: "Acknowledgements", aboutMode: $aboutMode, namespace: namespace) { 17 | LazyVStack(spacing: 0) { 18 | ForEach( 19 | model.indexedAcknowledgements, 20 | id: \.acknowledgement.name 21 | ) { (index, acknowledgement) in 22 | if index != 0 { 23 | Divider() 24 | .frame(height: 0.5) 25 | .opacity(0.5) 26 | } 27 | AcknowledgementRowView(acknowledgement: acknowledgement) 28 | } 29 | } 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /CodeEdit/CodeEditApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CodeEditApp.swift 3 | // CodeEdit 4 | // 5 | // Created by Wouter Hennen on 11/03/2023. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @main 11 | struct CodeEditApp: App { 12 | @NSApplicationDelegateAdaptor var appdelegate: AppDelegate 13 | @ObservedObject var settings = Settings.shared 14 | 15 | let updater: SoftwareUpdater = SoftwareUpdater() 16 | 17 | init() { 18 | // Register singleton services before anything else 19 | ServiceContainer.register( 20 | LSPService() 21 | ) 22 | 23 | _ = CodeEditDocumentController.shared 24 | NSMenuItem.swizzle() 25 | NSSplitViewItem.swizzle() 26 | } 27 | 28 | var body: some Scene { 29 | Group { 30 | WelcomeWindow() 31 | 32 | ExtensionManagerWindow() 33 | 34 | AboutWindow() 35 | 36 | SettingsWindow() 37 | .commands { 38 | CodeEditCommands() 39 | } 40 | } 41 | .environment(\.settings, settings.preferences) // Add settings to each window environment 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /CodeEdit/Features/InspectorArea/Views/InspectorSection.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InspectorSection.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 1/12/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct InspectorSection: View { 11 | var label: String 12 | let content: Content 13 | 14 | init(_ label: String, @ViewBuilder _ content: () -> Content) { 15 | self.label = label 16 | self.content = content() 17 | } 18 | 19 | var body: some View { 20 | VStack(alignment: .leading, spacing: 11) { 21 | Text(label) 22 | .foregroundColor(.secondary) 23 | .fontWeight(.bold) 24 | .font(.system(size: 12)) 25 | .padding(.leading, -1) 26 | VStack(alignment: .trailing, spacing: 5) { 27 | content 28 | Divider() 29 | } 30 | } 31 | } 32 | } 33 | 34 | struct InspectorSection_Previews: PreviewProvider { 35 | static var previews: some View { 36 | InspectorSection("Section Label") { 37 | Text("Preview") 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitLab/Model/GitLabEvent.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitLabEvent.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | class GitLabEvent: Codable { 11 | var title: String? 12 | var projectID: Int? 13 | var actionName: String? 14 | var targetID: Int? 15 | var targetType: String? 16 | var authorID: Int? 17 | var data: GitLabEventData? 18 | var targetTitle: String? 19 | var author: GitLabUser? 20 | var authorUsername: String? 21 | var createdAt: Date? 22 | var note: GitLabEventNote? 23 | 24 | enum CodingKeys: String, CodingKey { 25 | case title 26 | case projectID = "project_id" 27 | case actionName = "action_name" 28 | case targetID = "target_id" 29 | case targetType = "target_type" 30 | case authorID = "author_id" 31 | case data 32 | case targetTitle = "target_title" 33 | case author 34 | case authorUsername = "author_username" 35 | case createdAt = "created_at" 36 | case note 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 CodeEdit 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /CodeEdit/Features/Search/FuzzySearch/Collection+FuzzySearch.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Collection+FuzzySearch.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 03.02.24. 6 | // 7 | 8 | import Foundation 9 | import CollectionConcurrencyKit 10 | 11 | extension Collection where Iterator.Element: FuzzySearchable { 12 | /// Asynchronously performs a fuzzy search on a collection of elements conforming to FuzzySearchable. 13 | /// 14 | /// - Parameter query: The query string to match against the elements. 15 | /// 16 | /// - Returns: An array of tuples containing FuzzySearchMatchResult and the corresponding element. 17 | /// 18 | /// - Note: Because this is an extension on Collection and not only array, 19 | /// you can also use this on sets. 20 | func fuzzySearch(query: String) async -> [(result: FuzzySearchMatchResult, item: Iterator.Element)] { 21 | return await concurrentMap { 22 | (result: $0.fuzzyMatch(query: query), item: $0) 23 | }.filter { 24 | $0.result.weight > 0 25 | }.sorted { 26 | $0.result.weight > $1.result.weight 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /CodeEdit/Features/Settings/Views/SettingsPageView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SettingPageView.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 3/31/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct SettingsPageView: View { 11 | var page: SettingsPage 12 | var searchText: String 13 | 14 | init(_ page: SettingsPage, searchText: String) { 15 | self.page = page 16 | self.searchText = searchText 17 | } 18 | 19 | var symbol: Image? { 20 | switch page.icon { 21 | case .system(let name): 22 | Image(systemName: name) 23 | case .symbol(let name): 24 | Image(symbol: name) 25 | case .asset(let name): 26 | Image(name) 27 | case .none: nil 28 | } 29 | } 30 | 31 | var body: some View { 32 | NavigationLink(value: page) { 33 | Label { 34 | page.name.rawValue.highlightOccurrences(self.searchText) 35 | .padding(.leading, 2) 36 | } icon: { 37 | FeatureIcon(symbol: symbol, color: page.baseColor, size: 20) 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /CodeEdit/Features/CodeEditUI/Views/MenuWithButtonStyle.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MenuWithButtonStyle.swift 3 | // CodeEdit 4 | // 5 | // Created by Tommy Ludwig on 08.09.24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | /// A menu styled to resemble a bordered button. 11 | struct MenuWithButtonStyle: View { 12 | var systemImage: String 13 | var menu: () -> MenuView 14 | var body: some View { 15 | Menu { menu() } label: {} 16 | .background { 17 | Button {} label: { 18 | HStack { 19 | Image(systemName: systemImage) 20 | Image(systemName: "chevron.down") 21 | .resizable() 22 | .fontWeight(.bold) 23 | .frame(width: 8, height: 4.8) 24 | .padding(.leading, -1.5) 25 | .padding(.trailing, -2) 26 | }.offset(y: 1) 27 | } 28 | } 29 | .menuStyle(.borderlessButton) 30 | .menuIndicator(.hidden) 31 | .frame(width: 30) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Accounts/GitLab/Model/GitLabEventNote.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitLabEventNote.swift 3 | // CodeEditModules/GitAccounts 4 | // 5 | // Created by Nanashi Li on 2022/03/31. 6 | // 7 | 8 | import Foundation 9 | 10 | class GitLabEventNote: Codable { 11 | var id: Int? 12 | var body: String? 13 | var attachment: String? 14 | var author: GitLabUser? 15 | var createdAt: Date? 16 | var system: Bool? 17 | var upvote: Bool? 18 | var downvote: Bool? 19 | var notableID: Int? 20 | var notableType: String? 21 | 22 | init(_ json: [String: AnyObject]) { 23 | id = json["id"] as? Int 24 | body = json["body"] as? String 25 | attachment = json["attachment"] as? String 26 | author = GitLabUser(json["author"] as? [String: AnyObject] ?? [:]) 27 | createdAt = GitTime.rfc3339Date(json["created_at"] as? String) 28 | system = json["system"] as? Bool 29 | upvote = json["upvote"] as? Bool 30 | downvote = json["downvote"] as? Bool 31 | notableID = json["notable_id"] as? Int 32 | notableType = json["notable_type"] as? String 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /CodeEdit/Features/NavigatorArea/ProjectNavigator/OutlineView/ProjectNavigatorViewController+NSMenuDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ProjectNavigatorViewController+NSMenuDelegate.swift 3 | // CodeEdit 4 | // 5 | // Created by Dscyre Scotti on 6/23/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | // MARK: - NSMenuDelegate 11 | extension ProjectNavigatorViewController: NSMenuDelegate { 12 | 13 | /// Once a menu gets requested by a `right click` setup the menu 14 | /// 15 | /// If the right click happened outside a row this will result in no menu being shown. 16 | /// - Parameter menu: The menu that got requested 17 | func menuNeedsUpdate(_ menu: NSMenu) { 18 | let row = outlineView.clickedRow 19 | guard let menu = menu as? ProjectNavigatorMenu else { return } 20 | 21 | if row == -1 { 22 | menu.item = nil 23 | } else { 24 | if let item = outlineView.item(atRow: row) as? CEWorkspaceFile { 25 | menu.item = item 26 | menu.workspace = workspace 27 | } else { 28 | menu.item = nil 29 | } 30 | } 31 | menu.update() 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Client/GitConfigExtensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitConfigExtensions.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 11/16/24. 6 | // 7 | 8 | import Foundation 9 | 10 | /// Conformance of `Bool` to `GitConfigRepresentable` 11 | /// 12 | /// This enables `Bool` values to be represented in Git configuration as 13 | /// `true` or `false`. 14 | extension Bool: GitConfigRepresentable { 15 | public init?(configValue: String) { 16 | switch configValue.lowercased() { 17 | case "true": self = true 18 | case "false": self = false 19 | default: return nil 20 | } 21 | } 22 | 23 | public var asConfigValue: String { 24 | self ? "true" : "false" 25 | } 26 | } 27 | 28 | /// Conformance of `String` to `GitConfigRepresentable` 29 | /// 30 | /// This enables `String` values to be represented in Git configuration, 31 | /// automatically escaping them with quotes. 32 | extension String: GitConfigRepresentable { 33 | public init?(configValue: String) { 34 | self = configValue 35 | } 36 | 37 | public var asConfigValue: String { 38 | "\"\(self)\"" 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /CodeEdit/Features/SourceControl/Clone/ViewModels/GitCheckoutBranchViewModel.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GitCheckoutBranchView.swift 3 | // CodeEdit 4 | // 5 | // Created by Albert Vinizhanau on 10/17/23. 6 | // 7 | 8 | import Foundation 9 | 10 | class GitCheckoutBranchViewModel: ObservableObject { 11 | @Published var selectedBranch: GitBranch? 12 | @Published var branches: [GitBranch] = [] 13 | 14 | let repoPath: URL 15 | private let gitClient: GitClient 16 | 17 | init(repoPath: URL) { 18 | self.repoPath = repoPath 19 | gitClient = .init(directoryURL: repoPath, shellClient: .live()) 20 | } 21 | 22 | func loadBranches() async { 23 | let branches = ((try? await gitClient.getBranches()) ?? []) 24 | .filter({ $0.isRemote }) 25 | 26 | await MainActor.run { 27 | self.branches = branches 28 | if selectedBranch == nil { 29 | selectedBranch = branches.first 30 | } 31 | } 32 | } 33 | 34 | func checkoutBranch() async { 35 | guard let selectedBranch else { return } 36 | 37 | try? await gitClient.checkoutBranch(selectedBranch) 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /CodeEdit/Features/InspectorArea/Views/InspectorField.swift: -------------------------------------------------------------------------------- 1 | // 2 | // InspectorField.swift 3 | // CodeEdit 4 | // 5 | // Created by Austin Condiff on 1/12/23. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct InspectorField: View { 11 | var label: String 12 | let content: Content 13 | 14 | init(_ label: String, @ViewBuilder _ content: () -> Content) { 15 | self.label = label 16 | self.content = content() 17 | } 18 | 19 | var body: some View { 20 | HStack(alignment: .top, spacing: 5) { 21 | Text(label) 22 | .foregroundColor(.primary) 23 | .fontWeight(.regular) 24 | .font(.system(size: 10)) 25 | .padding(.top, 3) 26 | .frame(maxWidth: 72, alignment: .trailing) 27 | VStack(alignment: .leading) { 28 | content 29 | } 30 | .frame(maxWidth: .infinity) 31 | } 32 | } 33 | } 34 | 35 | struct InspectorField_Previews: PreviewProvider { 36 | static var previews: some View { 37 | InspectorField("Section Label") { 38 | Text("Preview") 39 | } 40 | } 41 | } 42 | --------------------------------------------------------------------------------