CN113126975B - Method and device for realizing code segment plug-in - Google Patents

Method and device for realizing code segment plug-in Download PDF

Info

Publication number
CN113126975B
CN113126975B CN202110682919.3A CN202110682919A CN113126975B CN 113126975 B CN113126975 B CN 113126975B CN 202110682919 A CN202110682919 A CN 202110682919A CN 113126975 B CN113126975 B CN 113126975B
Authority
CN
China
Prior art keywords
code segment
plug
template
code
server
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
CN202110682919.3A
Other languages
Chinese (zh)
Other versions
CN113126975A (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.)
Accumulus Technologies Tianjin Co Ltd
Original Assignee
Accumulus Technologies Tianjin 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 Accumulus Technologies Tianjin Co Ltd filed Critical Accumulus Technologies Tianjin Co Ltd
Priority to CN202110682919.3A priority Critical patent/CN113126975B/en
Publication of CN113126975A publication Critical patent/CN113126975A/en
Application granted granted Critical
Publication of CN113126975B publication Critical patent/CN113126975B/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

Abstract

The invention provides a method and a device for realizing code fragment plug-in, wherein the method comprises the following steps: starting a local editor and automatically activating a plug-in; acquiring configuration information to be requested; the configuration information to be requested includes: the method comprises the steps of obtaining the identification of a code fragment template to be obtained and the address of a server; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations; sending a request for acquiring the code segment template to a server through a plug-in according to the configuration information to be requested; acquiring the code fragment template returned by the server based on the request through a plug-in; and saving the code segment template to the plug-in. According to the invention, the required code segment is acquired on the server, so that the content of the code segment and the plug-in are not required to be uploaded to an application store, and the required code segment can be acquired only by requesting the acquisition from the server when in use, thereby improving the safety and the flexibility.

Description

