🧐 Research a new solution for file management
@FastestMolasses がすでに取り組んでいます。
2024年3月23日 から。
評価
この issue はまだ評価されていません。
説明
[!IMPORTANT]
This issue should only be picked up by CodeEdit maintainers
As a CE developer
I want a reliable foundation that handles and manages files
Because it is crucial to other functionality of the application
Our current solution for file managements is reaching its limits and there are some serious bugs present. There has recently been an attempt at writing tests for this part of the code, but it revealed that there is unwanted functionality and results.
Acceptance criteria
- There has been a thorough investigation on how file management for CodeEdit can be done most effectively
- The findings have been documented
Scope
In scope
- Research options on how load a directory recursively as workspace
- Document the findings of the research (Can be a markdown file)
- Optionally make PoCs/Demos in a separate project
Out of scope
- Implement anything of the research done in CodeEdit
Requirements (Might need further refinement)
- The system should be able to load in a directory recursively from disk
- It has to be done asynchronously, so no problems occur when a folder is loaded with large amounts of content
- It should be able to monitor changes in all the files on disk inside that directory, this doesn't include the contents of the file
- It should be able to add a files and folders to disk
Risks
- Because
CEWorkspaceFileManagerandCEWorkspaceFileare referenced at so many places in the codebase, truly refactoring the code might prove difficult. Especially since Xcode's code analysis is plain bad.
Implementation design
Problems with current implementation
There are likely multiple ways to tackle this problem, in terms of using different Apple/Swift APIs and how we design the system ourselves. The latter is the most important and something that we can control. The current setup of CEWorkspaceFileManager and CEWorkspaceFile is not working properly. There are multiple cases where an "IllegalState" is achievable.
One of the reasons this occurs is because currently the CEWorkspaceFile contains all kinds of information, it contains multiple variables & functions related to Git, some that have todo with UI and some that have to do with tab related stuff (Which arguably is also UI). It's not clear what the responsibility of the class is. It doesn't look like the class isn't following the single responsibility principle anymore. Everything that is somewhat related to it, gets "dumped" in there.
It also has some properties that in theory have something to do with it, but from a system design point of view, they don't. An example is fileDocument, from the type CodeFileDocument. You can argue that it should be there because it represents the contents of the file and is therefore related to it. But it actually has more to do with the editor and truly modifying the contents of file. And CEWorkspaceFile represents the file in things like the project navigator, where the contents of the files don't matter.
Another thing that can (and should) be looked at is abstraction. The current CEWorkspaceFileManager and CEWorkspaceFile is referenced everywhere, and is therefore hard coupled to almost everything is the codebase. This also makes it more difficult to make unit tests, as the FileManager can not be mocked or stubbed. It also is a disadvantage in cases like these, be it requires changing all the files/components that rely on it.
Things that are interesting to look into when redesigning
Right now there is one CEWorkspaceFile, which can be either a Folder or a File. Perhaps this is the right way to do and it is how we want it, but another possibility is to make a distinction between the two by making separate classes.
If PoCs are made, it is advised to develop them test driven. Since this is core functionality of the application, we should have tests in place from the get go. This way we know how we want it to behave, before it has been coded.
Tasks
- Do research for one or multiple solutions (Multiple people can work on this, but should be in contact with each other to prevent duplicate work)
- Document the findings
- Discuss findings and PoC's with the team
- 主要言語
- Swift
- スター
- 23.1k
- フォーク
- 1.2k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
CodeEditApp/CodeEdit のほかの issue
-
Product icons are missing from the Xcode project対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
CodeEditApp/CodeEdit#2190 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 15/100
CodeEditApp/CodeEdit#2195 · リアクション 13 件 ·
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
CodeEditApp/CodeEdit#2185 ·
-
Native GitHub Copilot inline completions対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
CodeEditApp/CodeEdit#2181 ·
-
creashes on startingオープンbug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
CodeEditApp/CodeEdit#2180 ·
CodeEditApp/CodeEdit の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
EtanHey/brainlayer#1069 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
MixinNetwork/flutter-plugins#512 ·
-
`qwenMTPSanitizeWeights` cannot load a standalone published MTP head対応中かも @aleroot が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ml-explore/mlx-swift-lm#678 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
xiufengsun/TokenTracker#750 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信