package openidea:plugin@1.21.0; /// Nodes of the native Project tree (API 1.21). interface project-view-types { enum node-kind { file, directory } record native-node { id: string, path: string, label: string, kind: node-kind, } record folder-details { label: string, /// An IDE icon name. The host uses its folder icon when absent or unknown. icon: option, } variant projection-kind { existing-node, virtual-folder(folder-details), } record projection-node { /// Existing nodes use an id from the input. A virtual folder uses a /// stable plugin-chosen id scoped to this native parent. id: string, /// The virtual folder id to group under, or none for a direct child. parent: option, kind: projection-kind, } } interface project-view { use types.{error}; /// Recompute the plugin's pane, or one project-relative or absolute /// directory. Without an invoking window, invalidate the pane in every window. refresh: func(view-id: string, directory: option) -> result<_, error>; /// Select a real file or directory in an owned pane or the built-in `project` /// pane of the invoking window. `focus` defaults to true. select-in: func(view-id: string, path: string, focus: option) -> result<_, error>; } /// Optional export for `[[contributes.projectViewPanes]]`. It runs while the /// plugin's pane is visible, on the project's native direct children. Return /// none to leave those children unchanged. Order is preserved among siblings; /// parent ids designate virtual folders in the same result. Omitted native /// children stay in the pane in native order. Unknown ids, duplicate references /// and invalid virtual trees discard the result. interface project-view-provider { use project-view-types.{native-node, projection-node}; use invocation.{invocation}; /// `settings` is the current view options as a JSON object. modify-children: func(view-id: string, parent: native-node, children: list, settings: string, ctx: borrow) -> option>; }