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

Code editor: project/workspace system #267

Open
icewolfz opened this issue May 29, 2024 · 1 comment
Open

Code editor: project/workspace system #267

icewolfz opened this issue May 29, 2024 · 1 comment
Labels
Code editor Code editor related issues enhancement A new feature or way to improve a current feature to make it better or offer more uses

Comments

@icewolfz
Copy link
Owner

icewolfz commented May 29, 2024

A side bar treeview that allows both folders and virtual folders to allow grouping or exploring folders

virtual folder feature be a folder contained in the work space that links to files/folders and users can add any files/folders with out creating new ones
a folder would be a real folder that when expanded would reveal all folders/files under it

const Path = require('path');
enum WorkSpaceItemType { Container, Item } //maybe split up item into file/folder?
class WorkSpaceItem {
    let name:string; // the displayed name
    let type:WorkSpaceItemType = WorkSpaceItemType .Container; //the type of item
    let icon:string; //a custom icon
    let path; //the path
    let _items; //subitems? maybe workspacecollction type
    function contructor(type, path) {
        this.type = type;
        this.path = path;
        if(this.type === WorkSpaceItemType .Container)
            this._items = new WorkSpaceCollection();
    }
    function getIcon():string {
        if(this.icon&& this.icon.length) return this.icon;
        if(this.type === WorkSpaceItemType .Container) return "fa-folder-o";
        return "fa-file-o"; 
    }
    function getDisplayName():string {
        if(this.name && this.name.length) return this.name;
        if(this.path && this.path.length) return Path.basename(this.path);
        if(this.type === WorkSpaceItemType .Container) return "(Unnamed Folder)";
        return "(Unnamed File)";
    }
    function items() {
        if(this.type === WorkSpaceItemType .Container)
            return this._items;   
        if(isDir(this.path)) return [];//return array of file data
        return [];//a file or unknown type so just return empty array as they should not have items
    }
}
class WorkSpaceCollection{
    let Items[]:WorkSpaceItemType = [];
    function add(item) { /*TODO add safty checks */this.Items.push(item); }
    function remove(item) { int idx = this.Items.indexOf(item); this.Items.splice(idx, 0); }
    get length():int { return this.Items.length; }
}
@icewolfz icewolfz added enhancement A new feature or way to improve a current feature to make it better or offer more uses Code editor Code editor related issues labels May 29, 2024
@icewolfz
Copy link
Owner Author

A basic session system has been added but it is just for saving a group of opened tabs, a workspace/project is a management system to allow grouping of folders and files with out needing to have them open

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code editor Code editor related issues enhancement A new feature or way to improve a current feature to make it better or offer more uses
Projects
None yet
Development

No branches or pull requests

1 participant