GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: fix the problem of plugin outline tree in workspace mode · euui/lowcode-engine@631b566

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/plugin-outline-pane/src
    • controllers
      • tree-master.ts
    • index.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/plugin-outline-pane/src/controllers/tree-master.ts‎

Copy file name to clipboardExpand all lines: packages/plugin-outline-pane/src/controllers/tree-master.ts
+4-16Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ export interface ITreeBoard {
1111
export class TreeMaster {
1212
readonly pluginContext: IPublicModelPluginContext;
1313

14+
private boards = new Set<ITreeBoard>();
15+
16+
private treeMap = new Map<string, Tree>();
17+
1418
constructor(pluginContext: IPublicModelPluginContext) {
1519
this.pluginContext = pluginContext;
1620
let startTime: any;
@@ -70,8 +74,6 @@ export class TreeMaster {
7074
}
7175
}
7276

73-
private boards = new Set<ITreeBoard>();
74-
7577
addBoard(board: ITreeBoard) {
7678
this.boards.add(board);
7779
}
@@ -84,8 +86,6 @@ export class TreeMaster {
8486
// todo others purge
8587
}
8688

87-
private treeMap = new Map<string, Tree>();
88-
8989
get currentTree(): Tree | null {
9090
const doc = this.pluginContext.project.getCurrentDocument();
9191
if (doc) {
@@ -100,15 +100,3 @@ export class TreeMaster {
100100
return null;
101101
}
102102
}
103-
104-
const mastersMap = new Map<string, TreeMaster>();
105-
export function getTreeMaster(pluginContext: IPublicModelPluginContext): TreeMaster {
106-
const key = pluginContext.project.currentDocument?.id || 'unknown';
107-
let master = mastersMap.get(key);
108-
if (!master) {
109-
master = new TreeMaster(pluginContext);
110-
pluginContext.logger.info('TreeMaster is created');
111-
mastersMap.set(key, master);
112-
}
113-
return master;
114-
}
Collapse file

‎packages/plugin-outline-pane/src/index.tsx‎

Copy file name to clipboardExpand all lines: packages/plugin-outline-pane/src/index.tsx
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { IconOutline } from './icons/outline';
33
import { IPublicModelPluginContext, IPublicModelDocumentModel } from '@alilc/lowcode-types';
44
import { enUS, zhCN } from './locale';
55
import { MasterPaneName, BackupPaneName } from './helper/consts';
6-
import { getTreeMaster } from './controllers/tree-master';
6+
import { TreeMaster } from './controllers/tree-master';
77
import { PaneController } from './controllers/pane-controller';
88

99
export const OutlinePlugin = (ctx: IPublicModelPluginContext, options: any) => {
@@ -26,7 +26,7 @@ export const OutlinePlugin = (ctx: IPublicModelPluginContext, options: any) => {
2626
masterPane: false,
2727
backupPane: false,
2828
};
29-
const treeMaster = getTreeMaster(ctx);
29+
const treeMaster = new TreeMaster(ctx);
3030
let masterPaneController: PaneController | null = null;
3131
let backupPaneController: PaneController | null = null;
3232
return {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.