CN110688103A - Code writing method and device, electronic equipment and computer readable storage medium - Google Patents
Code writing method and device, electronic equipment and computer readable storage medium Download PDFInfo
- Publication number
- CN110688103A CN110688103A CN201910959952.9A CN201910959952A CN110688103A CN 110688103 A CN110688103 A CN 110688103A CN 201910959952 A CN201910959952 A CN 201910959952A CN 110688103 A CN110688103 A CN 110688103A
- Authority
- CN
- China
- Prior art keywords
- code information
- code
- information
- user
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/33—Intelligent editors
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The embodiment of the application provides a code writing method and device, electronic equipment and a computer readable storage medium. The method comprises the following steps: the method comprises the steps of obtaining information input by a user, searching first code information matched with the information input by the user based on the obtained information input by the user, determining target first code information when detecting selection operation of the user aiming at the searched first code information, and inserting the target first code information or second code information containing the target first code information to a corresponding position to realize code writing. The embodiment of the application realizes that on one hand, the time and labor cost consumed by manual code writing are reduced; on the other hand, the possibility limit of the code written by the programmer for copying and pasting is reduced, so that the time consumption of copying and pasting is reduced, the complexity of copying and pasting is reduced, and the user experience is improved.
Description
Technical Field
The present application relates to the field of software development technologies, and in particular, to a code writing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the continuous development of the internet, informatization is integrated into the aspects of our lives, more and more people participate in the information technology industry and the programming work, and programmers realize certain functions on corresponding development tools by writing codes.
In the prior art, a programmer still writes codes manually to realize specific functions, or the programmer searches whether codes which realize the same functions exist in the codes written by the programmer before, and if so, the codes can be copied and pasted to corresponding positions.
However, in the above scheme, a large amount of time and a large amount of labor cost are consumed for a programmer to write codes manually; moreover, since the possibility that the programmer writes the code for realizing the same function before is low, the possibility that the programmer writes the code for realizing the same function before is also low, and even if the programmer writes the code for realizing the same function before, the programmer is also required to search a specific code position and then copy and paste the code, the time consumption is also long, the complexity is also high, and further the user experience is poor.
Disclosure of Invention
The application provides a code writing method, a code writing device, electronic equipment and a computer readable storage medium, which can solve at least one technical problem.
In a first aspect, a method for writing code is provided, the method including:
acquiring information input by a user;
searching first code information matched with the information input by the user based on the acquired information input by the user;
when the selection operation of the user for the searched first code information is detected, determining target first code information;
and inserting the target first code information or second code information containing the target first code information into a corresponding position to realize code writing.
In a second aspect, there is provided a code writing apparatus, the apparatus comprising:
the acquisition module is used for acquiring information input by a user;
the first searching module is used for searching first code information matched with the information input by the user based on the acquired information input by the user;
the first determining module is used for determining target first code information when the selection operation of the user aiming at the searched first code information is detected;
the first inserting module is used for inserting the target first code information or the second code information containing the target first code information into a corresponding position so as to realize code writing.
In a third aspect, an electronic device is provided, which includes:
one or more processors;
a memory;
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: and executing the corresponding operation according to the code writing method shown in the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the code writing method shown in the first aspect.
The beneficial effect that technical scheme that this application provided brought is:
compared with the prior art, the code compiling method and device, the electronic equipment and the computer readable storage medium have the advantages that the information input by a user is obtained, the first code information matched with the information input by the user is searched for based on the obtained information input by the user, when the selection operation of the user for the searched first code information is detected, the target first code information is determined, and the target first code information or the second code information containing the target first code information is inserted into the corresponding position to realize code compiling, so that the time and labor cost consumed by manual code compiling are reduced; on the other hand, the possibility limit of the code written by the programmer for copying and pasting is reduced, so that the time consumption of copying and pasting is reduced, the complexity of copying and pasting is reduced, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a code writing method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a code writing apparatus according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure;
fig. 4 is a display interface diagram of a code writing method according to an embodiment of the present application;
FIG. 5 is a display interface diagram of another code writing method provided by an embodiment of the present application;
fig. 6 is a schematic view of an interaction structure between Eclipse and a "code prompting assistant" provided in an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
An embodiment of the present application provides a code writing method, as shown in fig. 1, the method includes:
step S101, information input by a user is acquired.
For the embodiment of the application, the information input by the user on the preset input interface is obtained.
And step S102, searching first code information matched with the information input by the user based on the acquired information input by the user.
For the embodiment of the present application, the first code information may be field information, may also be class name information, and may also be method name information, such as "systemeexception" or "Filer", which is not limited in the embodiment of the present application.
Step S103, when the selection operation of the user for the searched first code information is detected, the target first code information is determined.
And step S104, inserting the target first code information or the second code information containing the target first code information into a corresponding position to realize code writing.
For the embodiment of the present application, the second code information is a function code block that implements a preset function and includes the first code information.
Compared with the prior art, the code compiling method includes the steps that information input by a user is obtained, first code information matched with the information input by the user is searched for based on the obtained information input by the user, when the selection operation of the user for the searched first code information is detected, target first code information is determined, and the target first code information or second code information containing the target first code information is inserted into a corresponding position to achieve code compiling, so that time and labor cost consumed by manual code compiling are reduced; on the other hand, the possibility limit of the code written by the programmer for copying and pasting is reduced, so that the time consumption of copying and pasting is reduced, the complexity of copying and pasting is reduced, and the user experience is improved.
In another possible implementation manner of the embodiment of the present application, step S103 may further include: and searching second code information containing the first code information based on the searched first code information matched with the information input by the user, wherein one piece of second code information contains one piece of first code information.
For the embodiment of the application, the first code information matched with the information input by the user comprises at least one, and for any one first code information, the second code information comprising any one first code information is searched.
For example, the information input by the user is "FileR", and based on that the found first code information matched with the information input by the user is "FileReader", "FileReadEvent", and "FileResolverlmpl", the second code information including the first code information "FileReader", the second code information including the first code information "FileReadEvent", and the second code information including the first code information "FileResolverlmpl" are found.
Further, when the selection operation of the user for the searched first code information is detected, the target first code information is determined, and if the target first code information is 'FileReader'.
In another possible implementation manner of the embodiment of the present application, after step S103, the method may further include: second code information containing the target first code information is searched.
For the embodiment of the application, the first code information matched with the information input by the user comprises at least one, when the selection operation of the user aiming at the searched at least one first code information is detected, the target first code information is determined, and the second code information comprising the target first code information is searched.
For example, as shown in fig. 4, the information input by the user is a 1: "FileR", based on the found first code information matching the information input by the user is A3, specifically, A3 includes: "FileReader", "Filer", "FileReadEvent", "FileResolverlmpl", and "fileexception", when it is determined that the target first code information is "FileReader" by detecting a selection operation of the user for the searched first code information, second code information including the target first code information "FileReader" is searched, as shown in fig. 5, the second code information including the target first code information "FileReader" is B.
In another possible implementation manner of the embodiment of the present application, if at least two pieces of first code information matched with the information input by the user are found, the step S102 may further include: determining the sequencing information corresponding to each searched first code information according to the hit times; and displaying each piece of first code information according to the sequencing information corresponding to each piece of searched first code information.
The hit times are the times of selecting each piece of first code information by the selection operation of the user.
For the embodiment of the application, the sequencing information corresponding to each piece of searched first code information is determined according to the hit times and/or the preset sequencing rule, each piece of first code information is displayed according to the sequencing information corresponding to each piece of searched first code information, the first code information commonly used by developers can be preferentially displayed, the selection of the developers is facilitated, and the waste of time is reduced. The preset ordering rule may be the length of the first code information, or may be an alphabetical order, which is not limited in the embodiment of the present application.
For example, the first code information is "FileReader", "FileReadEvent", and "FileResolverlmpl", respectively, where the number of hits of "FileReader" is 2, the number of hits of "FileReadEvent" and "FileResolverlmpl" is 5, and if the ordering is according to the rule of the number of hits in priority and the length of the first code information, the ordering information of "FileReader" is the third bit, the ordering information of "FileReadEvent" is the second bit, the ordering information of "FileResolverlmpl" is the first bit, that is, the ordering information of three first code information is: "FileResolverlmpl", "FileReadEvent", and "FileReader".
In another possible implementation manner of the embodiment of the present application, step S104 may specifically include any one of the following: if the second code information containing the target first code information exists, inserting the second code information containing the target first code information into a corresponding position; and if the second code information containing the target first code information does not exist, inserting the target first code information into the corresponding position.
For example, when the target first code information is "FileReader", if there is second code information including "FileReader", inserting the second code information including "FileReader" to a corresponding position; and if the second code information containing the FileReader does not exist, inserting the FileReader into the corresponding position.
In another possible implementation manner of the embodiment of the present application, step S104 may specifically include: and inserting the target first code information or second code information containing the target first code information into a corresponding position in a preset mode so as to realize code writing.
Wherein the preset mode comprises at least one of the following modes: inserting contents of the target first code information except for the information input by the user or contents of the second code information containing the target first code information except for the information input by the user into the information input by the user; the target first code information or the second code information containing the target first code information is substituted for the information input by the user.
For example, the information input by the user is "FileR", and if the target first code information is "FileReader", the content of the target first code information other than "FileR", that is, "reader", or the content of the second code information including the target first code information "FileReader" other than "FileR", is inserted into the position behind "FileR".
For another example, the information input by the user is "FileR", and if the target first code information is "FileReader", the target first code information, that is, "FileReader", or the second code information including the target first code information "FileReader" is used to replace "FileR".
In another possible implementation manner of the embodiment of the present application, after step S103, the method may further include: and updating the hit times of the target first code information.
For the embodiment of the present application, the hit frequency of the target first code information is updated in the following manner: the number of hits on the target first code information is increased by 1.
In another possible implementation manner of the embodiment of the present application, the code writing method may further include: the method includes storing a plurality of pieces of second code information input by a user and first code information corresponding to each piece of second code information, and creating a correspondence between each piece of first code information and each piece of second code information.
For the embodiment of the application, a plurality of pieces of second code information input by a user are stored in the first storage area, and the first code information corresponding to each piece of second code information is stored in the second storage area. The first storage area and the second storage area may be the same storage area, or may be two different storage areas, which is not limited in this embodiment of the application. Further, the user may export the plurality of pieces of second code information stored in the first storage area, the first code information stored in the second storage area and corresponding to each piece of second code information, and the corresponding relationship between each piece of first code information and each piece of second code information to the terminal device corresponding to the other user in a preset export manner.
For the embodiment of the present application, the corresponding relationship between each piece of first code information and each piece of second code information may be an index relationship, so as to search for the second code information including the first code information or search for the second code information including the target first code information based on the index relationship by using a preset search engine, or may be a mapping relationship, and the like, which is not limited in the embodiment of the present application.
For the embodiment of the present application, a plurality of pieces of second code information input by a user and first code information corresponding to each piece of second code information are stored, and a corresponding relationship between each piece of first code information and each piece of second code information is created, which may be executed before a code writing method, or before second code information including first code information is searched, or before second code information including target first code information is searched, and which is not limited in the embodiment of the present application.
In another possible implementation manner of the embodiment of the present application, if the found first code information matched with the information input by the user includes at least one, and at least one first code information meeting the preset condition exists in the at least one first code information, and the first code information meeting the preset condition includes second code information, the step S102 may further include: and determining the function information corresponding to each piece of second code information, and when the selection operation of the user for the function information is detected, inserting the second code information corresponding to the function information selected by the selection operation into the corresponding position.
And the function information corresponding to each piece of second code information is used for representing the function realized by each piece of second code information.
For the embodiment of the present application, the first code information meeting the preset condition is that at least one first code information exists, and the at least one first code information has the corresponding second code information. For example, the first code information "system" has its corresponding second code information "system { a ═ 1; and if so, the first code information "system" is the first code information meeting the preset condition.
For example, as shown in fig. 4, the information input by the user is a 1: "FileR", the first code information matched with a1 is A3, where A3 includes five pieces of first code information, where three pieces of first code information respectively have corresponding second code information, and then the function information a2 corresponding to three pieces of second code information is determined, specifically, a2 includes "read file", "write file", and "read-write file", and when a selection operation of a user for "read file" is detected, the second code information corresponding to the "read file" selected by the selection operation is inserted into a corresponding position, as shown in fig. 5, the second code information corresponding to the "read file" selected by the selection operation is B.
For the embodiment of the present application, the manner of inserting the second code information corresponding to the function information selected by the selection operation into the corresponding position is as follows: and inserting information except the information input by the user in the second code information corresponding to the function information selected by the selection operation into the information input by the user, or replacing the information input by the user with the second code information corresponding to the function information selected by the selection operation.
For the embodiments of the present application, the embodiments described above may be executed by a terminal device, a server, or a part of the terminal device and a part of the server. The embodiments of the present application are not limited.
The code writing method is specifically described from the perspective of method steps, and is introduced below with reference to a specific application scenario.
As shown in fig. 6, an embodiment of the present application provides a development tool Eclipse, which includes the following units: the system comprises a code editor, a code prompt box and a code block information base; the embodiment of the present application further provides a plug-in tool "code prompting assistant" that can run in Eclipse, where the "code prompting assistant" includes the following units: code input monitoring, code analyzer, code search engine, local engineering, code block caching, code information interaction, code block management interface and code block synchronization.
For the embodiment of the application, the code editor is used for acquiring information input by a user; the code input monitor is used for monitoring the information input by the user and acquired by the code editor and calling the code analyzer; the code analyzer can be used for calling a code search engine to search first code information matched with information input by a user from a local project, searching second code information containing the first code information from a code block cache, and sending the first code information and the second code information containing the first code information to a code prompt box so that the user selects target first code information from the first code information, and the code analyzer can also be used for calling the code search engine to search the first code information matched with the information input by the user from the local project and sending the first code information and the second code information to the code prompt box so that the user selects the target first code information from the first code information, calling the code search engine to search the second code information containing the target first code information from the code block cache and sending the second code information to the code prompt box; the code prompt box is used for inserting the target first code information or the second code information containing the target first code information into a corresponding position so as to realize code writing.
For the embodiment of the application, the code block management interface can receive first code information input by a user and second code information corresponding to the first code information; the code block synchronization can acquire first code information and corresponding second code information from other equipment; the code information interaction can establish the corresponding relation between the first code information and the second code information and store the corresponding relation into a code block information base or a code block cache. In the embodiment of the application, the code analyzer may further obtain second code information containing the first code information or second code information containing the target first code information from the code block information base through code information interaction.
The above embodiment of the method of the present application is described in detail, and a code writing apparatus is described below from the perspective of a virtual module or a virtual unit, as follows:
an embodiment of the present application provides a code writing apparatus, and as shown in fig. 2, the code writing apparatus 20 may include: an acquisition module 201, a first lookup module 202, a first determination module 203, and a first insertion module 204, wherein,
the obtaining module 201 is configured to obtain information input by a user.
The first searching module 202 is configured to search, based on the obtained information input by the user, first code information that matches the information input by the user.
The first determining module 203 is configured to determine the target first code information when a selection operation of the user for the found first code information is detected.
The first inserting module 204 is configured to insert the target first code information or the second code information including the target first code information into a corresponding position, so as to implement code writing.
In another possible implementation manner of the embodiment of the present application, the code writing apparatus 20 may further include a second lookup module, wherein,
and the second searching module is used for searching second code information containing the first code information based on the searched first code information matched with the information input by the user.
In another possible implementation manner of the embodiment of the present application, the code writing apparatus 20 may further include a third searching module, wherein,
and the third searching module is used for searching second code information containing the target first code information.
In another possible implementation manner of the embodiment of the present application, if at least two pieces of first code information matching the information input by the user are found, the code writing apparatus 20 may further include a second determining module and a display module, wherein,
and the second determining module is used for determining the sorting information corresponding to each searched first code information according to the hit times.
And the display module is used for displaying each piece of first code information according to the sequencing information corresponding to each piece of searched first code information.
The hit times are the times of selecting each piece of first code information by the selection operation of the user.
In another possible implementation manner of the embodiment of the present application, the first insertion module 204 includes any one of a first insertion unit and a second insertion unit, wherein,
and the first inserting unit is used for inserting the second code information containing the target first code information into a corresponding position if the second code information containing the target first code information exists.
And the second inserting unit is used for inserting the target first code information into the corresponding position if the second code information containing the target first code information does not exist.
In another possible implementation manner of the embodiment of the present application, the first plug-in module 204 further includes a third plug-in unit, wherein,
the third inserting unit is used for inserting the target first code information or the second code information containing the target first code information into a corresponding position in a preset mode so as to realize code compiling;
wherein the preset mode comprises at least one of the following modes:
inserting the contents of the target first code information except the information input by the user or the contents of the second code information containing the target first code information except the information input by the user after the information input by the user.
The target first code information or the second code information containing the target first code information is substituted for the information input by the user.
In another possible implementation manner of the embodiment of the present application, the code writing apparatus 20 further includes an update module, wherein,
and the updating module is used for updating the hit times of the target first code information.
In another possible implementation manner of the embodiment of the present application, the code writing apparatus 20 further includes a storage creation module, wherein,
the storage creating module is used for storing a plurality of pieces of second code information input by a user and the first code information corresponding to each piece of second code information respectively, and creating the corresponding relation between each piece of first code information and each piece of second code information.
In another possible implementation manner of the embodiment of the present application, if the found first code information matching the information input by the user includes at least one, and at least one first code information meeting the preset condition exists in the at least one first code information, and the first code information meeting the preset condition includes second code information, the code writing apparatus 20 further includes a third determining module and a second inserting module, wherein,
and the third determining module is used for determining the function information corresponding to each piece of second code information, and the function information corresponding to each piece of second code information is used for representing the function realized by each piece of second code information.
And the second inserting module is used for inserting the second code information corresponding to the function information selected by the selection operation into the corresponding position when the selection operation of the user for the function information is detected.
For the embodiment of the present application, the first search module 202, the second search module, and the third search module may be the same search module, any two of the search modules may be the same search module, or three different search modules; the first determining module 203, the second determining module, and the third determining module may be the same determining module, any two of the determining modules may be the same determining module, or three different determining modules; the first plug-in module 204 and the second plug-in module may be the same plug-in module or may be two different plug-in modules; the first insertion unit, the second insertion unit, and the third insertion unit may be the same insertion unit, any two insertion units may be the same insertion unit, or three different insertion units, which is not limited in the embodiment of the present application.
The code writing device 20 of the embodiment of the present application may perform operations corresponding to the code insertion method of the embodiment of the present application, and the implementation principles thereof are similar and will not be described herein again.
Compared with the prior art, the code compiling device is characterized in that the code compiling device is used for obtaining information input by a user, searching first code information matched with the information input by the user based on the obtained information input by the user, determining target first code information when the selection operation of the user for the searched first code information is detected, and inserting the target first code information or second code information containing the target first code information into a corresponding position to realize code compiling, so that time and labor cost consumed by manual code compiling are reduced; on the other hand, the possibility limit of the code written by the programmer for copying and pasting is reduced, so that the time consumption of copying and pasting is reduced, the complexity of copying and pasting is reduced, and the user experience is improved.
The code writing device of the present application is described above from the perspective of a virtual module or a virtual unit, and the electronic device of the present application is described below from the perspective of a physical device.
An embodiment of the present application provides an electronic device, as shown in fig. 3, an electronic device 4000 shown in fig. 3 includes: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further comprise a transceiver 4004. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The memory 4003 is used for storing application codes for executing the scheme of the present application, and the execution is controlled by the processor 4001. Processor 4001 is configured to execute application code stored in memory 4003 to implement what is shown in any of the foregoing method embodiments.
An embodiment of the present application provides an electronic device, where the electronic device includes: a memory and a processor; at least one program stored in the memory for execution by the processor, which when executed by the processor, implements: according to the method and the device, the information input by the user is acquired, the first code information matched with the information input by the user is searched based on the acquired information input by the user, when the selection operation of the user for the searched first code information is detected, the target first code information is determined, and the target first code information or the second code information containing the target first code information is inserted into the corresponding position, so that code compiling is realized, and on one hand, the time and labor cost consumed by manual code compiling are reduced; on the other hand, the possibility limit of the code written by the programmer for copying and pasting is reduced, so that the time consumption of copying and pasting is reduced, the complexity of copying and pasting is reduced, and the user experience is improved.
The electronic device of the present application is described above from the perspective of a physical device, and the computer-readable storage medium of the present application is described below from the perspective of a storage medium.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments. Compared with the prior art, the method and the device have the advantages that the information input by the user is obtained, the first code information matched with the information input by the user is searched based on the obtained information input by the user, when the selection operation of the user for the searched first code information is detected, the target first code information is determined, and the target first code information or the second code information containing the target first code information is inserted into the corresponding position to realize code compiling, so that the time and labor cost consumed by manual code compiling are reduced; on the other hand, the possibility limit of the code written by the programmer for copying and pasting is reduced, so that the time consumption of copying and pasting is reduced, the complexity of copying and pasting is reduced, and the user experience is improved.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.
Claims (10)
1. A method of code writing, comprising:
acquiring information input by a user;
searching first code information matched with the information input by the user based on the acquired information input by the user;
when the selection operation of the user for the searched first code information is detected, determining target first code information;
and inserting the target first code information or second code information containing the target first code information into a corresponding position to realize code writing.
2. The method of claim 1, wherein determining the target first code information further comprises:
and searching second code information containing the first code information based on the searched first code information matched with the information input by the user.
3. The method of claim 1, wherein determining the target first code information further comprises:
and searching second code information containing the target first code information.
4. The method according to any of claims 1-3, wherein if at least two first code information matching the user-entered information are found,
the searching for the first code information matched with the information input by the user further comprises:
determining the sequencing information corresponding to each searched first code information according to the hit times;
displaying each piece of first code information according to the sequencing information corresponding to each piece of searched first code information;
the hit times are the times of selecting each first code information by the selection operation of the user.
5. The method according to any one of claims 1 to 4, wherein the step of inserting the target first code information or second code information containing the target first code information into a corresponding position to implement code writing comprises:
inserting the target first code information or second code information containing the target first code information to a corresponding position in a preset mode to realize code writing;
wherein the preset mode comprises at least one of the following modes:
inserting contents of the target first code information except the user-input information or contents of the second code information containing the target first code information except the user-input information after the user-input information;
replacing the information input by the user with the target first code information or second code information containing the target first code information.
6. The method according to any one of claims 1 to 5, wherein when the user selection operation for the found first code information is detected, determining the target first code information, and then further comprising:
and updating the hit times of the target first code information.
7. The method according to any one of claims 1 to 6, wherein if the found first code information matching the information input by the user comprises at least one, and at least one first code information meeting a preset condition exists in the at least one first code information, the first code information meeting the preset condition comprises second code information;
the searching for the first code information matched with the information input by the user based on the acquired information input by the user further comprises:
determining function information corresponding to each piece of second code information, wherein the function information corresponding to each piece of second code information is used for representing the function realized by each piece of second code information;
and when the selection operation of the user for the function information is detected, inserting the second code information corresponding to the function information selected by the selection operation into the corresponding position.
8. A code writing apparatus, comprising:
the acquisition module is used for acquiring information input by a user;
the first searching module is used for searching first code information matched with the information input by the user based on the acquired information input by the user;
the first determining module is used for determining target first code information when the selection operation of the user aiming at the searched first code information is detected;
and the first inserting module is used for inserting the target first code information or second code information containing the target first code information into a corresponding position so as to realize code writing.
9. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: executing the code writing method according to any one of claims 1 to 7.
10. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing a method of code writing according to any one of claims 1 to 7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910959952.9A CN110688103B (en) | 2019-10-10 | 2019-10-10 | Code writing method, device, electronic equipment and computer readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910959952.9A CN110688103B (en) | 2019-10-10 | 2019-10-10 | Code writing method, device, electronic equipment and computer readable storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN110688103A true CN110688103A (en) | 2020-01-14 |
| CN110688103B CN110688103B (en) | 2023-07-04 |
Family
ID=69111903
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910959952.9A Active CN110688103B (en) | 2019-10-10 | 2019-10-10 | Code writing method, device, electronic equipment and computer readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN110688103B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111949522A (en) * | 2020-07-31 | 2020-11-17 | 中国工商银行股份有限公司 | User interface automatic testing method and device |
Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150339104A1 (en) * | 2014-05-21 | 2015-11-26 | International Business Machines Corporation | System and method for using development objectives to guide implementation of source code |
| CN105446788A (en) * | 2014-08-20 | 2016-03-30 | 联想(北京)有限公司 | Information processing method and electronic equipment |
| EP3082036A1 (en) * | 2015-03-30 | 2016-10-19 | Wipro Limited | System and method for software reuse |
| CN108255709A (en) * | 2017-12-26 | 2018-07-06 | 平安壹钱包电子商务有限公司 | Script tests method, apparatus, terminal device and the storage medium of written in code |
| CN108345453A (en) * | 2017-08-01 | 2018-07-31 | 平安科技(深圳)有限公司 | Code generating method, code generator and readable storage medium storing program for executing |
| CN109189384A (en) * | 2018-07-27 | 2019-01-11 | 武汉斗鱼网络科技有限公司 | A kind of multiplexing method and device of code |
| CN109254774A (en) * | 2018-08-30 | 2019-01-22 | 郑州云海信息技术有限公司 | The management method and device of code in software development system |
| CN110083340A (en) * | 2019-03-19 | 2019-08-02 | 深圳壹账通智能科技有限公司 | Code generating method, device, computer equipment and storage medium |
-
2019
- 2019-10-10 CN CN201910959952.9A patent/CN110688103B/en active Active
Patent Citations (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150339104A1 (en) * | 2014-05-21 | 2015-11-26 | International Business Machines Corporation | System and method for using development objectives to guide implementation of source code |
| CN105446788A (en) * | 2014-08-20 | 2016-03-30 | 联想(北京)有限公司 | Information processing method and electronic equipment |
| EP3082036A1 (en) * | 2015-03-30 | 2016-10-19 | Wipro Limited | System and method for software reuse |
| CN108345453A (en) * | 2017-08-01 | 2018-07-31 | 平安科技(深圳)有限公司 | Code generating method, code generator and readable storage medium storing program for executing |
| CN108255709A (en) * | 2017-12-26 | 2018-07-06 | 平安壹钱包电子商务有限公司 | Script tests method, apparatus, terminal device and the storage medium of written in code |
| CN109189384A (en) * | 2018-07-27 | 2019-01-11 | 武汉斗鱼网络科技有限公司 | A kind of multiplexing method and device of code |
| CN109254774A (en) * | 2018-08-30 | 2019-01-22 | 郑州云海信息技术有限公司 | The management method and device of code in software development system |
| CN110083340A (en) * | 2019-03-19 | 2019-08-02 | 深圳壹账通智能科技有限公司 | Code generating method, device, computer equipment and storage medium |
Non-Patent Citations (1)
| Title |
|---|
| 百度经验: "Eclipse中代码自动提示功能设置", 《HTTPS://MR.MBD.BAIDU.COM/R/ONIL2R3CQA?F=CP&U=E9BB63C35963FE57》 * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111949522A (en) * | 2020-07-31 | 2020-11-17 | 中国工商银行股份有限公司 | User interface automatic testing method and device |
| CN111949522B (en) * | 2020-07-31 | 2024-05-03 | 中国工商银行股份有限公司 | Automatic testing method and device for user interface |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110688103B (en) | 2023-07-04 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107729083B (en) | Method for loading driver and embedded device | |
| US20120174061A1 (en) | Code suggestion in a software development tool | |
| EP3267308A1 (en) | Application loading method and device | |
| US7596783B2 (en) | Methods and apparatus to implement annotation based thunking | |
| CN105183760A (en) | Webpage component loading method and apparatus | |
| CN111858581A (en) | Page query method and device, storage medium and electronic equipment | |
| CN110989999A (en) | Code generation method and device, electronic equipment and medium | |
| CN114942863A (en) | Cascade snapshot processing method, device and equipment and storage medium | |
| CN114064652A (en) | Data processing method and device, computer equipment and storage medium | |
| JP2016181228A (en) | Source code calculation device and source code calculation method | |
| CN110688103B (en) | Code writing method, device, electronic equipment and computer readable storage medium | |
| US8769498B2 (en) | Warning of register and storage area assignment errors | |
| CN111460235A (en) | Atlas data processing method, device, equipment and storage medium | |
| CN114610516A (en) | Application program repairing method and device, computer equipment and storage medium | |
| CN117687704B (en) | Display card initialization method, device, equipment and storage medium | |
| US7996824B2 (en) | Benchmark synthesis using workload statistics | |
| GB2506614A (en) | Extracting core data for a summary dump file based upon most recent trace data entries | |
| CN109766480B (en) | Data query method and device | |
| CN118034777B (en) | FTTR-based log management and version control method, FTTR-based log management and version control device, FTTR-based log management and version control equipment and medium | |
| CN114237591A (en) | Code merging method and device | |
| CN111767070A (en) | API document management method and device, computer equipment and storage medium | |
| CN115248803B (en) | Collection method and device suitable for network disk file, network disk and storage medium | |
| CN112948395B (en) | Data processing method and device for database and computer readable medium | |
| CN113282551B (en) | Data processing method, system and equipment | |
| CN121070360A (en) | Vue component registration method and device, electronic equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Address after: 801-2, floor 8, building 3, No. 22, Ronghua Middle Road, Beijing Economic and Technological Development Zone, Daxing District, Beijing Applicant after: Wanghai Kangxin (Beijing) Technology Co.,Ltd. Address before: Room 07, Room 2, Building B, 12 Hongda North Road, Beijing Daxing District, Beijing Applicant before: BEIJING NEUSOFT VIEWHIGH TECHNOLOGY Co.,Ltd. |
|
| GR01 | Patent grant | ||
| GR01 | Patent grant |