IDE-based tree node information remark implementation method and device

By extending the ProjectViewNodeDecorator interface and defining custom configuration file types in the IDE, and leveraging the PSI interface and XmlRecursiveElementVisitor of the IntelliJ platform, the lack of tree-structured node comments in the IDE was solved, enabling dynamic management and persistence of comment information, and improving code navigation and team collaboration efficiency.

CN121807374APending Publication Date: 2026-04-07SHANDONG CITY COMMERCIAL BANK COOP ALLIANCE CO LTD
View PDF 11 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-10
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing IDEs lack support for personalized annotations for tree-structured nodes in the project view, resulting in inefficient code navigation and documentation maintenance, disconnect between external documentation and project structure, and the built-in bookmark function cannot be persistently associated and does not support structured storage and collaborative editing.

Method used

By extending the ProjectViewNodeDecorator interface and defining a custom configuration file type (.profile), the PSI interface and XmlRecursiveElementVisitor of the IntelliJ platform are used to parse the annotation information. On-demand triggering mechanism, distributed storage and event communication mechanism are adopted to realize the dynamic management and persistence of annotation information.

Benefits of technology

It achieves deep integration and efficient management of tree node information, improves code understanding and project maintenance efficiency, reduces the risk of conflicts in multi-person collaboration, and ensures consistent user experience and system performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807374A_ABST
    Figure CN121807374A_ABST
Patent Text Reader

Abstract

The invention discloses an IDE-based tree node information remark implementation method and device, and the method comprises the steps: expanding a node decorator interface, positioning and analyzing XML remark information in an external configuration file according to a node path, and dynamically and additionally displaying the XML remark information beside a node name; a PSI interface is used for efficiently analyzing the configuration file, and a remark is extracted through a recursive accessor; the remark information is persistently stored in each directory in an XML file form, and version control is supported; right-click menu operation is integrated through an action system, and UI and logic decoupling is achieved by means of an event bus. The device comprises a node decoration module, a configuration file management module, a configuration analysis and caching module, a user interaction and event processing module and a data persistence and synchronization module. The scheme is applied to an IDE development environment, and aims to provide a node annotation function in a tree structure view for developers, so that the developers can understand, quickly search and position files conveniently, and the code management and document recording efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer software technology, and in particular to a method and apparatus for implementing tree node information annotation based on the IntelliJ platform and an IDE. Background Technology

[0002] During software development, developers often need to add personalized comments to file and directory nodes in the IDE's project view to facilitate code understanding, team collaboration, and project maintenance. While existing IDEs offer basic project views and file management functions, they lack support for personalized comments on tree-structured nodes. This makes it difficult for developers to attach custom comments to specific file or directory nodes, resulting in inefficient code navigation and documentation maintenance when the project structure is complex, folder names are ambiguous, or the number of files is large.

[0003] To address the aforementioned issues, current software developers primarily employ methods such as recording project structure comments through external documentation or relying on the bookmarks and tags provided by IDEs for simple annotation. However, external documentation is disconnected from the project structure, making maintenance inconvenient; while native bookmark functionality cannot be persistently associated with specific tree nodes and does not support structured storage and collaborative editing, resulting in limitations and efficiency issues.

[0004] Therefore, there is a lack of existing technologies that can deeply integrate with IDE project views and support dynamic management and persistent storage of tree-structured node-level annotation information. There is an urgent need for an efficient and scalable plug-in implementation method to improve development efficiency and collaboration experience. Summary of the Invention

[0005] In the enhancement and management of node information in the IDE tree structure view, addressing the difficulty of adding custom annotations to specific file or directory nodes using existing technologies, this invention provides a method and apparatus for implementing tree node information annotation based on the IDE, offering developers node annotation functionality within the tree structure view. This solution allows users to add, edit, and delete detailed node information within the tree structure, thereby improving the efficiency of code management and documentation. For scenarios with numerous folders or ambiguous file names, this solution can provide an annotated view of the project structure, facilitating developer understanding, quick file retrieval, and location.

[0006] In a first aspect, the present invention provides a method for implementing tree node information annotation based on an IDE, the method comprising the following technical solutions: Dynamic Node Decoration: By extending the ProjectViewNodeDecorator interface, dynamic decoration of project view nodes is achieved. Specifically, in response to user actions in the IDE project view, the system locates the associated comment configuration file (.profile) based on the virtual file path corresponding to the node, parses the comment information within it, and dynamically appends the comment content when the node is displayed. This process uses an on-demand triggering mechanism, executing only when the node is expanded, thereby avoiding unnecessary performance overhead and ensuring efficient system response.

[0007] Custom configuration file type and PSI parsing: Define .profile as a custom configuration file type, with an XML structure containing... <profile>and <file>Tags correspond to descriptions of directories and files, respectively. The system utilizes the IntelliJ platform's PSI (Program Structure Interface) to efficiently parse XML content. It uses XmlRecursiveElementVisitor to traverse the tag structure and quickly extract descriptions matching the current tree node. This method significantly improves parsing performance and memory efficiency, while leveraging PSI's caching mechanism to further avoid redundant parsing and ensure processing speed under large tree structures.

[0008] Persistent and collaborative management of comments: Each directory stores an independent .profile file, persistently saving comments for that directory and its subfiles in XML format. This file can work with version control systems, supporting collaborative development by multiple users and reducing the risk of conflicts. The system supports hot updates of comments; user modifications to the configuration file are persisted in real time and take effect without restarting the IDE, ensuring data and operational consistency.

