CN110688103B - Code writing method, device, electronic equipment and computer readable storage medium - Google Patents

Code writing method, device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN110688103B
CN110688103B CN201910959952.9A CN201910959952A CN110688103B CN 110688103 B CN110688103 B CN 110688103B CN 201910959952 A CN201910959952 A CN 201910959952A CN 110688103 B CN110688103 B CN 110688103B
Authority
CN
China
Prior art keywords
code information
information
code
target
user
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.)
Active
Application number
CN201910959952.9A
Other languages
Chinese (zh)
Other versions
CN110688103A (en
Inventor
梁国华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wanghai Kangxin Beijing Technology Co ltd
Original Assignee
Wanghai Kangxin Beijing Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wanghai Kangxin Beijing Technology Co ltd filed Critical Wanghai Kangxin Beijing Technology Co ltd
Priority to CN201910959952.9A priority Critical patent/CN110688103B/en
Publication of CN110688103A publication Critical patent/CN110688103A/en
Application granted granted Critical
Publication of CN110688103B publication Critical patent/CN110688103B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent 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, a code writing device, electronic equipment and a computer readable storage medium. The method comprises the following steps: 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, determining target first code information when detecting selection operation of the user on the searched first code information, and 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. 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 copying and pasting the previously written codes of the programmer 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

Code writing method, device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of software development technologies, and in particular, to a code writing method, a code writing device, an electronic device, and a computer readable storage medium.
Background
Along with the continuous development of the internet, informatization has been integrated into aspects of our lives, more and more people participate in the information technology industry and in programming work, and programmers realize certain functions by writing codes on corresponding development tools.
In the prior art, a programmer manually writes codes to realize specific functions, or the programmer searches whether codes which are written before the programmer exist for realizing the same functions, and if so, the codes can be copied and pasted to corresponding positions.
However, in the above scheme, a lot of time is required for a programmer to write the code manually, and a lot of labor cost is required; moreover, because the possibility that the programmer writes the codes for realizing the same function is low, the possibility that the programmer writes the codes before copying and pasting the codes is also low, and even if the programmer writes the codes for realizing the same function before, the programmer is required to search specific code positions, then copy and paste the codes, which is time-consuming, has high complexity and further causes poor user experience.
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, there is provided a method of code writing, the method 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 detecting the selection operation of a user for the searched first code information, determining target first code information;
and inserting the target first code information or the second code information containing the target first code information into the 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 detecting the selection operation of a user on the searched first code information;
and 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 the corresponding position so as to realize code writing.
In a third aspect, an electronic device is provided, the 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 applications configured to: operations corresponding to the code writing method according to the first aspect are performed.
In a fourth aspect, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the code writing method of the first aspect.
The beneficial effects that this application provided technical scheme brought are:
compared with the prior art, the method and the device for coding the codes, the electronic equipment and the computer readable storage medium have the advantages that 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 coding is realized, and on one hand, the time and the labor cost consumed by coding the manual code are reduced; on the other hand, the possibility limit of copying and pasting the previously written codes of the programmer 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 that are required to be used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flow chart of a code writing method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a code writing device 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 application;
FIG. 4 is a display interface diagram of a code writing method according to an embodiment of the present application;
FIG. 5 is a diagram of a display interface of another method for writing code according to an embodiment of the present application;
fig. 6 is a schematic diagram of an interaction structure between Eclipse and a "code hint assistant" according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for the purpose of illustrating 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 expressly stated otherwise, as understood by those skilled in the art. 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. The term "and/or" as used herein includes all or any element and all combination of one or more of the associated listed items.
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the 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 the technical solutions of the present application solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
The embodiment of the application provides a code writing method, as shown in fig. 1, comprising the following steps:
step S101, information input by a user is acquired.
For the embodiment of the application, information input by a user on a preset input interface is obtained.
Step S102, based on the acquired information input by the user, searching first code information matched with the information input by the user.
For the embodiment of the present application, the first code information may be field information, class name information, or method name information, such as "systemException" or "Filer", which is not limited in the embodiment of the present application.
Step S103, when detecting the selection operation of the user for the searched first code information, determining the target first code information.
Step S104, inserting the target first code information or the second code information containing the target first code information into the corresponding position to realize code writing.
For the embodiment of the application, the second code information is a functional code block containing the first code information and realizing a preset function.
Compared with the prior art, the method for coding the code has the advantages that 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 coding is realized, and on one hand, the time and labor cost consumed by coding the manual code are reduced; on the other hand, the possibility limit of copying and pasting the previously written codes of the programmer 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 second code information contains one 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 piece, and the second code information comprising any piece of first code information is searched for aiming at any piece of first code information.
For example, the information input by the user is "FileR", the second code information including the first code information "FileReader" is searched for, the second code information including the first code information "FileReadEvent" is searched for, and the second code information including the first code information "FileResolverlmpl" is searched for based on the searched first code information matching the information input by the user being "FileReader", "FileReadEvent", and "fileresolverlpl", respectively.
Further, when the selection operation of the user on the searched first code information is detected, the target first code information is determined, for example, the target first code information is "FileReader".
In another possible implementation manner of the embodiment of the present application, step S103 may further include: second code information including 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 for 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 A1: "FileR", based on the found first code information matching the information input by the user, is A3, specifically, A3 includes: when the "FileReader", "Filer", "FileReadEvent", "FileResolverlmpl" and "Filer exception" are detected and the selection operation of the user with respect to the searched first code information is determined, the second code information containing the target first code information "FileReader" is searched for, and as shown in fig. 5, the second code information containing 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 matching with the information input by the user are found, the step S102 may further include: determining the sorting information corresponding to each first code information according to the hit times; and displaying each piece of first code information according to the searched sorting information corresponding to each piece of first code information.
Wherein the hit number is the number of times that the user selects each first code information for the selection operation.
For the embodiment of the application, the sorting information corresponding to each piece of searched first code information is determined according to the number of hits and/or the preset sorting rule, each piece of first code information is displayed according to the sorting information corresponding to each piece of searched first code information, the first code information commonly used by a developer can be preferentially displayed, the selection of the developer 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 alphabetical, which is not limited in the embodiment of the present application.
For example, the first code information is "FileReader", "FileReadEvent" and "fileresolverimpl", where the hit number of "FileReader" is 2, the hit numbers of "FileReadEvent" and "fileresolverimpl" are 5, if the ordering is according to the rule of 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, and the ordering information of "fileresolverimpl" is the first bit, that is, the ordering of the 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, if the target first code information is "FileReader", if there is second code information including "FileReader", the second code information including "FileReader" is inserted into the corresponding position; if the second code information containing the FileReader does not exist, the FileReader is inserted 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 the second code information containing the target first code information into the corresponding position in a preset mode so as to realize code writing.
The preset mode comprises at least one of the following steps: inserting the content except the information input by the user in the target first code information or the content except the information input by the user in the second code information containing the target first code information into the information input by the user; and replacing the information input by the user with the target first code information or the second code information containing the target first code information.
For example, if the information input by the user is "FileR", if the target first code information is "FileR", the content other than "FileR", that is, "reader", in the target first code information or the content other than "FileR" in the second code information including the target first code information "FileR" is inserted after "FileR".
For another example, if the information input by the user is "FileR", if the target first code information is "FileReader", the "FileR" is replaced with the target first code information, i.e., "FileReader", or the second code information including the target first code information "FileReader".
In another possible implementation manner of the embodiment of the present application, step S103 may further include: the hit number of the target first code information is updated.
For the embodiment of the present application, the hit number updating method of the target first code information is as follows: 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: and 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 respectively, and creating a corresponding relation 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 the embodiment of the present application. Further, the user may export the plurality of second code information stored in the first storage area, the first code information corresponding to each second code information stored in the second storage area, and the correspondence between each first code information and each 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 correspondence between each first code information and each second code information may be an index relationship, so that the second code information including the first code information may be searched by using a preset search engine based on the index relationship, or the second code information including the target first code information may be searched, or may also be a mapping relationship, which is not limited in the embodiment of the present application.
For the embodiment of the present application, the plurality of second code information input by the user and the first code information corresponding to each second code information are stored, and the correspondence between each first code information and each second code information is created, which may be executed before the code writing method, before the second code information including the first code information is searched, or before the second code information including the target first code information is searched.
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 first code information, and at least one first code information meeting the preset condition exists in the at least one first code information, the first code information meeting the preset condition exists in the second code information, the step S102 may specifically further include: and determining the function information corresponding to each piece of second code information, and 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 on the function information is detected.
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 application, the first code information meeting the preset condition is at least one first code information, and the at least one first code information is at least one second code information corresponding to the at least one first code information. For example, the first code information "system" has its corresponding second code information "system { a=1; "system" is the first code information satisfying the predetermined condition.
For example, as shown in fig. 4, the information input by the user is A1: the first code information matched with the first code information A1 is "FileR", wherein the first code information A3 comprises five first code information, wherein the three first code information respectively comprises corresponding second code information, then the functional information A2 respectively corresponding to the three second code information is determined, specifically, the functional information A2 comprises "read file", "write file" and "read write file", when the selection operation of a user for the "read file" is detected, the second code information corresponding to the "read file" selected by the selection operation is inserted into the corresponding position, as shown in fig. 5, and 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: 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 foregoing embodiments may be executed by a terminal device, or may be executed by a server, or may be executed partly by the terminal device and partly by the server. The embodiments of the present application are not limited thereto.
The code writing method is specifically described from the aspect of method steps, and is described below in connection with 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: a code editor, a code prompt box and a code block information base; the embodiment of the application also provides a plug-in tool 'code prompt assistant' capable of running in Eclipse, wherein the 'code prompt assistant' comprises the following units: code input monitoring, code analyzers, code search engines, local engineering, code block caching, code information interaction, code block management interfaces, 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 monitoring is used for monitoring the information input by the user and acquired by the code editor and calling the code analyzer; the code analyzer may be used to call the code search engine to search the first code information matching the information input by the user from the local engineering, search the second code information containing the first code information from the code block cache, and send the first code information and the second code information containing the first code information to the code prompt box, so that the user selects the target first code information from the first code information, and call the code search engine to search the first code information matching the information input by the user from the local engineering and send the first code information to the code prompt box, so that the user selects the target first code information from the first code information, and call the code search engine to search the second code information containing the target first code information from the code block cache and send 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 the corresponding position so as to realize code writing.
For the embodiment of the application, the code block management interface may receive first code information and corresponding second code information input by a user; the code block synchronization can acquire first code information and corresponding second code information from other devices; the code information interaction can establish a corresponding relation between the first code information and the second code information and store the corresponding relation in a code block information base or a code block cache. In the embodiment of the application, the code analyzer can also acquire the second code information containing the first code information or the second code information containing the target first code information from the code block information base through code information interaction.
The foregoing describes the embodiments of the method of the present application in detail, and describes the code writing apparatus from the perspective of a virtual module or a virtual unit, as follows:
the embodiment of the application provides a code writing apparatus, 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 detecting a selection operation of the user for the found first code information.
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 search module, where,
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 search module, where,
and the third searching module is used for searching the 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 first code information matching the information input by the user is found, the code writing apparatus 20 may further include a second determining module and a display module, where,
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 searched sorting information corresponding to each piece of first code information.
Wherein the hit number is the number of times that the user selects each first code information for the selection operation.
In another possible implementation manner of the embodiment of the present application, the first inserting module 204 includes any one of a first inserting unit and a second inserting unit, wherein,
and the first inserting unit is used for inserting the second code information containing the target first code information to the 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 to 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 inserting module 204 further includes a third inserting unit, where,
the third inserting unit is used for inserting the target first code information or the second code information containing the target first code information to the corresponding position in a preset mode so as to realize code writing;
the preset mode comprises at least one of the following steps:
after inserting the content except the information input by the user in the target first code information or the content except the information input by the user in the second code information containing the target first code information.
And replacing the information input by the user with the target first code information or the second code information containing the target first code information.
In another possible implementation manner of the embodiment of the present application, the code writing apparatus 20 further includes an updating module, where,
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 creating module, wherein,
the storage creation module is used for 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 respectively, and creating a 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 first code information satisfying the preset condition, the first code information satisfying the preset condition includes second code information, the code writing apparatus 20 further includes a third determining module and a second inserting module, where,
and the third determining module is used for determining the 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 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 on 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, or any two may be the same search module, or may be three different search modules; the first determining module 203, the second determining module and the third determining module may be the same determining module, or any two of the determining modules may be the same determining module, or may be three different determining modules; the first insert module 204 and the second insert module may be the same insert module or two different insert modules; the first insertion unit, the second insertion unit, and the third insertion unit may be the same insertion unit, or any two may be the same insertion unit, or may be three different insertion units, which is not limited in this embodiment of the present application.
The code writing apparatus 20 in the embodiment of the present application may perform operations corresponding to the code insertion method in the embodiment of the present application, and implementation principles are similar, and are not described herein again.
Compared with the prior art, the code writing device provided by the embodiment of the application searches first code information matched with information input by a user based on the acquired information input by the user, determines target first code information when detecting the selection operation of the user on the searched first code information, and inserts 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, so that time and labor cost consumed by manual code writing are reduced on one hand; on the other hand, the possibility limit of copying and pasting the previously written codes of the programmer 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 apparatus of the present application is described above in terms of a virtual module or a virtual unit, and the electronic device of the present application is described below in terms of a physical apparatus.
The embodiment of the 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. Wherein the processor 4001 is coupled to the memory 4003, such as via a bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004. It should be noted that, in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The processor 4001 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. The processor 4001 may also be a combination that implements computing functionality, e.g., comprising one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
Bus 4002 may include a path to transfer information between the aforementioned components. Bus 4002 may be a PCI bus or an EISA bus, or the like. The bus 4002 can be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 3, but not only one bus or one type of bus.
The memory 4003 may be, but is not limited to, ROM or other type of static storage device that can store static information and instructions, RAM or other type of dynamic storage device that can store information and instructions, EEPROM, CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 4003 is used for storing application program codes for executing the present application, and execution is controlled by the processor 4001. The processor 4001 is configured to execute application program codes stored in the memory 4003 to realize what is shown in any of the foregoing method embodiments.
The embodiment of the application provides electronic equipment, which comprises: a memory and a processor; at least one program stored in the memory for execution by the processor, which when executed by the processor, performs: 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 writing is realized, and time and labor cost consumed by manual code writing are reduced on one hand; on the other hand, the possibility limit of copying and pasting the previously written codes of the programmer 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 apparatus of the present application is described above from the point of view of the physical device, and the computer-readable storage medium of the present application is described below from the point of view of the storage medium.
The present application provides a computer readable storage medium having a computer program stored thereon, which when run on a computer, causes the computer to perform the corresponding method embodiments described above. Compared with the prior art, the method and the device have the advantages that through acquiring information input by a user, based on the acquired information input by the user, first code information matched with the information input by the user is searched, 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, so that code writing is realized, and time and labor cost consumed by manual code writing are reduced on one hand; on the other hand, the possibility limit of copying and pasting the previously written codes of the programmer 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, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for a person skilled in the art, several improvements and modifications can be made without departing from the principle of the present application, and these improvements and modifications should also be considered 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 detecting the selection operation of a user for the searched first code information, determining target first code information; inserting the target first code information or second code information containing the target first code information into a corresponding position to realize code writing;
the inserting the target first code information or the second code information containing the target first code information into the corresponding position includes:
if the second code information which corresponds to the target first code information and contains the target first code information is determined to exist, displaying at least one piece of function information in the second code information, wherein at least a part of functions realized by different piece of function information are different;
in response to detecting a selection operation for the function information, a second code corresponding to the function information selected by the selection operation is inserted to a corresponding position.
2. The method of claim 1, wherein said determining the target first code information further comprises, before:
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 the determining the target first code information further comprises, thereafter:
and searching second code information containing the target first code information.
4. The method of any of claims 1-3, wherein if at least two first code information matching the user-entered information is found,
the searching for the first code information matched with the information input by the user further comprises the following steps:
determining the sorting information corresponding to each first code information according to the hit times;
displaying each piece of first code information according to the corresponding sorting information of each piece of searched first code information;
wherein the hit number is the number of times each first code information is selected for a user's selection operation.
5. The method according to claim 1, wherein the step of inserting the target first code information or the second code information containing the target first code information into a corresponding location to achieve code writing includes:
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 writing;
the preset mode comprises at least one of the following steps:
inserting the content except the information input by the user in the target first code information or the content except the information input by the user in the second code information containing the target first code information after the information input by the user;
and 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 of claim 4, wherein when detecting the selection operation of the user for the first code information, determining the target first code information further comprises:
and updating the hit times of the target first code information.
7. The method of claim 1 wherein if the found first code information that matches the information entered by the user includes at least one and there is at least one first code information that satisfies a predetermined condition in the at least one first code information, determining that the first code information that satisfies the predetermined condition has second code information.
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 detecting the selection operation of a user on the searched first code information;
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;
the first inserting module is configured to display at least one piece of function information in the second code information if it is determined that there is second code information corresponding to the target first code information and including the target first code information, where at least a portion of functions implemented by different pieces of function information are different; in response to detecting a selection operation for the function information, a second code corresponding to the function information selected by the selection operation is inserted to a corresponding position.
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 applications configured to: a code writing method according to any one of claims 1 to 7 is performed.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the program, when executed by a processor, implements the code writing method of any of claims 1 to 7.
CN201910959952.9A 2019-10-10 2019-10-10 Code writing method, device, electronic equipment and computer readable storage medium Active CN110688103B (en)

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 CN110688103A (en) 2020-01-14
CN110688103B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111949522B (en) * 2020-07-31 2024-05-03 中国工商银行股份有限公司 Automatic testing method and device for user interface

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9361068B2 (en) * 2014-05-21 2016-06-07 International Business Machines Corporation System and method for using development objectives to guide implementation of source code

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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)

