@ingestron/authoring 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +4 -0
- package/README.md +17 -2
- package/dist/annotations.d.ts +24 -0
- package/dist/annotations.d.ts.map +1 -0
- package/dist/annotations.js +132 -0
- package/dist/annotations.js.map +1 -0
- package/dist/completion.d.ts +8 -0
- package/dist/completion.d.ts.map +1 -0
- package/dist/completion.js +183 -0
- package/dist/completion.js.map +1 -0
- package/dist/context.d.ts +36 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +98 -0
- package/dist/context.js.map +1 -0
- package/dist/contract-uses.d.ts +8 -0
- package/dist/contract-uses.d.ts.map +1 -0
- package/dist/contract-uses.js +40 -0
- package/dist/contract-uses.js.map +1 -0
- package/dist/diagnostics.d.ts +20 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +143 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/docs-entries.d.ts +5 -0
- package/dist/docs-entries.d.ts.map +1 -0
- package/dist/docs-entries.js +109 -0
- package/dist/docs-entries.js.map +1 -0
- package/dist/docs.d.ts +7 -0
- package/dist/docs.d.ts.map +1 -0
- package/dist/docs.js +23 -0
- package/dist/docs.js.map +1 -0
- package/dist/explain.d.ts +14 -0
- package/dist/explain.d.ts.map +1 -0
- package/dist/explain.js +55 -0
- package/dist/explain.js.map +1 -0
- package/dist/fields.d.ts +19 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +151 -0
- package/dist/fields.js.map +1 -0
- package/dist/fix-all.d.ts +5 -0
- package/dist/fix-all.d.ts.map +1 -0
- package/dist/fix-all.js +23 -0
- package/dist/fix-all.js.map +1 -0
- package/dist/fixed.d.ts +6 -0
- package/dist/fixed.d.ts.map +1 -0
- package/dist/fixed.js +43 -0
- package/dist/fixed.js.map +1 -0
- package/dist/fixes.d.ts +33 -0
- package/dist/fixes.d.ts.map +1 -0
- package/dist/fixes.js +99 -0
- package/dist/fixes.js.map +1 -0
- package/dist/flow.d.ts +16 -0
- package/dist/flow.d.ts.map +1 -0
- package/dist/flow.js +62 -0
- package/dist/flow.js.map +1 -0
- package/dist/hover.d.ts +7 -0
- package/dist/hover.d.ts.map +1 -0
- package/dist/hover.js +172 -0
- package/dist/hover.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/inline.d.ts +7 -0
- package/dist/inline.d.ts.map +1 -0
- package/dist/inline.js +57 -0
- package/dist/inline.js.map +1 -0
- package/dist/inputs.d.ts +5 -0
- package/dist/inputs.d.ts.map +1 -0
- package/dist/inputs.js +72 -0
- package/dist/inputs.js.map +1 -0
- package/dist/method-suggestions.d.ts +5 -0
- package/dist/method-suggestions.d.ts.map +1 -0
- package/dist/method-suggestions.js +24 -0
- package/dist/method-suggestions.js.map +1 -0
- package/dist/methods.d.ts +26 -0
- package/dist/methods.d.ts.map +1 -0
- package/dist/methods.js +67 -0
- package/dist/methods.js.map +1 -0
- package/dist/moves.d.ts +5 -0
- package/dist/moves.d.ts.map +1 -0
- package/dist/moves.js +82 -0
- package/dist/moves.js.map +1 -0
- package/dist/navigation.d.ts +24 -0
- package/dist/navigation.d.ts.map +1 -0
- package/dist/navigation.js +176 -0
- package/dist/navigation.js.map +1 -0
- package/dist/platform-request.d.ts +6 -0
- package/dist/platform-request.d.ts.map +1 -0
- package/dist/platform-request.js +13 -0
- package/dist/platform-request.js.map +1 -0
- package/dist/preview.d.ts +20 -0
- package/dist/preview.d.ts.map +1 -0
- package/dist/preview.js +51 -0
- package/dist/preview.js.map +1 -0
- package/dist/problems-at.d.ts +17 -0
- package/dist/problems-at.d.ts.map +1 -0
- package/dist/problems-at.js +32 -0
- package/dist/problems-at.js.map +1 -0
- package/dist/project.d.ts +27 -0
- package/dist/project.d.ts.map +1 -0
- package/dist/project.js +96 -0
- package/dist/project.js.map +1 -0
- package/dist/reference.d.ts +50 -0
- package/dist/reference.d.ts.map +1 -0
- package/dist/reference.js +152 -0
- package/dist/reference.js.map +1 -0
- package/dist/references.d.ts +8 -0
- package/dist/references.d.ts.map +1 -0
- package/dist/references.js +68 -0
- package/dist/references.js.map +1 -0
- package/dist/rename.d.ts +22 -0
- package/dist/rename.d.ts.map +1 -0
- package/dist/rename.js +64 -0
- package/dist/rename.js.map +1 -0
- package/dist/schema.d.ts +23 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +46 -0
- package/dist/schema.js.map +1 -0
- package/dist/skeletons.d.ts +7 -0
- package/dist/skeletons.d.ts.map +1 -0
- package/dist/skeletons.js +107 -0
- package/dist/skeletons.js.map +1 -0
- package/dist/smart.d.ts +24 -0
- package/dist/smart.d.ts.map +1 -0
- package/dist/smart.js +113 -0
- package/dist/smart.js.map +1 -0
- package/dist/suggestion.d.ts +23 -0
- package/dist/suggestion.d.ts.map +1 -0
- package/dist/suggestion.js +2 -0
- package/dist/suggestion.js.map +1 -0
- package/dist/symbols.d.ts +12 -0
- package/dist/symbols.d.ts.map +1 -0
- package/dist/symbols.js +21 -0
- package/dist/symbols.js.map +1 -0
- package/dist/target.d.ts +4 -0
- package/dist/target.d.ts.map +1 -0
- package/dist/target.js +7 -0
- package/dist/target.js.map +1 -0
- package/dist/value-help.d.ts +7 -0
- package/dist/value-help.d.ts.map +1 -0
- package/dist/value-help.js +206 -0
- package/dist/value-help.js.map +1 -0
- package/dist/yaml.d.ts +33 -0
- package/dist/yaml.d.ts.map +1 -0
- package/dist/yaml.js +179 -0
- package/dist/yaml.js.map +1 -0
- package/package.json +58 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/NOTICE
ADDED
package/README.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @ingestron/authoring
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Editor features for Ingestron projects, as plain functions over a project's
|
|
4
|
+
files: problems and quick fixes, completion and smart defaults, hover
|
|
5
|
+
explanations, go to definition, references and rename, and previews of the
|
|
6
|
+
generated files. They use the CLI's packs, so an editor and the CLI never
|
|
7
|
+
disagree.
|
|
8
|
+
|
|
9
|
+
The [VS Code extension](https://github.com/ingestron/vscode) adapts them to VS Code. User
|
|
10
|
+
documentation lives on the docs site.
|
|
11
|
+
|
|
12
|
+
## Documentation
|
|
13
|
+
|
|
14
|
+
User documentation: https://docs.ingestron.io.
|
|
15
|
+
|
|
16
|
+
## Licence
|
|
17
|
+
|
|
18
|
+
[Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type DefinitionDocument } from "@ingestron/config";
|
|
2
|
+
import { type Project } from "./project.js";
|
|
3
|
+
/** A note at the end of a line, with more on hover. */
|
|
4
|
+
export interface Annotation {
|
|
5
|
+
line: number;
|
|
6
|
+
label: string;
|
|
7
|
+
tooltip?: string;
|
|
8
|
+
}
|
|
9
|
+
/** The methods that build a line's table, how they were chosen, and its generated files. */
|
|
10
|
+
export interface GeneratedLens {
|
|
11
|
+
line: number;
|
|
12
|
+
/** Such as `files → streaming-table`. */
|
|
13
|
+
methods: string;
|
|
14
|
+
/** How each method was chosen, one line per step. */
|
|
15
|
+
chosen: string;
|
|
16
|
+
files: string[];
|
|
17
|
+
}
|
|
18
|
+
/** Values of `${…}` references and each table's name and methods, for the environment. */
|
|
19
|
+
export declare function annotationsIn(project: Project, file: string, text: string, environment: string | undefined): Annotation[];
|
|
20
|
+
/** For each table in a flow, transform or contract, the files generated for it. */
|
|
21
|
+
export declare function generatedLenses(project: Project, file: string, text: string, environment: string | undefined): GeneratedLens[];
|
|
22
|
+
/** The project's documents with `${…}` resolved, once per project snapshot and environment. */
|
|
23
|
+
export declare function documentsOf(project: Project, environment: string | undefined): DefinitionDocument[];
|
|
24
|
+
//# sourceMappingURL=annotations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.d.ts","sourceRoot":"","sources":["../src/annotations.ts"],"names":[],"mappings":"AAEA,OAAO,EAAkB,KAAK,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAI5E,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAItD,uDAAuD;AACvD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,4FAA4F;AAC5F,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,0FAA0F;AAC1F,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,UAAU,EAAE,CASd;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,aAAa,EAAE,CAWjB;AA2BD,+FAA+F;AAC/F,wBAAgB,WAAW,CACzB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,kBAAkB,EAAE,CAetB"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// What a line resolves to, shown beside it: a variable's value, a table's full
|
|
2
|
+
// name with the methods that build it, and the files generated from it.
|
|
3
|
+
import { resolveProject } from "@ingestron/config";
|
|
4
|
+
import { kinds, NO_STORE } from "@ingestron/definitions";
|
|
5
|
+
import { targetOf } from "./target.js";
|
|
6
|
+
import { generatedFiles, generatedForTable } from "./preview.js";
|
|
7
|
+
import { resolved } from "./project.js";
|
|
8
|
+
import { resolveText } from "./references.js";
|
|
9
|
+
import { allSpots, positionAt, rangeOf } from "./yaml.js";
|
|
10
|
+
/** Values of `${…}` references and each table's name and methods, for the environment. */
|
|
11
|
+
export function annotationsIn(project, file, text, environment) {
|
|
12
|
+
return [
|
|
13
|
+
...variables(project, file, text, environment),
|
|
14
|
+
...tablesIn(project, file, text, environment).map(({ line, table }) => ({
|
|
15
|
+
line,
|
|
16
|
+
label: `→ ${targetOf(table)}`,
|
|
17
|
+
tooltip: chosen(table),
|
|
18
|
+
})),
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
/** For each table in a flow, transform or contract, the files generated for it. */
|
|
22
|
+
export function generatedLenses(project, file, text, environment) {
|
|
23
|
+
const found = tablesIn(project, file, text, environment);
|
|
24
|
+
if (found.length === 0)
|
|
25
|
+
return [];
|
|
26
|
+
const files = generatedFiles(project, environment);
|
|
27
|
+
if (!Array.isArray(files))
|
|
28
|
+
return [];
|
|
29
|
+
return found.map(({ line, table }) => ({
|
|
30
|
+
line,
|
|
31
|
+
methods: methodsOf(table).join(" → "),
|
|
32
|
+
chosen: chosen(table),
|
|
33
|
+
files: generatedForTable(files, table.name, table.fullName.table).map((item) => item.path),
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
const hidden = /\$\{(secret|envvar):/;
|
|
37
|
+
const loads = new WeakMap();
|
|
38
|
+
function variables(project, file, text, environment) {
|
|
39
|
+
if (!text.includes("${"))
|
|
40
|
+
return [];
|
|
41
|
+
const document = documentsOf(project, environment).find((item) => item.file === file);
|
|
42
|
+
return allSpots(text)
|
|
43
|
+
.filter((spot) => spot.part === "value" && spot.text.includes("${") && !hidden.test(spot.text))
|
|
44
|
+
.flatMap((spot) => {
|
|
45
|
+
// The loaded document when the project loads; otherwise project.yaml's values alone.
|
|
46
|
+
const value = document
|
|
47
|
+
? valueAt(document.value, spot.segments)
|
|
48
|
+
: resolveText(project, spot.text, environment);
|
|
49
|
+
if (value === undefined || value === spot.text)
|
|
50
|
+
return [];
|
|
51
|
+
const shown = typeof value === "string" ? value : JSON.stringify(value);
|
|
52
|
+
const label = `= ${shown.length > 80 ? `${shown.slice(0, 79)}…` : shown}`;
|
|
53
|
+
return [{ line: positionAt(text, spot.range[0]).line, label, tooltip: shown }];
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** The project's documents with `${…}` resolved, once per project snapshot and environment. */
|
|
57
|
+
export function documentsOf(project, environment) {
|
|
58
|
+
let byEnvironment = loads.get(project);
|
|
59
|
+
if (!byEnvironment)
|
|
60
|
+
loads.set(project, (byEnvironment = new Map()));
|
|
61
|
+
const key = environment ?? "";
|
|
62
|
+
let documents = byEnvironment.get(key);
|
|
63
|
+
if (!documents) {
|
|
64
|
+
const loaded = resolveProject(project.files, {
|
|
65
|
+
kinds: Object.values(kinds),
|
|
66
|
+
...(environment && { environment }),
|
|
67
|
+
envvars: {},
|
|
68
|
+
});
|
|
69
|
+
documents = loaded.ok ? [...loaded.project.documents] : [];
|
|
70
|
+
byEnvironment.set(key, documents);
|
|
71
|
+
}
|
|
72
|
+
return documents;
|
|
73
|
+
}
|
|
74
|
+
function valueAt(value, segments) {
|
|
75
|
+
return segments.reduce((node, segment) => node !== null && typeof node === "object"
|
|
76
|
+
? node[segment]
|
|
77
|
+
: undefined, value);
|
|
78
|
+
}
|
|
79
|
+
/** The model's tables written in this file, each at the line that names it. */
|
|
80
|
+
function tablesIn(project, file, text, environment) {
|
|
81
|
+
const model = resolved(project, environment).model;
|
|
82
|
+
if (!model)
|
|
83
|
+
return [];
|
|
84
|
+
const lineOf = (pointer, part = "key") => {
|
|
85
|
+
const range = rangeOf(text, pointer, part);
|
|
86
|
+
return range && positionAt(text, range[0]).line;
|
|
87
|
+
};
|
|
88
|
+
const id = /^id:\s*(\S+)/m.exec(text)?.[1];
|
|
89
|
+
return model.tables.flatMap((table) => {
|
|
90
|
+
let line;
|
|
91
|
+
if (table.origin.file === file)
|
|
92
|
+
line = table.origin.kind === "Flow" ? lineOf(`/tables/${table.name}`) : lineOf("/id");
|
|
93
|
+
else if (/^kind:\s*DataContract/m.test(text) && table.contract.id === id)
|
|
94
|
+
line = contractLine(text, table.name, lineOf);
|
|
95
|
+
return line === undefined ? [] : [{ line, table }];
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
/** The line of the contract object named like the table, else of the first object. */
|
|
99
|
+
function contractLine(text, name, lineOf) {
|
|
100
|
+
const names = allSpots(text).filter((spot) => spot.part === "value" && /^\/schema\/\d+\/name$/.test(spot.pointer));
|
|
101
|
+
const own = names.find((spot) => spot.text === name) ?? names[0];
|
|
102
|
+
return own && lineOf(own.pointer, "value");
|
|
103
|
+
}
|
|
104
|
+
function methodsOf(table) {
|
|
105
|
+
return [table.ingest, table.transform, table.store].flatMap((step) => step ? [step.method] : []);
|
|
106
|
+
}
|
|
107
|
+
const choosers = {
|
|
108
|
+
definition: "written in the definition",
|
|
109
|
+
"standard-rule": "chosen by the standard's rule",
|
|
110
|
+
"standard-default": "chosen by the standard's default",
|
|
111
|
+
"pack-rule": "chosen by the pack's rule",
|
|
112
|
+
"pack-default": "chosen by the pack's default",
|
|
113
|
+
};
|
|
114
|
+
/** How each step's method was chosen, one line per step. */
|
|
115
|
+
function chosen(table) {
|
|
116
|
+
const steps = { ingest: table.ingest, transform: table.transform, store: table.store };
|
|
117
|
+
const lines = Object.entries(steps).flatMap(([action, step]) => step ? [`${action}: ${step.method}, ${chooser(step.chosenBy)}`] : []);
|
|
118
|
+
if (table.endsAtFiles)
|
|
119
|
+
lines.push(`store: ${NO_STORE}, ends at the landed files, ${chooser(table.endsAtFiles)}`);
|
|
120
|
+
return lines.join("\n");
|
|
121
|
+
}
|
|
122
|
+
/** What chose a method, with the rule's facts and where it is written. */
|
|
123
|
+
function chooser({ by, when, file, line }) {
|
|
124
|
+
const facts = when
|
|
125
|
+
? ` when ${Object.entries(when)
|
|
126
|
+
.map(([key, value]) => `${key}: ${String(value)}`)
|
|
127
|
+
.join(", ")}`
|
|
128
|
+
: "";
|
|
129
|
+
const where = file ? ` (${file}${line ? `:${line}` : ""})` : "";
|
|
130
|
+
return `${choosers[by]}${facts}${where}`;
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=annotations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.js","sourceRoot":"","sources":["../src/annotations.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,wEAAwE;AACxE,OAAO,EAAE,cAAc,EAA2B,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAqC,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAgB,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmB1D,0FAA0F;AAC1F,MAAM,UAAU,aAAa,CAC3B,OAAgB,EAChB,IAAY,EACZ,IAAY,EACZ,WAA+B;IAE/B,OAAO;QACL,GAAG,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,CAAC;QAC9C,GAAG,QAAQ,CAAC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C,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,EAAE,EAAE,CAC7D,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,KAAK,IAAI,CAAC,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CACrE,CAAC;IACF,IAAI,KAAK,CAAC,WAAW;QACnB,KAAK,CAAC,IAAI,CAAC,UAAU,QAAQ,+BAA+B,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAC5F,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,0EAA0E;AAC1E,SAAS,OAAO,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAY;IACjD,MAAM,KAAK,GAAG,IAAI;QAChB,CAAC,CAAC,SAAS,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC;aAC1B,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,KAAK,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;aACjD,IAAI,CAAC,IAAI,CAAC,EAAE;QACjB,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IAChE,OAAO,GAAG,QAAQ,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,KAAK,EAAE,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Project } from "./project.js";
|
|
2
|
+
import type { Suggestion } from "./suggestion.js";
|
|
3
|
+
export type { Suggestion } from "./suggestion.js";
|
|
4
|
+
/** Suggestions for the cursor at `offset` in `text`, the open text of `file`. */
|
|
5
|
+
export declare function completionsAt(project: Project, file: string, text: string, offset: number, environment: string | undefined): Suggestion[];
|
|
6
|
+
/** The distinct names of the project's symbols with `prefix`, such as every value name. */
|
|
7
|
+
export declare function names(project: Project, prefix: string, kind: Suggestion["kind"]): Suggestion[];
|
|
8
|
+
//# sourceMappingURL=completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../src/completion.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAS5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAIlD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,iFAAiF;AACjF,wBAAgB,aAAa,CAC3B,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,UAAU,EAAE,CAad;AAwCD,2FAA2F;AAC3F,wBAAgB,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,UAAU,EAAE,CAO9F"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// Completion that knows the project: values, tables and ids by reference,
|
|
2
|
+
// methods for `uses`, allowed values, fields from the schema, and the
|
|
3
|
+
// settings of the method a table resolves to.
|
|
4
|
+
import { packs } from "@ingestron/cli";
|
|
5
|
+
import { kinds, referenceKinds } from "@ingestron/definitions";
|
|
6
|
+
import { occurrences } from "./navigation.js";
|
|
7
|
+
import { inlineCompletions, patternNames } from "./inline.js";
|
|
8
|
+
import { schemaFor, schemasAt } from "./schema.js";
|
|
9
|
+
import { skeletons } from "./skeletons.js";
|
|
10
|
+
import { firstFields, itemSnippets, newTables, preferred, rankMethods } from "./smart.js";
|
|
11
|
+
import { methodsFor } from "./method-suggestions.js";
|
|
12
|
+
import { flowFacts, placeAt, writtenKeys } from "./context.js";
|
|
13
|
+
import { fieldAt, fieldsIn } from "./fields.js";
|
|
14
|
+
import { markFixed } from "./fixed.js";
|
|
15
|
+
import { inputCompletions } from "./inputs.js";
|
|
16
|
+
import { valueHelp } from "./value-help.js";
|
|
17
|
+
/** Suggestions for the cursor at `offset` in `text`, the open text of `file`. */
|
|
18
|
+
export function completionsAt(project, file, text, offset, environment) {
|
|
19
|
+
const before = text.slice(0, offset);
|
|
20
|
+
const inputs = inputCompletions(project, file, before);
|
|
21
|
+
if (inputs)
|
|
22
|
+
return inputs;
|
|
23
|
+
const inline = inlineCompletions(project, before, file);
|
|
24
|
+
if (inline)
|
|
25
|
+
return inline;
|
|
26
|
+
if (!/\.ya?ml$/.test(file))
|
|
27
|
+
return [];
|
|
28
|
+
if (/^\s*\w*$/.test(text))
|
|
29
|
+
return skeletons(project, file);
|
|
30
|
+
const place = placeAt(file, text, offset);
|
|
31
|
+
if (place.path[0] === "naming" && /\{\{\s*\w*$/.test(before))
|
|
32
|
+
return patternNames();
|
|
33
|
+
return place.part === "key"
|
|
34
|
+
? newKeys(project, place, environment)
|
|
35
|
+
: values(project, place, environment);
|
|
36
|
+
}
|
|
37
|
+
/** Keys for a new line; a mapping holds each key once, so the keys already written are left out. */
|
|
38
|
+
function newKeys(project, place, environment) {
|
|
39
|
+
const written = writtenKeys(place);
|
|
40
|
+
return keyCompletions(project, place, environment).filter((item) => !written.has(item.label));
|
|
41
|
+
}
|
|
42
|
+
/** Values, or for a new list item of mappings its fields; straight after `key:` with its space. */
|
|
43
|
+
function values(project, place, environment) {
|
|
44
|
+
const found = valueCompletions(project, place, environment);
|
|
45
|
+
const items = place.part === "item" && found.length === 0 ? newItem(project, place, environment) : found;
|
|
46
|
+
// Inside [ ], an item of mappings is a { } to fill; its keys follow once it is there.
|
|
47
|
+
if (place.part === "item" && place.inFlow && items.some((item) => item.kind === "field"))
|
|
48
|
+
return [
|
|
49
|
+
...items.filter((item) => item.snippet?.startsWith("{")),
|
|
50
|
+
{ label: "{ }", kind: "value", detail: "a new item", snippet: "{ $0 }", retrigger: true },
|
|
51
|
+
];
|
|
52
|
+
if (place.part === "item" && /-$/.test(place.before))
|
|
53
|
+
return items.map(afterDash);
|
|
54
|
+
if (!place.tight)
|
|
55
|
+
return items;
|
|
56
|
+
// Straight after `key:` a value brings its space; a block starts on the next line anyway.
|
|
57
|
+
return items.map((item) => {
|
|
58
|
+
if (!item.snippet)
|
|
59
|
+
return { ...item, insertText: ` ${item.insertText ?? item.label}` };
|
|
60
|
+
return item.snippet.startsWith("\n") ? item : { ...item, snippet: ` ${item.snippet}` };
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/** Straight after `-`, a suggestion brings the space and is inserted after the dash. */
|
|
64
|
+
function afterDash(item) {
|
|
65
|
+
const spaced = item.snippet ? { snippet: ` ${item.snippet}` } : { insertText: ` ${item.label}` };
|
|
66
|
+
return { ...item, ...spaced, afterDash: true };
|
|
67
|
+
}
|
|
68
|
+
/** A new item in a list of mappings: ready-made items first, then the item's fields. */
|
|
69
|
+
function newItem(project, place, environment) {
|
|
70
|
+
const fields = fieldsIn(project, place, [...place.path, "0"], environment) ?? [];
|
|
71
|
+
return [...itemSnippets(place), ...firstFields(place, fields).map(fieldSuggestion)];
|
|
72
|
+
}
|
|
73
|
+
/** The distinct names of the project's symbols with `prefix`, such as every value name. */
|
|
74
|
+
export function names(project, prefix, kind) {
|
|
75
|
+
const found = occurrences(project).filter((item) => item.definition && item.symbol.startsWith(prefix));
|
|
76
|
+
return [...new Set(found.map((item) => item.symbol.slice(prefix.length)))]
|
|
77
|
+
.sort()
|
|
78
|
+
.map((label) => ({ label, kind }));
|
|
79
|
+
}
|
|
80
|
+
function valueCompletions(project, place, environment) {
|
|
81
|
+
const { kind, path } = place;
|
|
82
|
+
const link = Object.values(kinds)
|
|
83
|
+
.filter((item) => item.kind === kind)
|
|
84
|
+
.flatMap((item) => Object.entries(item.links ?? {}))
|
|
85
|
+
.find(([pointer]) => matches(pointer.split("/").slice(1), path));
|
|
86
|
+
if (link)
|
|
87
|
+
return linkCompletions(project, place, link[1]);
|
|
88
|
+
if (kind === "Transform" && path[0] === "inputs")
|
|
89
|
+
return names(project, "table:", "reference");
|
|
90
|
+
if (path.at(-1) === "uses") {
|
|
91
|
+
const methods = methodsFor(project, path[path.length - 2] ?? "", kind === "Flow");
|
|
92
|
+
return kind === "Flow" && path.at(-2) === "ingest"
|
|
93
|
+
? rankMethods(project, place, methods, methodNamed)
|
|
94
|
+
: methods;
|
|
95
|
+
}
|
|
96
|
+
return describedValues(project, place, environment);
|
|
97
|
+
}
|
|
98
|
+
/** The field's allowed values with their meanings; for others' schemas, their values and examples. */
|
|
99
|
+
function describedValues(project, place, environment) {
|
|
100
|
+
const { kind, path } = place;
|
|
101
|
+
const field = fieldAt(project, place, path, environment);
|
|
102
|
+
if (field?.values)
|
|
103
|
+
return markFixed(project, place, environment, allowedValues(field));
|
|
104
|
+
const ours = kind !== undefined && kind in referenceKinds && kind !== "DataContract";
|
|
105
|
+
if (ours)
|
|
106
|
+
return helpFor(project, place, field);
|
|
107
|
+
const listed = schemaValues(place);
|
|
108
|
+
return listed.length > 0 ? listed : helpFor(project, place, field);
|
|
109
|
+
}
|
|
110
|
+
/** Value help for a field's value, or for a new item of a list of plain values. */
|
|
111
|
+
function helpFor(project, place, field) {
|
|
112
|
+
return field ? valueHelp(project, place, field) : [];
|
|
113
|
+
}
|
|
114
|
+
/** A field's allowed values, each with its meaning. */
|
|
115
|
+
function allowedValues(field) {
|
|
116
|
+
return (field.values ?? []).map(({ value, description }) => ({
|
|
117
|
+
label: String(value),
|
|
118
|
+
kind: "value",
|
|
119
|
+
docs: field.docs,
|
|
120
|
+
...(description && { documentation: description }),
|
|
121
|
+
}));
|
|
122
|
+
}
|
|
123
|
+
/** Others' schemas, such as ODCS for contracts: their allowed values and examples. */
|
|
124
|
+
function schemaValues(place) {
|
|
125
|
+
const schema = schemaFor(place.file, place.kind);
|
|
126
|
+
const values = schema
|
|
127
|
+
? schemasAt(schema, place.path).flatMap((item) => [
|
|
128
|
+
...(item.enum ?? []),
|
|
129
|
+
...(item.examples ?? []),
|
|
130
|
+
])
|
|
131
|
+
: [];
|
|
132
|
+
const plain = values.filter((value) => typeof value !== "object");
|
|
133
|
+
return [...new Set(plain.map(String))].sort().map((label) => ({ label, kind: "value" }));
|
|
134
|
+
}
|
|
135
|
+
/** Ids of the target kind; for a flow table's contract, `<source>.<object>` first. */
|
|
136
|
+
function linkCompletions(project, place, target) {
|
|
137
|
+
const items = names(project, `doc:${target}:`, "reference");
|
|
138
|
+
const [group, table] = place.path;
|
|
139
|
+
if (target !== "DataContract" || group !== "tables")
|
|
140
|
+
return items;
|
|
141
|
+
const tables = place.data.tables;
|
|
142
|
+
const object = tables?.[table ?? ""]?.object ?? table;
|
|
143
|
+
return preferred(items, `${flowFacts(project, place).source}.${object}`);
|
|
144
|
+
}
|
|
145
|
+
function matches(pattern, path) {
|
|
146
|
+
return (pattern.length === path.length &&
|
|
147
|
+
pattern.every((part, index) => part === "*" || part === path[index]));
|
|
148
|
+
}
|
|
149
|
+
function keyCompletions(project, place, environment) {
|
|
150
|
+
const { path } = place;
|
|
151
|
+
if (path.length === 1 && path[0] === "tables" && place.kind === "Flow")
|
|
152
|
+
return newTables(project, place);
|
|
153
|
+
const described = fieldsIn(project, place, path, environment);
|
|
154
|
+
if (described)
|
|
155
|
+
return described.map(fieldSuggestion);
|
|
156
|
+
const schema = schemaFor(place.file, place.kind);
|
|
157
|
+
if (!schema)
|
|
158
|
+
return [];
|
|
159
|
+
const fields = schemasAt(schema, path).flatMap((item) => Object.entries(item.properties ?? {}));
|
|
160
|
+
const seen = new Set();
|
|
161
|
+
return fields
|
|
162
|
+
.filter(([name]) => !seen.has(name) && seen.add(name))
|
|
163
|
+
.map(([label, field]) => ({
|
|
164
|
+
label,
|
|
165
|
+
kind: "field",
|
|
166
|
+
...(field.description && { documentation: field.description }),
|
|
167
|
+
}));
|
|
168
|
+
}
|
|
169
|
+
/** A described field as a key to complete, with its default. */
|
|
170
|
+
function fieldSuggestion(field) {
|
|
171
|
+
const shown = typeof field.default === "string" ? field.default : JSON.stringify(field.default);
|
|
172
|
+
return {
|
|
173
|
+
label: field.name,
|
|
174
|
+
kind: field.placement ? "setting" : "field",
|
|
175
|
+
docs: field.docs,
|
|
176
|
+
...(field.default !== undefined && { detail: `default: ${shown}` }),
|
|
177
|
+
...(field.description && { documentation: field.description }),
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function methodNamed(name) {
|
|
181
|
+
return packs.map((pack) => pack.methods[name]).find((method) => method !== undefined);
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=completion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.js","sourceRoot":"","sources":["../src/completion.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,sEAAsE;AACtE,8CAA8C;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,cAAc,EAA+B,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAc,MAAM,cAAc,CAAC;AAC3E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