├── .gitignore
├── .vscode
└── launch.json
├── .vscodeignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── images
├── icon-dark.png
├── icon-light.png
└── pack-icon.png
├── language-configuration.json
├── package-lock.json
├── package.json
├── snippets
├── chemdah
│ ├── Chemdah-a.code-snippets
│ └── Chemdah-m.code-snippets
├── ketherscript
│ └── ketherscript.code-snippets
├── questengine
│ └── questengine-m.code-snippets
└── taboolib
│ └── TabooLib-a.code-snippets
├── src
├── extension.js
└── extension.ts
├── syntaxes
└── kether.tmLanguage.json
├── tsc
└── tsconfig.json
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | *.vsix
3 | def.*
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | // A launch configuration that launches the extension inside a new window
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | {
6 | "version": "0.2.0",
7 | "configurations": [
8 | {
9 | "name": "Extension",
10 | "type": "extensionHost",
11 | "request": "launch",
12 | "args": [
13 | "--extensionDevelopmentPath=${workspaceFolder}"
14 | ]
15 | }
16 | ]
17 | }
--------------------------------------------------------------------------------
/.vscodeignore:
--------------------------------------------------------------------------------
1 | .vscode/**
2 | .vscode-test/**
3 | .gitignore
4 | vsc-extension-quickstart.md
5 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # 更新日志
2 | ### v1.0.0
3 | - [+] 所有由 TabooLib 提供的公有动作 + 原生动作的代码补全
4 | - [+] 更新代码介绍
5 | ### V1.0.1
6 | - [+] 更新questengine提供的私人动作
7 | - [M] 添加player更多关键词优化体验
8 | - [M] location 修改补充
9 | - [M] 规范描述
10 | ### V1.0.2
11 | - [+] 简单支持.ks(Kether Script)文件
12 | ### V1.0.3
13 |
14 | - [M] 支持.ks(Kether Script)文件
15 | - [+] 支持.ady文件支持
16 | - [M] 修正 TabooLib公有动作 关于IF,ELSE的格式
17 | - [+] 新增 Chemdah 公私有动作
18 | - [M] 修正 TabooLib公有动作 关于CHECK的语法错误
19 |
20 | ### V1.0.4
21 |
22 | - [M] 修复package配置
23 |
24 | ### V1.0.5 预览版
25 |
26 | - [M] 更新package配置
27 | - [+] 添加KS文件图标[ Light/Dark ]
28 | - [+] 更新了插件图标
29 | - [M] 修复Taboolib中公有动作Literal的错误
30 | - [+] 添加KetherScript的创建函数的补全
31 | - [+] **[ 测试 ]** 添加新功能打开文件 【光标选中文件名(例如 *litecat.ks* ) 按下 `Ctrl` + `F12` 即可跳转工作区下为*litecat.ks*的文件】__[ 支持在YAML/KetherScript 中使用 ]__
32 | - [+] **[ 测试 ]** 添加新功能对KETHERSCRIPT的格式化程序
33 | - [M] 重构Kether的代码高亮
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 |
635 | Copyright (C)
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | Copyright (C)
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ### ⚠ 注意:使用前请安装YAML扩展!否则无法提示
2 | >名称: YAML | ID: redhat.vscode-yam | 发布者: Red Hat | VS Marketplace 链接: https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml
3 |
4 | ## 下载
5 | [VSCode商店下载](https://marketplace.visualstudio.com/items?itemName=LiteCat.kether-snippet)
6 |
7 | ### 官方文档:https://kether.tabooproject.org/list.html
8 | 
9 | ---
10 | ## 📃特点
11 | ---
12 | ### 你只需要记住标题
13 | 
14 | ### 输入文字自动补全!
15 | 
16 | > 插件已经实现了所有由 TabooLib 提供的公有动作以及原生动作、Chemdah、QuestEngine的补全以及提示 (类似WIKI)
17 |
18 | ### **[ 测试 ]** 打开文件 【光标选中文件名(例如 *litecat.ks* ) 按下 `Ctrl` + `F12` 即可跳转工作区下为*litecat.ks*的文件】__[ 支持在YAML/KetherScript 中使用 ]__
19 | ### **[ 测试 ]** 对KETHERSCRIPT的格式化程序
20 | ---
21 | ## ✏想法与意见
22 |
23 | 如果你想帮助我们更好的修改本插件你可以通过以下两种途径联系我:
24 |
25 | 1. QQ:961274111
26 |
27 | 1. 邮件: littttt87@hotmail.com
28 |
29 | 1. GITHUB ISSUES: https://github.com/LiteCat0905/Kether-snippet/issues
30 | ---
31 |
32 | ### 1.0.5 预览版 (2023/12/10)
33 |
34 | - 添加KS文件图标[ Light/Dark ]
35 | - 更新了插件图标
36 | - 修复Taboolib中公有动作Literal的错误
37 | - 添加KetherScript的创建函数的补全
38 | - **[ 测试 ]** 添加新功能打开文件 【光标选中文件名(例如 *litecat.ks* ) 按下 `Ctrl` + `F12` 即可跳转工作区下为*litecat.ks*的文件】__[ 支持在YAML/KetherScript 中使用 ]__
39 | - **[ 测试 ]** 添加新功能对KETHERSCRIPT的格式化程序
40 | - 重构Kether的代码高亮
41 |
42 | ### 1.0.4 (2023/1/20 23:23)
43 |
44 | - 紧急修复一处BUG (1.0.3版本报废!)
45 |
46 | ### 1.0.0 (2023/1/17 1:48)
47 |
48 | - 编写所有由 TabooLib 提供的公有动作以及原生动作的补全
49 |
50 | ### 1.0.1 (2023/1/17 14:36)
51 |
52 | - 优化 player 补充体验
53 | - location 输入优化
54 | - 规范描述信息:(XX私人动作)····描述
55 | - 更新questengine提供的私人动作
56 |
57 | ### 1.0.2 (2023/1/17 19:58)
58 |
59 | - 简单支持.ks(Kether Script)文件
60 | > 还没具体写语法相关的东西,只能识别这类文件罢了( 还在学着写
61 |
62 | ### 1.0.3 (2023/1/20 1:47)
63 |
64 | - ※该版本报废
65 | - 支持.ks(Kether Script)文件
66 | > 照着Ruby简单写了些语法高亮(还是不会写)支持高亮大部分Kether语法
67 | - 支持.ady文件支持 同上
68 | - 修正 TabooLib公有动作 关于IF,ELSE的格式
69 | - 新增 Chemdah 公私有动作
70 | - 修复 TabooLib公有动作 关于CHECK 的语法错误
71 |
72 |
73 | ```
74 | Copyright (C) 2023 LiteCat
75 |
76 | This program is free software: you can redistribute it and/or modify
77 | it under the terms of the GNU General Public License as published by
78 | the Free Software Foundation, either version 3 of the License, or
79 | (at your option) any later version.
80 |
81 | This program is distributed in the hope that it will be useful,
82 | but WITHOUT ANY WARRANTY; without even the implied warranty of
83 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
84 | GNU General Public License for more details.
85 |
86 | You should have received a copy of the GNU General Public License
87 | along with this program. If not, see .
88 | ```
89 |
--------------------------------------------------------------------------------
/images/icon-dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteCat0905/Kether-snippet/e7b6aa6c1dd0a05bd505c97ea39b92efa83ce3df/images/icon-dark.png
--------------------------------------------------------------------------------
/images/icon-light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteCat0905/Kether-snippet/e7b6aa6c1dd0a05bd505c97ea39b92efa83ce3df/images/icon-light.png
--------------------------------------------------------------------------------
/images/pack-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteCat0905/Kether-snippet/e7b6aa6c1dd0a05bd505c97ea39b92efa83ce3df/images/pack-icon.png
--------------------------------------------------------------------------------
/language-configuration.json:
--------------------------------------------------------------------------------
1 | {
2 | "comments": {
3 | // 用于单行注释的符号。如果您的语言不支持行注释,请删除此条目
4 | "lineComment": "#",
5 | // 用于开始和结束块注释的符号。如果您的语言不支持块注释,请删除此条目
6 | // "blockComment": [ "/*", "*/" ]
7 | },
8 | // 用作括号的符号
9 | "brackets": [
10 | ["{ ", " }"],
11 | ["[", "]"],
12 | ["(", ")"]
13 | ],
14 | // 键入时自动关闭的符号
15 | "autoClosingPairs": [
16 | ["{ ", " }"],
17 | ["[", "]"],
18 | ["(", ")"],
19 | ["\"", "\""],
20 | ["'", "'"],
21 | { "open": "'", "close": "'", "notIn": ["string", "comment"] },
22 | { "open": "\"", "close": "\"", "notIn": ["string"] }
23 | ],
24 | // 可用于环绕选定内容的符号
25 | "surroundingPairs": [
26 | ["{", "}"],
27 | ["[", "]"],
28 | ["(", ")"],
29 | ["\"", "\""],
30 | ["'", "'"]
31 | ]
32 | }
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "kether-snippet",
3 | "version": "1.0.6",
4 | "lockfileVersion": 3,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "kether-snippet",
9 | "version": "1.0.6",
10 | "hasInstallScript": true,
11 | "dependencies": {
12 | "fs": "^0.0.1-security",
13 | "path": "^0.12.7",
14 | "vscode": "^1.1.37"
15 | },
16 | "devDependencies": {
17 | "@types/node": "^16.11.7",
18 | "typescript": "^4.5.2"
19 | },
20 | "engines": {
21 | "vscode": "^1.70.0"
22 | }
23 | },
24 | "node_modules/@tootallnate/once": {
25 | "version": "1.1.2",
26 | "resolved": "https://registry.npmmirror.com/@tootallnate/once/-/once-1.1.2.tgz",
27 | "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==",
28 | "engines": {
29 | "node": ">= 6"
30 | }
31 | },
32 | "node_modules/@types/node": {
33 | "version": "16.18.67",
34 | "resolved": "https://registry.npmmirror.com/@types/node/-/node-16.18.67.tgz",
35 | "integrity": "sha512-gUa0tDO9oxyAYO9V9tqxDJguVMDpqUwH5I5Q9ASYBCso+8CUdJlKPKDYS1YSS9kyZWIduDafZvucGM0zGNKFjg==",
36 | "dev": true
37 | },
38 | "node_modules/agent-base": {
39 | "version": "6.0.2",
40 | "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz",
41 | "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
42 | "dependencies": {
43 | "debug": "4"
44 | },
45 | "engines": {
46 | "node": ">= 6.0.0"
47 | }
48 | },
49 | "node_modules/balanced-match": {
50 | "version": "1.0.2",
51 | "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-1.0.2.tgz",
52 | "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="
53 | },
54 | "node_modules/brace-expansion": {
55 | "version": "1.1.11",
56 | "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-1.1.11.tgz",
57 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
58 | "dependencies": {
59 | "balanced-match": "^1.0.0",
60 | "concat-map": "0.0.1"
61 | }
62 | },
63 | "node_modules/browser-stdout": {
64 | "version": "1.3.1",
65 | "resolved": "https://registry.npmmirror.com/browser-stdout/-/browser-stdout-1.3.1.tgz",
66 | "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw=="
67 | },
68 | "node_modules/buffer-from": {
69 | "version": "1.1.2",
70 | "resolved": "https://registry.npmmirror.com/buffer-from/-/buffer-from-1.1.2.tgz",
71 | "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
72 | },
73 | "node_modules/commander": {
74 | "version": "2.15.1",
75 | "resolved": "https://registry.npmmirror.com/commander/-/commander-2.15.1.tgz",
76 | "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag=="
77 | },
78 | "node_modules/concat-map": {
79 | "version": "0.0.1",
80 | "resolved": "https://registry.npmmirror.com/concat-map/-/concat-map-0.0.1.tgz",
81 | "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="
82 | },
83 | "node_modules/debug": {
84 | "version": "4.3.4",
85 | "resolved": "https://registry.npmmirror.com/debug/-/debug-4.3.4.tgz",
86 | "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
87 | "dependencies": {
88 | "ms": "2.1.2"
89 | },
90 | "engines": {
91 | "node": ">=6.0"
92 | },
93 | "peerDependenciesMeta": {
94 | "supports-color": {
95 | "optional": true
96 | }
97 | }
98 | },
99 | "node_modules/diff": {
100 | "version": "3.5.0",
101 | "resolved": "https://registry.npmmirror.com/diff/-/diff-3.5.0.tgz",
102 | "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
103 | "engines": {
104 | "node": ">=0.3.1"
105 | }
106 | },
107 | "node_modules/es6-promise": {
108 | "version": "4.2.8",
109 | "resolved": "https://registry.npmmirror.com/es6-promise/-/es6-promise-4.2.8.tgz",
110 | "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w=="
111 | },
112 | "node_modules/es6-promisify": {
113 | "version": "5.0.0",
114 | "resolved": "https://registry.npmmirror.com/es6-promisify/-/es6-promisify-5.0.0.tgz",
115 | "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==",
116 | "dependencies": {
117 | "es6-promise": "^4.0.3"
118 | }
119 | },
120 | "node_modules/escape-string-regexp": {
121 | "version": "1.0.5",
122 | "resolved": "https://registry.npmmirror.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
123 | "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
124 | "engines": {
125 | "node": ">=0.8.0"
126 | }
127 | },
128 | "node_modules/fs": {
129 | "version": "0.0.1-security",
130 | "resolved": "https://registry.npmmirror.com/fs/-/fs-0.0.1-security.tgz",
131 | "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w=="
132 | },
133 | "node_modules/fs.realpath": {
134 | "version": "1.0.0",
135 | "resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz",
136 | "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
137 | },
138 | "node_modules/glob": {
139 | "version": "7.2.3",
140 | "resolved": "https://registry.npmmirror.com/glob/-/glob-7.2.3.tgz",
141 | "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
142 | "dependencies": {
143 | "fs.realpath": "^1.0.0",
144 | "inflight": "^1.0.4",
145 | "inherits": "2",
146 | "minimatch": "^3.1.1",
147 | "once": "^1.3.0",
148 | "path-is-absolute": "^1.0.0"
149 | },
150 | "engines": {
151 | "node": "*"
152 | }
153 | },
154 | "node_modules/growl": {
155 | "version": "1.10.5",
156 | "resolved": "https://registry.npmmirror.com/growl/-/growl-1.10.5.tgz",
157 | "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==",
158 | "engines": {
159 | "node": ">=4.x"
160 | }
161 | },
162 | "node_modules/has-flag": {
163 | "version": "3.0.0",
164 | "resolved": "https://registry.npmmirror.com/has-flag/-/has-flag-3.0.0.tgz",
165 | "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
166 | "engines": {
167 | "node": ">=4"
168 | }
169 | },
170 | "node_modules/he": {
171 | "version": "1.1.1",
172 | "resolved": "https://registry.npmmirror.com/he/-/he-1.1.1.tgz",
173 | "integrity": "sha512-z/GDPjlRMNOa2XJiB4em8wJpuuBfrFOlYKTZxtpkdr1uPdibHI8rYA3MY0KDObpVyaes0e/aunid/t88ZI2EKA==",
174 | "bin": {
175 | "he": "bin/he"
176 | }
177 | },
178 | "node_modules/http-proxy-agent": {
179 | "version": "4.0.1",
180 | "resolved": "https://registry.npmmirror.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
181 | "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",
182 | "dependencies": {
183 | "@tootallnate/once": "1",
184 | "agent-base": "6",
185 | "debug": "4"
186 | },
187 | "engines": {
188 | "node": ">= 6"
189 | }
190 | },
191 | "node_modules/https-proxy-agent": {
192 | "version": "5.0.1",
193 | "resolved": "https://registry.npmmirror.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
194 | "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==",
195 | "dependencies": {
196 | "agent-base": "6",
197 | "debug": "4"
198 | },
199 | "engines": {
200 | "node": ">= 6"
201 | }
202 | },
203 | "node_modules/inflight": {
204 | "version": "1.0.6",
205 | "resolved": "https://registry.npmmirror.com/inflight/-/inflight-1.0.6.tgz",
206 | "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
207 | "dependencies": {
208 | "once": "^1.3.0",
209 | "wrappy": "1"
210 | }
211 | },
212 | "node_modules/inherits": {
213 | "version": "2.0.3",
214 | "resolved": "https://registry.npmmirror.com/inherits/-/inherits-2.0.3.tgz",
215 | "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw=="
216 | },
217 | "node_modules/minimatch": {
218 | "version": "3.1.2",
219 | "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.2.tgz",
220 | "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
221 | "dependencies": {
222 | "brace-expansion": "^1.1.7"
223 | },
224 | "engines": {
225 | "node": "*"
226 | }
227 | },
228 | "node_modules/minimist": {
229 | "version": "0.0.8",
230 | "resolved": "https://registry.npmmirror.com/minimist/-/minimist-0.0.8.tgz",
231 | "integrity": "sha512-miQKw5Hv4NS1Psg2517mV4e4dYNaO3++hjAvLOAzKqZ61rH8NS1SK+vbfBWZ5PY/Me/bEWhUwqMghEW5Fb9T7Q=="
232 | },
233 | "node_modules/mkdirp": {
234 | "version": "0.5.1",
235 | "resolved": "https://registry.npmmirror.com/mkdirp/-/mkdirp-0.5.1.tgz",
236 | "integrity": "sha512-SknJC52obPfGQPnjIkXbmA6+5H15E+fR+E4iR2oQ3zzCLbd7/ONua69R/Gw7AgkTLsRG+r5fzksYwWe1AgTyWA==",
237 | "deprecated": "Legacy versions of mkdirp are no longer supported. Please update to mkdirp 1.x. (Note that the API surface has changed to use Promises in 1.x.)",
238 | "dependencies": {
239 | "minimist": "0.0.8"
240 | },
241 | "bin": {
242 | "mkdirp": "bin/cmd.js"
243 | }
244 | },
245 | "node_modules/mocha": {
246 | "version": "5.2.0",
247 | "resolved": "https://registry.npmmirror.com/mocha/-/mocha-5.2.0.tgz",
248 | "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==",
249 | "dependencies": {
250 | "browser-stdout": "1.3.1",
251 | "commander": "2.15.1",
252 | "debug": "3.1.0",
253 | "diff": "3.5.0",
254 | "escape-string-regexp": "1.0.5",
255 | "glob": "7.1.2",
256 | "growl": "1.10.5",
257 | "he": "1.1.1",
258 | "minimatch": "3.0.4",
259 | "mkdirp": "0.5.1",
260 | "supports-color": "5.4.0"
261 | },
262 | "bin": {
263 | "_mocha": "bin/_mocha",
264 | "mocha": "bin/mocha"
265 | },
266 | "engines": {
267 | "node": ">= 4.0.0"
268 | }
269 | },
270 | "node_modules/mocha/node_modules/debug": {
271 | "version": "3.1.0",
272 | "resolved": "https://registry.npmmirror.com/debug/-/debug-3.1.0.tgz",
273 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
274 | "dependencies": {
275 | "ms": "2.0.0"
276 | }
277 | },
278 | "node_modules/mocha/node_modules/glob": {
279 | "version": "7.1.2",
280 | "resolved": "https://registry.npmmirror.com/glob/-/glob-7.1.2.tgz",
281 | "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
282 | "dependencies": {
283 | "fs.realpath": "^1.0.0",
284 | "inflight": "^1.0.4",
285 | "inherits": "2",
286 | "minimatch": "^3.0.4",
287 | "once": "^1.3.0",
288 | "path-is-absolute": "^1.0.0"
289 | },
290 | "engines": {
291 | "node": "*"
292 | }
293 | },
294 | "node_modules/mocha/node_modules/minimatch": {
295 | "version": "3.0.4",
296 | "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-3.0.4.tgz",
297 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
298 | "dependencies": {
299 | "brace-expansion": "^1.1.7"
300 | },
301 | "engines": {
302 | "node": "*"
303 | }
304 | },
305 | "node_modules/mocha/node_modules/ms": {
306 | "version": "2.0.0",
307 | "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz",
308 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
309 | },
310 | "node_modules/ms": {
311 | "version": "2.1.2",
312 | "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz",
313 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
314 | },
315 | "node_modules/once": {
316 | "version": "1.4.0",
317 | "resolved": "https://registry.npmmirror.com/once/-/once-1.4.0.tgz",
318 | "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
319 | "dependencies": {
320 | "wrappy": "1"
321 | }
322 | },
323 | "node_modules/path": {
324 | "version": "0.12.7",
325 | "resolved": "https://registry.npmmirror.com/path/-/path-0.12.7.tgz",
326 | "integrity": "sha512-aXXC6s+1w7otVF9UletFkFcDsJeO7lSZBPUQhtb5O0xJe8LtYhj/GxldoL09bBj9+ZmE2hNoHqQSFMN5fikh4Q==",
327 | "dependencies": {
328 | "process": "^0.11.1",
329 | "util": "^0.10.3"
330 | }
331 | },
332 | "node_modules/path-is-absolute": {
333 | "version": "1.0.1",
334 | "resolved": "https://registry.npmmirror.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
335 | "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
336 | "engines": {
337 | "node": ">=0.10.0"
338 | }
339 | },
340 | "node_modules/process": {
341 | "version": "0.11.10",
342 | "resolved": "https://registry.npmmirror.com/process/-/process-0.11.10.tgz",
343 | "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
344 | "engines": {
345 | "node": ">= 0.6.0"
346 | }
347 | },
348 | "node_modules/semver": {
349 | "version": "5.7.2",
350 | "resolved": "https://registry.npmmirror.com/semver/-/semver-5.7.2.tgz",
351 | "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
352 | "bin": {
353 | "semver": "bin/semver"
354 | }
355 | },
356 | "node_modules/source-map": {
357 | "version": "0.6.1",
358 | "resolved": "https://registry.npmmirror.com/source-map/-/source-map-0.6.1.tgz",
359 | "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
360 | "engines": {
361 | "node": ">=0.10.0"
362 | }
363 | },
364 | "node_modules/source-map-support": {
365 | "version": "0.5.21",
366 | "resolved": "https://registry.npmmirror.com/source-map-support/-/source-map-support-0.5.21.tgz",
367 | "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
368 | "dependencies": {
369 | "buffer-from": "^1.0.0",
370 | "source-map": "^0.6.0"
371 | }
372 | },
373 | "node_modules/supports-color": {
374 | "version": "5.4.0",
375 | "resolved": "https://registry.npmmirror.com/supports-color/-/supports-color-5.4.0.tgz",
376 | "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==",
377 | "dependencies": {
378 | "has-flag": "^3.0.0"
379 | },
380 | "engines": {
381 | "node": ">=4"
382 | }
383 | },
384 | "node_modules/typescript": {
385 | "version": "4.9.5",
386 | "resolved": "https://registry.npmmirror.com/typescript/-/typescript-4.9.5.tgz",
387 | "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
388 | "dev": true,
389 | "bin": {
390 | "tsc": "bin/tsc",
391 | "tsserver": "bin/tsserver"
392 | },
393 | "engines": {
394 | "node": ">=4.2.0"
395 | }
396 | },
397 | "node_modules/util": {
398 | "version": "0.10.4",
399 | "resolved": "https://registry.npmmirror.com/util/-/util-0.10.4.tgz",
400 | "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
401 | "dependencies": {
402 | "inherits": "2.0.3"
403 | }
404 | },
405 | "node_modules/vscode": {
406 | "version": "1.1.37",
407 | "resolved": "https://registry.npmmirror.com/vscode/-/vscode-1.1.37.tgz",
408 | "integrity": "sha512-vJNj6IlN7IJPdMavlQa1KoFB3Ihn06q1AiN3ZFI/HfzPNzbKZWPPuiU+XkpNOfGU5k15m4r80nxNPlM7wcc0wg==",
409 | "deprecated": "This package is deprecated in favor of @types/vscode and vscode-test. For more information please read: https://code.visualstudio.com/updates/v1_36#_splitting-vscode-package-into-typesvscode-and-vscodetest",
410 | "dependencies": {
411 | "glob": "^7.1.2",
412 | "http-proxy-agent": "^4.0.1",
413 | "https-proxy-agent": "^5.0.0",
414 | "mocha": "^5.2.0",
415 | "semver": "^5.4.1",
416 | "source-map-support": "^0.5.0",
417 | "vscode-test": "^0.4.1"
418 | },
419 | "bin": {
420 | "vscode-install": "bin/install"
421 | },
422 | "engines": {
423 | "node": ">=8.9.3"
424 | }
425 | },
426 | "node_modules/vscode-test": {
427 | "version": "0.4.3",
428 | "resolved": "https://registry.npmmirror.com/vscode-test/-/vscode-test-0.4.3.tgz",
429 | "integrity": "sha512-EkMGqBSefZH2MgW65nY05rdRSko15uvzq4VAPM5jVmwYuFQKE7eikKXNJDRxL+OITXHB6pI+a3XqqD32Y3KC5w==",
430 | "deprecated": "This package has been renamed to @vscode/test-electron, please update to the new name",
431 | "dependencies": {
432 | "http-proxy-agent": "^2.1.0",
433 | "https-proxy-agent": "^2.2.1"
434 | },
435 | "engines": {
436 | "node": ">=8.9.3"
437 | }
438 | },
439 | "node_modules/vscode-test/node_modules/agent-base": {
440 | "version": "4.3.0",
441 | "resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-4.3.0.tgz",
442 | "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
443 | "dependencies": {
444 | "es6-promisify": "^5.0.0"
445 | },
446 | "engines": {
447 | "node": ">= 4.0.0"
448 | }
449 | },
450 | "node_modules/vscode-test/node_modules/debug": {
451 | "version": "3.1.0",
452 | "resolved": "https://registry.npmmirror.com/debug/-/debug-3.1.0.tgz",
453 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
454 | "dependencies": {
455 | "ms": "2.0.0"
456 | }
457 | },
458 | "node_modules/vscode-test/node_modules/http-proxy-agent": {
459 | "version": "2.1.0",
460 | "resolved": "https://registry.npmmirror.com/http-proxy-agent/-/http-proxy-agent-2.1.0.tgz",
461 | "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==",
462 | "dependencies": {
463 | "agent-base": "4",
464 | "debug": "3.1.0"
465 | },
466 | "engines": {
467 | "node": ">= 4.5.0"
468 | }
469 | },
470 | "node_modules/vscode-test/node_modules/https-proxy-agent": {
471 | "version": "2.2.4",
472 | "resolved": "https://registry.npmmirror.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz",
473 | "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==",
474 | "dependencies": {
475 | "agent-base": "^4.3.0",
476 | "debug": "^3.1.0"
477 | },
478 | "engines": {
479 | "node": ">= 4.5.0"
480 | }
481 | },
482 | "node_modules/vscode-test/node_modules/ms": {
483 | "version": "2.0.0",
484 | "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz",
485 | "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
486 | },
487 | "node_modules/wrappy": {
488 | "version": "1.0.2",
489 | "resolved": "https://registry.npmmirror.com/wrappy/-/wrappy-1.0.2.tgz",
490 | "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
491 | }
492 | }
493 | }
494 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "kether-snippet",
3 | "displayName": "Kether支持",
4 | "description": "Kether动作补全以及支持Kether Script",
5 | "keywords": [
6 | "kether",
7 | "ks",
8 | "questengine",
9 | "TabooLib",
10 | "trmenu",
11 | "ketherscript",
12 | ".ks"
13 | ],
14 | "publisher": "LiteCat",
15 | "version": "1.0.5",
16 | "preview": true,
17 | "icon": "images/pack-icon.png",
18 | "engines": {
19 | "vscode": "^1.70.0"
20 | },
21 | "repository": {
22 | "type": "git",
23 | "url": "https://github.com/LiteCat0905/Kether-snippet.git"
24 | },
25 | "categories": [
26 | "Snippets",
27 | "Programming Languages"
28 | ],
29 | "main": "src/extension",
30 | "activationEvents": [
31 | "onLanguage:kether",
32 | "onLanguage:yaml",
33 | "onCommand:extension.ketherDefinition"
34 | ],
35 | "contributes": {
36 | "snippets": [
37 | {
38 | "language": "yaml",
39 | "path": "./snippets/taboolib/TabooLib-a.code-snippets"
40 | },
41 | {
42 | "language": "yaml",
43 | "path": "./snippets/questengine/questengine-m.code-snippets"
44 | },
45 | {
46 | "language": "yaml",
47 | "path": "./snippets/chemdah/Chemdah-a.code-snippets"
48 | },
49 | {
50 | "language": "yaml",
51 | "path": "./snippets/chemdah/Chemdah-m.code-snippets"
52 | },
53 | {
54 | "language": "kether",
55 | "path": "./snippets/taboolib/TabooLib-a.code-snippets"
56 | },
57 | {
58 | "language": "kether",
59 | "path": "./snippets/questengine/questengine-m.code-snippets"
60 | },
61 | {
62 | "language": "kether",
63 | "path": "./snippets/chemdah/Chemdah-a.code-snippets"
64 | },
65 | {
66 | "language": "kether",
67 | "path": "./snippets/chemdah/Chemdah-m.code-snippets"
68 | },
69 | {
70 | "language": "kether",
71 | "path": "./snippets/ketherscript/ketherscript.code-snippets"
72 | }
73 | ],
74 | "keybindings": [
75 | {
76 | "command": "extension.ketherDefinition",
77 | "key": "ctrl+f12",
78 | "when": "editorTextFocus && editorLangId == kether || editorLangId == yaml"
79 | }
80 | ],
81 | "languages": [
82 | {
83 | "id": "kether",
84 | "aliases": [
85 | "Kether"
86 | ],
87 | "extensions": [
88 | ".ks",
89 | ".ady"
90 | ],
91 | "configuration": "./language-configuration.json",
92 | "icon": {
93 | "light": "images/icon-light.png",
94 | "dark": "images/icon-dark.png"
95 | }
96 | }
97 | ],
98 | "grammars": [
99 | {
100 | "language": "kether",
101 | "scopeName": "source.ks",
102 | "path": "./syntaxes/kether.tmLanguage.json"
103 | }
104 | ]
105 | },
106 | "scripts": {
107 | "vscode:prepublish": "npm run compile",
108 | "compile": "tsc -p ./",
109 | "watch": "tsc -watch -p ./",
110 | "postinstall": "node ./node_modules/vscode/bin/install",
111 | "test": "echo \"Error: no test specified\" && exit 1"
112 | }
113 | }
--------------------------------------------------------------------------------
/snippets/chemdah/Chemdah-a.code-snippets:
--------------------------------------------------------------------------------
1 | // Chemdah 提供的私有动作
2 | {
3 | "作用于任务或对话开始时的脚本代理中,可取消行为。": {
4 | "prefix": [
5 | "Cancel",
6 | ],
7 | "description": "(Chemdah私人动作)cancel",
8 | "body": [
9 | "cancel",
10 | ]
11 | },
12 | "向上取整": {
13 | "prefix": [
14 | "Ceil",
15 | ],
16 | "description": "(Chemdah私人动作)ceil {aciton}",
17 | "body": [
18 | "ceil $1",
19 | ]
20 | },
21 | "作用于对话的脚本代理中,可结束对话。": {
22 | "prefix": [
23 | "Close",
24 | ],
25 | "description": "(Chemdah私人动作)close",
26 | "body": [
27 | "close",
28 | ]
29 | },
30 | "向下取整": {
31 | "prefix": [
32 | "Floor",
33 | ],
34 | "description": "(Chemdah私人动作)floor {aciton}",
35 | "body": [
36 | "floor $1",
37 | ]
38 | },
39 | "跳转到特定对话结构中。": {
40 | "prefix": [
41 | "Goto",
42 | ],
43 | "description": "(Chemdah私人动作)goto {token}",
44 | "body": [
45 | "goto $1",
46 | ]
47 | },
48 | "取两值之最大": {
49 | "prefix": [
50 | "Max",
51 | ],
52 | "description": "(Chemdah私人动作)max {aciton} {action}",
53 | "body": [
54 | "max $1 $2",
55 | ]
56 | },
57 | "作用于对话的脚本代理中,可获取对话 NPC 的头顶坐标。": {
58 | "prefix": [
59 | "Origin",
60 | ],
61 | "description": "(Chemdah私人动作)origin",
62 | "body": [
63 | "origin",
64 | ]
65 | },
66 | "取两值之最小": {
67 | "prefix": [
68 | "Min",
69 | ],
70 | "description": "(Chemdah私人动作)min {aciton} {action}",
71 | "body": [
72 | "mine $1 $2",
73 | ]
74 | },
75 | "在 Chemdah 任务脚本代理中,返回当前任务或条目序号。": {
76 | "prefix": [
77 | "Quest This",
78 | ],
79 | "description": "(Chemdah私人动作)this [task]",
80 | "body": [
81 | "this $1",
82 | ]
83 | },
84 | "作用于 agent:begin 时:增加 NPC 即将发送的对话内容。作用于 agent:refuse, agent:end, then 时:使 NPC 立即发送特定内容,常用于对话的收尾。": {
85 | "prefix": [
86 | "Talk",
87 | ],
88 | "description": "(Chemdah私人动作)talk {token}",
89 | "body": [
90 | "talk \"$1\"",
91 | ]
92 | },
93 | "仅作用于 UI 模块的配置文件中,用于构建任务的完成进度。": {
94 | "prefix": [
95 | "UI",
96 | ],
97 | "description": "(Chemdah私人动作)ui (percent|bar {token}) {token list} [exclude {token list}]",
98 | "body": [
99 | "ui ${1|percent,bar|} [ $2 ] exclude [ $3 ]",
100 | ]
101 | },
102 | "修改或获取全局变量。": {
103 | "prefix": [
104 | "Variable",
105 | ],
106 | "description": "(Chemdah私人动作)var {action} [(add|to) {action}] [default {action}]",
107 | "body": [
108 | "var key add $1 default $2",
109 | ]
110 | },
111 | "唤起或停止 Wizard 引导": {
112 | "prefix": [
113 | "Wizard",
114 | ],
115 | "description": "(Chemdah私人动作)wizard (to {action}|cancel)",
116 | "body": [
117 | "wizard to \"$1\"",
118 | ]
119 | },
120 | "定义离线补偿,当玩家在 fetch reset 语句执行前离开游戏时,那么玩家下次进入游戏后将执行 fetch mark 中的语句。": {
121 | "prefix": [
122 | "Workflows Fetch",
123 | ],
124 | "description": "(Chemdah私人动作)fetch (mark {token} {action}|reset {token})",
125 | "body": [
126 | "fetch mark $1 { $2 }",
127 | ]
128 | },
129 | }
--------------------------------------------------------------------------------
/snippets/chemdah/Chemdah-m.code-snippets:
--------------------------------------------------------------------------------
1 | // Chemdah 提供的公有动作
2 | {
3 | "获取坐标中的 X、Y、Z 轴整数值。": {
4 | "prefix": [
5 | "Block",
6 | ],
7 | "description": "(Chemdah公有动作)block (x|y|z) in {location}",
8 | "body": [
9 | "block ${1|x,y,z|} in ${2:world} ${3:0} ${4:0} ${5:0}",
10 | ]
11 | },
12 | "判断两个坐标之间的距离,若两坐标位于不同世界则返回 -1。": {
13 | "prefix": [
14 | "Distance",
15 | ],
16 | "description": "(Chemdah公有动作)distance {location} to {location}",
17 | "body": [
18 | "distance $1 to $2",
19 | ]
20 | },
21 | "检查玩家装备是否为特定物品,使用 Chemdah 物品表达式。表达式帮助详见 Chemdah 文档。": {
22 | "prefix": [
23 | "Equipment Check",
24 | "equip check"
25 | ],
26 | "description": "(Chemdah公有动作)inventory {equipment} is {token} [amount {int}]",
27 | "body": [
28 | "inventory ${1|hand,offhand,head,chest,legs,boots|} is \"$2\" amount $3",
29 | ]
30 | },
31 | "Minecraft:": {
32 | "prefix": [
33 | "Minecraft:"
34 | ],
35 | "description": "(Chemdah公有动作)Minecraft:",
36 | "body": [
37 | "minecraft:$1",
38 | ]
39 | },
40 | "检查玩家背包中是否含有特定物品,使用 Chemdah 物品表达式。": {
41 | "prefix": [
42 | "Inventory Check",
43 | ],
44 | "description": "(Chemdah公有动作)inventory check {token} [amount {int}]",
45 | "body": [
46 | "inventory check \"$1\" amount $2",
47 | ]
48 | },
49 | "关闭玩家当前页面。": {
50 | "prefix": [
51 | "Inventory Close",
52 | ],
53 | "description": "(Chemdah公有动作)inventory close",
54 | "body": [
55 | "inventory close",
56 | ]
57 | },
58 | "获取玩家背包中的特定物品数量,使用 Chemdah 物品表达式。": {
59 | "prefix": [
60 | "Inventory Count",
61 | ],
62 | "description": "(Chemdah公有动作)inventory (count|amount) {token}",
63 | "body": [
64 | "inventory count \"$1\"",
65 | ]
66 | },
67 | "检查玩家背包中某个位置是否为特定物品,使用 Chemdah 物品表达式。": {
68 | "prefix": [
69 | "Inv Slot Check",
70 | ],
71 | "description": "(Chemdah公有动作)inventory slot {int} is {token} [amount {int}]",
72 | "body": [
73 | "inventory slot $1 is \"$2\" amount $3",
74 | ]
75 | },
76 | "检查玩家背包中是否含有特定物品并移除,使用 Chemdah 物品表达式。": {
77 | "prefix": [
78 | "Inventory Take",
79 | ],
80 | "description": "(Chemdah公有动作)inventory (remove|take) {token} [amount {int}]",
81 | "body": [
82 | "inventory take \"$1\" amount $2",
83 | ]
84 | },
85 | "(Chemdah公有动作)获取坐标中的 X、Y、Z、Yaw、Pitch 或修改。": {
86 | "prefix": [
87 | "Location X,Y,Z",
88 | ],
89 | "description": "(Chemdah公有动作)(x|y|z|yaw|pitch) in {locaiton} [(to|add) {action}]",
90 | "body": [
91 | "${1|x,y,z|} in location ${2:world} ${3:0} ${4:0} ${5:0}",
92 | ]
93 | },
94 | "获取玩家的 MMOCore 属性点数。": {
95 | "prefix": [
96 | "MMOCore Attribute Point",
97 | ],
98 | "description": "(Chemdah公有动作)mmocore attribute point",
99 | "body": [
100 | "mmocore attribute point",
101 | ]
102 | },
103 | "获取玩家的 MMOCore 职业相关数据。": {
104 | "prefix": [
105 | "MMOCore Class",
106 | ],
107 | "description": "(Chemdah公有动作)mmocore class (id|name|point)",
108 | "body": [
109 | "mmocore class ${1|id,name,point|}",
110 | ]
111 | },
112 | "获取玩家的 MMOCore 等级或经验值。": {
113 | "prefix": [
114 | "MMOCore Level & Exp",
115 | ],
116 | "description": "(Chemdah公有动作)mmocore (level|experience|exp)",
117 | "body": [
118 | "mmocore ${1|level,experience|exp|}",
119 | ]
120 | },
121 | "获取玩家的 MMOCore 法力值。": {
122 | "prefix": [
123 | "MMOCore Mana",
124 | ],
125 | "description": "(Chemdah公有动作)mmocore mana",
126 | "body": [
127 | "mmocore mana",
128 | ]
129 | },
130 | "获取玩家的 MMOCore 耐力值。": {
131 | "prefix": [
132 | "MMOCore Stamina",
133 | ],
134 | "description": "(Chemdah公有动作)mmocore stamina",
135 | "body": [
136 | "mmocore stamina",
137 | ]
138 | },
139 | "使玩家执行 MythicMobs 怪物技能。": {
140 | "prefix": [
141 | "MythicMobs Cast",
142 | ],
143 | "description": "(Chemdah公有动作)(mythicmobs|mm) cast {token} [with {trigger}]",
144 | "body": [
145 | "mm cast $1 with ${2|DEFAULT,API,ATTACK,BOW_HIT,BLOCK,BLOCK_PLACE,BLOCK_BREAK,COMBAT,CONSUME,CROUCH,UNCROUCH,DAMAGED,DROPCOMBAT,DEATH,DESPAWNED,ENTERCOMBAT,EXPLODE,INTERACT,KILL,KILLPLAYER,PLAYERDEATH,SHOOT,SIGNAL,SPAWN,SPLASH_POTION,SWING,TARGETCHANGE,TARGETED,TELEPORT,TIMER,USE,RIGHTCLICK,READY,CAST,FISH,FISH_BITE,FISH_CATCH_FISH,FISH_CATCH_ENTITY,FISH_GROUND,FISH_REEL,FISH_FAIL,TAME,TAME_FAIL,TRIDENT_THROW,TRIDENT_HIT,CUSTOM|}",
146 | ]
147 | },
148 | "在指定的坐标下播放粒子效果,若在结尾使用 @self 则只播放给自己。": {
149 | "prefix": [
150 | "Particle Normal",
151 | ],
152 | "description": "(Chemdah公有动作)particle normal {token} (at|on) {location} [@self]",
153 | "body": [
154 | "particle normal \"${1:flame} ${2:0} ${3:0} ${4:0} -count ${5:10} -speed ${6:0.1}\" at location ${7:world} ${8:0} ${9:0} ${10:0} @self",
155 | ]
156 | },
157 | "检测玩家是否在特定区域内,使用 Chemdah 坐标表达式": {
158 | "prefix": [
159 | "Position",
160 | ],
161 | "description": "(Chemdah公有动作)position in[side] {token}",
162 | "body": [
163 | "position inside \"${1:world} ${2:0} ${3:0} ${4:0} > 10 10 10\"",
164 | ]
165 | },
166 | "修改或获取玩家的变量。": {
167 | "prefix": [
168 | "Profile Data",
169 | ],
170 | "description": "(Chemdah公有动作)profile data {action} [(add|to) {action}] [default {action}]",
171 | "body": [
172 | "profile data $1 add $2 default $3",
173 | ]
174 | },
175 | "修改或获取玩家自定义等级中的等级或经验。": {
176 | "prefix": [
177 | "Profile Level",
178 | ],
179 | "description": "(Chemdah公有动作)profile level {action} (level|exp|exp-max) [(add|to) {action}]",
180 | "body": [
181 | "profile level ${1:default} exp add $2",
182 | ]
183 | },
184 | "检测玩家正在进行的或尚未接受的任务(已选择的)。": {
185 | "prefix": [
186 | "Quest Check",
187 | ],
188 | "description": "(Chemdah公有动作)bbbbbbb",
189 | "body": [
190 | "quest ${1|accept-check,accepted,completed|}",
191 | ]
192 | },
193 | "控制玩家正在进行的或尚未接受的任务 (已选择的)。": {
194 | "prefix": [
195 | "Quest Control",
196 | ],
197 | "description": "(Chemdah公有动作)quest {control}",
198 | "body": [
199 | "quest ${1|accept,complete,fail,restart,stop|}",
200 | ]
201 | },
202 | "修改或获取玩家当前任务(已选择的)中的变量。": {
203 | "prefix": [
204 | "Quest Data",
205 | ],
206 | "description": "(Chemdah公有动作)quest data {action} [(add|to) {action}] [default {action}]",
207 | "body": [
208 | "quest data $1 add $2 default $3",
209 | ]
210 | },
211 | "检测玩家是否接受或已完成任务组": {
212 | "prefix": [
213 | "Quest Group Check",
214 | ],
215 | "description": "(Chemdah公有动作)quest-group (accepted|completed) {action}",
216 | "body": [
217 | "quest-group ${1|accepted,completed|} $2",
218 | ]
219 | },
220 | "获取玩家当前任务(已选择的)或任务(已选择的)中的某项条目的进度信息。": {
221 | "prefix": [
222 | "Quest Progress",
223 | ],
224 | "description": "(Chemdah公有动作)quest progress (value|target|percent|percent100) [task {action}]",
225 | "body": [
226 | "quest progress ${1|value,target,percent,percent100|} task $2",
227 | ]
228 | },
229 | "选择任何一个服务器中存在的有效任务以供后续操作。": {
230 | "prefix": [
231 | "Quest Select",
232 | ],
233 | "description": "(Chemdah公有动作)quest select {action}",
234 | "body": [
235 | "quest select $1",
236 | ]
237 | },
238 | "隐藏或刷新任务(已选择的)或任务(已选择的)中某项条目的进度显示。": {
239 | "prefix": [
240 | "Quest Stats",
241 | ],
242 | "description": "(Chemdah公有动作)quest stats (hide |refresh} [task {action|}]",
243 | "body": [
244 | "quest stats ${1|refresh,hide|} task $2",
245 | ]
246 | },
247 | "获取某个任务 (已选择) 中的所有条目序号。": {
248 | "prefix": [
249 | "Quest Tasks",
250 | ],
251 | "description": "(Chemdah公有动作)quest tasks",
252 | "body": [
253 | "quest tasks",
254 | ]
255 | },
256 | "使玩家追踪任务(已选择的)": {
257 | "prefix": [
258 | "Quest Track",
259 | ],
260 | "description": "(Chemdah公有动作)quest track",
261 | "body": [
262 | "quest track",
263 | ]
264 | },
265 | "获取玩家正在追踪的任务名称": {
266 | "prefix": [
267 | "Quest Tracking",
268 | ],
269 | "description": "(Chemdah公有动作)quest tracking",
270 | "body": [
271 | "quest tracking",
272 | ]
273 | },
274 | "获取玩家当前正在进行的所有任务,使用 self 则忽略共享(多人)任务。": {
275 | "prefix": [
276 | "Quests",
277 | ],
278 | "description": "(Chemdah公有动作)quests [self]",
279 | "body": [
280 | "quests ${1:self}",
281 | ]
282 | },
283 | "在 #Location 构建的坐标出生成特定 WorldEdit 建筑模板。或旋转、忽略空气": {
284 | "prefix": [
285 | "Schematic",
286 | ],
287 | "description": "(Chemdah公有动作)schem[atic] {action} (at|on) {location} [rotation {int}] [ignore air]",
288 | "body": [
289 | "schematic $1",
290 | ]
291 | },
292 | "运行或停止某个脚本文件。": {
293 | "prefix": [
294 | "Script",
295 | "KetherScript"
296 | ],
297 | "description": "(Chemdah公有动作)script (run|stop) {token}",
298 | "body": [
299 | "script ${1|run,stop|} $2",
300 | ]
301 | },
302 | "获取玩家的 SkillAPI 属性或属性点数。": {
303 | "prefix": [
304 | "SkillAPI Attribute",
305 | ],
306 | "description": "(Chemdah公有动作)skillapi attribute (point|{token})",
307 | "body": [
308 | "skillapi attribute ${1|point,{token}|}",
309 | ]
310 | },
311 | "使玩家执行 SkillAPI 技能。": {
312 | "prefix": [
313 | "SkillAPI Cast",
314 | ],
315 | "description": "(Chemdah公有动作)skillapi cast {token}",
316 | "body": [
317 | "skillapi cast $1",
318 | ]
319 | },
320 | "获取玩家的 SkillAPI 职业相关数据。": {
321 | "prefix": [
322 | "SkillAPI Class",
323 | ],
324 | "description": "(Chemdah公有动作)skillapi class (main|size)",
325 | "body": [
326 | "skillapi class ${1|main,size|}",
327 | ]
328 | },
329 | "获取玩家的 SkillAPI 当前经验值或升级所需经验。": {
330 | "prefix": [
331 | "SkillAPI Exp",
332 | ],
333 | "description": "(Chemdah公有动作)skillapi exp (total|required)",
334 | "body": [
335 | "skillapi exp ${1|total,required|}",
336 | ]
337 | },
338 | "获取玩家的 SkillAPI 等级或是否满级。": {
339 | "prefix": [
340 | "SkillAPI Level",
341 | ],
342 | "description": "(Chemdah公有动作)mmocore level [maxed]",
343 | "body": [
344 | "mmocore level ${1:maxed}",
345 | ]
346 | },
347 | "获取玩家的 SkillAPI 法力值。": {
348 | "prefix": [
349 | "SkillAPI Mana",
350 | ],
351 | "description": "(Chemdah公有动作)skillapi mana",
352 | "body": [
353 | "skillapi mana",
354 | ]
355 | },
356 | "获取玩家的 SkillAPI 技能点数。": {
357 | "prefix": [
358 | "SkillAPI Skill Point",
359 | ],
360 | "description": "(Chemdah公有动作)skillapi skill point",
361 | "body": [
362 | "skillapi skill point",
363 | ]
364 | },
365 | "唤起玩家的 Trigger 任务": {
366 | "prefix": [
367 | "Trigger",
368 | ],
369 | "description": "(Chemdah公有动作)trigger {token}",
370 | "body": [
371 | "trigger $1",
372 | ]
373 | }
374 | }
--------------------------------------------------------------------------------
/snippets/ketherscript/ketherscript.code-snippets:
--------------------------------------------------------------------------------
1 | // KetherScript快速创建脚本
2 | {
3 | "创建函数": {
4 | "prefix": [
5 | "def",
6 | ],
7 | "description": "KetherScript",
8 | "body": [
9 | "def $1 = {",
10 | " $2",
11 | "}"
12 |
13 | ]
14 | },
15 | "定义": {
16 | "prefix": [
17 | "def",
18 | ],
19 | "description": "KetherScript",
20 | "body": [
21 | "def",
22 | ]
23 | },
24 | "创建主函数": {
25 | "prefix": [
26 | "main",
27 | ],
28 | "description": "KetherScript",
29 | "body": [
30 | "def main = {",
31 | " $1",
32 | "}"
33 |
34 | ]
35 | }
36 | }
--------------------------------------------------------------------------------
/snippets/questengine/questengine-m.code-snippets:
--------------------------------------------------------------------------------
1 | //questengine私有动作
2 | {
3 | "(小时)延迟运行时间,等待时间后运行下一个语句": {
4 | "prefix": [
5 | "waitTime 小时",
6 | ],
7 | "description": "(QE私人动作)waitTime [数字][时间单位]",
8 | "body": [
9 | "waitTime $1h",
10 | ]
11 | },
12 | "(分钟)延迟运行时间,等待时间后运行下一个语句": {
13 | "prefix": [
14 | "waitTime 分钟",
15 | ],
16 | "description": "(QE私人动作)waitTime [数字][时间单位]",
17 | "body": [
18 | "waitTime $1m",
19 | ]
20 | },
21 | "(秒)延迟运行时间,等待时间后运行下一个语句": {
22 | "prefix": [
23 | "waitTime 秒",
24 | ],
25 | "description": "(QE私人动作)waitTime [数字][时间单位]",
26 | "body": [
27 | "waitTime $1s",
28 | ]
29 | },
30 | "添加标签": {
31 | "prefix": [
32 | "tags add",
33 | ],
34 | "description": "(QE私人动作)tags add [标签]",
35 | "body": [
36 | "tags add ",
37 | ]
38 | },
39 | "删除标签": {
40 | "prefix": [
41 | "tags remove",
42 | ],
43 | "description": "(QE私人动作)tags remove [标签]",
44 | "body": [
45 | "tags remove ",
46 | ]
47 | },
48 | "是否有某标签": {
49 | "prefix": [
50 | "tags has",
51 | ],
52 | "description": "(QE私人动作)tags has [标签]",
53 | "body": [
54 | "tags has ",
55 | ]
56 | },
57 | "获得数据": {
58 | "prefix": [
59 | "storage get",
60 | ],
61 | "description": "(QE私人动作)storage [id] get",
62 | "body": [
63 | "storage $1 get",
64 | ]
65 | },
66 | "设置数据": {
67 | "prefix": [
68 | "storage set",
69 | ],
70 | "description": "(QE私人动作)storage [id] set [action]",
71 | "body": [
72 | "storage $1 set $2",
73 | ]
74 | },
75 | "删除数据": {
76 | "prefix": [
77 | "storage remove",
78 | ],
79 | "description": "(QE私人动作)storage [id] remove",
80 | "body": [
81 | "storage $1 remove",
82 | ]
83 | },
84 | "选择任务": {
85 | "prefix": [
86 | "quest select",
87 | ],
88 | "description": "(QE私人动作)quest select [任务编号]",
89 | "body": [
90 | "quest select $1",
91 | ]
92 | },
93 | "接受任务": {
94 | "prefix": [
95 | "quest accept",
96 | ],
97 | "description": "(QE私人动作)quest accept",
98 | "body": [
99 | "quest select $1 quest accept",
100 | ]
101 | },
102 | "放弃任务": {
103 | "prefix": [
104 | "quest quit",
105 | ],
106 | "description": "(QE私人动作)quest quit",
107 | "body": [
108 | "quest select $1 quest quit",
109 | ]
110 | },
111 | "完成任务": {
112 | "prefix": [
113 | "quest finish",
114 | ],
115 | "description": "(QE私人动作)quest finish",
116 | "body": [
117 | "quest select $1 quest finish",
118 | ]
119 | },
120 | "获取任务名称": {
121 | "prefix": [
122 | "quest name",
123 | ],
124 | "description": "(QE私人动作)quest name",
125 | "body": [
126 | "quest select $1 quest name",
127 | ]
128 | },
129 | "获取任务状,返回枚举(DOING)": {
130 | "prefix": [
131 | "quest state",
132 | ],
133 | "description": "(QE私人动作)quest state",
134 | "body": [
135 | "quest select $1 quest state",
136 | ]
137 | },
138 | "获取任务状,返回语言内容(正在进行中)": {
139 | "prefix": [
140 | "quest state lang",
141 | ],
142 | "description": "(QE私人动作)quest state lang",
143 | "body": [
144 | "quest select $1 quest state lang",
145 | ]
146 | },
147 | "获取任务剩余时间": {
148 | "prefix": [
149 | "quest limitTime",
150 | ],
151 | "description": "(QE私人动作)quest limitTime",
152 | "body": [
153 | "quest select $1 quest limitTime",
154 | ]
155 | },
156 | "选择目标": {
157 | "prefix": [
158 | "target select",
159 | ],
160 | "description": "(QE私人动作)target select [目标编号]",
161 | "body": [
162 | "quest select $1 target select $2",
163 | ]
164 | },
165 | "获取目标进度": {
166 | "prefix": [
167 | "target schedule",
168 | ],
169 | "description": "(QE私人动作)target schedule",
170 | "body": [
171 | "quest select $1 target select $2 target schedule",
172 | ]
173 | },
174 | "获取目标状态, 返回枚举": {
175 | "prefix": [
176 | "target state",
177 | ],
178 | "description": "(QE私人动作)target state",
179 | "body": [
180 | "quest select $1 target select $2 target state",
181 | ]
182 | },
183 | "获取目标状态, 返回语言内容": {
184 | "prefix": [
185 | "target state lang",
186 | ],
187 | "description": "(QE私人动作)target state lang",
188 | "body": [
189 | "quest select $1 target select $2 target state lang",
190 | ]
191 | },
192 | "选择对话": {
193 | "prefix": [
194 | "dialog select",
195 | ],
196 | "description": "(QE私人动作)dialog select [对话编号]",
197 | "body": [
198 | "dialog select $1",
199 | ]
200 | },
201 | "发送对话": {
202 | "prefix": [
203 | "dialog send",
204 | ],
205 | "description": "(QE私人动作)dialog send",
206 | "body": [
207 | "dialog select $1 dialog send",
208 | ]
209 | },
210 | "发送对话(位置)": {
211 | "prefix": [
212 | "dialog send where",
213 | ],
214 | "description": "(QE私人动作)dialog send where [location]",
215 | "body": [
216 | "dialog select $1 dialog send where ${2:world} ${3:0} ${4:0} ${5:0}",
217 | ]
218 | },
219 | "检查玩家是否有特定物品": {
220 | "prefix": [
221 | "itemCheck inv",
222 | ],
223 | "description": "(QE私人动作)itemCheck inv [类型] \"选择 内容\"",
224 | "body": [
225 | "itemCheck inv ${1|all, mainHand|} \"${2|MINECRAFT -material displayName- \"\" -loreContains -customModelData -amount,MMOITEMS -id|}\"",
226 | ]
227 | },
228 | "检查玩家是否有特定物品并拿走": {
229 | "prefix": [
230 | "itemCheck take",
231 | ],
232 | "description": "(QE私人动作)itemCheck take \"选择 内容\"",
233 | "body": [
234 | "itemCheck take \"${2|MINECRAFT -material displayName- \"\" -loreContains -customModelData -amount,MMOITEMS -id|}\"",
235 | ]
236 | },
237 | "对话空间范围,应用于对话模块空间范围 dialogID.space.condition": {
238 | "prefix": [
239 | "spaceRange",
240 | ],
241 | "description": "(QE私人动作)spaceRange [长] [高] [宽]n",
242 | "body": [
243 | "spaceRange ${1:长} ${2:高} ${3:宽}",
244 | ]
245 | },
246 | "空间范围,应用于条件检查,比如任务要求达到目的地": {
247 | "prefix": [
248 | "spaceRange where",
249 | ],
250 | "description": "(QE私人动作)spaceRange [长] [高] [宽] where [location]",
251 | "body": [
252 | "spaceRange ${1:长} ${2:高} ${3:宽} where ${4:world} ${5:0} ${6:0} ${7:0}",
253 | ]
254 | },
255 | "开动态门": {
256 | "prefix": [
257 | "doors open",
258 | ],
259 | "description": "(QE私人动作)doors to [ID] open",
260 | "body": [
261 | "doors to $1 open",
262 | ]
263 | },
264 | "关动态门": {
265 | "prefix": [
266 | "doors close",
267 | ],
268 | "description": "(QE私人动作)doors to [ID] close",
269 | "body": [
270 | "doors to $1 close",
271 | ]
272 | },
273 | "情景放映": {
274 | "prefix": [
275 | "tutorial start",
276 | ],
277 | "description": "(QE私人动作)tutorial start [id]",
278 | "body": [
279 | "tutorial start $1",
280 | ]
281 | },
282 | "选择导航": {
283 | "prefix": [
284 | "nav select",
285 | ],
286 | "description": "(QE私人动作)nav select [导航编号]",
287 | "body": [
288 | "nav select $1",
289 | ]
290 | },
291 | "为玩家创建导航": {
292 | "prefix": [
293 | "nav create",
294 | ],
295 | "description": "(QE私人动作)nav create target [location]",
296 | "body": [
297 | "nav create target location ${1:world} ${2:0} ${3:0} ${4:0}",
298 | ]
299 | },
300 | "播放导航(绿色粒子)": {
301 | "prefix": [
302 | "nav set start",
303 | ],
304 | "description": "(QE私人动作)nav set start",
305 | "body": [
306 | "nav select $1 nav set start",
307 | ]
308 | },
309 | "播放导航(指定粒子)": {
310 | "prefix": [
311 | "nav set start display",
312 | ],
313 | "description": "(QE私人动作)nav set start display [粒子类型]",
314 | "body": [
315 | "nav select $1 nav set start display $1",
316 | ]
317 | },
318 | // nav select gotortchillback
319 | // nav create target location world 236 74 222
320 | // nav set start display TOTEM
321 | // nav set stop
322 | "停止导航": {
323 | "prefix": [
324 | "nav set stop",
325 | ],
326 | "description": "(QE私人动作)nav set stop",
327 | "body": [
328 | "nav select $1 nav set stop",
329 | ]
330 | },
331 | "清除导航数据": {
332 | "prefix": [
333 | "nav set clear",
334 | ],
335 | "description": "(QE私人动作)nav set clear",
336 | "body": [
337 | "nav select $1 nav set clear",
338 | ]
339 | },
340 | "隐藏或显示玩家": {
341 | "prefix": [
342 | "hide player set",
343 | ],
344 | "description": "(QE私人动作)hide player set [true或false]",
345 | "body": [
346 | "hide player set ${1|true,false|}",
347 | ]
348 | },
349 | "WorldGuard判断位置是否在该区域": {
350 | "prefix": [
351 | "worldguard",
352 | ],
353 | "description": "(QE私人动作)worldguard [location] id [区域ID]",
354 | "body": [
355 | "worldguard ${1:world} ${2:0} ${3:0} ${4:0} id $5",
356 | ]
357 | },
358 | "给玩家附加药水效果": {
359 | "prefix": [
360 | "actionEffect select",
361 | ],
362 | "description": "(QE私人动作)actionEffect select [药水] time [时间,20等于1秒]",
363 | "body": [
364 | "actionEffect select ${1:药水|} time ${2:时间,20等于1秒|}",
365 | ]
366 | },
367 | "创建光照": {
368 | "prefix": [
369 | "light create",
370 | ],
371 | "description": "(QE私人动作)light create level [光照等级] where [location]",
372 | "body": [
373 | "light create level ${1:光照等级} where ${2:world} ${3:0} ${4:0} ${5:0}",
374 | ]
375 | },
376 | "删除光照": {
377 | "prefix": [
378 | "light delete",
379 | ],
380 | "description": "(QE私人动作)light delete where [location]",
381 | "body": [
382 | "light delete where ${1:world} ${2:0} ${3:0} ${4:0}",
383 | ]
384 | },
385 | "传送玩家": {
386 | "prefix": [
387 | "player location to",
388 | ],
389 | "description": "(QE私人动作)player location to [location]",
390 | "body": [
391 | "player location to ${1:world} ${2:0} ${3:0} ${4:0}",
392 | ]
393 | },
394 | }
--------------------------------------------------------------------------------
/snippets/taboolib/TabooLib-a.code-snippets:
--------------------------------------------------------------------------------
1 | //由 TabooLib 提供的公有动作
2 | {
3 | "获取或设置玩家的额外生命": {
4 | "prefix": ["absorption","player absorption amount"],
5 | "description": "(公有动作)player absorption amount [(add|to) {action}]",
6 | "body": [
7 | "player absorption amount $1",
8 | ]
9 | },
10 | "将动作的返回值作为动作栏信息发送给执行者。": {
11 | "prefix": "actionbar",
12 | "description": "(公有动作)actionbar {action}",
13 | "body": [
14 | "actionbar \"$1\"",
15 | ]
16 | },
17 | "判断动作列表的所有返回值是否均为是。": {
18 | "prefix": "alll",
19 | "description": "(公有动作)all {action list}",
20 | "body": [
21 | "all [ $1 ]",
22 | ]
23 | },
24 | "获取玩家的 IP 地址": {
25 | "prefix": ["address","player address"],
26 | "description": "(公有动作)player address",
27 | "body": [
28 | "player address",
29 | ]
30 | },
31 | "判断或修改玩家是否允许飞行": {
32 | "prefix": ["allow flight","player allow flight"],
33 | "description": "(公有动作)player allow flight [to {action}]",
34 | "body": [
35 | "player allow flight $1",
36 | ]
37 | },
38 | "判断动作列表的所有返回值是否含有是。": {
39 | "prefix": "any",
40 | "description": "(公有动作)any {action list}",
41 | "body": [
42 | "any [ $1 ]",
43 | ]
44 | },
45 | "将动作列表的所有返回值作为集合返回。": {
46 | "prefix": "array",
47 | "description": "(公有动作)array {action list}",
48 | "body": [
49 | "array [ $1 ]",
50 | ]
51 | },
52 | "在不受生命周期控制的异步计划中执行动作。\n当程序运行结束后,所有未完成的 #Async 动作会被直接关闭。": {
53 | "prefix": "async",
54 | "description": "(公有动作)async {action}",
55 | "body": [
56 | "async { sleep 1s $1 } $2",
57 | ]
58 | },
59 | "获取玩家的攻击冷却。": {
60 | "prefix": ["attack cooldown","player attack cooldown"],
61 | "description": "(公有动作)player attack cooldown",
62 | "body": [
63 | "player attack cooldown",
64 | ]
65 | },
66 | "等待动作完成。": {
67 | "prefix": "await",
68 | "description": "(公有动作)await {action}",
69 | "body": [
70 | "await $1",
71 | ]
72 | },
73 | "等待动作列表中的所有动作完成。": {
74 | "prefix": "await all",
75 | "description": "(公有动作)await_all {action list}",
76 | "body": [
77 | "await_all [ $1 sleep 1s ] $2",
78 | ]
79 | },
80 | "等待动作列表中的任意动作完成。": {
81 | "prefix": "await any",
82 | "description": "(公有动作)await_any {action list}",
83 | "body": [
84 | "await_any [ $1 sleep 1s ] $2",
85 | ]
86 | },
87 | "获取或修改玩家的出生点(床),需要对应方块材质为床。": {
88 | "prefix": ["Bed Spawn","player bed spawn"],
89 | "description": "(公有动作)player bed spawn [to {action}]",
90 | "body": [
91 | "player bed spawn",
92 | ]
93 | },
94 | "获取玩家出生点(床)的坐标轴。(x)": {
95 | "prefix": ["Bed Spawn x","player bed spawn x"],
96 | "description": "(公有动作)actionbar {action}",
97 | "body": [
98 | "player bed spawn x",
99 | ]
100 | },
101 | "获取玩家出生点(床)的坐标轴。(y)": {
102 | "prefix": ["Bed Spawn y","player bed spawn y"],
103 | "description": "(公有动作)actionbar {action}",
104 | "body": [
105 | "player bed spawn y",
106 | ]
107 | },
108 | "获取玩家出生点(床)的坐标轴。(z)": {
109 | "prefix": ["Bed Spawn z","player bed spawn z"],
110 | "description": "(公有动作)actionbar {action}",
111 | "body": [
112 | "player bed spawn z",
113 | ]
114 | },
115 | "判断玩家是否在格挡状态。": {
116 | "prefix": ["Blocking","player blocking"],
117 | "description": "(公有动作)player blocking",
118 | "body": [
119 | "player blocking",
120 | ]
121 | },
122 | "该方法用于在特定循环语句 (ForEach, Join, Map, While) 中使用,结束循环体。": {
123 | "prefix": "Break",
124 | "description": "(公有动作)break",
125 | "body": [
126 | "break",
127 | ]
128 | },
129 | "在 Shell 模式下该语句无任何意义。\n调用已声明的任何函数,包括 main 函数。": {
130 | "prefix": "Call",
131 | "description": "(公有动作)call {token}",
132 | "body": [
133 | "call $1",
134 | ]
135 | },
136 | "完整的选择语句需要包含至少一项选择分支, 也就是 when block。\n每个标准的选择分支由 when {条件} -> {表达式} 组成。\n也可使用 else {表达} 作为默认分支。": {
137 | "prefix": "case",
138 | "description": "(公有动作)case {aciton} [ {when block} ... ]",
139 | "body": [
140 | "case &$1 [when $2 -> $3 when $4 -> $5 else $6 ]",
141 | ]
142 | },
143 | "将两个动作的返回值进行对比,支持多种判定方式。(==)": {
144 | "prefix": "Check == (相等)",
145 | "description": "(公有动作)check {action} {symbol} {action}",
146 | "body": [
147 | "check $1 == $2",
148 | ]
149 | },
150 | "将两个动作的返回值进行对比,支持多种判定方式。(is)": {
151 | "prefix": "Check is (相等)",
152 | "description": "(公有动作)check {action} {symbol} {action}",
153 | "body": [
154 | "check $1 is $2",
155 | ]
156 | },
157 | "将两个动作的返回值进行对比,支持多种判定方式。(!=)": {
158 | "prefix": "Check != (不相等)",
159 | "description": "(公有动作)check {action} {symbol} {action}",
160 | "body": [
161 | "check $1 != $2",
162 | ]
163 | },
164 | "将两个动作的返回值进行对比,支持多种判定方式。(not)": {
165 | "prefix": "Check not (不相等)",
166 | "description": "(公有动作)check {action} {symbol} {action}",
167 | "body": [
168 | "check $1 not $2",
169 | ]
170 | },
171 | "将两个动作的返回值进行对比,支持多种判定方式。(=!)": {
172 | "prefix": "Check =! (相似等于)",
173 | "description": "(公有动作)check {action} {symbol} {action}",
174 | "body": [
175 | "check $1 != $2",
176 | ]
177 | },
178 | "将两个动作的返回值进行对比,支持多种判定方式。(is?)": {
179 | "prefix": "Check is? (相似等于)",
180 | "description": "(公有动作)check {action} {symbol} {action}",
181 | "body": [
182 | "check $1 is? $2",
183 | ]
184 | },
185 | "将两个动作的返回值进行对比,支持多种判定方式。(>)": {
186 | "prefix": "Check > (大于)",
187 | "description": "(公有动作)check {action} {symbol} {action}",
188 | "body": [
189 | "check $1 > $2",
190 | ]
191 | },
192 | "将两个动作的返回值进行对比,支持多种判定方式。(gt)": {
193 | "prefix": "Check gt (大于)",
194 | "description": "(公有动作)check {action} {symbol} {action}",
195 | "body": [
196 | "check $1 gt $2",
197 | ]
198 | },
199 | "将两个动作的返回值进行对比,支持多种判定方式。(>=)": {
200 | "prefix": "Check >= (大于等于)",
201 | "description": "(公有动作)check {action} {symbol} {action}",
202 | "body": [
203 | "check $1 >= $2",
204 | ]
205 | },
206 | "将两个动作的返回值进行对比,支持多种判定方式。(<)": {
207 | "prefix": "Check < (小于)",
208 | "description": "(公有动作)check {action} {symbol} {action}",
209 | "body": [
210 | "check $1 < $2",
211 | ]
212 | },
213 | "将两个动作的返回值进行对比,支持多种判定方式。(lt)": {
214 | "prefix": "Check lt (小于)",
215 | "description": "(公有动作)check {action} {symbol} {action}",
216 | "body": [
217 | "check $1 lt $2",
218 | ]
219 | },
220 | "将两个动作的返回值进行对比,支持多种判定方式。(<=)": {
221 | "prefix": "Check <= (小于等于)",
222 | "description": "(公有动作)check {action} {symbol} {action}",
223 | "body": [
224 | "check $1 <= $2",
225 | ]
226 | },
227 | "将动作的返回值作为命令执行,默认以玩家为执行者。": {
228 | "prefix": "Command",
229 | "description": "(公有动作)command {action} [as (console|player|op)]",
230 | "body": [
231 | "command \"$1\"",
232 | ]
233 | },
234 | "替换动作的返回值中所有颜色代码。\n支持由 TabooLib 提供的高级颜色代码。": {
235 | "prefix": "ColorText",
236 | "description": "(公有动作)color[ed] {action}",
237 | "body": [
238 | "color",
239 | ]
240 | },
241 | "获取或修改玩家的指南针目标。": {
242 | "prefix": ["Compass Target","player compass target"],
243 | "description": "(公有动作)player compass target [to {action}]",
244 | "body": [
245 | "player compass target",
246 | ]
247 | },
248 | "获取玩家指南针目标的坐标轴。(x)": {
249 | "prefix": ["Compass X","player compass x"],
250 | "description": "(公有动作)player compass (x|y|z)",
251 | "body": [
252 | "player compass x",
253 | ]
254 | },
255 | "获取玩家指南针目标的坐标轴。(y)": {
256 | "prefix": ["Compass Y","player compass y"],
257 | "description": "(公有动作)player compass (x|y|z)",
258 | "body": [
259 | "player compass y",
260 | ]
261 | },
262 | "获取玩家指南针目标的坐标轴。(z)": {
263 | "prefix": ["Compass Z","plplayer compass zayer"],
264 | "description": "(公有动作)player compass (x|y|z)",
265 | "body": [
266 | "player compass z",
267 | ]
268 | },
269 | "(用于查看可交谈对象的测试积极参与对话。返回:如果对话正在进行,则为 True)Tests to see of a Conversable object is actively engaged in a conversation.\nReturns:\nTrue if a conversation is in progress": {
270 | "prefix": ["Conversing","player conversing"],
271 | "description": "(公有动作)player conversing",
272 | "body": [
273 | "player conversing",
274 | ]
275 | },
276 | "本年、本月、本周中的天数。年:(1 ~ 365)": {
277 | "prefix": "Date year (本年天数)",
278 | "description": "(公有动作)day of (year|month|week)",
279 | "body": [
280 | "day in year",
281 | ]
282 | },
283 | "本年、本月、本周中的天数。月:(1 ~ 31)": {
284 | "prefix": "Date month (本月天数)",
285 | "description": "(公有动作)day of (year|month|week)",
286 | "body": [
287 | "day in month",
288 | ]
289 | },
290 | "本年、本月、本周中的天数。周:(1 ~ 7)": {
291 | "prefix": "Date week (本周天数)",
292 | "description": "(公有动作)day of (year|month|week)",
293 | "body": [
294 | "day in week",
295 | ]
296 | },
297 | "当前小时(0 ~ 23)。": {
298 | "prefix": "Date hour (当前小时)",
299 | "description": "(公有动作)hour[s]",
300 | "body": [
301 | "hour",
302 | ]
303 | },
304 | "当前分钟(0 ~ 59)。": {
305 | "prefix": "Date minute (当前分钟)",
306 | "description": "(公有动作)minute[s]",
307 | "body": [
308 | "minute",
309 | ]
310 | },
311 | "当前月份(1 ~ 12)。": {
312 | "prefix": "Date month (当前月)",
313 | "description": "(公有动作)playerblocking",
314 | "body": [
315 | "month",
316 | ]
317 | },
318 | "当前秒(0 ~ 59)。": {
319 | "prefix": "Date second (当前秒)",
320 | "description": "(公有动作)second[s]",
321 | "body": [
322 | "second",
323 | ]
324 | },
325 | "当前年份(MIN_YEAR ~ MAX_YEAR)。": {
326 | "prefix": "Date year (当前年)",
327 | "description": "(公有动作)year[s]",
328 | "body": [
329 | "year",
330 | ]
331 | },
332 | "判断玩家是否死亡。": {
333 | "prefix": ["dead","player dead"],
334 | "description": "(公有动作)player dead",
335 | "body": [
336 | "player dead",
337 | ]
338 | },
339 | "将动作的返回值作为列表获取指定元素。": {
340 | "prefix": "Element",
341 | "description": "(公有动作)element {action} of {action}",
342 | "body": [
343 | "element $1 of $2",
344 | ]
345 | },
346 | "获取或修改玩家的疲劳度。": {
347 | "prefix": ["Exhaustion","player exhaustion"],
348 | "description": "(公有动作)player exhaustion [(add|to) {action}]",
349 | "body": [
350 | "player exhaustion",
351 | ]
352 | },
353 | "退出程序。": {
354 | "prefix": "Exit",
355 | "description": "(公有动作)exit (success|pause|cooldown)",
356 | "body": [
357 | "exit success",
358 | ]
359 | },
360 | "获取或修改玩家的经验相关数据,只有 player exp 允许修改。": {
361 | "prefix": ["Exp","player exp"],
362 | "description": "(公有动作)player exp [until next level|at level|to level] [(add|to) {action}]",
363 | "body": [
364 | "player exp",
365 | ]
366 | },
367 | "返回玩家的首次游戏时间。": {
368 | "prefix": ["First Played","player first played"],
369 | "description": "(公有动作)player first played",
370 | "body": [
371 | "player first played",
372 | ]
373 | },
374 | "获取或修改玩家的飞行速度。": {
375 | "prefix": ["SpeedFly(飞行)","player fly speed"],
376 | "description": "(公有动作)player fly speed [(add|to) {action}]",
377 | "body": [
378 | "player fly speed",
379 | ]
380 | },
381 | "获取或修改玩家的移动速度。": {
382 | "prefix": ["Speedwalk(移动)","player walk speed"],
383 | "description": "(公有动作)player walk speed [(add|to) {action}]",
384 | "body": [
385 | "player walk speed",
386 | ]
387 | },
388 | "判断或修改玩家是否在飞行状态。": {
389 | "prefix": ["Flying","player flying"],
390 | "description": "(公有动作)player flying [to {action}]",
391 | "body": [
392 | "player flying",
393 | ]
394 | },
395 | "获取或修改玩家的饥饿值": {
396 | "prefix": ["Food Level","player food level"],
397 | "description": "(公有动作)player food level [(add|to) {action}]",
398 | "body": [
399 | "player food level",
400 | ]
401 | },
402 | "遍历第一个动作的返回值中所有成员,并作为临时变量传入第二个动作。": {
403 | "prefix": "ForEach",
404 | "description": "(公有动作)for {token} in {action} then {action}",
405 | "body": [
406 | "for $1 in $2 then { $3 }",
407 | ]
408 | },
409 | "使用特定的方式格式化特定的时间。": {
410 | "prefix": "Format Time",
411 | "description": "(公有动作)format {action} (by|with) {token}",
412 | "body": [
413 | "format time with \"yyyy-MM-dd HH:mm\"",
414 | ]
415 | },
416 | "获取或修改玩家的游戏模式。": {
417 | "prefix": ["GameMode","player gamemode"],
418 | "description": "(公有动作)可用模式:\t生存:SURVIVAL, 0\n创造:CREATIVE, 1\n冒险:ADVENTURE, 2\n观察:SPECTATOR, 3\nplayer gamemode [to {action}]",
419 | "body": [
420 | "player gamemode",
421 | ]
422 | },
423 | "判断或修改玩家是否在滑翔状态。": {
424 | "prefix": ["Gliding","player gliding"],
425 | "description": "(公有动作)player gliding [to {action}]",
426 | "body": [
427 | "player gliding",
428 | ]
429 | },
430 | "判断或修改玩家是否在发光状态。": {
431 | "prefix": ["Glowing","player glowing"],
432 | "description": "(公有动作)player glowing [to {action}]",
433 | "body": [
434 | "player glowing",
435 | ]
436 | },
437 | "在 Shell 模式下该语句无任何意义。\n跳转到已声明的任何函数,包括 main 函数。": {
438 | "prefix": "Goto",
439 | "description": "(公有动作)goto {token}",
440 | "body": [
441 | "goto ",
442 | ]
443 | },
444 | "判断或修改玩家是否拥有重力。": {
445 | "prefix": ["Gravity","player gravity"],
446 | "description": "(公有动作)player gravity [(add|to) {action}]",
447 | "body": [
448 | "player gravity",
449 | ]
450 | },
451 | "获取或修改玩家的生命。": {
452 | "prefix": ["Health","player health"],
453 | "description": "(公有动作)player [ max ]health [(add|to) {action}]",
454 | "body": [
455 | "player health",
456 | ]
457 | },
458 | "获取或修改玩家的最大生命。": {
459 | "prefix": ["MaxHealth","player maxhealth"],
460 | "description": "(公有动作)player maxhealth [(add|to) {action}]",
461 | "body": [
462 | "player maxhealth",
463 | ]
464 | },
465 | "当一个动作的返回值为是时,执行第二个动作,反之执行第三个动作。": {
466 | "prefix": "If & Else",
467 | "description": "(公有动作)If {action} then {action} [else {action}]",
468 | "body": [
469 | "if $1 then { $2 } else { $3 }",
470 | ]
471 | },
472 | "替换动作的返回值中所有内联脚本。内联脚本指在字符串中使用 {{ ... }} 插入脚本代码。": {
473 | "prefix": "Inline",
474 | "description": "(公有动作)inline {action} | function {action}",
475 | "body": [
476 | "inline",
477 | ]
478 | },
479 | "判断玩家是否在载具中。": {
480 | "prefix": ["Inside Vehicle","player inside vehicle"],
481 | "description": "(公有动作)player inside vehicle",
482 | "body": [
483 | "player inside vehicle",
484 | ]
485 | },
486 | "运行 JavaScript 代码,并返回结果。": {
487 | "prefix": "JavaScript",
488 | "description": "(公有动作)并传入当前程序的所有变量,以及事件 (event)、执行者 (sender)、服务器 (server)。",
489 | "body": [
490 | "javascript ",
491 | ]
492 | },
493 | "将动作列表的所有返回值合并为字符串返回,默认使用空格作为分隔。": {
494 | "prefix": "Join",
495 | "description": "(公有动作)join {action list} [by {token}]",
496 | "body": [
497 | "join [ $1 ]",
498 | ]
499 | },
500 | "判断或修改玩家是否在跳跃状态。 ": {
501 | "prefix": ["Jumping","player jumping"],
502 | "description": "(公有动作)player jumping [to {action}]",
503 | "body": [
504 | "player jumping",
505 | ]
506 | },
507 | "返回玩家的最后游戏、登陆时间": {
508 | "prefix": ["Last Played","player last login"],
509 | "description": "(公有动作)player last (played|login)",
510 | "body": [
511 | "player last login",
512 | ]
513 | },
514 | "(返回实体当前是否被束缚。)Returns whether the entity is currently leashed.": {
515 | "prefix": ["Leashed","player leashed"],
516 | "description": "(公有动作)player leashed",
517 | "body": [
518 | "player leashed",
519 | ]
520 | },
521 | "获取或修改玩家的等级。": {
522 | "prefix": ["Level","player level"],
523 | "description": "(公有动作)player level [(add|to) {action}]",
524 | "body": [
525 | "player level",
526 | ]
527 | },
528 | "创建并返回一个字符串。当字符串中存在空格时需将内容写在双引号或单引号中,若内容中不含空格则允许省略引号": {
529 | "prefix": "Literal",
530 | "description": "(公有动作)注意:即使是 literal 100 也并非整数类型,如有需要请使用 #Type 动作。literal {token} | {token}",
531 | "body": [
532 | "literal",
533 | ]
534 | },
535 | "获取玩家的客户端语言。": {
536 | "prefix": ["Locale","player locale"],
537 | "description": "(公有动作)player locale",
538 | "body": [
539 | "player locale",
540 | ]
541 | },
542 | "构建一个坐标": {
543 | "prefix": "Location",
544 | "description": "(公有动作)location {action} {action} {action} {action} [and {action} {action}]",
545 | "body": [
546 | "location ${1:world} ${2:0} ${3:0} ${4:0}",
547 | ]
548 | },
549 | "获取或修改玩家的角度。": {
550 | "prefix": ["Location Angle","player yaw"],
551 | "description": "(公有动作)player (yaw|pitch) [(add|to) {action}]",
552 | "body": [
553 | "player yaw",
554 | ]
555 | },
556 | "(X)获取玩家的坐标轴。使用 block 则返回整数(方块)坐标。": {
557 | "prefix": ["Location X","player x"],
558 | "description": "(公有动作)player [block ](x|y|z)",
559 | "body": [
560 | "player x",
561 | ]
562 | },
563 | "(Y)获取玩家的坐标轴。使用 block 则返回整数(方块)坐标。": {
564 | "prefix": ["Location Y","player y"],
565 | "description": "(公有动作)player [ block ](x|y|z)",
566 | "body": [
567 | "player y",
568 | ]
569 | },
570 | "(Z)获取玩家的坐标轴。使用 block 则返回整数(方块)坐标。": {
571 | "prefix": ["Location Z","player z"],
572 | "description": "(公有动作)player [block ](x|y|z)",
573 | "body": [
574 | "player z",
575 | ]
576 | },
577 | "(X)获取玩家的坐标轴返回整数(方块)坐标。": {
578 | "prefix": ["LocationBlock X","player block x"],
579 | "description": "(公有动作)player block (x|y|z)",
580 | "body": [
581 | "player block x",
582 | ]
583 | },
584 | "(Y)获取玩家的坐标轴返回整数(方块)坐标。": {
585 | "prefix": ["LocationBlock Y","player block y"],
586 | "description": "(公有动作)player block (x|y|z)",
587 | "body": [
588 | "player block y",
589 | ]
590 | },
591 | "(Z)获取玩家的坐标轴返回整数(方块)坐标。": {
592 | "prefix": ["LocationBlock Z","player block z"],
593 | "description": "(公有动作)player block (x|y|z)",
594 | "body": [
595 | "player block z",
596 | ]
597 | },
598 | "遍历第一个动作的返回值中所有成员,并作为临时变量传入第二个动作。最终将所有第二个动作的返回值作为集合返回。与 #ForEach 动作不同的是,#Map 则会整理每一次非空的处理结果。": {
599 | "prefix": "Map",
600 | "description": "(公有动作)map {token} in {action} with {action}",
601 | "body": [
602 | "map $1 in $2 with $3",
603 | ]
604 | },
605 | "使用数学运算符处理动作列表的所有返回值。(加)": {
606 | "prefix": "Math(加)",
607 | "description": "(公有动作)math {symbol} {action list}",
608 | "body": [
609 | "math add [ $1 ]",
610 | ]
611 | },
612 | "使用数学运算符处理动作列表的所有返回值。(减)": {
613 | "prefix": "Math(减)",
614 | "description": "(公有动作)math {symbol} {action list}",
615 | "body": [
616 | "math sub [ $1 ]",
617 | ]
618 | },
619 | "使用数学运算符处理动作列表的所有返回值。(乘)": {
620 | "prefix": "Math(乘)",
621 | "description": "(公有动作)math {symbol} {action list}",
622 | "body": [
623 | "math mul [ $1 ]",
624 | ]
625 | },
626 | "使用数学运算符处理动作列表的所有返回值。(除)": {
627 | "prefix": "Math(除)",
628 | "description": "(公有动作)math {symbol} {action list}",
629 | "body": [
630 | "math div [ $1 ]",
631 | ]
632 | },
633 | "获取玩家的列表名称。": {
634 | "prefix": ["NameList","player list name"],
635 | "description": "(公有动作)player [(display|list) ] name",
636 | "body": [
637 | "player list name",
638 | ]
639 | },
640 | "获取玩家的展示名称。": {
641 | "prefix": ["NameDisplay","player display name"],
642 | "description": "(公有动作)player [(display|list) ] name",
643 | "body": [
644 | "player display name",
645 | ]
646 | },
647 | "获取玩家的游戏名称": {
648 | "prefix": ["name","player name"],
649 | "description": "(公有动作)player [(display|list) ] name",
650 | "body": [
651 | "player name",
652 | ]
653 | },
654 | "获取或修改玩家的无敌时间。": {
655 | "prefix": ["No Damage Ticks","player no damage ticks"],
656 | "description": "(公有动作)player no damage ticks [(add|to) {action}]",
657 | "body": [
658 | "player no damage ticks",
659 | ]
660 | },
661 | "判断动作的返回值是否为否,即否定动作的结果。": {
662 | "prefix": "Not",
663 | "description": "(公有动作)not {action}",
664 | "body": [
665 | "not $1",
666 | ]
667 | },
668 | "返回一个空值。": {
669 | "prefix": "Null",
670 | "description": "(公有动作)null",
671 | "body": [
672 | "null",
673 | ]
674 | },
675 | "判断玩家是否在地面上,该数据由客户端返回,可能会被篡改。": {
676 | "prefix": ["On Ground","player on ground"],
677 | "description": "(公有动作)player on ground",
678 | "body": [
679 | "player on ground",
680 | ]
681 | },
682 | "判断或修改玩家是否为 OP 权限。": {
683 | "prefix": ["Op","player op"],
684 | "description": "(公有动作)player op [to {action}]",
685 | "body": [
686 | "player op",
687 | ]
688 | },
689 | "对动作的返回值进行非空判断。": {
690 | "prefix": "Optional",
691 | "description": "(公有动作)optional {action} else {action}",
692 | "body": [
693 | "optional $1 else $2",
694 | ]
695 | },
696 | "返回一个空字符串。": {
697 | "prefix": "Pass",
698 | "description": "(公有动作)pass",
699 | "body": [
700 | "pass",
701 | ]
702 | },
703 | "使程序的生命周期强制暂停,该操作不可被撤销,直到程序关闭。": {
704 | "prefix": "Pause",
705 | "description": "(公有动作)pause",
706 | "body": [
707 | "pause",
708 | ]
709 | },
710 | "将动作的返回值作为权限判断执行者是否持有该权限。": {
711 | "prefix": "Permission",
712 | "description": "(公有动作)perm[ission] {action}",
713 | "body": [
714 | "perm $1",
715 | ]
716 | },
717 | "替换动作的返回值中所有 PlaceholderAPI 变量。": {
718 | "prefix": "PlaceholderAPI",
719 | "description": "(公有动作)papi {action} | placeholder {action}",
720 | "body": [
721 | "papi \"%$1%\"",
722 | ]
723 | },
724 | "将动作的返回值作为信息发送给控制台。": {
725 | "prefix": "Print",
726 | "description": "(公有动作)print {action} | log {action}",
727 | "body": [
728 | "print \"$1\"",
729 | ]
730 | },
731 | "在一定的范围内随机返回一个浮点数或整数,相比于 #random,这个范围由动作的返回值表示。": {
732 | "prefix": "Random2",
733 | "description": "(公有动作)random2 {MIN} to {MAX}",
734 | "body": [
735 | "random2 $1 to $2",
736 | ]
737 | },
738 | "(A to B)在一定的范围内随机返回一个浮点数,或从动作的返回值中随机返回一个成员。在定义范围时可以省略第二个参数来选定 0 ~ 范围。": {
739 | "prefix": "Random",
740 | "description": "(公有动作)random {double} [to {double}] | random {action}",
741 | "body": [
742 | "random $1 to $2",
743 | ]
744 | },
745 | "([ 1 2 3 ])在一定的范围内随机返回一个浮点数,或从动作的返回值中随机返回一个成员。在定义范围时可以省略第二个参数来选定 0 ~ 范围。": {
746 | "prefix": "Random",
747 | "description": "(公有动作)random {double} [to {double}] | random {action}",
748 | "body": [
749 | "random [ $1 ]",
750 | ]
751 | },
752 | "创建一组数字集合,当你省略步长或使用整型作为步长时,则创建的是整型集合,反之创建浮点数集合。集合的类型取决于步长的类型,而不是范围数字类型。": {
753 | "prefix": "Range",
754 | "description": "(公有动作)plarange {number} to {number} [step {number}]",
755 | "body": [
756 | "range $1 to $2",
757 | ]
758 | },
759 | "获取或修改玩家的氧气。": {
760 | "prefix": ["Remaining Air","player remaining air"],
761 | "description": "(公有动作)player remaining air [(add|to) {action}]",
762 | "body": [
763 | "player remaining air",
764 | ]
765 | },
766 | "重复一个动作数次。": {
767 | "prefix": "Repeat",
768 | "description": "(公有动作)repeat {int} {action}",
769 | "body": [
770 | "repeat $1 $2",
771 | ]
772 | },
773 | "判断玩家是否在激流(三叉戟)状态。": {
774 | "prefix": ["Riptiding","player riptiding"],
775 | "description": "(公有动作)player riptiding",
776 | "body": [
777 | "player riptiding",
778 | ]
779 | },
780 | "将动作的返回值作为浮点数并四舍五入为最接近的整数。": {
781 | "prefix": "Round",
782 | "description": "(公有动作)round {action}",
783 | "body": [
784 | "round $1",
785 | ]
786 | },
787 | "获取或修改玩家的饱食度。": {
788 | "prefix": ["Saturation","player saturation"],
789 | "description": "(公有动作)player saturation [(add|to) {action}]",
790 | "body": [
791 | "player saturation",
792 | ]
793 | },
794 | "将动作的返回值作为浮点数并保留小数点后两位。": {
795 | "prefix": "Scaled",
796 | "description": "(公有动作)scale[d] {action}",
797 | "body": [
798 | "scale $1",
799 | ]
800 | },
801 | "将动作的返回值作为列表获取其长度。": {
802 | "prefix": "Size",
803 | "description": "(公有动作)size {action}",
804 | "body": [
805 | "size range $1 to $2",
806 | ]
807 | },
808 | "堵塞工作线程特定时间段。": {
809 | "prefix": "Sleep",
810 | "description": "(公有动作)(sleep|delay|wait) {duration}",
811 | "body": [
812 | "sleep $1",
813 | ]
814 | },
815 | "返回玩家是否处于睡眠状态。设置是否忽略玩家作为不睡眠。如果每个人都在睡觉或设置了这个标志,那么时间将提前到第二天。如果每个人都设置了这个旗帜,但实际上没有人在床上,那么什么都不会发生。": {
816 | "prefix": ["Sleep Ignored","player sleep ignored"],
817 | "description": "(公有动作)player sleep ignored [to {action}]",
818 | "body": [
819 | "player sleep ignored",
820 | ]
821 | },
822 | "返回玩家的睡眠时间。": {
823 | "prefix": ["Sleep Ticks","player sleep ticks"],
824 | "description": "(公有动作)player sleep ticks",
825 | "body": [
826 | "player sleep ticks",
827 | ]
828 | },
829 | "判断玩家是否在潜行状态。": {
830 | "prefix": ["Sneaking","player sneaking"],
831 | "description": "(公有动作)player sneaking",
832 | "body": [
833 | "player sneaking",
834 | ]
835 | },
836 | "将文本作为音效播放,默认音量与音调均为 1.0。使用 \"resource:\" 作为前缀则播放资源包中的音效。": {
837 | "prefix": "Sound",
838 | "description": "(公有动作)sound {token} [by {double} {double}]",
839 | "body": [
840 | "sound $1",
841 | ]
842 | },
843 | "对动作的返回值作为字符串切片并返回。": {
844 | "prefix": "Split",
845 | "description": "(公有动作)split {action} [with {token}]",
846 | "body": [
847 | "split \"$1\" with \"$1\"",
848 | ]
849 | },
850 | "判断玩家是否在疾跑状态。": {
851 | "prefix": ["Sprinting","player sprinting"],
852 | "description": "(公有动作)player sprinting",
853 | "body": [
854 | "player sprinting",
855 | ]
856 | },
857 | "将动作的返回值作为副标题信息发送给执行者,默认的淡入淡出、停留、时间为0、20、0。": {
858 | "prefix": "Subtitle",
859 | "description": "(公有动作)subtitle {action} [by {int} {int} {int}]",
860 | "body": [
861 | "subtitle \"$1\" by ${2:0} ${3:20} ${4:0}",
862 | ]
863 | },
864 | "判断或修改玩家是否在游泳状态。": {
865 | "prefix": ["Swimming","player swimming"],
866 | "description": "(公有动作)player swimming [(add|to) {action}]",
867 | "body": [
868 | "player swimming",
869 | ]
870 | },
871 | "切换当前观察者到特定玩家。": {
872 | "prefix": "Switch",
873 | "description": "(公有动作)switch {action}",
874 | "body": [
875 | "switch $1",
876 | ]
877 | },
878 | "将动作的返回值作为信息发送给执行者。": {
879 | "prefix": "Tell",
880 | "description": "(公有动作)tell {action} | send {action} | message {action}",
881 | "body": [
882 | "tell \"$1\"",
883 | ]
884 | },
885 | "使用特定的方式格式化当前系统时间。": {
886 | "prefix": "Time Format",
887 | "description": "(公有动作)time as {token} | date as {token}",
888 | "body": [
889 | "date as \"yyyy-MM-dd HH:mm:ss\"",
890 | ]
891 | },
892 | "将动作的返回值作为标题信息发送给执行者,默认的淡入淡出、停留、时间为0、20、0。": {
893 | "prefix": "Title",
894 | "description": "(公有动作)title {action} [subtitle {action}] [by {int} {int} {int}]",
895 | "body": [
896 | "title \"$1\"",
897 | ]
898 | },
899 | "将动作的返回值作为成就信息发送给执行者。支持列表作为动作的返回值。(※需要服务端版本高于 1.13)": {
900 | "prefix": "Toast",
901 | "description": "(公有动作)toast {material} {action} [(by|with) (task|goal|challenge)]",
902 | "body": [
903 | "toast $1 \"$2\" by ${3:challenge}",
904 | ]
905 | },
906 | "创建并返回一个最接近的字符串、整型、长整型、浮点数 或 布尔值。当字符串中存在空格时需将内容写在双引号或单引号中,若内容中不含空格则允许省略引号。或使用指定类型进行格式化(以动作作为参数):int, long, float, double, boolean": {
907 | "prefix": "Type",
908 | "description": "(公有动作)type {token} | type {type} {action}",
909 | "body": [
910 | "type $1",
911 | ]
912 | },
913 | "获取变量。": {
914 | "prefix": "get",
915 | "description": "(公有动作)get {token}",
916 | "body": [
917 | "get $1",
918 | ]
919 | },
920 | "获取变量。(&)": {
921 | "prefix": "&",
922 | "description": "(公有动作)&{token}",
923 | "body": [
924 | "&$1",
925 | ]
926 | },
927 | "将变量设置为基本类型或一个动作的返回值。": {
928 | "prefix": "Set",
929 | "description": "(公有动作)set {token} {token}",
930 | "body": [
931 | "set $1 $2",
932 | ]
933 | },
934 | "将变量设置为基本类型或一个动作的返回值": {
935 | "prefix": "Set",
936 | "description": "(公有动作)set {token} to {action}",
937 | "body": [
938 | "set $1 to $2",
939 | ]
940 | },
941 | "将所有变量的节点合并字符串列表返回。": {
942 | "prefix": "Variables",
943 | "description": "(公有动作)vars | variables",
944 | "body": [
945 | "vars",
946 | ]
947 | },
948 | "将动作的返回值作为警告发送给控制台。": {
949 | "prefix": "Warning",
950 | "description": "(公有动作)warn[ing] {action}",
951 | "body": [
952 | "warning \"$1\"",
953 | ]
954 | },
955 | "当一个动作的返回值为是时,重复第二个动作直到第一个动作的的返回值为否。": {
956 | "prefix": "While",
957 | "description": "(公有动作)while {action} then {action}",
958 | "body": [
959 | "while $1 then $2",
960 | ]
961 | },
962 | "判断或修改玩家是否在白名单中。": {
963 | "prefix": ["Whitelist","player whitelist"],
964 | "description": "(公有动作)player whitelist [to {action}]",
965 | "body": [
966 | "player whitelist",
967 | ]
968 | },
969 | "获取玩家的当前所在世界名称。": {
970 | "prefix": ["World","player world"],
971 | "description": "(公有动作)player world",
972 | "body": [
973 | "player world",
974 | ]
975 | },
976 | "改变为真": {
977 | "prefix": "to true",
978 | "body": [
979 | "to true",
980 | ]
981 | },
982 | "改变为假": {
983 | "prefix": "to false",
984 | "description": "(公有动作)to false",
985 | "body": [
986 | "to false",
987 | ]
988 | },
989 | "作为控制台": {
990 | "prefix": "as console",
991 | "description": "(公有动作)as (console|player|op)",
992 | "body": [
993 | "as console",
994 | ]
995 | },
996 | "作为玩家": {
997 | "prefix": "as player",
998 | "description": "(公有动作)as (console|player|op)",
999 | "body": [
1000 | "as player",
1001 | ]
1002 | },
1003 | "作为OP": {
1004 | "prefix": "as op",
1005 | "description": "(公有动作)as (console|player|op)",
1006 | "body": [
1007 | "as op",
1008 | ]
1009 | },
1010 |
1011 |
1012 | }
--------------------------------------------------------------------------------
/src/extension.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3 | if (k2 === undefined) k2 = k;
4 | var desc = Object.getOwnPropertyDescriptor(m, k);
5 | if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6 | desc = { enumerable: true, get: function() { return m[k]; } };
7 | }
8 | Object.defineProperty(o, k2, desc);
9 | }) : (function(o, m, k, k2) {
10 | if (k2 === undefined) k2 = k;
11 | o[k2] = m[k];
12 | }));
13 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14 | Object.defineProperty(o, "default", { enumerable: true, value: v });
15 | }) : function(o, v) {
16 | o["default"] = v;
17 | });
18 | var __importStar = (this && this.__importStar) || function (mod) {
19 | if (mod && mod.__esModule) return mod;
20 | var result = {};
21 | if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22 | __setModuleDefault(result, mod);
23 | return result;
24 | };
25 | Object.defineProperty(exports, "__esModule", { value: true });
26 | exports.activate = void 0;
27 | const vscode = __importStar(require("vscode"));
28 | // class YamlDefinitionProvider implements vscode.DefinitionProvider {
29 | // provideDefinition(
30 | // document: vscode.TextDocument,
31 | // position: vscode.Position,
32 | // token: vscode.CancellationToken
33 | // ): vscode.ProviderResult {
34 | // const word = document.getText(document.getWordRangeAtPosition(position));
35 | // if (path.extname(word) === '.yml') {
36 | // const workspaceFolder = vscode.workspace.getWorkspaceFolder(document.uri);
37 | // if (workspaceFolder) {
38 | // const definitionPath = path.join(workspaceFolder.uri.fsPath, word);
39 | // const uri = vscode.Uri.file(definitionPath);
40 | // const location = new vscode.Location(uri, new vscode.Position(0, 0));
41 | // return location;
42 | // }
43 | // }
44 | // }
45 | // }
46 | function formatKetherCode(code) {
47 | const lines = code.split(/\r?\n/);
48 | const formattedLines = lines.map((line) => {
49 | // 检测行的原始缩进(tab 数量)
50 | const originalIndentMatch = line.match(/^\s*/);
51 | const originalIndent = originalIndentMatch ? originalIndentMatch[0] : '';
52 | // 去除行首的缩进后剩余部分进行处理
53 | let lineContent = line.substr(originalIndent.length);
54 | if (lineContent.startsWith('#') || lineContent.trim() === '') {
55 | // 对注释或空行不做处理,只保留缩进
56 | return originalIndent + lineContent;
57 | }
58 | // 保证字符串两侧有空格
59 | lineContent = lineContent.replace(/("[^"]*")/g, ' $1 ');
60 | // 保证括号两侧有空格
61 | lineContent = lineContent.replace(/(\[|\])/g, ' $1 ');
62 | // 确保操作符两侧有空格
63 | lineContent = lineContent.replace(/(math\s+(add|sub|mul|div))\s+\[/g, '$1 [ ');
64 | // 确保关键字两侧有空格,同时忽略了之前关键字后面的 inline
65 | lineContent = lineContent.replace(/(def|script\s+(run|stop)|check|for|break|call|actionbar|subtitle|title)\b/g, '$1 ');
66 | // 修正 while 关键字的空格问题
67 | lineContent = lineContent.replace(/(\bwhile\b)\s+(?!as)/g, '$1 ');
68 | // 规范化空格,但避免删除命令行中的空格
69 | lineContent = lineContent.replace(/(? {
93 | if (files.length > 0) {
94 | const fileUri = files[0];
95 | vscode.workspace.openTextDocument(fileUri).then(doc => {
96 | vscode.window.showTextDocument(doc);
97 | }, err => {
98 | console.error('Error opening file:', err);
99 | vscode.window.showErrorMessage(`无法打开文件: ${fileUri.fsPath}`);
100 | });
101 | }
102 | else {
103 | vscode.window.showErrorMessage(`没有找到文件: ${word}`);
104 | }
105 | }, err => {
106 | console.error('Error searching files:', err);
107 | vscode.window.showErrorMessage(`搜索文件时出错: ${word}`);
108 | });
109 | }
110 | else {
111 | vscode.window.showErrorMessage('当前没有打开的编辑器。');
112 | }
113 | });
114 | context.subscriptions.push(disposable, vscode.languages.registerDocumentFormattingEditProvider('kether', {
115 | provideDocumentFormattingEdits(document) {
116 | const formattedCode = formatKetherCode(document.getText());
117 | const entireRange = new vscode.Range(document.positionAt(0), document.positionAt(document.getText().length));
118 | return [vscode.TextEdit.replace(entireRange, formattedCode)];
119 | },
120 | }));
121 | }
122 | exports.activate = activate;
123 |
--------------------------------------------------------------------------------
/src/extension.ts:
--------------------------------------------------------------------------------
1 | import * as vscode from 'vscode';
2 | import * as path from 'path';
3 |
4 | // class YamlDefinitionProvider implements vscode.DefinitionProvider {
5 | // provideDefinition(
6 | // document: vscode.TextDocument,
7 | // position: vscode.Position,
8 | // token: vscode.CancellationToken
9 | // ): vscode.ProviderResult {
10 | // const word = document.getText(document.getWordRangeAtPosition(position));
11 | // if (path.extname(word) === '.yml') {
12 | // const workspaceFolder = vscode.workspace.getWorkspaceFolder(document.uri);
13 | // if (workspaceFolder) {
14 | // const definitionPath = path.join(workspaceFolder.uri.fsPath, word);
15 | // const uri = vscode.Uri.file(definitionPath);
16 | // const location = new vscode.Location(uri, new vscode.Position(0, 0));
17 | // return location;
18 | // }
19 | // }
20 | // }
21 | // }
22 |
23 | function formatKetherCode(code: string): string {
24 | const lines = code.split(/\r?\n/);
25 | const formattedLines = lines.map((line) => {
26 | // 检测行的原始缩进(tab 数量)
27 | const originalIndentMatch = line.match(/^\s*/);
28 | const originalIndent = originalIndentMatch ? originalIndentMatch[0] : '';
29 |
30 | // 去除行首的缩进后剩余部分进行处理
31 | let lineContent = line.substr(originalIndent.length);
32 |
33 | if (lineContent.startsWith('#') || lineContent.trim() === '') {
34 | // 对注释或空行不做处理,只保留缩进
35 | return originalIndent + lineContent;
36 | }
37 |
38 | // 保证字符串两侧有空格
39 | lineContent = lineContent.replace(/("[^"]*")/g, ' $1 ');
40 |
41 | // 保证括号两侧有空格
42 | lineContent = lineContent.replace(/(\[|\])/g, ' $1 ');
43 |
44 | // 确保操作符两侧有空格
45 | lineContent = lineContent.replace(/(math\s+(add|sub|mul|div))\s+\[/g, '$1 [ ');
46 |
47 | // 确保关键字两侧有空格,同时忽略了之前关键字后面的 inline
48 | lineContent = lineContent.replace(/(def|script\s+(run|stop)|check|for|break|call|actionbar|subtitle|title)\b/g, '$1 ');
49 |
50 | // 修正 while 关键字的空格问题
51 | lineContent = lineContent.replace(/(\bwhile\b)\s+(?!as)/g, '$1 ');
52 |
53 | // 规范化空格,但避免删除命令行中的空格
54 | lineContent = lineContent.replace(/(? {
83 | if (files.length > 0) {
84 | const fileUri = files[0];
85 | vscode.workspace.openTextDocument(fileUri).then(doc => {
86 | vscode.window.showTextDocument(doc);
87 | }, err => {
88 | console.error('Error opening file:', err);
89 | vscode.window.showErrorMessage(`无法打开文件: ${fileUri.fsPath}`);
90 | });
91 | } else {
92 | vscode.window.showErrorMessage(`没有找到文件: ${word}`);
93 | }
94 | }, err => {
95 | console.error('Error searching files:', err);
96 | vscode.window.showErrorMessage(`搜索文件时出错: ${word}`);
97 | });
98 | } else {
99 | vscode.window.showErrorMessage('当前没有打开的编辑器。');
100 | }
101 | });
102 |
103 | context.subscriptions.push(disposable,
104 | vscode.languages.registerDocumentFormattingEditProvider('kether', {
105 | provideDocumentFormattingEdits(document: vscode.TextDocument): vscode.TextEdit[] {
106 | const formattedCode = formatKetherCode(document.getText());
107 | const entireRange = new vscode.Range(
108 | document.positionAt(0),
109 | document.positionAt(document.getText().length)
110 | );
111 | return [vscode.TextEdit.replace(entireRange, formattedCode)];
112 | },
113 | })
114 | );
115 | }
--------------------------------------------------------------------------------
/syntaxes/kether.tmLanguage.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "kether",
3 | "scopeName": "source.ks",
4 | "fileTypes": [
5 | "ks"
6 | ],
7 | "patterns": [
8 | {
9 | "include": "#comments"
10 | },
11 | {
12 | "include": "#keywords"
13 | },
14 | {
15 | "include": "#operators"
16 | },
17 | {
18 | "include": "#strings"
19 | },
20 | {
21 | "include": "#numbers"
22 | },
23 | {
24 | "include": "#variables"
25 | },
26 | {
27 | "include": "#actions"
28 | },
29 | {
30 | "include": "#conditionals"
31 | },
32 | {
33 | "include": "#loops"
34 | },
35 | {
36 | "include": "#errors"
37 | }
38 | ],
39 | "repository": {
40 | "comments": {
41 | "patterns": [
42 | {
43 | "name": "comment.line.kether",
44 | "match": "#.*$"
45 | }
46 | ]
47 | },
48 | "keywords": {
49 | "patterns": [
50 | {
51 | "name": "keyword.function.kether",
52 | "match": "\\b(talk|script|random2|print|tell|while|warning|toast|title|switch|subtitle|split|sound|scale|round|perm|map|join|javascript|second|year|month|minute|hour|command|await_any|await_all|actionbar)\\b"
53 | },
54 | {
55 | "name": "keyword.control.kether",
56 | "match": "\\b(run|stop|as|to|set|get|repeat|pause|pass|else|optional|if|check|math|for|break|call|async|await)\\b"
57 | }
58 | ]
59 | },
60 | "operators": {
61 | "patterns": [
62 | {
63 | "name": "keyword.operator.kether",
64 | "match": "\\b(add|sub|mul|div|inline|player)\\b"
65 | }
66 | ]
67 | },
68 | "strings": {
69 | "patterns": [
70 | {
71 | "name": "string.quoted.double.kether",
72 | "begin": "\"",
73 | "end": "\"",
74 | "patterns": [
75 | {
76 | "name": "constant.character.escape.kether",
77 | "match": "\\\\."
78 | }
79 | ]
80 | }
81 | ]
82 | },
83 | "numbers": {
84 | "patterns": [
85 | {
86 | "name": "constant.numeric.kether",
87 | "match": "\\b\\d+\\b"
88 | }
89 | ]
90 | },
91 | "variables": {
92 | "patterns": [
93 | {
94 | "name": "variable.kether",
95 | "match": "\\b(&[a-f0-9klmnor])\\b"
96 | },
97 | {
98 | "name": "variable.kether",
99 | "match": "\\b\\w+\\b"
100 | }
101 | ]
102 | },
103 | "conditionals": {
104 | "patterns": [
105 | {
106 | "name": "keyword.control.kether",
107 | "match": "\\b(check|==|is|!=|not|>=|<=|>|<)\\b"
108 | },
109 | {
110 | "name": "keyword.operator.kether",
111 | "match": "\\b(=\\?|=!|is?)\\b"
112 | }
113 | ]
114 | },
115 | "loops": {
116 | "patterns": [
117 | {
118 | "name": "keyword.control.kether",
119 | "match": "\\b(while|for|break)\\b"
120 | }
121 | ]
122 | },
123 | "errors": {
124 | "patterns": [
125 | {
126 | "name": "invalid.illegal.kether",
127 | "match": "\\b(\".*\"as|math\\s+\\w+\\s+\\[\\d+\\d*\\d*\\])\\b"
128 | },
129 | {
130 | "name": "invalid.deprecated.kether",
131 | "match": "\\b(\".*\"|%.*?%|-.+?_|-.+?_)\\b(?!\\s+papi)"
132 | },
133 | {
134 | "name": "invalid.deprecated.kether",
135 | "match": "\\b(\".*\"|%.*?%|-.+?_|-.+?_)\\b(?=\\s+{{)"
136 | }
137 | ]
138 | }
139 | }
140 | }
--------------------------------------------------------------------------------
/tsc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LiteCat0905/Kether-snippet/e7b6aa6c1dd0a05bd505c97ea39b92efa83ce3df/tsc
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | /* Visit https://aka.ms/tsconfig to read more about this file */
4 |
5 | /* Projects */
6 | // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7 | // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8 | // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9 | // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10 | // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11 | // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12 |
13 | /* Language and Environment */
14 | "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15 | // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16 | // "jsx": "preserve", /* Specify what JSX code is generated. */
17 | // "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
18 | // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19 | // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20 | // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21 | // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22 | // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23 | // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24 | // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25 | // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26 |
27 | /* Modules */
28 | "module": "commonjs", /* Specify what module code is generated. */
29 | // "rootDir": "./", /* Specify the root folder within your source files. */
30 | // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
31 | // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32 | // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33 | // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34 | // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35 | // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36 | // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37 | // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38 | // "resolveJsonModule": true, /* Enable importing .json files. */
39 | // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */
40 |
41 | /* JavaScript Support */
42 | // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
43 | // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
44 | // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
45 |
46 | /* Emit */
47 | // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
48 | // "declarationMap": true, /* Create sourcemaps for d.ts files. */
49 | // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
50 | // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
51 | // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
52 | // "outDir": "./", /* Specify an output folder for all emitted files. */
53 | // "removeComments": true, /* Disable emitting comments. */
54 | // "noEmit": true, /* Disable emitting files from a compilation. */
55 | // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
56 | // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
57 | // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
58 | // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
59 | // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
60 | // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
61 | // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
62 | // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
63 | // "newLine": "crlf", /* Set the newline character for emitting files. */
64 | // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
65 | // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
66 | // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
67 | // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
68 | // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
69 | // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
70 |
71 | /* Interop Constraints */
72 | // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
73 | // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
74 | "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
75 | // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
76 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
77 |
78 | /* Type Checking */
79 | "strict": true, /* Enable all strict type-checking options. */
80 | // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
81 | // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
82 | // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
83 | // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
84 | // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
85 | // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
86 | // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
87 | // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
88 | // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
89 | // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
90 | // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
91 | // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
92 | // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
93 | // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
94 | // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
95 | // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
96 | // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
97 | // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
98 |
99 | /* Completeness */
100 | // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
101 | "skipLibCheck": true /* Skip type checking all .d.ts files. */
102 | }
103 | }
104 |
--------------------------------------------------------------------------------