* Cited by examiner, † Cited by third party
Title
Eclipse中代码自动提示功能设置;百度经验;《https://mr.mbd.baidu.com/r/ONil2R3CqA?f=cp&u=e9bb63c35963fe57》;20161206;第1-9页 *

Also Published As

Publication number Publication date
CN110688103A (en) 2020-01-14

Similar Documents

Publication Publication Date Title
CN109976761B (en) Software development kit generation method and device and terminal equipment
CN107729083B (en) Method for loading driver and embedded device
CN105183760B (en) Webpage component loading method and device
US20070234286A1 (en) Methods and apparatus to implement annotation based thunking
CN108763341B (en) Electronic device, automatic table building method and storage medium
CN114090671A (en) Data import method and device, electronic equipment and storage medium
CN107463485B (en) Method stack-based log acquisition method and device and terminal
CN110688103B (en) Code writing method, device, electronic equipment and computer readable storage medium
CN114942863A (en) Cascade snapshot processing method, device and equipment and storage medium
CN111858581B (en) Paging query method and device, storage medium and electronic equipment
CN111460235A (en) Atlas data processing method, device, equipment and storage medium
CN110989999A (en) Code generation method and device, electronic equipment and medium
CN110209453A (en) It is multipair as refreshing automatically and display methods and Related product based on driver
CN110516333A (en) Device layout methods, device, equipment and readable storage medium storing program for executing in a kind of PCB
CN114610516A (en) Application program repairing method and device, computer equipment and storage medium
CN110955696B (en) Data reading method, device, equipment and storage medium
CN108920749B (en) Pipeline two-dimensional and three-dimensional data updating method and device and computer readable storage medium
CN108984615B (en) Data query method and system and storage medium
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
CN117687704B (en) Display card initialization method, device, equipment and storage medium
CN116679852B (en) Project icon quotation method and device, electronic equipment and medium
CN112948395B (en) Data processing method and device for database and computer readable medium
CN112966065B (en) Navigation map data management method, device and storage medium
CN113761635B (en) Method for determining processing shape of steel bar and method for processing steel bar
JP5046081B2 (en) Process simulator

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