[0009] Performance optimization and rendering: The system adopts an on-demand rendering strategy, loading and displaying annotation information only for the currently expanded node level. Combined with the PSI caching mechanism and recursive accessor technology, it significantly improves the rendering speed and overall response performance under the tree structure, providing users with a smooth interactive experience.

[0010] User interaction and event communication: Custom operations (such as adding, editing, and deleting notes) are registered through the IntelliJ platform's ActionSystem and integrated into the right-click menu of the project view, providing users with an intuitive and convenient interactive interface. User operations communicate through the EventBus, decoupling the UI from business logic. The input interface uses native platform components to ensure a consistent user experience. In particular, a confirmation prompt is provided for the delete operation to effectively prevent accidental operations.

[0011] Secondly, the present invention provides a tree node information annotation implementation device based on IDE, the device mainly comprising the following modules: Node Decoration Module: By implementing the node decorator interface provided by the IDE platform in the project view, this module dynamically obtains and displays the annotation information corresponding to nodes. Based on the virtual file path corresponding to the node, this module locates and parses the annotation configuration file stored in the project structure, appending the annotation content as text next to the node name, achieving non-intrusive information enhancement.

[0012] Configuration file management module: Defines and registers a custom file type (e.g., .profile) to store comments for tree nodes. This file is organized in XML format, with a structure consistent with the project directory hierarchy. Each directory can contain one configuration file, which can record comments for the current directory and its subfiles. Syntax highlighting, structure validation, and intelligent editing functions for this file type are implemented through the language support interface provided by the IDE platform.

[0013] Configuration parsing and caching module: This module uses the Program Structure Interface (PSI) provided by the IDE platform to parse the comment configuration file. It implements a recursive accessor (such as XmlRecursiveElementVisitor) to efficiently traverse the XML structure and extract comment information matching the current node. This module supports a caching mechanism to avoid repeated parsing, significantly improving the efficiency and response speed of comment information reading.

[0014] The user interaction and event handling module provides a graphical interface button integrated into the right-click menu of the project view, supporting users to add, edit, and delete annotations on selected nodes. It decouples UI operations from business logic through the ActionSystem and EventBus mechanisms provided by the IDE platform. User input is collected via standard dialog boxes, and a message mechanism is used to notify various modules to update data and refresh the view.

[0015] Data persistence and synchronization module: Comment information is persistently stored in the project directory as XML files, supporting collaborative management with version control systems. This module ensures that the creation, updating, and deletion of comment files are synchronized with user operations, and achieves data consistency across multiple views through an event listener mechanism.

[0016] The Java file automatic compilation and uploading method and apparatus provided by this invention, through a series of technological innovations, effectively overcomes the defects existing in the background technology and achieves the following beneficial effects: The technical advantages of this invention are mainly reflected in the following innovations: I. Dynamic Decoration and On-Demand Triggering Mechanism for Node Information This innovation is achieved through the "dynamic decoration of node information" in the method section and the "node decoration module" in the device section. Specifically, by extending the IDE's ProjectViewNodeDecorator interface, it locates and parses the .profile configuration file based on the node's virtual file path, dynamically appending the comments next to the node's display name. This process is triggered only when the parent node is expanded. Compared to the methods in the background technology that rely on external documents or simple bookmarks, this mechanism achieves three major breakthroughs: First, it achieves deep visual integration of comments and tree nodes, solving the core pain point of the disconnect between external documents and code structure; second, through the on-demand triggering mechanism, decoration rendering is only performed when the user expands the node, avoiding the performance loss caused by traditional global scanning; and third, it achieves true WYSIWYG, allowing users to directly obtain key information in the project view without frequently switching between the IDE and external documents, significantly improving the efficiency of code browsing and project understanding.

[0017] II. Efficient Configuration Parsing and Caching Mechanism Based on PSI This innovation is achieved through the "Custom Configuration File Type and PSI Parsing" in the methodology section and the "Configuration Parsing and Caching Module" in the device section. By defining a structured XML configuration file format and leveraging the IntelliJ platform's underlying PSI interface and its XmlRecursiveElementVisitor recursive accessor for efficient file content parsing, combined with a caching mechanism, duplicate parsing is avoided. Compared to traditional methods of manually parsing external documents or using limited APIs, this solution offers significant advantages: First, the PSI interface provides platform-level syntax parsing capabilities, efficiently handling XML structures and avoiding the complexity and performance bottlenecks of developing custom parsers; second, the recursive accessor pattern ensures complete traversal of the XML tree and accurate data extraction, guaranteeing the accuracy of annotation information retrieval; finally, the introduction of the caching mechanism greatly improves parsing performance in large projects, allowing repeated access to the same node to be directly read from memory, avoiding unnecessary disk I / O and parsing overhead.

[0018] III. Distributed configuration file management and multi-user collaboration support This innovation is achieved through the "persistent and collaborative management of notes information" in the methodology section and the "data persistence and synchronization module" in the device section. Notes are persistently stored by independently storing .profile files in each directory, and these files can be integrated into a version control system for collaborative management. Compared to the centralized and conflict-prone external document maintenance methods in the background technologies, this solution achieves three optimizations: First, the distributed storage strategy naturally reduces the probability of modification conflicts during multi-person collaboration, allowing different developers to maintain notes information in different directories; second, the integration with the version control system enables notes information to be updated and traced synchronously with the source code, achieving true configuration as code; and third, directory-level configuration file management better aligns with the actual project structure, facilitating the classification, maintenance, and permission management of notes information.

