Code processing method and device, equipment, medium and product
By displaying a floating window in the code editor interface, allowing users to enter and automatically add code to insert text to the top of the code file, the problem of developers needing to manually add code in the existing technology is solved, and the code editing efficiency and user experience is improved.
Patent Information
- Application Number
- CN202411678516.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art When writing programs, developers need to manually scroll to the top of the code file to add declarations, comments or import statements, which are inefficient and error-prone, and have poor user experience.
By presenting the floating window in the code editor interface, users allow the user to enter code into the suspended window and automatically add it to the top of the code file.
It improves the code editing efficiency of developers, reduces errors caused by manual operations, and improves user experience.
Smart Images

Figure CN119597265A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software development tools, and in particular to a code processing method, device, equipment, medium and product. Background Art
[0002] Currently, when writing programs, developers often need to add various declarations, comments, or import statements (such as import statements in Python code editors) at the top of the code file. The existing method is usually to manually scroll to the corresponding part of the file and then insert the corresponding text. Some modern code editors provide shortcut keys and auto-completion functions to simplify this process, but users still need to manually locate the beginning of the file for editing.
[0003] Therefore, how the code editor can automatically complete code insertion in response to user operations to improve the developer's user experience and code editing efficiency is an urgent problem to be solved. Summary of the invention
[0004] The present invention provides a code processing method, apparatus, device, medium and product, which are based on a code editor and automatically complete code insertion according to user operations, thereby improving the code editing efficiency of developers, reducing errors caused by manual operations, and improving user experience.
[0005] According to one aspect of the present invention, there is provided a code processing method, comprising:
[0006] During the process of the target user editing the code based on the code editor, if a code insertion instruction issued by the target user is detected, the configuration information of the floating window is determined;
[0007] According to the configuration information, a floating window is displayed in the code editor interface to instruct the target user to enter the target insertion code in the displayed floating window;
[0008] Determine the target code to be inserted, and insert the code according to the target to update the code displayed in the code editor.
[0009] According to another aspect of the present invention, there is provided a code processing device, comprising:
[0010] A determination module, used for determining the configuration information of the floating window if a code insertion instruction issued by the target user is detected during the process of the target user editing the code based on the code editor;
[0011] A display module, used to display a floating window on the code editor interface according to the configuration information, so as to instruct the target user to input the target insertion code in the displayed floating window;
[0012] The update module is used to determine the target insertion code and insert the code according to the target to update the code displayed in the code editor.
[0013] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the code processing method described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the code processing method described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the code processing method of any embodiment of the present invention is implemented.
[0019] The technical solution of the embodiment of the present invention is that during the process of the target user editing the code based on the code editor, if a code insertion instruction issued by the target user is detected, the configuration information of the floating window is determined; according to the configuration information, the floating window is displayed in the code editor interface to instruct the target user to enter the target insertion code in the displayed floating window; the target insertion code is determined, and according to the target insertion code, the displayed code in the code editor is updated. By automatically completing the code insertion based on the code editor according to the user operation, the code editing efficiency of the developer can be improved, the errors caused by manual operation can be reduced, and the user experience can be improved.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flowchart of a code processing method provided by Embodiment 1 of the present invention;
[0023] Figure 2 is a flow chart of a code processing method provided by Embodiment 2 of the present invention;
[0024] Figure 3 is a structural block diagram of a code processing device provided by Embodiment 3 of the present invention;
[0025] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", "target", "candidate", "alternative", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0028] It should be noted that in the related art, users are often required to manually locate the beginning of the file for editing. This method has the following technical disadvantages: (1) Low efficiency: Frequently scrolling the scroll bar of the editor is not only time-consuming, but also easily interrupts the developer's train of thought. (2) Error-prone: Manual operation increases the possibility of human error, such as forgetting to insert necessary import statements or accidentally deleting existing code. (3) Poor user experience: Frequent up and down scrolling operations reduce the developer's experience, especially when processing large code files. In response to the above technical disadvantages, the present invention proposes a code processing solution based on a code editor, through a canvas window suspended above the code editor interface, allowing users to enter any text in it, and these texts will be automatically added to the top of the currently opened code file. This method significantly improves the efficiency of developers, reduces errors caused by manual operations, and improves user experience. The specific implementation method will be described in detail in subsequent embodiments.
[0029] Embodiment 1
[0030] Figure 1 It is a flowchart of a code processing method provided in the first embodiment of the present invention; this embodiment is applicable to the case where the code editor obtains the insertion code based on the floating window and automatically completes the code insertion. The method can be executed by a code processing device, and the code processing device can be implemented in the form of hardware and / or software. The code processing device can be configured in an electronic device, such as an electronic device configured with a code editor and a floating canvas input system, and is executed by the floating canvas input system. Optionally, the floating canvas input system provided by the present invention can be integrated into an existing code editor as a plug-in or extension.
[0031] like Figure 1 As shown, the code processing method includes:
[0032] S101. During a process in which a target user is editing a code based on a code editor, if a code insertion instruction issued by the target user is detected, configuration information of a floating window is determined.
[0033] The target user may be, for example, a developer who edits code based on a code editor. The code editor may be, for example, a VS-code (Visual Studio Code) code editor or a PyCharm (Python Integrated Development Environment) code editor. The code insertion instruction refers to an instruction issued by the target user for the target to insert code. The target user may issue the code insertion instruction by using a preset insertion shortcut key or by clicking the mouse.
[0034] A floating window refers to a window that is suspended in the code editor interface. The floating window may include a text input box. The code editor interface refers to the interface for the target user to edit code. Configuration information refers to information for configuring the properties of the floating window. The configuration information may include the display position of the floating window and the floating window format. The floating window format may include the transparency of the window and / or the size information of the window. The display position of the floating window may be horizontally centered, left-aligned, or right-aligned. The display position of the floating window may also be the top, bottom, or sidebar of the code editor interface, preferably the top. The configuration information may specifically be a default floating window format and a default floating window display position, or a custom floating window format and a custom floating window display position.
[0035] Optionally, during the process of the target user editing code based on the code editor, if it is detected that the user types a wake-up shortcut key on the keyboard, such as ctrl+q, or it is detected that the user performs a preset click operation with the mouse, such as double-clicking the mouse in a preset area of the code editor interface, it can be determined that the code insertion instruction issued by the target user is detected.
[0036] Optionally, determining the configuration information of the floating window includes: matching in a preset configuration library based on the account information of the target user to determine whether the preset configuration library stores custom configuration information obtained by the target user in advance by customizing the floating window format and the floating window display position; if not, determining the configuration information of the floating window based on the default floating window format and the default floating window display position.
[0037] The account information refers to information that can characterize the identity of the target user, and the account information can be, for example, the identity identification number of the target user. The preset configuration library can store the account information of the floating canvas input system management user and the corresponding custom configuration information. The default floating window format can have a transparency of 0, and the default floating window display position can be centered at the top of the code editor interface.
[0038] Optionally, if the preset configuration library stores custom configuration information obtained by the target user in advance by customizing the floating window format and the floating window display position, the custom configuration information corresponding to the target user can be determined as the configuration information of the floating window.
[0039] Exemplarily, by waking up the shortcut key, the target user can wake up the floating canvas for the current code file at any time. Furthermore, the floating canvas input system can insert the content in the floating canvas into the top of the code file, thereby realizing an efficient code processing solution based on the code editor.
[0040] S102: Display a floating window in the code editor interface according to the configuration information to instruct the target user to input the target insertion code in the displayed floating window.
[0041] The target insertion code refers to the code input by the target user in the floating window and inserted into the preset position of the currently edited code. The preset position refers to a pre-specified insertion position, and the preset position may be, for example, the top of the code.
[0042] Optionally, displaying a floating window in the code editor interface according to the configuration information includes: determining a target format of the floating window according to the transparency and size information in the configuration information; and displaying a floating window of a preset format at a preset position of the code editor interface according to the target format and the position information in the configuration information, so as to realize the display of the floating window in the code editor interface. The size information may be the size of the floating window.
[0043] Optionally, while the target user is inputting the code, a preview area can be provided to display the content to be added. Through the preview area, the target user can check whether the text content is correct before actual application, thereby realizing the instant preview function of the floating canvas input system.
[0044] S103: Determine a target insertion code, and insert the code according to the target, so as to update the displayed code in the code editor.
[0045] The code originally displayed in the code editor is the code input by the target user based on the real-time editing of the code editor, that is, the candidate code file. The code displayed in the code editor after the display code is updated is the target code file after the target insertion code is added to the candidate code file.
[0046] Optionally, determining the target insertion code includes: during the process of the target user inputting the target insertion code in the displayed floating window, if it is detected that the target user clicks a preset confirmation shortcut key or moves the mouse position out of the floating window area, it is determined that the target user input is completed; when the target user input is completed, the content entered in the current floating window is determined as the target insertion code.
[0047] The preset confirmation shortcut key may be, for example, ctrl+s.
[0048] Optionally, the position change of the mouse in the code editor interface can be monitored. When the target user is detected to move the mouse out of the floating window area, it can be considered that the target user's input is completed; or when a signal of a preset confirmation shortcut key is received through the keyboard, it can be considered that the target user's input is completed, that is, it is determined that the target user's input is completed.
[0049] Optionally, when the target user input is completed, the floating canvas input system can read the text in the floating window based on a preset content reading function to obtain the content entered in the current floating window, and determine the content entered in the current floating window as the target insertion code.
[0050] Optionally, based on the target insertion code, the code displayed in the code editor is updated, including: adding the target insertion code entered by the target user in the floating window to the candidate code file currently edited by the target user to generate a target code file; updating the candidate code file displayed in the code editor to the target code file to update the code displayed in the code editor.
[0051] The candidate code file refers to the code file that the target user has entered in the code editor interface. The target code file refers to the file obtained by adding the target insertion code to the preset position in the candidate code file. The preset position refers to a pre-specified insertion position, and the preset position can be, for example, the top of the code, that is, the top of the candidate code file. The target insertion code can be, for example, a declaration, comment or import statement, specifically, an import statement in Python, such as "import numpy" or "import os".
[0052] Optionally, an API (Application Programming Interface) provided by the representative editor may be used to obtain the currently active document, ie, the candidate code file.
[0053] Optionally, the target insertion code entered by the target user in the floating window is added to the candidate code file currently being edited by the target user to generate a target code file, including: if the candidate code file is an empty file, directly determining the target insertion code as the target code file; if the candidate code file is not empty, adding the target insertion code entered by the target user in the floating window to the top of the candidate code file currently being edited by the target user to generate the target code file.
[0054] Exemplarily, if the candidate code file is empty, the target insertion code may be directly inserted as the first line, that is, the target insertion code may be directly determined as the target code file.
[0055] Optionally, if the candidate code file is not empty, the target insertion code input by the target user in the floating window can be added before the first line of the candidate code file currently edited by the target user, that is, the top of the candidate code file, to generate a target code file.
[0056] Optionally, after the target insertion code input by the target user in the floating window is added to the candidate code file currently edited by the target user, the floating window can be automatically closed after the code insertion is completed, so that the target user can continue to edit the code based on the code editor.
[0057] Optionally, when the floating canvas input system is configured in electronic devices with different operating systems and code editors, it is necessary to ensure that the floating canvas is compatible with different operating systems and code editor versions, and detailed help documents or wizards can also be provided to guide users on how to enable and use the floating canvas function.
[0058] It should be noted that, through the technical solution of the present invention, developers do not need to manually scroll to the top of the file, and can directly enter text in the floating canvas, which saves a lot of time and improves code processing efficiency; by automatically inserting text, human errors are reduced, such as forgetting to insert necessary import statements or accidentally deleting existing code, thereby reducing the overall error probability of the code; by setting a simple and intuitive user interface and a smooth operation process, the developer's user experience is improved; by setting the position and transparency of the floating canvas to be adjustable, the personalized needs of different users can be met; finally, the floating canvas input system provided by the present invention can be applied to a variety of programming languages and code editors, and has a wide range of applicability.
[0059] The technical solution of the embodiment of the present invention is that during the process of the target user editing the code based on the code editor, if a code insertion instruction issued by the target user is detected, the configuration information of the floating window is determined; according to the configuration information, the floating window is displayed in the code editor interface to instruct the target user to enter the target insertion code in the displayed floating window; the target insertion code is determined, and according to the target insertion code, the displayed code in the code editor is updated. By automatically completing the code insertion based on the code editor according to the user operation, the code editing efficiency of the developer can be improved, the errors caused by manual operation can be reduced, and the user experience can be improved.
[0060] Embodiment 2
[0061] Figure 2 is a flowchart of a code processing method provided in Embodiment 2 of the present invention; based on the above embodiments, this embodiment provides a preferred example of code insertion processing based on a code editor, specifically, Figure 2 As shown, the method includes:
[0062] S201. During the process of the target user editing the code based on the code editor, if a code insertion instruction issued by the target user is detected, a match is performed in the preset configuration library according to the account information of the target user to determine whether the preset configuration library stores the custom configuration information obtained by the target user in advance for the floating window format and the floating window display position.
[0063] S202: If not, determine the configuration information of the floating window according to the default floating window format and the default floating window display position.
[0064] S203: Determine the target format of the floating window according to the transparency and size information in the configuration information.
[0065] S204. Display a floating window of a preset format at a preset position of the code editor interface according to the target format and the position information in the configuration information, so as to realize the floating window display in the code editor interface, and instruct the target user to input the target insertion code in the displayed floating window.
[0066] S205: When the target user inputs the target insertion code in the displayed floating window, if it is detected that the target user clicks a preset confirmation shortcut key or moves the mouse out of the floating window area, it is determined that the target user has completed the input.
[0067] S206: When the target user completes input, the content input in the current floating window is determined as the target insertion code.
[0068] S207: Add the target insertion code input by the target user in the floating window to the candidate code file currently edited by the target user to generate a target code file.
[0069] S208: Update the candidate code file displayed in the code editor to the target code file, so as to update the code displayed in the code editor.
[0070] The technical solution of the embodiment of the present invention is that during the process of the target user editing the code based on the code editor, if a code insertion instruction issued by the target user is detected, the configuration information of the floating window is determined; according to the configuration information, the floating window is displayed in the code editor interface to instruct the target user to enter the target insertion code in the displayed floating window; the target insertion code is determined, and according to the target insertion code, the displayed code in the code editor is updated. By automatically completing the code insertion based on the code editor according to the user operation, the code editing efficiency of the developer can be improved, the errors caused by manual operation can be reduced, and the user experience can be improved.
[0071] Embodiment 3
[0072] Figure 3 : is a structural block diagram of a code processing device provided in the third embodiment of the present invention; this embodiment is applicable to the case where the code editor obtains the insertion code based on the floating window and automatically completes the code insertion. The code processing device provided in the embodiment of the present invention can execute the code processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method; the code processing device can be implemented in the form of hardware and / or software, and configured in an electronic device with a code processing function, such as an electronic device configured with a code editor and a floating canvas input system, and is executed by the floating canvas input system, such as Figure 3 As shown, the code processing device specifically includes:
[0073] The determination module 301 is used to determine the configuration information of the floating window if a code insertion instruction issued by the target user is detected during the process of the target user editing the code based on the code editor;
[0074] The display module 302 is used to display a floating window in the code editor interface according to the configuration information, so as to instruct the target user to input the target insertion code in the displayed floating window;
[0075] The updating module 303 is used to determine the target insertion code and update the displayed code in the code editor according to the target insertion code.
[0076] The technical solution of the embodiment of the present invention is that during the process of the target user editing the code based on the code editor, if a code insertion instruction issued by the target user is detected, the configuration information of the floating window is determined; according to the configuration information, the floating window is displayed in the code editor interface to instruct the target user to enter the target insertion code in the displayed floating window; the target insertion code is determined, and according to the target insertion code, the displayed code in the code editor is updated. By automatically completing the code insertion based on the code editor according to the user operation, the code editing efficiency of the developer can be improved, the errors caused by manual operation can be reduced, and the user experience can be improved.
[0077] Furthermore, the determination module 301 is specifically used for:
[0078] According to the target user's account information, a match is performed in the preset configuration library to determine whether the preset configuration library stores the custom configuration information obtained by the target user in advance by customizing the floating window format and the floating window display position;
[0079] If not, the configuration information of the floating window is determined according to the default floating window format and the default floating window display position.
[0080] Furthermore, the display module 302 is specifically used for:
[0081] Determine the target format of the floating window according to the transparency and size information in the configuration information;
[0082] According to the target format and the position information in the configuration information, a floating window of a preset format is displayed at a preset position of the code editor interface, so as to realize the floating window display in the code editor interface.
[0083] Furthermore, the updating module 303 is specifically used for:
[0084] During the process of the target user inputting the target insertion code in the displayed floating window, if it is detected that the target user clicks a preset confirmation shortcut key or the mouse position moves out of the floating window area, it is determined that the target user has completed the input;
[0085] When the target user completes input, the content input in the current floating window is determined as the target insertion code.
[0086] Furthermore, the updating module 303 may include:
[0087] A generating unit, used for adding the target insertion code input by the target user in the floating window to the candidate code file currently edited by the target user to generate a target code file;
[0088] The updating unit is used to update the candidate code file displayed in the code editor to the target code file, so as to update the code displayed in the code editor.
[0089] Furthermore, the generating unit is specifically used for:
[0090] If the candidate code file is an empty file, the target insertion code is directly determined as the target code file;
[0091] If the candidate code file is not empty, the target insertion code input by the target user in the floating window is added to the top of the candidate code file currently edited by the target user to generate a target code file.
[0092] Embodiment 4
[0093] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0094] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0095] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0096] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a code processing method.
[0097] In some embodiments, the code processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the code processing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the code processing method in any other appropriate manner (e.g., by means of firmware).
[0098] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0099] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0100] In the context of the present invention, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0101] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0102] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0103] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0104] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and the computer program implements the code processing method of any embodiment of the present invention when executed by a processor.
[0105] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0106] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0107] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A code processing method, characterized in that: include: During the process of the target user editing the code based on the code editor, if a code insertion instruction issued by the target user is detected, the configuration information of the floating window is determined; According to the configuration information, a floating window is displayed in the code editor interface to instruct the target user to enter the target insertion code in the displayed floating window; Determine the target code insertion, and insert the code according to the target to update the code displayed in the code editor.
2. The method according to claim 1, characterized in that Determine the configuration information of the floating window, including: According to the target user's account information, a match is performed in the preset configuration library to determine whether the preset configuration library stores the custom configuration information obtained by the target user in advance by customizing the floating window format and the floating window display position; If not, the configuration information of the floating window is determined according to the default floating window format and the default floating window display position.
3. The method according to claim 1, characterized in that According to the configuration information, a floating window is displayed in the code editor interface, including: Determine the target format of the floating window according to the transparency and size information in the configuration information; According to the target format and the position information in the configuration information, a floating window of a preset format is displayed at a preset position of the code editor interface, so as to realize the floating window display in the code editor interface.
4. The method according to claim 1, characterized in that: Determine the target insertion code, including: During the process of the target user inputting the target insertion code in the displayed floating window, if it is detected that the target user clicks a preset confirmation shortcut key or the mouse position moves out of the floating window area, it is determined that the target user has completed the input; When the target user completes input, the content input in the current floating window is determined as the target insertion code.
5. The method according to claim 1, characterized in that Insert code according to the target and update the code displayed in the code editor, including: Add the target insertion code input by the target user in the floating window to the candidate code file currently edited by the target user to generate a target code file; The candidate code file displayed in the code editor is updated to the target code file, so as to update the code displayed in the code editor.
6. The method according to claim 5, characterized in that The target insertion code entered by the target user in the floating window is added to the candidate code file currently edited by the target user to generate a target code file, including: If the candidate code file is an empty file, the target insertion code is directly determined as the target code file; If the candidate code file is not empty, the target insertion code input by the target user in the floating window is added to the top of the candidate code file currently edited by the target user to generate a target code file.
7. A code processing device, characterized in that: include: A determination module, used for determining the configuration information of the floating window if a code insertion instruction issued by the target user is detected during the process of the target user editing the code based on the code editor; A display module, used to display a floating window in the code editor interface according to the configuration information, so as to instruct the target user to enter the target insertion code in the displayed floating window; The update module is used to determine the target insertion code and insert the code according to the target to update the code displayed in the code editor.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the code processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the code processing method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the code processing method according to any one of claims 1 to 6.