Method and device for realizing code segment plug-in
Technical Field
The invention relates to the technical field of development assistance, in particular to a method and a device for realizing a code fragment plug-in.
Background
At present, code fragments are quickly input by a code fragment tool snipet when codes are written, but the existing code fragment tool is fixed aiming at certain grammatical languages and can not be changed; each company has its own coding style and code specification, the code fragment plug-in generated according to the basic syntax cannot be used satisfactorily, and the user needs to configure the code fragment plug-in separately in the custom editor of the editor itself, and needs to rewrite the code fragment after replacing the computer, which is inconvenient.
Disclosure of Invention
The invention provides a method and a device for realizing a code fragment plug-in, which are used for solving the problems that some grammatical languages in the existing code fragment tool are fixed and cannot adapt to the internal coding style and code specification of a company, and if the code fragments in the company are released to an application store together, the codes are leaked and do not meet the requirement of information safety.
In order to solve the above problems, the present invention is realized by:
in a first aspect, the present invention provides a method for implementing a code segment plug-in, which is applied to a terminal and includes:
starting a local editor and automatically activating a plug-in;
acquiring configuration information to be requested; the configuration information to be requested includes: the method comprises the steps of obtaining the identification of a code fragment template to be obtained and the address of a server; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations;
sending a request for acquiring the code segment template to the server through the plug-in according to the configuration information to be requested;
acquiring the code fragment template returned by the server based on the request through the plug-in;
and saving the code segment template to the plug-in.
Optionally, after the code fragment template is saved in the plug-in, the method further includes:
updating a code segment list in the local editor according to the code segment template, and displaying the code segment list in the local editor, wherein the code segment list comprises a primary list and a corresponding secondary list, the primary list displays the code segment key words, and the secondary list corresponding to the primary list displays the corresponding code segments.
Optionally, the obtaining of the configuration information to be requested includes:
acquiring the identifier of the code segment template written in a setting interface of the local editor by a user;
and acquiring the address of the server pre-stored in the local editor or acquiring the address of the server written by a user in a setting interface of the local editor.
Optionally, after the code fragment template is saved in the plug-in, the method further includes:
when a target code segment keyword input by a user on an editing interface of the local editor is received, inquiring a target code segment corresponding to the target code segment keyword from the code segment template stored by the plug-in according to the target code segment keyword;
and inserting the target code segment into an editing interface of the local editor.
Optionally, the server is a local area network server.
In a second aspect, the present invention provides a method for implementing a code fragment plug-in, which is applied to a server, and includes:
receiving a request for acquiring a code segment template sent by a plug-in of a local editor of a terminal; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations;
and sending a corresponding code fragment template to the terminal based on the request.
Optionally, before receiving the request for obtaining the code segment template sent by the terminal, the method further includes:
acquiring a code segment rule constructed by a user, wherein the code segment rule comprises a code segment keyword and a corresponding code segment;
and acquiring a code segment template constructed by a user according to at least one code segment rule.
Optionally, the code fragment rule further includes at least one of: rule names and applicable languages.
Optionally, the code fragment template further includes at least one of: template name, applicable language, template number, and rule list.
Optionally, the server is a local area network server.
In a third aspect, the present invention provides an apparatus for implementing a code fragment plug-in, including:
the starting module is used for starting the local editor and automatically activating the plug-in;
the first acquisition module is used for acquiring the configuration information to be requested; the configuration information to be requested includes: the method comprises the steps of obtaining the identification of a code fragment template to be obtained and the address of a server; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations;
the first sending module is used for sending a request for acquiring the code segment template to the server through the plug-in according to the configuration information to be requested;
a second obtaining module, configured to obtain, by the plug-in, the code fragment template returned by the server based on the request;
and the storage module is used for storing the code segment template into the plug-in.
Optionally, the updating module is configured to update a code segment list in the local editor according to the code segment template, and display the code segment list in the local editor, where the code segment list includes a primary list and a corresponding secondary list, the primary list displays the key words of the code segment, and the corresponding secondary list displays the corresponding code segment.
Optionally, the first obtaining module includes:
the first obtaining sub-module is used for obtaining the identifier of the code segment template written in the setting interface of the local editor by a user;
and the second obtaining submodule is used for obtaining the address of the server pre-stored in the local editor or obtaining the address of the server written in a setting interface of the local editor by a user.
Optionally, the processing module is configured to, when a target code segment keyword input by a user on an editing interface of the local editor is received, query, according to the target code segment keyword, a target code segment corresponding to the target code segment keyword from the code segment template stored in the plug-in;
and inserting the target code segment into an editing interface of the local editor.
Optionally, the server is a local area network server.
In a fourth aspect, the present invention provides an apparatus for implementing a code fragment plug-in, including:
the receiving module is used for receiving a request for acquiring a code segment template sent by a plug-in of a local editor of the terminal; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations;
and the second sending module is used for sending the corresponding code fragment template to the terminal based on the request. Optionally, the framework module is configured to obtain a code segment rule constructed by a user, where the code segment rule includes a code segment keyword and a corresponding code segment; and acquiring a code segment template constructed by a user according to at least one code segment rule.
Optionally, the code fragment rule further includes at least one of: rule names and applicable languages.
Optionally, the code fragment template further includes at least one of: template name, applicable language, template number, and rule list.
Optionally, the server is a local area network server.
In a fifth aspect, the present invention provides a terminal comprising a processor, a memory and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method for implementing a code segment plug-in according to any one of the first aspect.
In a sixth aspect, the present invention provides a server, comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the implementation method of the code segment plugin according to any one of the second aspects.
In a seventh aspect, the present invention provides a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the implementation method of the code segment plug-in according to any one of the first aspect, or implement the steps of the implementation method of the code segment plug-in according to any one of the second aspect.
In the invention, the problem that the existing code fragment tools are fixed and can not be changed aiming at certain grammatical languages is solved by acquiring the required code fragments on the server; and the user needs to configure the code segments independently in the self-defined editor of the editor, and needs to rewrite after replacing the computer, which is inconvenient, and the code segments in the company can cause code leakage if being released to an application store, and do not meet the requirement of information safety.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a schematic flow chart of a method for implementing a code segment plug-in according to an embodiment of the present invention, applied to a terminal;
fig. 2 is a schematic flow chart illustrating a method for implementing a code fragment plug-in according to an embodiment of the present invention, applied to a server;
fig. 3 is a schematic overall architecture diagram of an implementation method of a code fragment plug-in according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal to which another apparatus for implementing a code segment plug-in provided in the embodiment of the present invention is applied;
fig. 5 is a schematic structural diagram of an implementation apparatus of a code fragment plug-in applied to a server according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a terminal according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention provides a method for implementing a code fragment plugin, which is applied to a terminal, and includes:
step 11: starting a local editor and automatically activating a plug-in;
step 12: acquiring configuration information to be requested; the configuration information to be requested includes: the method comprises the steps of obtaining the identification of a code fragment template to be obtained and the address of a server; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations;
step 13: sending a request for acquiring the code segment template to the server through the plug-in according to the configuration information to be requested;
step 14: acquiring the code fragment template returned by the server based on the request through the plug-in;
step 15: and saving the code segment template to the plug-in.
In the embodiment of the invention, the code segment plug-in is downloaded from an application store and is installed on the local editor for use, the plug-in is automatically activated when the local editor is started, and when the functions of the plug-in are updated, a user only needs to update in the application store; in step 12, obtaining the configuration information to be requested according to the operation of the user; the configuration information to be requested includes: the method comprises the steps that the identification of a code segment template to be obtained and the address of a server are obtained, wherein the identification of the code segment template is a name or a number defined by a user, the user inputs the identification of the code segment template to be obtained and the address of the server in a corresponding input box, and the address of the server can also be stored in the local editor as default input in advance; in step 13, the plug-in sends a request for obtaining a code fragment template to the server according to the address of the server in the configuration information to be requested; receiving the code segment template sent by the server, storing the code segment template in the plug-in, and ensuring that the code segment template can be used when offline; and the plug-in automatically reads the configuration information to be requested configured on the local editor after being activated and sends a request to the server to acquire and update the code segment template, and if the plug-in does not read the configuration information to be requested after being activated, the update is failed.
In the embodiment of the invention, the problem that the existing code fragment tools are fixed and can not be changed aiming at certain grammatical languages is solved by acquiring the required code fragments on the server; and the user needs to configure the code segments independently in the self-defined editor of the editor, and needs to rewrite after replacing the computer, which is inconvenient, and the code segments in the company can cause code leakage if being released to an application store, and do not meet the requirement of information safety.
In this embodiment of the present invention, optionally, after the code fragment template is stored in the plug-in, the method further includes:
updating a code segment list in the local editor according to the code segment template, and displaying the code segment list in the local editor, wherein the code segment list comprises a primary list and a corresponding secondary list, the primary list displays the code segment key words, and the secondary list corresponding to the primary list displays the corresponding code segments.
In the embodiment of the invention, the newly acquired code segment template is updated in the code segment list in the plug-in and is visually displayed in the local editor.
In this embodiment of the present invention, optionally, the obtaining of the configuration information to be requested includes:
acquiring the identifier of the code segment template written in a setting interface of the local editor by a user;
and acquiring the address of the server pre-stored in the local editor or acquiring the address of the server written by a user in a setting interface of the local editor.
In this embodiment of the present invention, optionally, after the code fragment template is stored in the plug-in, the method further includes:
when a target code segment keyword input by a user on an editing interface of the local editor is received, inquiring a target code segment corresponding to the target code segment keyword from the code segment template stored by the plug-in according to the target code segment keyword;
and inserting the target code segment into an editing interface of the local editor.
In the embodiment of the invention, when a user uses a local editor and edits a target code segment keyword input by an interface, a target code segment corresponding to the target code segment keyword is inquired from the code segment template stored by the plug-in; inserting the target code segment into an editing interface of the local editor, for example, after typing nfc (new function component), a user clicks enter to quickly generate a code segment of an initialized component; after typing uss (useSearch), a user clicks to enter a car to quickly obtain a code segment corresponding to the useSearch, manual input in a line and a line is not needed, or the same scene is searched for to be copied and pasted, the learning cost is low, the code segments are usually used, the corresponding keyword names are set by the user, and the familiarity cost is low; meanwhile, the code segments are obtained from the server, so that corresponding code segment data cannot be obtained even if a person in an external environment installs the plug-in, and the safety is ensured.
In the embodiment of the present invention, optionally, the server is a local area network server.
In the embodiment of the invention, the local area network server such as a company internal server ensures that the company internal code is not leaked outwards and ensures the security, the code segment can be stored in the company internal server without limitation, any equipment which can provide a network request and return required data can be used as the server, and can be a remote server or a local server, the data security is ensured by carrying out identity verification on the server, or the leakage of the code segment is not required to be considered when the local area network server is used for an open-source project.
In the embodiment of the invention, the problem that the existing code fragment tools are fixed and can not be changed aiming at certain grammatical languages is solved by acquiring the required code fragments on the server; and the user needs to configure the code segments independently in the self-defined editor of the editor, and needs to rewrite after replacing the computer, which is inconvenient, and the code segments in the company can cause code leakage if being released to an application store, and do not meet the requirement of information safety.
Referring to fig. 2, the present invention provides a method for implementing a code fragment plug-in, which is applied to a server and includes:
step 21: receiving a request for acquiring a code segment template sent by a plug-in of a local editor of a terminal; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations;
step 22: and sending a corresponding code fragment template to the terminal based on the request.
In the embodiment of the invention, the server receives a request for acquiring the code segment template sent by the terminal, and sends the corresponding code segment template to the terminal to provide data support for the plug-in.
In this embodiment of the present invention, optionally, before receiving the request for obtaining the code segment template sent by the terminal, the method further includes:
acquiring a code segment rule constructed by a user, wherein the code segment rule comprises a code segment keyword and a corresponding code segment;
and acquiring a code segment template constructed by a user according to at least one code segment rule. In the embodiment of the invention, a user can freely configure code segment rules on a server as required, wherein the code segment rules comprise code segment keywords, corresponding code segments, rule names and applicable languages, the user can input the code segment keywords, the corresponding code segments, the rule names and the applicable languages on a page of a newly-built rule by 'newly-building the rule' on the server, and the code segment keywords are the trigger rules of the code segment rules, namely, the user can quickly generate a code segment of an initialized component by clicking to enter after typing in an nfc (new function component) code segment keyword; the user forms the code segment template by associating a plurality of rules, for example, the user can input a template name, an applicable language, a template number and a rule list on a page of the newly built template by 'newly building the template' on the server, wherein the rule list comprises the code segment rules for the user to select, and the code segment template is uniformly managed, so that a data support effect is provided for the plug-in.
In this embodiment of the present invention, optionally, the code fragment rule further includes at least one of the following: rule names and applicable languages.
In this embodiment of the present invention, optionally, the code segment template further includes at least one of the following: template name, applicable language, template number, and rule list.
In the embodiment of the present invention, optionally, the server is a local area network server.
In the embodiment of the invention, the local area network server such as a company internal server ensures that the company internal code is not leaked outwards and ensures the security, the code segment can be stored in the company internal server without limitation, any equipment which can provide a network request and return required data can be used as the server, and can be a remote server or a local server, the data security is ensured by carrying out identity verification on the server, or the leakage of the code segment is not required to be considered when the local area network server is used for an open-source project.
In the embodiment of the invention, the trigger rule and the corresponding code fragment in the code fragment template are key attributes, the language is used for standardizing the development language suitable for the rule, and other attributes belong to interpretation descriptions; the code fragment template is suitable for the rule items of the language decision rule list, and the template number is the only identifier used by the developer in configuration in the editor; the user can make addition, deletion, modification and check on the rules and the templates.
Referring to fig. 3, in the embodiment of the present invention, a developer of a plug-in of the code segment sends the plug-in to an application store, so that a user may download and install the plug-in into a local editor, and at the same time, the developer maintains a corresponding code segment in a server, such as an internal company server, so that the internal company code is not leaked outside, and security is ensured, the code segment may be, but is not limited to be, stored in the internal company server, any device that can provide a network request and return required data may serve as the server, may be a remote server, may also be a local server, and data security is ensured by performing identity verification on the server, or when an open-source project is used, the code segment leakage is not considered; and the server receives a request for acquiring the code segment template sent by the terminal, sends the corresponding code segment template to the terminal and provides data support for the plug-in.
Referring to fig. 4, the present invention provides an apparatus for implementing a code fragment plug-in, including:
a starting module 41, configured to start a local editor and automatically activate a plug-in;
a first obtaining module 42, configured to obtain configuration information to be requested; the configuration information to be requested includes: the method comprises the steps of obtaining the identification of a code fragment template to be obtained and the address of a server; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations;
a first sending module 43, configured to send, according to the configuration information to be requested, a request for obtaining the code segment template to the server through the plug-in;
a second obtaining module 44, configured to obtain, through the plug-in, the code fragment template returned by the server based on the request;
and the storage module 45 is used for storing the code segment template into the plug-in.
In the embodiment of the present invention, optionally, the updating module is configured to update a code segment list in the local editor according to the code segment template, and display the code segment list in the local editor, where the code segment list includes a primary list and a corresponding secondary list, the primary list displays the key words of the code segment, and the secondary list corresponding to the primary list displays the corresponding code segment.
In this embodiment of the present invention, optionally, the first obtaining module includes:
the first obtaining sub-module is used for obtaining the identifier of the code segment template written in the setting interface of the local editor by a user;
and the second obtaining submodule is used for obtaining the address of the server pre-stored in the local editor or obtaining the address of the server written in a setting interface of the local editor by a user.
In the embodiment of the present invention, optionally, the processing module is configured to, when a target code segment keyword input by a user on an editing interface of the local editor is received, query, according to the target code segment keyword, a target code segment corresponding to the target code segment keyword from the code segment template stored in the plug-in;
and inserting the target code segment into an editing interface of the local editor.
In the embodiment of the present invention, optionally, the server is a local area network server.
The device for implementing the code segment plug-in provided by the embodiment of the present invention can implement each process implemented by the method for implementing the code segment plug-in the method embodiment of fig. 1, and is not described herein again to avoid repetition.
Referring to fig. 5, the present invention provides an apparatus for implementing a code fragment plug-in, including:
a receiving module 51, configured to receive a request for obtaining a code segment template sent by a plug-in of a local editor of a terminal; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations;
a second sending module 52, configured to send, to the terminal, a corresponding code segment template based on the request. In the embodiment of the present invention, optionally, the framework module is configured to obtain a code segment rule constructed by a user, where the code segment rule includes a code segment keyword and a corresponding code segment; and acquiring a code segment template constructed by a user according to at least one code segment rule.
In this embodiment of the present invention, optionally, the code fragment rule further includes at least one of the following: rule names and applicable languages.
In this embodiment of the present invention, optionally, the code segment template further includes at least one of the following: template name, applicable language, template number, and rule list.
In the embodiment of the present invention, optionally, the server is a local area network server.
The device for implementing the code segment plug-in provided by the embodiment of the present invention can implement each process implemented by the method for implementing the code segment plug-in the method embodiment of fig. 2, and is not described herein again to avoid repetition.
Referring to fig. 6, an embodiment of the present invention further provides a terminal 60, which includes a processor 61, a memory 62, and a computer program stored in the memory 62 and capable of running on the processor 61, where the computer program, when executed by the processor 61, implements each process of the implementation method embodiment of the code segment plugin, and can achieve the same technical effect, and is not described herein again to avoid repetition.
Referring to fig. 7, an embodiment of the present invention further provides a server 70, including a processor 71, a memory 72, and a computer program stored in the memory 72 and capable of running on the processor 71, where the computer program is executed by the processor 71 to implement each process of the implementation method embodiment of the code segment plugin, and can achieve the same technical effect, and no further description is provided herein to avoid repetition.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the implementation method embodiment of the code segment plugin, and can achieve the same technical effect, and in order to avoid repetition, the computer program is not described herein again. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a terminal) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (13)

1. A method for implementing code segment plug-in is applied to a terminal and comprises the following steps:
starting a local editor and automatically activating a plug-in;
acquiring configuration information to be requested; the configuration information to be requested includes: the method comprises the steps of obtaining the identification of a code fragment template to be obtained and the address of a server; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations;
sending a request for acquiring the code segment template to the server through the plug-in according to the configuration information to be requested; the server is a local area network server;
acquiring the code fragment template returned by the server based on the request through the plug-in;
saving the code fragment template to the plug-in;
when a target code segment keyword input by a user on an editing interface of the local editor is received, inquiring a target code segment corresponding to the target code segment keyword from the code segment template stored by the plug-in according to the target code segment keyword;
inserting the target code segment into an editing interface of the local editor;
and the plug-in automatically reads the configuration information to be requested configured on the local editor after being activated and sends a request to the server to acquire and update the code segment template, and if the plug-in does not read the configuration information to be requested after being activated, the update is failed.
2. The method for implementing code fragment plug-in of claim 1, after saving the code fragment template into the plug-in, further comprising:
updating a code segment list in the local editor according to the code segment template, and displaying the code segment list in the local editor, wherein the code segment list comprises a primary list and a corresponding secondary list, the primary list displays the code segment key words, and the secondary list corresponding to the primary list displays the corresponding code segments.
3. The method for implementing the code fragment plug-in of claim 1, wherein the obtaining of the configuration information to be requested comprises:
acquiring the identifier of the code segment template written in a setting interface of the local editor by a user;
and acquiring the address of the server pre-stored in the local editor or acquiring the address of the server written by a user in a setting interface of the local editor.
4. The implementation method of the code segment plug-in is applied to a server and comprises the following steps:
receiving a request for acquiring a code segment template sent by a plug-in of a local editor of a terminal; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations; wherein the terminal executes the implementation method of the code segment plug-in of any one of claims 1 to 3;
and sending a corresponding code fragment template to the terminal based on the request.
5. The method for implementing code segment plug-in of claim 4, wherein the receiving the request for obtaining the code segment template sent by the terminal further comprises:
acquiring a code segment rule constructed by a user, wherein the code segment rule comprises a code segment keyword and a corresponding code segment;
and acquiring a code segment template constructed by a user according to at least one code segment rule.
6. The method of claim 5,
the code fragment rules further include at least one of: rule names and applicable languages.
7. The method of claim 5,
the code fragment template further comprises at least one of: template name, applicable language, template number, and rule list.
8. The method of claim 4,
the server is a local area network server.
9. An apparatus for implementing a code fragment plug-in, comprising:
the starting module is used for starting the local editor and automatically activating the plug-in;
the first acquisition module is used for acquiring the configuration information to be requested; the configuration information to be requested includes: the method comprises the steps of obtaining the identification of a code fragment template to be obtained and the address of a server; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations;
the first sending module is used for sending a request for acquiring the code segment template to the server through the plug-in according to the configuration information to be requested; the server is a local area network server;
a second obtaining module, configured to obtain, by the plug-in, the code fragment template returned by the server based on the request;
the storage module is used for storing the code segment template into the plug-in;
the processing module is used for inquiring a target code segment corresponding to a target code segment keyword from the code segment template stored by the plug-in according to the target code segment keyword when the target code segment keyword input by a user on an editing interface of the local editor is received; inserting the target code segment into an editing interface of the local editor;
and the plug-in automatically reads the configuration information to be requested configured on the local editor after being activated and sends a request to the server to acquire and update the code segment template, and if the plug-in does not read the configuration information to be requested after being activated, the update is failed.
10. An apparatus for implementing a code fragment plug-in, comprising:
the receiving module is used for receiving a request for acquiring a code segment template sent by a plug-in of a local editor of the terminal; the code segment template comprises at least one pair of code segment keywords and corresponding code segment combinations; wherein the terminal executes the implementation method of the code segment plug-in of any one of claims 1 to 3;
and the second sending module is used for sending the corresponding code fragment template to the terminal based on the request.
11. A terminal, characterized in that it comprises a processor, a memory and a program or instructions stored on said memory and executable on said processor, said program or instructions, when executed by said processor, implementing the steps of the implementation method of the code segment plug-in according to any one of claims 1 to 3.
12. A server, comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method for implementing a code segment plug-in according to any one of claims 4 to 8.
13. A readable storage medium, on which a program or instructions are stored, which, when executed by a processor, implement the implementation method of the code fragment plug-in of any one of claims 1 to 3 or the steps of the implementation method of the code fragment plug-in of any one of claims 4 to 8.
CN202110682919.3A 2021-06-21 2021-06-21 Method and device for realizing code segment plug-in Active CN113126975B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110682919.3A CN113126975B (en) 2021-06-21 2021-06-21 Method and device for realizing code segment plug-in

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110682919.3A CN113126975B (en) 2021-06-21 2021-06-21 Method and device for realizing code segment plug-in

Publications (2)

Publication Number Publication Date
CN113126975A CN113126975A (en) 2021-07-16
CN113126975B true CN113126975B (en) 2021-09-17

Family

ID=76783197

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110682919.3A Active CN113126975B (en) 2021-06-21 2021-06-21 Method and device for realizing code segment plug-in

Country Status (1)

Country Link
CN (1) CN113126975B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399074A (en) * 2018-01-30 2018-08-14 努比亚技术有限公司 A kind of update method of application program, terminal and computer readable storage medium
CN110083340A (en) * 2019-03-19 2019-08-02 深圳壹账通智能科技有限公司 Code generating method, device, computer equipment and storage medium
CN110968503A (en) * 2019-11-06 2020-04-07 支付宝(杭州)信息技术有限公司 Code scanning system and method and plug-in

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105530309B (en) * 2015-12-22 2019-07-09 Tcl集团股份有限公司 A kind of Internet of Things control platform and its implementation
CN105718287B (en) * 2016-01-20 2018-11-13 中南大学 A kind of program streaming execution method of intelligent terminal
CN106933598A (en) * 2017-03-27 2017-07-07 广州市轩辕云翰信息科技有限公司 Realize the method and system of the automatic management of template file
CN112579098B (en) * 2020-12-25 2024-02-06 平安银行股份有限公司 Software release method and device, electronic equipment and readable storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399074A (en) * 2018-01-30 2018-08-14 努比亚技术有限公司 A kind of update method of application program, terminal and computer readable storage medium
CN110083340A (en) * 2019-03-19 2019-08-02 深圳壹账通智能科技有限公司 Code generating method, device, computer equipment and storage medium
CN110968503A (en) * 2019-11-06 2020-04-07 支付宝(杭州)信息技术有限公司 Code scanning system and method and plug-in

Also Published As

Publication number Publication date
CN113126975A (en) 2021-07-16

Similar Documents

Publication Publication Date Title
CN106406844B (en) Method and device for realizing public number menu of communication interaction platform
CN107645546B (en) File monitoring method based on android system, intelligent device and storage medium
CN111198709A (en) RPM software package management method, system, device and readable storage medium
CN104850971B (en) Correlation method and device of order information and logistics information
CN110990008B (en) Page updating method and device, storage medium and electronic equipment
CN111881473A (en) Privacy file protection method and device, computer equipment and readable storage medium
CN111831920A (en) User demand analysis method and device, computer equipment and storage medium
CN110413292B (en) Light application installation method of application program, mobile terminal and storage medium
CN111857810A (en) Front-end development file creating method and device and electronic equipment
CN111124540A (en) Dynamic configuration method and service request forwarding method of service control system
CN113126975B (en) Method and device for realizing code segment plug-in
CN111949298A (en) Generation method and device of upgrade package, server and computer storage medium
CN110866007B (en) Information management method, system and computer equipment for big data application and table
CN108196921B (en) Document development method and device, computer equipment and storage medium
CN115291887A (en) Code generation method, device, equipment and storage medium
US9936015B2 (en) Method for building up a content management system
CN109522014B (en) Algorithm processing method based on new product development, electronic device and readable storage medium
CN114281688A (en) Codeless or low-code automatic case management method and device
CN112783578A (en) Method, device and equipment for starting task flow and storage medium
CN108595924B (en) Business authority management method and device, computer equipment and storage medium
CN109635175B (en) Page data splicing method and device, readable storage medium and electronic equipment
CN113821249A (en) Project development configuration method and device, electronic equipment and readable storage medium
CN112632946A (en) Method, apparatus, computer device and storage medium for automatic table building
CN112000354A (en) Version information updating method, version information updating device, version information updating equipment and storage medium
CN112988781A (en) Data query method and device, electronic equipment and computer readable 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
GR01 Patent grant
GR01 Patent grant