[0019] IV. Loosely Coupled Event-Driven Interaction Architecture This innovation is achieved through the "User Interaction and Event Communication" module in the methodology section and the "User Interaction and Event Handling Module" in the device section. Operations are integrated into the right-click menu via ActionSystem, and the user interface and core business logic are decoupled based on the EventBus event bus. Compared to traditional tightly coupled UI processing logic, this architecture offers multiple benefits: First, the event bus mechanism standardizes communication between modules, reducing system complexity and maintenance costs; second, the decoupled design enhances system scalability, ensuring that adding new features does not affect the stability of existing modules; finally, the use of native components guarantees a consistent user experience, reducing user learning costs, while the operation confirmation mechanism effectively prevents the risk of data loss due to accidental operations.

[0020] V. On-demand rendering and multi-layer performance optimization This innovation is achieved collaboratively by the "Performance Optimization and Rendering" section and related modules in the methodology. The system comprehensively employs technologies such as on-demand rendering, PSI caching, and recursive accessors to ensure smooth performance even under large-scale tree structures. Compared to conventional implementations, this solution offers significant performance advantages: the on-demand rendering strategy ensures that only the node levels currently of interest to the user are processed, greatly reducing unnecessary memory usage and computational overhead; the PSI caching mechanism avoids repeated parsing of configuration files, improving the efficiency of reading annotation information; and the use of recursive accessors optimizes the traversal process of XML structures, increasing the speed of data extraction. These optimization measures work together to ensure that this solution maintains excellent responsiveness even in large-scale project environments.

[0021] The above description is merely an overview of the technical solution disclosed herein. In order to better understand the technical means of this disclosure and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this disclosure more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of the method of the present invention; Figure 2 A schematic diagram illustrating the corresponding layered rendering collaboration; Figure 3 A flowchart illustrating the specific process of adding and editing buttons; Figure 4 A schematic diagram illustrating the specific process for deleting a note; Figure 5 This is a schematic diagram of the thread architecture for the button thread and the message bus; Figure 6 This is a schematic diagram showing the plugin interface effect; Figure 7 A schematic diagram of the function button interface; Figure 8 A schematic diagram showing the interface for adding and editing buttons; Figure 9 A diagram showing the information entry window; Figure 10 A diagram illustrating the steps to delete a note is provided. Figure 11 This is a schematic diagram of the principle of the device of the present invention. Detailed Implementation

[0024] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0025] It should be understood that the following specific examples illustrate the implementation of this disclosure, and those skilled in the art can easily understand other advantages and effects of this disclosure from the content disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. This disclosure can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this disclosure. It should be noted that, in the absence of conflict, the following embodiments and features in the embodiments can be combined with each other. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0026] It should be noted that various aspects of embodiments within the scope of the appended claims are described below. It will be apparent that the aspects described herein can be embodied in a wide variety of forms, and any particular structure and / or function described herein is merely illustrative. Based on this disclosure, those skilled in the art will understand that one aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number of aspects set forth herein can be used to implement the device and / or practice the method. Additionally, this device and / or method can be implemented using structures and / or functionalities other than one or more of the aspects set forth herein.

[0027] It should also be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of this disclosure. The drawings only show the components related to this disclosure and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.

[0028] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. These embodiments are implemented based on the technical solution of the present invention, and provide detailed implementation methods and processes; however, the scope of protection of the present invention is not limited to the following embodiments.

[0029] Definitions: IDE: Integrated Development Environment ProjectViewNodeDecorator: Project view node decorator interface PSI: Program Structure Interface XmlRecursiveElementVisitor: XML Recursive Element Visitor ActionSystem: Action System EventBus: Event Bus VirtualFile: Virtual file PsiElement: PSI element DumbAwareAction: Dumb Aware Action LanguageFileType: Language file type interface CachedValuesManager: Cached Value Manager MergeProvider: Merge Provider VirtualFileListener: Virtual file listener DialogBuilder: Dialog Builder NewItemPopupUtil: A utility class for creating a new item popup. This invention provides a method for implementing tree node information annotation based on an IDE, see [link / reference]. Figure 1 The method includes: dynamically acquiring notes associated with the current tree node in response to user operations in the IDE project view; wherein the notes are stored in at least one external configuration file corresponding to the project directory structure hierarchy; parsing the configuration file to obtain notes matching the current tree node; dynamically overlaying the notes in a decorative form on the user interface representation of the current tree node; and providing a user interaction interface to edit the notes in response to user input and persistently saving the changes to the configuration file.

[0030] This method is suitable for large-scale software project development scenarios, especially for collaborative team development of complex business systems in banking, finance, and e-commerce. It achieves intelligent annotation display of file and directory nodes through dynamic decoration of project tree nodes, custom configuration file types, efficient PSI parsing, distributed persistence, and event communication mechanisms. Its core objectives are to improve code navigation efficiency, reduce team communication costs, and enhance project maintainability. Implementation results show that this method can significantly shorten the time for new members to familiarize themselves with the project, improve collaboration efficiency, and maintain excellent performance even with tens of thousands of files.

[0031] The method includes the following functions: Dynamic decoration of node information: By deeply integrating the ProjectViewNodeDecorator interface of IntelliJPlatformSDK, the node information is enhanced and displayed using the project view node decorator provided by IntelliJPlatformSDK.

[0032] The system responds to user actions in the IDE project view by locating the associated comment configuration file (.profile) based on the virtual file path of the node, parsing the comment information, and dynamically appending the comment content when the node is displayed. This process uses an on-demand triggering mechanism, executing only when the node is expanded, thereby avoiding unnecessary performance overhead and ensuring efficient system response. The specific implementation process is as follows: In the IntelliJ platform plugin development environment, the first step is to create a class that inherits from ProjectViewNodeDecorator and override its decorate method. Within this method, the system obtains the PsiElement object of the current node and resolves its corresponding virtual file path. Based on this path, the system dynamically locates the .profile configuration file in the same directory.

[0033] When a user expands a node in the project tree, the system triggers the decoration process: It retrieves the corresponding .profile file using VirtualFileManager, uses XmlRecursiveElementVisitor to traverse the XML structure, and matches the current node name with the information in the configuration file. <file>or <profile>The `name` attribute of the tag. Upon successful matching, extract the comment information from the `display` attribute, and use the `setLocationString` method to dynamically append the comment content as gray text to the end of the node name.

[0034] This process employs a strict on-demand triggering mechanism, performing decoration operations only when the user actually expands the node, thus avoiding unnecessary performance overhead. The process covers the entire workflow from node expansion event listening, configuration file location, XML parsing to final rendering and display.

[0035] Custom Configuration File Types and PSI Parsing: To achieve professional management of configuration files, a custom file type, .profile, is defined by extending the LanguageFileType interface. Specific implementation includes: Register the FileTypeFactory extension point in plugin.xml to associate the .profile suffix with the custom ProfileFileType and register it in the IDE. Simultaneously, by registering XmlLikeRootTagProvider, XML language support is provided for .profile files, including syntax highlighting, code folding, and structure validation, enabling intelligent suggestions and structured editing capabilities. Furthermore, file icons can be set to increase their visibility in the project view.

[0036] The configuration file follows a strict XML format specification: the root element is <profile>, containing multiple <file>Child elements. Each <file>The element contains two required attributes: name (filename) and display (display notes), and can be expanded to include metadata attributes such as author and date.

[0037] During parsing, the system fully leverages the efficient parsing capabilities of PSI (Program Structure Interface). By creating a subclass of XmlRecursiveElementVisitor and overriding the visitXmlTag method, precise capture and data extraction of specific tags are achieved. Combined with PSI's caching mechanism, repeated accesses to the same file only require reading from the memory cache, significantly improving parsing efficiency.

[0038] Persistent and collaborative management of notes information: A distributed configuration file management strategy is adopted, with .profile files stored independently in each project directory. The specific implementation is as follows: When a user adds the first comment in a directory, the system automatically creates a .profile file in that directory. The file uses UTF-8 encoding and adheres to strict XML format specifications. By registering a VirtualFileListener, the system monitors configuration file additions, deletions, and modifications in real time, ensuring strong consistency between memory cache and disk data.

[0039] To support team collaboration, .profile files are designed to be managed synchronously with the source code. When users update code through a version control system (such as Git), comments are automatically updated synchronously. The system provides three-way merging capabilities for .profile files by implementing the MergeProvider interface, effectively reducing merge conflicts.

[0040] The hot update mechanism is implemented through a message bus: when the configuration file is modified, the system publishes a ProfileUpdateEvent through EventBus. All related decorators listen to this event and automatically refresh the displayed content, allowing for real-time updates without restarting the IDE.

[0041] Performance optimization and rendering: To improve performance in large-scale projects, this method implements a multi-layered optimization strategy: The rendering layer employs an on-demand loading mechanism, which overrides the `decorate` method of `ProjectViewNodeDecorator` to perform decoration operations only when the node is visible. Simultaneously, the rendering extent is dynamically managed by listening to the collapse / expansion events of the `ProjectView`.

[0042] Specifically, IDE tools use hierarchical rendering in project view rendering, only rendering the expanded layers and ignoring collapsed layers. To address this rendering method, this invention designs a corresponding collaborative display solution, such as... Figure 2 As shown.

[0043] At the parsing level, a PSI caching mechanism is used, which caches the parsing results through CachedValuesManager and sets a reasonable cache invalidation policy (based on file modification timestamps).

[0044] The measured data are shown in Table 1: Table 1 compares the parsing of the project tree with 1000 nodes.

[0045] When processing a project tree containing 1000 nodes, the PSI parsing method reduces time by 78% and memory usage by 88% compared to traditional DOM parsing.

[0046] At the data structure level, a lazy loading strategy is adopted, parsing the configuration file content only on the first access, and subsequent accesses directly use cached data. Meanwhile, a WeakReference reference mechanism is implemented to avoid memory leaks.

[0047] User interaction and event communication: Achieving a seamless user experience through multi-layered integration. Specific implementation includes: By registering an AnActionExtensionPoint extension point, the three actions "Add Note," "Edit Note," and "Delete Note" are integrated into the right-click menu of the project view. Each action inherits from the DumbAwareAction class and overrides the actionPerformed method to handle specific business logic.

[0048] The input interface is created using the platform's native DialogBuilder API to ensure consistency with the IDE style. For add operations, NewItemPopupUtil.createNewItemPopup is used to create the input dialog box; for edit operations, existing notes are automatically pre-populated; for delete operations, a confirmation dialog box is displayed to prevent accidental operations.

[0049] Event communication uses a publish-subscribe pattern: user actions publish corresponding events via EventBus, and each module subscribes to events of interest using the @Subscribe annotation. For example, when a user adds a note, a RemarkAddedEvent is published, and the persistence module and rendering module listen for this event to perform file saving and UI refresh operations, respectively.

[0050] As a practical example of user interaction and event communication functionality, function buttons (such as "Add / Edit Note" and "Delete Note") are deeply integrated with the ActionSystem and EventBus (message bus) provided by the IntelliJ platform, realizing a complete response flow from user interface operation to data change notification. This mechanism ensures the decoupling of UI and business logic, improving the maintainability and scalability of the system.

[0051] The specific process for adding / editing buttons is as follows: Figure 3 As shown in the diagram. The process for adding / editing comments is as follows: When a user clicks the "Add Comment" button in the project view, the system retrieves the currently selected file node and checks if a .profile file exists under that node. If it doesn't exist, it creates it; otherwise, it parses the XML content. Depending on the operation type (add or modify), the system displays an input box and shows historical comments for the user to edit. After the user enters their input, the system publishes a create or modify event via the message bus, passing the event to the backend processing module to update the XML content and save it to disk. Finally, the project view is refreshed, and a notification of successful operation is displayed.

[0052] The specific process for deleting the note button is as follows: Figure 4 As shown in the diagram. The process for deleting a note: After the user clicks the "Delete Note" button, the system retrieves the currently selected file node and checks if the .profile file exists. If it doesn't exist, it displays "No note file"; if it exists, it checks for corresponding note information. If there is no note, it displays "No note information"; if there is a note, it displays a confirmation dialog box. After the user confirms the deletion, the system publishes a delete event via the message bus, deleting the corresponding XML tag. If the .profile file is empty after deletion, the entire file is deleted; otherwise, the changes are saved. Finally, the view is refreshed and a notification of successful deletion is displayed.

[0053] Register it to the IDE using a custom button. Also, add keyboard shortcuts: an edit button (Ctrl+A) and a delete button (Ctrl+E).

[0054] This invention is for use in the project view, therefore the functionality needs to be extended to the ProjectViewPopupMenu menu. To use it, right-click on a folder and then click the corresponding function in the ProjectViewPopupMenu. The button implementation needs to inherit from DumbAwareAction and register the extended button group in the plugin.xml plugin core file.

[0055] To ensure consistency with the IDEA platform, we use `NewItemPopupUtil.createNewItemPopup` provided by the IntelliJPlatformSDK. This interface allows users to add or modify notes simply by typing and pressing Enter. A `Consumer` is used to carry the callback for the input information, facilitating further processing.

[0056] The messaging infrastructure is divided into listener registration, subscription, and publishing. Listener registration is divided into application-level and project-level. Plugin invention uses application-level listeners, and the thread that retrieves application-level messages uses the `syncPublisher` method to publish them to a custom Topic. Topic.create() is used to obtain a topic object.

[0057] The thread architecture diagram of the button thread and the message bus is as follows: Figure 5 As shown in the diagram, the button thread and message bus architecture illustrates the plugin's thread architecture. UI actions (such as clicking a button) are executed on the Event Dispatch Thread (EDT), triggered by the IntelliJ platform's ActionSystem. Background services use `executeOnPooledThread()` to perform time-consuming operations, such as reading or writing to the `.profile` file. Read operations use `ReadAction.run()` to ensure thread safety. After data changes, the system publishes the event to a custom Topic using the `syncPublisher()` method. Event listeners receive the event on the EDT and update the UI, achieving decoupling between the UI and business logic.

[0058] When adding notes, if the .profile file does not exist in the current folder, it will be created first before the information is written and saved. This avoids the problem of duplicate note file creation. Notes cannot be added to the .profile file itself; instead, buttons are used to hide or show notes based on conditions. When the file is right-clicked, a button menu will appear, which will then display the function buttons for hiding or showing notes based on certain conditions.

[0059] When editing notes, the system first retrieves existing note information and then makes changes based on it.

[0060] Add a notification if a note is accidentally deleted, asking the user whether they want to delete the note.

[0061] Plugin interface effect display as follows Figure 6 As shown, the plugin functionality is accessed through IntelliJ IDEA's menu bar, and integrated near menus such as FindUsages (Alt+F7), Analyze, Refactor, and Bookmarks. Users can find the "Add / Edit Note" (Ctrl+A) and "Delete Note" (Ctrl+E) functions through these menus. These functions are also integrated into the right-click menu of the project view for convenient and quick operation.

[0062] Function button interface display as follows Figure 7 As shown, the function button interface displays the plugin's main function buttons, including the two core buttons: "Add / Edit Note" and "Delete Note". The interface is simple and clear, conforming to the design style of the IntelliJ platform, making it easy for users to quickly identify and use.

[0063] Add | Edit Notes button, such as Figure 8 As shown. The Add Note window pops up when the user clicks the "Add Note" button. The window is titled "Add Note" and contains an input box where the user can enter a note name. The interface follows the interaction habits of the IntelliJ platform; the user can complete the addition operation by pressing the Enter key after entering the information.

[0064] The information entry window is shown in the image. Figure 9 As shown. The Edit Notes window pops up when the user clicks the "Edit Notes" button. The window is titled "Edit Notes," and the input box displays the existing notes (such as "Folder Notes"). The user can directly modify the existing content. Press Enter to save the changes after modification.

[0065] The operation of deleting a note is shown below. Figure 10 As shown. The "Delete Note" confirmation dialog box will pop up when the user clicks the "Delete Note" button. The dialog box is titled "Delete Note," displays the message "Are you sure you want to delete the notes in the current file?", and provides two buttons for the user to choose from: "Delete" and "Cancel." This design aims to prevent accidental deletion and protect user data security.

[0066] This invention also provides an IDE-based tree node information annotation implementation device, suitable for development environments of large and complex projects in banking, finance, e-commerce, and other industries. See also Figure 11 This device comprises a node decoration module, a configuration file management module, a configuration parsing and caching module, a user interaction and event handling module, and a data persistence and synchronization module, providing end-to-end support from node rendering, configuration parsing, user interaction to data synchronization. This device significantly improves team collaboration efficiency, reduces project maintenance costs, and boasts excellent scalability and performance.

[0067] The device specifically includes: Node Decoration Module: This module implements the ProjectViewNodeDecorator interface to dynamically add annotation information to nodes during the project view rendering process. When a user expands a directory or selects a file, the decorator obtains the virtual file path corresponding to the node and determines whether it is a directory or a file based on the path. If it is a directory, it directly searches for a .profile file in that directory; if it is a file, it traces upwards through its parent directories until it finds a .profile file containing the configuration for that file. The plugin uses XmlRecursiveElementVisitor to traverse the XML structure, accurately finding elements that match the current node. <file>or <profile>The tag is used to append the comments from the display attribute to the node name in the form of "[Comments]". This method does not modify any original file information, but only enhances the UI layer, achieving a truly non-intrusive display.

[0068] Configuration file management module: This module registers a new file type, .profile, through the LanguageFileType interface, specifically for storing annotation information for tree nodes. The .profile file uses XML format, and its structure corresponds one-to-one with the project directory hierarchy. <profile>The tag represents the configuration of the current directory and can contain multiple tags. <file>child tags, each <file>The tag matches the actual filename via the `name` attribute, while the `display` attribute stores comments. The plugin binds XML language support to this file type, implementing syntax highlighting, structure validation, and intelligent editing functions, and sets a unique icon to improve its visibility in the project view. Each `.profile` file in a directory only records comments for the current directory and its subfiles, facilitating management and reducing merge conflicts in version control. The configuration parsing and caching module is the core guarantee of the plugin's performance. It utilizes the IDE's Program Structure Interface (PSI) to parse the `.profile` file, offering significant performance advantages compared to the traditional XPath / DOM method. Through `XmlRecursiveElementVisitor`, the plugin can directly access the required XML nodes, avoiding full file scanning and greatly improving parsing efficiency. When processing 1000 nodes, the PSI method takes only 95ms and uses 22MB of memory, while XPath takes 580ms and uses 240MB, and DOM takes 420ms and uses 185MB. In addition, this module introduces a caching mechanism to cache parsed files. When the file content changes, the cache is automatically updated to avoid repeated parsing and ensure a smooth response speed even in large projects.

[0069] User Interaction and Event Handling Module: This module provides users with an intuitive and efficient operation method. The plugin integrates two function buttons, "Add / Edit Note" and "Delete Note," into the right-click menu of the project view, with shortcut keys Ctrl+A and Ctrl+E respectively. When the user clicks the button, the plugin performs the corresponding operation based on the currently selected node type: for adding or editing, a standard input dialog box is created using NewItemPopupUtil, automatically filling in existing notes (edit mode); for deleting, a confirmation dialog box pops up to prevent accidental operation. All user operations are triggered through ActionSystem and events are published using EventBus, achieving complete decoupling between the UI and business logic. Event listeners perform file read / write operations upon receiving a message and refresh the view to ensure the user sees the operation results immediately.

[0070] Data Persistence and Synchronization Module: This module is responsible for reliably storing comment information and maintaining synchronization across multiple views. The plugin writes comment information in XML format to the `.profile` file in the project directory. These files can be managed by version control systems such as Git, supporting team collaboration. When a user adds or modifies a comment, the plugin creates or updates the corresponding `.profile` file; when a comment is deleted, the entire file is deleted if it becomes empty, otherwise only the corresponding XML tag is deleted. Through an event listener mechanism, any modification to a comment in any window is instantly synchronized to other open project views, ensuring data consistency across all views. This design not only guarantees data reliability but also optimizes team collaboration efficiency and reduces the possibility of version conflicts.

[0071] Example: Detailed Implementation Process of Bank Digital Core System Development (The project and personnel information involved in this example are fabricated, but the workflow and technical principles are real) Project Name: "Rock Solid" Digital Core System Reconstruction Project Project scope: 30,000+ files, 20 development teams (510 people per team), covering more than 10 core business areas such as accounts, payments, risk control, and customer information.

[0072] Key pain points: The directory structure is deep and complex, with many folders named with technical terms or numbers (such as acctsrv01, pmtcoreengine), making it difficult for both new and old employees to quickly understand the business context, and resulting in extremely high costs for cross-team collaboration and communication.

[0073] Technical foundation: All development teams use IntelliJ IDEA or Android Studio as their development IDE, and GitLab is used for code repositories.

[0074] Phase 1: Project Launch and Plugin Deployment (Week 1) 1. Technological Decisions and Unified Deployment: After evaluation, the project's technical committee decided to adopt the "TreeNodeNotes" plugin as the project-level note standardization management tool.

[0075] The operations team packages the plugin and distributes it to all developers' IDEs through internal channels to ensure version consistency.

[0076] At the project launch meeting, all team members received a half-hour training session on plugin usage, focusing on the role of the .profile file, the writing standards for comments, and the collaborative maintenance process.

[0077] 2. Initialize project structure notes (to be performed by the architect team): The chief architect right-clicked on the project root directory, used the "Add Comment" function, and entered the overall description of the project: "'Rock' Digital Core System. Technology stack: Java 17 + Spring Cloud + Kubernetes. Phase 1 refactoring, goal: decouple monolithic architecture and achieve agile delivery." Subsequently, the architect added initial notes to the top-level business directory one by one: / account: "Account business domain, which includes all core business capabilities for corporate, retail, and internal accounts." / payment: "Payment and clearing business domain, responsible for all internal and external fund transfer business of the bank." / risk: "Risk management business domain, implementing real-time transaction risk control, credit assessment and compliance monitoring." This stage only establishes the main note framework, laying the foundation for subsequent detailed note refinement by each team.

[0078] Example of adding a note: Operating procedures: Locating the directory: Developers can right-click on the target business directory (e.g., / acctmanagement) in the IDEA project view.

[0079] Add a note: Select the "Add / Edit Note" button (shortcut key Ctrl+A) to bring up the input window.

[0080] Enter remarks: For example, enter "Core account management module, supports full lifecycle management of corporate and personal accounts".

[0081] Save notes: Press Enter to confirm. The plugin will automatically generate or update a .profile file in this directory to store notes in XML format.

[0082] Real-time display: Notes are immediately displayed next to the corresponding node in the project view for quick identification.

[0083] Phase 2: Detailed Notes During Development (Week 2-20) 1. Each team is further divided into specific tasks (taking the account team as an example): The module manager took over the / account directory and further refined it: Go to / account / retail and add the following note: "Personal account module. Functions: account opening, account closing, deposit, withdrawal, transfer, account inquiry. Owner: Zhang San's team." Navigate to ` / account / retail / service / src / main / java / com / bank / account / query` and add the following comment: "Account information query service layer. Core service: AccountQueryService. Important: Performance-sensitive, involves database sharding and table partitioning for queries." When developing specific features, regular developers should add notes to the deep directories they are responsible for: When developers were working on an old component under / account / retail / api / src / main / java / com / bank / account / command, they added the following note: "Legacy account opening command controller, V1.3 interface, planned to be replaced by NewAccountCommandController in Q4. Historical issue: needs to handle XXX exceptions." 2. Compliance Embedded (by collaboration between the compliance team and the development team): The compliance team provides standard annotation text, which the development team is required to add to the corresponding module.

[0084] The developers added the following note to the / risk / credit directory: "Credit risk weighted asset calculation engine. Compliance requirements: Strictly comply with BASEL III Section XXX. Algorithm version: CVaR2.1. Audit point: Calculation logs must be retained for 7 years." Add the following note to the / payment / crossborder directory: "Cross-border payment module. Regulatory reporting requirements: Transactions exceeding USD 50,000 must be automatically reported to the State Administration of Foreign Exchange. Reference document: 'Foreign Exchange Administration Regulations 2023 Edition'." 3. Daily Collaboration and Information Acquisition: A developer from the payment team needed to call an API from the account team. He navigated directly to the relevant directory under / account and quickly understood the API's function, responsible person, and precautions through the intuitive notes displayed on the nodes, without having to ask anyone or read a lot of documentation.

[0085] When a new member joins the risk control team, their first task is to expand the / risk directory in the project view and combine it with the notes at each level. Within a day, they gain a macro and accurate understanding of the architecture, technology, and compliance requirements of the system's risk module.

[0086] Phase 3: Version Control and Conflict Resolution (Ongoing Process) 1. Incorporate the .profile file into Git management: All .profile files, like other source code, are added to the GitLab repository for version control.

[0087] Before committing code (CodeCommit), developers will habitually check and update comments if they have modified the directory structure or believe that comments need to be updated.

[0088] 2. Collaboration and Merger: When two developers simultaneously modify the comments of different files in the same directory, GitLab automatically merges these changes into the .profile file.

[0089] When the two modified the same <file>When adding remarks to tags, conflicts will occur in the merge request. The conflicts will be clearly shown in the merge difference view of GitLab. For example: <<<<<<<HEAD <filename="LegacyRiskModel.java"display="Old model, to be deprecated" / > ======= <filename="LegacyRiskModel.java"display="Important: This model is still in use in the XX business line. Please confirm with Li Si before deprecating." / > >>>>>>>branchname At this time, the merger needs to contact the two developers and manually resolve the conflict according to the communication results, retaining the most accurate and up-to-date remarks. This process ensures the accuracy and effectiveness of the remarks.

[0090] Phase 4: Maintenance and Knowledge Inheritance (Late Stage and Future of the Project) 1. Fault Troubleshooting and Quick Location: The production environment alarm points to "payment failure". The operation and maintenance personnel quickly search the project structure. Through the remarks in the / payment / reconciliation directory "End-of-day batch reconciliation module, execution time PM11:00, dependent on the core system daily cut file", they quickly lock the troubleshooting focus on this module, greatly shortening the fault location time.

[0091] 2. Project Knowledge Deposition: All business logics, technical decisions, compliance requirements, and reasons for historical changes are solidified in the project structure in the form of remarks, coexisting with the code, avoiding knowledge loss caused by personnel flow.

[0092] .profile file has become a more timely and accurate "living" document than a separate document.

[0093] Through the detailed applications throughout the project's full life cycle above, the plugin has evolved from a small convenient tool into a key infrastructure for improving collaboration efficiency, ensuring compliance and transparency, and promoting knowledge inheritance in the bank's large-scale refactoring project.

[0094] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0095] Although the present invention has been described in detail in the specification, drawings and embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention; and all technical solutions and improvements that do not depart from the spirit and scope of the present invention are covered within the protection scope of the patent of the present invention.< / file> < / file> < / file> < / profile> < / profile> < / file> < / file> < / file> < / profile> < / profile> < / file> < / file> < / profile>

Claims

1. A method for implementing tree node information annotation based on an IDE, characterized in that, The method includes: In response to user actions in the IDE project view, the system dynamically retrieves annotation information associated with the current tree node by extending the ProjectViewNodeDecorator interface provided by the IDE platform. This annotation information is stored in at least one external configuration file (.profile) corresponding to the project directory structure hierarchy. The configuration file is in XML format, with the root element being... <profile>child element is <file> ;< / file> < / profile> The configuration file is parsed to obtain the annotation content that matches the current tree node. The parsing process uses the IDE's PsiManager to obtain the file's PsiFile and uses the XmlRecursiveElementVisitor recursive accessor to traverse the XML structure to extract the annotation information. The remarks are dynamically overlaid and displayed as decorations on the user interface representation of the current tree node; Provide a user interaction interface to edit the remarks in response to user input and persistently save the changes to the configuration file.

2. The method for implementing tree node information annotation based on IDE according to claim 1, characterized in that, The process of dynamically acquiring remarks information is triggered only when the parent node level of the current tree node is expanded.

3. The method for implementing tree node information annotation based on IDE according to claim 1, characterized in that, The parsing process caches the parsing results through CachedValuesManager.

4. The method for implementing tree node information annotation based on IDE according to claim 1, characterized in that, The configuration file is stored independently in its corresponding project directory. The configuration file in a directory is used to store the comments information of the directory and the files in it. The configuration file can be managed by a version control system.

5. The method for implementing tree node information annotation based on IDE according to claim 1, characterized in that, The user interaction interface is registered as a right-click menu option in the project view through the IDE's ActionSystem; users can communicate via the EventBus event bus to edit, add, or delete notes through the interaction interface.

6. The method for implementing tree node information annotation based on IDE according to claim 5, characterized in that, The operation of deleting notes should provide a confirmation prompt to the user. A confirmation dialog box should be created using DialogBuilder.

7. The method for implementing tree node information annotation based on IDE according to claim 1, characterized in that, When adding or editing notes, if the .profile file does not exist in the current directory, it will be created automatically; If it exists, use NewItemPopupUtil.createNewItemPopup to create an input dialog box and pre-populate it with the existing content.

8. A device for implementing tree node information annotation based on an IDE, characterized in that, The device includes: Node decoration module: In response to user operations in the IDE project view, dynamically obtain the annotation information associated with the current tree node, and dynamically overlay the annotation information on the user interface representation of the current tree node in a decorative form; wherein, the annotation information is stored in at least one external configuration file .profile corresponding to the project directory structure hierarchy; Configuration file management module: used to define and register the external configuration file types, and supports syntax highlighting, structure verification and intelligent editing of the configuration files; Configuration parsing and caching module: used to parse the configuration file to obtain the remarks content that matches the current tree node; User interaction and event handling module: used to provide a user interaction interface to edit the remarks information in response to user input, and the editing operation is communicated through the event bus; Data persistence and synchronization module: This module is used to persistently save user-modified notes to the configuration file and supports collaborative management through a version control system.

9. The IDE-based tree node information annotation implementation device according to claim 8, characterized in that, The configuration parsing and caching module parses the XML-formatted configuration file using the XmlRecursiveElementVisitor recursive accessor and implements a caching mechanism using CachedValuesManager to avoid repeated parsing.

10. The IDE-based tree node information annotation implementation device according to claim 8, characterized in that, The user interaction and event handling module integrates the user interaction interface into the right-click menu of the project view through ActionSystem, and publishes events through EventBus to notify the node decoration module and the configuration parsing and caching module to update data and view.

Citation Information

Patent Citations

  • Method and device for adding remarks

    CN102929994A

  • File management method and terminal

    CN105912710A

  • File remark display system

    CN106202434A

  • XML (extensive markup language) Configuration file updating method, system, medium and device

    CN107608704A

  • UI editing method, device and equipment, and computer readable storage medium

    CN111857717A