Code editing method and system based on low-code development platform
By built -in online code editors on the cloud server on the low -code development platform, configure development components and detection components, the limitations of the existing low -code development platform in code editing have been solved, and the support of multiple programming languages and efficient code have been realized. Completion, guide packs and other functions have improved development efficiency and code quality.
Patent Information
- Application Number
- CN202411426181.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-10-14
AI Technical Summary
The existing low-code development platform has limitations in code editing, which is difficult to meet the development needs in complex scenarios, and lacks effective real-time feedback and error prompts, which affects development efficiency.
This paper proposes a code editing method and system based on a low-code development platform. By building an online code editor into the cloud server and configuring development components and detection components, code analysis, detection information reflection, and code revision recommendations are realized.
Provide online text editing functions, highlighting grammar, automatic indentation, code folding, etc., support a variety of programming languages, realize code complement, automatic guidance package, pre -compilation, shortcut keys, and version control to improve code quality and development efficiency.
Smart Images

Figure CN119336310A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of low-code development, and in particular to a code editing method and system based on a low-code development platform. Background Art
[0002] At present, in the current software development field, the traditional code development method requires developers to have deep programming knowledge and skills. However, this development model has a high threshold and low development efficiency for non-professional developers or users without rich programming experience. In order to solve this problem, low-code development platforms came into being. Low-code development platforms simplify the programming process, allowing users to complete application development through simple operations such as dragging and dropping, configuration, etc., greatly reducing the difficulty and cost of development.
[0003] However, existing low-code development platforms still have certain limitations in code editing.
[0004] On the one hand, the code editing functions provided by these platforms are relatively simple and cannot meet the development needs in complex scenarios;
[0005] On the other hand, when users write code, they often lack effective real-time feedback and error prompts, which makes it easy for errors to occur during the development process and affects development efficiency. Summary of the invention
[0006] The present invention proposes a code editing method and system based on a low-code development platform, which are used to solve the situation in the above-mentioned background technology.
[0007] In a first aspect, the present invention proposes a code editing method based on a low-code development platform, including a user terminal and a cloud server, wherein the cloud server has a built-in online code editor;
[0008] An online code editor is pre-set on a cloud server; wherein the online code editor is configured with a development component and a detection component;
[0009] When the code editor receives the user's input code, the cloud server parses the input code to determine the class name and the detection information based on the class name reflection;
[0010] The detection information is determined by the detection component on the input code, and the detection information includes: code completion prompt information, code chain error information and code variables;
[0011] Based on the detection information, a component editing recommendation interface for code revision is constructed.
[0012] In combination with the first aspect, the online editor is connected to a public script library, wherein the public script library is used to identify a user terminal accessing the online editor, and the user terminal includes a third-party application, a dedicated application, and a third-party browser;
[0013] When the cloud server receives the first development access request of the third-party application, it determines the development permission of the development operation through the second development access request and configures the corresponding code editing environment; wherein the third-party application is an application development program;
[0014] When the cloud server receives the second development access request from the third-party browser, it determines the execution system and execution device of the development operation through the second development access request, and configures the corresponding development environment;
[0015] When the cloud server receives the third development access request for exclusive application program access, the cloud server performs display interface adaptation with the development device through the third development access request.
[0016] In combination with the first aspect, the development component includes an editing component and a functional component; wherein,
[0017] The editing components include: an online text editing component, a syntax highlighting component, and an automatic indentation control component; wherein the online text editing component is adapted to the corresponding functional component according to the programming language;
[0018] Functional components include quick operation control components, code folding components and code visualization components.
[0019] In combination with the first aspect, the detection component performs input code detection in the pre-compilation stage, and the detection component includes: a static analysis component, a syntax detection component and a chain code error detection;
[0020] The static analysis component is used to include a first analysis trigger condition and a second analysis trigger condition, wherein the first analysis trigger condition is configured to generate a temporary trigger signal after the user inputs the code and the second analysis trigger condition is configured to generate a temporary trigger signal when the first analysis trigger condition has been triggered and a Boolean event is generated;
[0021] The grammar detection component is used to trigger synchronously when the first analysis trigger condition is triggered;
[0022] The chain code error component is used to trigger the start after the first analysis trigger condition is triggered or the second analysis trigger condition is triggered.
[0023] In combination with the first aspect, after the code editor receives the user's input code, the method further includes:
[0024] The code recognition mechanism for importing input code and code information is triggered through the code first transfer page of the online editor; wherein the code recognition mechanism is used to identify the code type, code development environment and code chain text;
[0025] According to the recognition results of the code recognition mechanism, the pre-compilation environment is automatically configured, and shortcut keys and common statements corresponding to the code type are generated in the pre-compilation environment.
[0026] In combination with the first aspect, the detection information is reflected from the cloud server to the user end;
[0027] Wherein, when there is code completion prompt information in the detection information, the code completion position and the completion code text are determined based on a preset standard code database and the prompt semantics in the prompt information;
[0028] Generate quick completion prompt buttons based on the code completion position;
[0029] Generate a list of completion codes based on the completion code text and quick completion prompt keys;
[0030] When a first trigger instruction of the user end for any completion code in the completion code list and a second trigger key of the shortcut prompt key are received, automatic completion is performed.
[0031] In combination with the first aspect, after the code editor receives the user's input code, the method further includes:
[0032] Build a unique editing space corresponding to the input code and set exclusive permissions for the unique editing space;
[0033] According to the exclusive permissions, the editing verification conditions are set. When the user terminal meets the editing verification conditions, the corresponding user terminal is authorized to connect to the display interface of the unique editing space to edit the code.
[0034] In combination with the first aspect, the component editing recommendation interface for building code revisions further includes:
[0035] Obtaining at least one revision measure corresponding to the detection information in the component editing recommendation interface; and
[0036] Acquire at least one revision measure from at least one code revision item confirmed in the detection information; and
[0037] Based on at least one revision measure, a priority order of a set of revision measures is obtained from a component editing recommendation interface including a plurality of revision measures, and the priority order is fed back to a user terminal.
[0038] In combination with the first aspect, the component editing recommendation interface for building code revisions further includes:
[0039] When it is detected that the component editing recommendation interface does not have the required editing component, an external editing tool library is connected, and an editing tool loading interface is generated based on the external editing tool library; wherein the external editing tool library is used to set a variety of code editing tools;
[0040] In response to the external editing tool library establishing a connection with the online code editor service, and controlling the online code editor to load the editing tool, a second component editing recommendation interface is generated, and the editing content of the code entered on the online editor is displayed on the second component editing recommendation interface.
[0041] In a second aspect, the present invention proposes a code editing system based on a low-code development platform, comprising:
[0042] Cloud server: used to pre-set an online code editor; wherein the online code editor is configured with a development component and a detection component;
[0043] Online code editor: used to parse the input code after receiving it from the user, determine the class name and the detection information based on the class name reflection;
[0044] The detection information is determined by the detection component on the input code, and the detection information includes: code completion prompt information, code chain error information and code variables;
[0045] User side: used to build a component editing recommendation interface for code revisions based on detection information.
[0046] The beneficial effects of the present invention are:
[0047] Code editing: Provides online text editing functions, supports syntax highlighting, automatic indentation, code folding, etc., to help developers write more standardized and readable code. Supports multiple programming languages, including but not limited to JavaScript, Java, CSS, etc.
[0048] Code prompt completion: After the user enters the code, the browser passes the input information and code information to the server. The server parses the input information and code information to obtain the real class name, obtains related variables, methods and other prompt information based on the class name reflection, converts the information package into a certain format and returns it to the browser. The browser port renders and displays it. The user can select or use the tab key to select the prompted code for entry. It supports automatic prompt completion of chain code and automatic prompt completion of generic information in the code, reducing the time and error rate of code input.
[0049] Automatic package import: When saving, it can automatically identify the classes or methods that need to be imported, and automatically add the corresponding import statements. This function can improve programming efficiency and allow developers to focus on the implementation of code logic rather than tedious import operations.
[0050] Pre-compilation: sunway_IDE provides the function of manual compilation. Static analysis and syntax checking can be performed in the pre-compilation stage to detect potential problems in advance and provide repair suggestions, thereby improving code quality.
[0051] Shortcut keys: sunway_IDE has built-in a variety of shortcut keys, which facilitate users to quickly perform some common operations during the coding process. When the built-in shortcut keys do not meet user needs, you can also maintain custom shortcut keys to meet users' more personalized needs.
[0052] Version control: The independently developed version control mechanism ensures that a file can only be edited by one person at a time, preventing code conflicts. It supports code history submission records, review and rollback, ensuring the security of the project.
[0053] Cross-platform support: No local installation is required, it can be accessed and used through a browser, supporting all mainstream operating systems and devices, and responsive design to ensure a good user experience on various screen sizes.
[0054] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0055] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0057] In the attached picture:
[0058] Figure 1 A method flow chart of a code editing method based on a low-code development platform in an embodiment of the present invention;
[0059] Figure 2 This is a system composition diagram of a code editing system based on a low-code development platform in an embodiment of the present invention;
[0060] Figure 3 This is a diagram showing the Java script writing interface in an embodiment of the present invention;
[0061] Figure 4 This is a diagram showing the automatic package guide interface in an embodiment of the present invention;
[0062] Figure 5 This is a diagram showing the js script writing interface in an embodiment of the present invention;
[0063] Figure 6 Write an interface display diagram for Mapper in the embodiment of the present invention;
[0064] Figure 7 This is a diagram showing the built-in shortcut key interface in an embodiment of the present invention;
[0065] Figure 8 This is a display diagram of customizing and editing shortcut keys in an embodiment of the present invention;
[0066] Fig. 9 This is a diagram showing the automatic completion prompt in an embodiment of the present invention. DETAILED DESCRIPTION
[0067] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0068] like Figure 1 As shown, this embodiment provides a code editing method based on a low-code development platform, including: a user end, a cloud server, and a cloud server having a built-in online code editor;
[0069] An online code editor is pre-set on a cloud server; wherein the online code editor is configured with a development component and a detection component;
[0070] When the code editor receives the user's input code, the cloud server parses the input code to determine the class name and the detection information based on the class name reflection;
[0071] The detection information is determined by the detection component on the input code, and the detection information includes: code completion prompt information, code chain error information and code variables;
[0072] Based on the detection information, a component editing recommendation interface for code revision is constructed.
[0073] The principle of the above technical solution is:
[0074] The present invention includes two parts: the user end and the cloud server. The user end refers to the port where individuals or teams using the low-code development platform perform development function operations through terminal devices. The user end can obtain powerful code editing functions through the cloud server. The cloud server has a built-in online code editor that can support multiple programming languages and development frameworks based on the user end's request.
[0075] The online code editor is pre-configured by the cloud server and integrates development components and detection components. The development components and detection components can automatically identify the code written by the user and provide corresponding feedback based on the content of the code. When the user enters the code in the code editor, the cloud server will parse the code, extract the class name, and then provide feedback based on the class name, thereby obtaining some detection information based on the class name.
[0076] The detection information is processed and analyzed by the detection component. When there are code errors or omissions, some code completion prompts will be given. For example, when the user tries to write a function called "hello", the system will prompt the user to add "function" before the file name to avoid the user entering the wrong type. In addition, the detection component will also find chain errors in the code, such as when the user uses undefined variables or functions, a warning will be issued. Finally, the detection component will also detect whether the variables in the code are correct. If so, it will return a correct answer. If not, an error prompt will be issued.
[0077] Based on this detection information, the cloud server will build a component editing recommendation interface for code revisions. On this interface, users can see all the modification suggestions given by the system and can choose to accept or reject them according to their needs. If these modification suggestions are accepted, the modification suggestions will be automatically applied to the code for rapid iteration and debugging. If these modification suggestions are rejected, users can also manually view the cause of the error and fix it.
[0078] The beneficial effects of the above technical solution are:
[0079] Code editing: Provides online text editing functions, supports syntax highlighting, automatic indentation, code folding, etc., to help developers write more standardized and readable code. Supports multiple programming languages, including but not limited to JavaScript, Java, CSS, etc.
[0080] Code prompt completion: After the user enters the code, the browser passes the input information and code information to the server. The server parses the input information and code information to obtain the real class name, obtains related variables, methods and other prompt information based on the class name reflection, converts the information package into a certain format and returns it to the browser. The browser port renders and displays it. The user can select or use the tab key to select the prompted code for entry. It supports automatic prompt completion of chain code and automatic prompt completion of generic information in the code, reducing the time and error rate of code input.
[0081] Automatic package import: When saving, it can automatically identify the classes or methods that need to be imported, and automatically add the corresponding import statements. This function can improve programming efficiency and allow developers to focus on the implementation of code logic rather than tedious import operations.
[0082] Pre-compilation: sunway_IDE provides the function of manual compilation. Static analysis and syntax checking can be performed in the pre-compilation stage to detect potential problems in advance and provide repair suggestions, thereby improving code quality.
[0083] Shortcut keys: sunway_IDE has built-in a variety of shortcut keys, which facilitate users to quickly perform some common operations during the coding process. When the built-in shortcut keys do not meet user needs, you can also maintain custom shortcut keys to meet more personalized needs of users.
[0084] Version control: The self-developed version control mechanism ensures that a file can only be edited by one person at a time, preventing code conflicts. It supports code history submission records, review and rollback, ensuring the security of the project.
[0085] Cross-platform support: No local installation is required, you can access and use it through the browser, supporting all major operating systems and devices. Responsive design ensures a good user experience on all screen sizes.
[0086] As an embodiment of the present invention: the online editor is connected to a public script library, wherein the public script library is used to identify a user terminal accessing the online editor, the user terminal includes a third-party application, a dedicated application, and a third-party browser;
[0087] When the cloud server receives the first development access request of the third-party application, it determines the development permission of the development operation through the second development access request and configures the corresponding code editing environment; wherein the third-party application is an application development program;
[0088] When the cloud server receives the second development access request from the third-party browser, it determines the execution system and execution device of the development operation through the second development access request, and configures the corresponding development environment;
[0089] When the cloud server receives the third development access request for exclusive application program access, the cloud server performs display interface adaptation with the development device through the third development access request.
[0090] The principle of the above technical solution is: Figure 3 , Figure 5 and Figure 6As shown, the online editor is connected to a public script library, which includes third-party applications, proprietary applications, and third-party browsers. When processing the first development access request of a third-party application, the cloud server will determine the permissions for development operations through the second development access request and configure the code editing environment accordingly. This is because third-party applications usually involve some specific technologies and development requirements, so they need to be assigned appropriate permissions and environments to meet their specific needs. For the second development access request from a third-party browser, the cloud server will determine the execution system and device through the second development access request and configure the development environment accordingly.
[0091] In specific implementation, development on third-party browsers may be subject to certain restrictions. For example, some functions may only be applicable to specific operating systems or devices, so it is necessary to configure appropriate execution systems and devices to ensure smooth development. For the third development access request of the exclusive application, the cloud server will adapt the interface with the development device through the third development access request. This is because exclusive applications are usually customized solutions for a specific field or demand, so the interface needs to be adapted according to the actual application scenario and device characteristics to ensure a good user experience.
[0092] The beneficial effects of the above technical solution are:
[0093] The present invention can be connected to a third-party browser, a third-party application, and a proprietary application, and can adapt the most suitable editing tool and editing interface to different types of user terminals.
[0094] As an embodiment of the present invention: the development component includes an editing component and a functional component; wherein,
[0095] The editing components include: an online text editing component, a syntax highlighting component, and an automatic indentation control component; wherein the online text editing component is adapted to the corresponding functional component according to the programming language;
[0096] Functional components include quick operation control components, code folding components and code visualization components.
[0097] The principle of the above technical solution is:
[0098] In actual operation, through the editing components, it is possible to achieve, for example: real-time synchronization: the online text editing component can synchronize the data between the user end and the cloud server in real time, ensuring that no matter where the user is, he can view and update his code in time; code templates: the online text editing component can automatically generate code templates based on the code entered by the user, so that the user can quickly copy and paste; automatic error correction: the online text editing component can automatically check the code entered by the user, and display error prompts in real time to help users avoid errors; code formatting: the online text editing component can automatically format the code entered by the user to make it conform to programming specifications and coding style; automatic completion: the online text editing component can automatically complete the code entered by the user according to the user's programming habits and project requirements, thereby improving writing speed and efficiency; code comments: the online text editing component can automatically identify and insert code comments to help users better understand and maintain the code.
[0099] The beneficial effects of the above technical solution are:
[0100] The present invention has a variety of editing tools and functional components to realize automatic development functions.
[0101] As an embodiment of the present invention: Figure 4 and Fig. 9 As shown, the detection component performs input code detection in the pre-compilation stage, and the detection component includes: a static analysis component, a syntax detection component and a chain code error detection;
[0102] The static analysis component is used to include a first analysis trigger condition and a second analysis trigger condition, wherein the first analysis trigger condition is configured to generate a temporary trigger signal after the user inputs the code and the second analysis trigger condition is configured to generate a temporary trigger signal when the first analysis trigger condition has been triggered and a Boolean event is generated;
[0103] The grammar detection component is used to trigger synchronously when the first analysis trigger condition is triggered;
[0104] The chain code error component is used to trigger the start after the first analysis trigger condition is triggered or the second analysis trigger condition is triggered.
[0105] The principle of the above technical solution is:
[0106] In the actual implementation process, the detection component includes three parts: static analysis component, syntax detection component and chain code error detection. Among them, the static analysis component is mainly responsible for monitoring the code input by the user and generating a temporary trigger signal when certain trigger conditions are met. The syntax detection component is responsible for real-time monitoring of the user's code when the first analysis trigger condition is triggered, and ensuring that it complies with the programming specifications. The chain code error detection component is responsible for real-time detection of the user's code after the first analysis trigger condition is triggered or the second analysis trigger condition is triggered, and timely discovering and correcting errors therein.
[0107] The beneficial effects of the above technical solution are:
[0108] The above method enables the error detection of the code to start immediately after the code is entered into the editor, thereby minimizing the error rate of the user when writing the code, and also reducing the workload of the user when maintaining the code later. At the same time, since all error detection is completed before the code is written, the user does not need to test the correctness of the code again when the code is running, thus saving the user's time and energy.
[0109] As an embodiment of the present invention: Figure 7 and Figure 8 As shown, after the code editor receives the user's input code, it also includes:
[0110] The code recognition mechanism for importing input code and code information is triggered through the code first transfer page of the online editor; wherein the code recognition mechanism is used to identify the code type, code development environment and code chain text;
[0111] According to the recognition results of the code recognition mechanism, the pre-compilation environment is automatically configured, and shortcut keys and common statements corresponding to the code type are generated in the pre-compilation environment.
[0112] The principle of the above technical solution is:
[0113] In the specific implementation process, when the code editor receives the user's input code, the system will trigger the code recognition mechanism of the imported input code and code information through the code first transfer page of the online editor. This step is to achieve automatic understanding and processing of the code. Secondly, the code recognition mechanism will be used to identify the code type, code development environment, and code chain text. This will enable the system to understand the specific content and context of the user's input, so as to better provide assistance to them. Then, based on the recognition results of the code recognition mechanism, the system will automatically configure the pre-compilation environment. This step will make it easier for users to perform programming operations, while also reducing the error rate of users when writing code. Finally, in the pre-compilation environment, the system will generate shortcut keys and common statements for the corresponding code types.
[0114] The beneficial effects of the above technical solution are:
[0115] The quick-set code recognition mechanism and pre-compilation environment greatly improve the user's programming efficiency, enabling them to complete more programming tasks in a shorter time.
[0116] As an embodiment of the present invention: the detection information is reflected from the cloud server to the user end;
[0117] Wherein, when there is code completion prompt information in the detection information, the code completion position and the completion code text are determined based on a preset standard code database and the prompt semantics in the prompt information;
[0118] Generate quick completion prompt buttons based on the code completion position;
[0119] Generate a list of completion codes based on the completion code text and quick completion prompt keys;
[0120] When a first trigger instruction of the user end for any completion code in the completion code list and a second trigger key of the shortcut prompt key are received, automatic completion is performed.
[0121] The principle of the above technical solution is:
[0122] In the specific implementation, when the user enters the code in the code editor, the corresponding detection information is obtained through the cloud server. The monitoring information corresponds to the display of the code completion, and allows the user to choose whether to accept the code completion suggestion as needed. When there is code completion prompt information in the detection information, the system will use the preset standard code database and the prompt semantics in the prompt information to determine the location of the code completion and the completion code text. Thereby ensuring that the system provides users with accurate and effective code completion suggestions. According to the location of the code completion, the system will generate a quick completion prompt button. These buttons will simplify the user's operation process and improve their programming efficiency. Next, a complete completion code list will be generated by combining the completion code text and the quick completion prompt button. This list will contain all the relevant codes for users to call directly when needed. When the user receives the first trigger instruction for any completion code in the completion code list and the second trigger button of the quick prompt button, the system will perform automatic completion. It will further optimize the user's programming process and improve their work efficiency.
[0123] The beneficial effects of the above technical solution are:
[0124] The present invention can realize automatic code completion. If it is found that the input code is insufficient or has errors, automatic completion is realized.
[0125] As an embodiment of the present invention: after the code editor receives the input code from the user, it also includes:
[0126] Build a unique editing space corresponding to the input code and set exclusive permissions for the unique editing space;
[0127] According to the exclusive permissions, the editing verification conditions are set. When the user terminal meets the editing verification conditions, the corresponding user terminal is authorized to connect to the display interface of the unique editing space to edit the code.
[0128] The principle of the above technical solution is:
[0129] In the specific implementation process, when a user tries to edit their code in the code editor, the system will build a unique editing space for them. This space will have a unique identifier to ensure that it belongs only to the user. At the same time, the system will also set exclusive permissions for this space, and only the user can access and edit it. According to the permissions the user has, the system will set editing verification conditions. For example, a user may need to meet a certain level of knowledge or experience requirements before being allowed to edit his or her own code. If the user meets these verification conditions, the system will authorize the user to enter the editing interface and authenticate the user to ensure that they are a legitimate editor. The system can also provide a display interface where users can view their code and editing status on the page. This interface can include functions such as code folding, collapsing, and tagging to help users better organize and manage their code.
[0130] The beneficial effects of the above technical solution are:
[0131] Each user who enters code has a unique development space, and there will be no confusion in user script development.
[0132] As an embodiment of the present invention: the component editing recommendation interface for building code revisions further includes:
[0133] Obtaining at least one revision measure corresponding to the detection information in the component editing recommendation interface; and
[0134] Acquire at least one revision measure from at least one code revision item confirmed in the detection information; and
[0135] Based on at least one revision measure, a priority order of a set of revision measures is obtained from a component editing recommendation interface including a plurality of revision measures, and the priority order is fed back to a user terminal.
[0136] The principle of the above technical solution is:
[0137] In specific implementation, after building the interface for code revision recommendation, at least one revision measure should be obtained from the detection information, and the most relevant or important revision measures should be found to recommend to the user. After obtaining the revision measures, the system also needs to prioritize them. This process can be sorted according to the importance of the revision measures, or factors such as implementation difficulty, in order to provide the best recommendation to the user. Finally, one or more revision measures that best suit the current user needs will be extracted from the sorted set of revision measures and fed back to the user. This ensures that no matter what the user's programming experience and goals are, they can get the revision suggestions that best suit them.
[0138] The beneficial effects of the above technical solution are:
[0139] When revising, it is possible to make sorting recommendations based on the editing needs and priorities of the code, as well as the priority of the recommended revision plan.
[0140] As an embodiment of the present invention: the component editing recommendation interface for building code revisions further includes:
[0141] When it is detected that the component editing recommendation interface does not have the required editing component, an external editing tool library is connected, and an editing tool loading interface is generated based on the external editing tool library; wherein the external editing tool library is used to set a variety of code editing tools;
[0142] In response to the external editing tool library establishing a connection with the online code editor service, and controlling the online code editor to load the editing tool, a second component editing recommendation interface is generated, and the editing content of the code entered on the online editor is displayed on the second component editing recommendation interface.
[0143] The principle of the above technical solution is: when building the code revision recommendation interface, if it is detected that the component editing recommendation interface does not have the required editing component, we will connect to the external editing tool library and generate the corresponding editing tool loading interface according to the requirements of this tool library. In this way, more accurate and efficient code editing tools can be provided according to the actual needs of users. When the external editing tool library establishes a connection with the online code editor service and controls the editing tool loaded by the online code editor, we will generate a second component editing recommendation interface. On this interface, the editing content of the code entered by the user on the online code editor will be displayed, so that users can view and manage all their code editing information in any editing interface.
[0144] The beneficial effects of the above technical solution are:
[0145] By connecting to an external editing tool library and generating corresponding editing tools according to the user's actual needs, and displaying all the user's code editing information through two component editing recommendation interfaces, the editing tools can be expanded.
[0146] As an embodiment of the present invention, the present invention proposes a code editing system based on a low-code development platform, including:
[0147] Cloud server: used to pre-set an online code editor; wherein the online code editor is configured with a development component and a detection component;
[0148] Online code editor: used to parse the input code after receiving it from the user, determine the class name and the detection information based on the class name reflection;
[0149] The detection information is determined by the detection component on the input code, and the detection information includes: code completion prompt information, code chain error information and code variables;
[0150] User side: used to build a component editing recommendation interface for code revisions based on detection information.
[0151] The principle of the above technical solution is that the present invention includes two parts: the user end and the cloud server. The user end refers to individuals or teams using the low-code development platform, who can obtain powerful code editing functions through the cloud server. The cloud server has a built-in online code editor that can easily support multiple programming languages and development frameworks.
[0152] Specifically, the online code editor is pre-configured by the cloud server. It integrates development components and detection components, which can automatically identify the code written by the user and provide corresponding feedback based on the content of the code. Specifically, when the user enters the code in the code editor, the cloud server will parse the code, extract the class name, and then reflect based on the class name to obtain some detection information based on the class name.
[0153] These detection information are processed and analyzed by the detection component, which will give some code completion prompts. For example, when a user tries to write a function named "hello", the system will prompt the user to add "function" before the file name to avoid the user entering the wrong type. In addition, the detection component will also find chain errors in the code. For example, when the user uses an undefined variable or function, the system will issue a warning. Finally, the detection component will also detect whether the variables in the code are correct. If so, it will return a correct answer. If not, an error prompt will be issued.
[0154] Based on this detection information, the cloud server will build a component editing recommendation interface for code revisions. On this interface, users can see all the modification suggestions given by the system and can choose to accept or reject them according to their needs. If these modification suggestions are accepted, they will be automatically applied to the code, so that iteration and debugging can be performed quickly. If these modification suggestions are rejected, users can also manually view the cause of the error and fix it.
[0155] The beneficial effects of the above technical solution are:
[0156] Code editing: Provides online text editing functions, supports syntax highlighting, automatic indentation, code folding, etc., to help developers write more standardized and readable code. Supports multiple programming languages, including but not limited to JavaScript, Java, CSS, etc.
[0157] Code prompt completion: After the user enters the code, the browser passes the input information and code information to the server. The server parses the input information and code information to obtain the real class name, obtains related variables, methods and other prompt information based on the class name reflection, converts the information package into a certain format and returns it to the browser. The browser port renders and displays it. The user can select or use the tab key to select the prompted code for entry. It supports automatic prompt completion of chain code and automatic prompt completion of generic information in the code, reducing the time and error rate of code input.
[0158] Automatic package import: When saving, it can automatically identify the classes or methods that need to be imported, and automatically add the corresponding import statements. This function can improve programming efficiency and allow developers to focus on the implementation of code logic rather than tedious import operations.
[0159] Pre-compilation: sunway_IDE provides the function of manual compilation. Static analysis and syntax checking can be performed in the pre-compilation stage to detect potential problems in advance and provide repair suggestions, thereby improving code quality.
[0160] Shortcut keys: sunway_IDE has built-in a variety of shortcut keys, which facilitate users to quickly perform some common operations during the coding process. When the built-in shortcut keys do not meet user needs, you can also maintain custom shortcut keys to meet more personalized needs of users.
[0161] Version control: The self-developed version control mechanism ensures that a file can only be edited by one person at a time, preventing code conflicts. It supports code history submission records, review and rollback, ensuring the security of the project.
[0162] Cross-platform support: No local installation is required, you can access and use it through the browser, supporting all major operating systems and devices. Responsive design ensures a good user experience on all screen sizes.
[0163] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A code editing method based on a low-code development platform, characterized in that: It includes the user end and cloud server. The cloud server has a built-in online code editor. An online code editor is pre-set on a cloud server; wherein the online code editor is configured with a development component and a detection component; When the code editor receives the user's input code, the cloud server parses the input code to determine the class name and the detection information based on the class name reflection; The detection information is determined by the detection component on the input code, and the detection information includes: code completion prompt information, code chain error information and code variables; Based on the detection information, a component editing recommendation interface for code revision is constructed.
2. A code editing method based on a low-code development platform as claimed in claim 1, characterized in that: The online editor is connected to a public script library, wherein the public script library is used to identify a user terminal accessing the online editor, wherein the user terminal includes a third-party application, a dedicated application, and a third-party browser; When the cloud server receives the first development access request of the third-party application, it determines the development permission of the development operation through the second development access request and configures the corresponding code editing environment; wherein the third-party application is an application development program; When the cloud server receives the second development access request from the third-party browser, it determines the execution system and execution device of the development operation through the second development access request, and configures the corresponding development environment; When the cloud server receives the third development access request for exclusive application program access, the cloud server performs display interface adaptation with the development device through the third development access request.
3. A code editing method based on a low-code development platform as claimed in claim 1, characterized in that: The development components include editing components and functional components; wherein, The editing components include: an online text editing component, a syntax highlighting component, and an automatic indentation control component; wherein the online text editing component is adapted to the corresponding functional component according to the programming language; Functional components include quick operation control components, code folding components and code visualization components.
4. A code editing method based on a low-code development platform as claimed in claim 1, characterized in that: The detection component performs input code detection in the pre-compilation stage, and the detection component includes: a static analysis component, a syntax detection component and a chain code error detection; The static analysis component is used to include a first analysis trigger condition and a second analysis trigger condition, wherein the first analysis trigger condition is configured to generate a temporary trigger signal after the user inputs the code and the second analysis trigger condition is configured to generate a temporary trigger signal when the first analysis trigger condition has been triggered and a Boolean event is generated; The grammar detection component is used to trigger synchronously when the first analysis trigger condition is triggered; The chain code error component is used to trigger the start after the first analysis trigger condition is triggered or the second analysis trigger condition is triggered.
5. A code editing method based on a low-code development platform as claimed in claim 1, characterized in that: After the code editor receives the input code from the user, it also includes: The code recognition mechanism for importing input code and code information is triggered through the code first transfer page of the online editor; wherein the code recognition mechanism is used to identify the code type, code development environment and code chain text; According to the recognition results of the code recognition mechanism, the pre-compilation environment is automatically configured, and shortcut keys and common statements corresponding to the code type are generated in the pre-compilation environment.
6. A code editing method based on a low-code development platform as claimed in claim 1, characterized in that: The detection information is reflected from the cloud server to the user end; Wherein, when there is code completion prompt information in the detection information, the code completion position and the completion code text are determined based on a preset standard code database and the prompt semantics in the prompt information; Generate quick completion prompt buttons based on the code completion position; Generate a list of completion codes based on the completion code text and quick completion prompt keys; When a first trigger instruction of the user end for any completion code in the completion code list and a second trigger key of the shortcut prompt key are received, automatic completion is performed.
7. A code editing method based on a low-code development platform as claimed in claim 1, characterized in that: After the code editor receives the input code from the user, it also includes: Build a unique editing space corresponding to the input code and set exclusive permissions for the unique editing space; According to the exclusive permissions, the editing verification conditions are set. When the user terminal meets the editing verification conditions, the corresponding user terminal is authorized to connect to the display interface of the unique editing space to edit the code.
8. A code editing method based on a low-code development platform as claimed in claim 1, characterized in that: The component editing recommendation interface for building code revisions also includes: Obtaining at least one revision measure corresponding to the detection information in the component editing recommendation interface; and Acquire at least one revision measure from at least one code revision item confirmed in the detection information; and Based on at least one revision measure, a priority order of a set of revision measures is obtained from a component editing recommendation interface including a plurality of revision measures, and the priority order is fed back to a user terminal.
9. A code editing method based on a low-code development platform as claimed in claim 1, characterized in that: The component editing recommendation interface for building code revisions also includes: When it is detected that the component editing recommendation interface does not have the required editing component, an external editing tool library is connected, and an editing tool loading interface is generated based on the external editing tool library; wherein the external editing tool library is used to set a variety of code editing tools; In response to the external editing tool library establishing a connection with the online code editor service, and controlling the online code editor to load the editing tool, a second component editing recommendation interface is generated, and the editing content of the code entered on the online editor is displayed on the second component editing recommendation interface.
10. A code editing system based on a low-code development platform, characterized in that: include: Cloud server: used to pre-set an online code editor; wherein the online code editor is configured with a development component and a detection component; Online code editor: used to parse the input code after receiving it from the user, determine the class name and the detection information based on the class name reflection; The detection information is determined by the detection component on the input code, and the detection information includes: code completion prompt information, code chain error information and code variables; User side: used to build a component editing recommendation interface for code revisions based on detection information.
Citation Information
Patent Citations
Code editing method and device, server, user equipment and storage medium
CN112817583A
Browser webpage end-based video stream rendering component type dragging editing tool
CN116088824A
Intelligent WebIDE design method for online development of Internet of Things
CN116880818A
Low-code customized development method
CN118245037A
Code processing method and device, equipment and medium
CN118535141A