Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Improved File Handling System #1341

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from
Draft

Improved File Handling System #1341

wants to merge 35 commits into from

Conversation

Wouter01
Copy link
Member

@Wouter01 Wouter01 commented Jun 20, 2023

Description

Rewrite of the file handling system.

The current file handling system starts to get slow for larger projects. This is noticeable to the user by the slow startup times of codeedit, slower file moving in larger projects, etc. A new file handling system is added which is more performant. It also makes more use of the capabilities of NSDocument, simplyfying things.

Related Issues

Checklist

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

Screenshots

Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
@Wouter01 Wouter01 changed the title Filemanager actor Improved File Handling System Jun 20, 2023
@Rachmaye
Copy link

Wowzer

Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
import AppKit
import SwiftUI

protocol Resource: AnyObject, Identifiable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering on whether the term Resource is too arbitrary

Copy link
Member Author

@Wouter01 Wouter01 Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to suggest better names :) I chose this because it's used a lot throughout the codebase and is memorizable (compared to, for example, CEWorkspaceFile)

Copy link
Member Author

@Wouter01 Wouter01 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apple's docs also refer to filesystem items as resources

func fileName(typeHidden: Bool) -> String
}

extension Resource {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these properties in an extension?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Protocols cannot have function (or property) implementations, only declarations. To add default implementations you need to use an extension

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this functionality even belong in this feature (as in the feature folder)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I placed them here for now, once the PR is ready for review these things will be resolved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this functionality even belong in this feature (as in the feature folder)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I placed them here for now, once the PR is ready for review these things will be resolved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is becoming a bit of a mess. Inner enums, property and function definitions are all over the place. They should either be separated by functionality with the // MARK comment or it should be something like, enum definitions first, then normal properties, then calculated properties, then override functions, then normal functions

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I placed them here for now, once the PR is ready for review these things will be resolved.

Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>

# Conflicts:
#	CodeEdit/Features/InspectorSidebar/InspectorSidebarView.swift
#	CodeEdit/Features/NavigatorSidebar/OutlineView/FileSystemTableViewCell.swift
#	CodeEdit/Features/NavigatorSidebar/ProjectNavigator/OutlineView/ProjectNavigatorTableViewCell.swift
#	CodeEdit/Features/NavigatorSidebar/ProjectNavigator/OutlineView/ProjectNavigatorViewController+OutlineTableViewCellDelegate.swift
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>

# Conflicts:
#	CodeEdit/Features/Documents/Views/WorkspaceCodeFileView.swift
#	CodeEdit/Features/InspectorSidebar/Views/FileInspectorView.swift
#	CodeEdit/Features/NavigatorSidebar/ProjectNavigator/OutlineView/ProjectNavigatorViewController.swift
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
Signed-off-by: Wouter01 <wouterhennen@gmail.com>
@austincondiff
Copy link
Collaborator

What is the status of this PR?

@Wouter01
Copy link
Member Author

What is the status of this PR?

It's 80% done, but I currently don't have the time to resume working on it

@austincondiff
Copy link
Collaborator

austincondiff commented Aug 16, 2023

So close! That is okay, I totally understand. Do you have any idea when you might get the time in the future? Depending, it may be best to close this for the time being and reopen when that time comes. What do you think?

@Wouter01
Copy link
Member Author

So close! That is okay, I totally understand. Do you have any idea when you might get the time in the future? Depending, it may be best to close this for the time being and reopen when that time comes. What do you think?

Maybe in September, but I can't promise anything 😅. It's fine for me to close this PR for now, but it's probably best that a linked issue is created so the work doesn't get lost. Also, branches are removed from time to time, so I'm hoping this one doesn't get deleted. I have a local copy though

@austincondiff
Copy link
Collaborator

In that case, we can keep this PR open. It may help to keep it updated from time to time though so you don't end up with major conflicts down the road.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants