Skip to content

Commit 9396507

Browse files
committed
external definitions allowed
1 parent d58600d commit 9396507

File tree

4 files changed

+72
-31
lines changed

4 files changed

+72
-31
lines changed

types/codegen/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
generated/
2+
typescript-template-bank/
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/* tslint:disable */
2+
/* eslint-disable */
3+
import { Position, Range, TextDocumentIdentifier } from './lsp'
4+
5+
{{#models}}
6+
{{#model}}
7+
{{^withoutRuntimeChecks}}
8+
export * from './{{{ classFilename }}}{{importFileExtension}}';
9+
{{#useSagaAndRecords}}
10+
{{^isEnum}}
11+
export * from './{{{ classFilename }}}Record{{importFileExtension}}';
12+
{{/isEnum}}
13+
{{/useSagaAndRecords}}
14+
{{/withoutRuntimeChecks}}
15+
{{#withoutRuntimeChecks}}
16+
{{#isEnum}}
17+
{{>modelEnumInterfaces}}
18+
{{/isEnum}}
19+
{{^isEnum}}
20+
{{#oneOf}}
21+
{{#-first}}
22+
{{>modelOneOfInterfaces}}
23+
{{/-first}}
24+
{{/oneOf}}
25+
{{^oneOf}}
26+
{{>modelGenericInterfaces}}
27+
{{/oneOf}}
28+
{{/isEnum}}
29+
{{/withoutRuntimeChecks}}
30+
{{/model}}
31+
{{/models}}

types/codegen/openapitools.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@
99
"output": "#{cwd}/generated",
1010
"inputSpec": "#{cwd}/schema/chatTypes.json",
1111
"templateDir": "#{cwd}/custom-templates",
12+
"typeMappings": {
13+
"Position": "Position",
14+
"Range": "Range"
15+
},
16+
"importMappings": {
17+
"Position": "../../lsp",
18+
"Range": "../../lsp"
19+
},
1220
"additionalProperties": {
1321
"supportsES6": true,
1422
"modelPropertyNaming": "original",

types/codegen/schema/chatTypes.json

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
"info": {
44
"title": "ChatItemAction API",
55
"version": "1.0.0",
6-
"description": "API definition for ChatItemAction interface",
7-
"x-constants": [
8-
{
9-
"name": "OPEN_WORKSPACE_INDEX_SETTINGS_BUTTON_ID",
10-
"value": "open-settings-for-ws-index"
11-
}
12-
]
6+
"description": "API definition for ChatItemAction interface"
137
},
148
"paths": {},
159
"components": {
@@ -26,7 +20,7 @@
2620
},
2721
"prompt": {
2822
"type": "string",
29-
"description": "This is a test of the documentation. How much documentation can I add? What else can I put here?"
23+
"description": "Optional prompt text for the action"
3024
},
3125
"disabled": {
3226
"type": "boolean",
@@ -166,29 +160,35 @@
166160
"description": "Type of code selection"
167161
},
168162
"PositionCursor": {
169-
"type": "object",
170-
"properties": {
171-
"position": {
172-
"type": "Position"
173-
}
174-
},
175-
"required": ["position"]
176-
},
177-
"RangeCursor": {
178-
"type": "object",
179-
"properties": {
180-
"range": {
181-
"type": "Range"
182-
}
183-
},
184-
"required": ["range"]
185-
},
186-
"CursorState": {
187-
"oneOf": [
188-
{ "$ref": "#/components/schemas/PositionCursor" },
189-
{ "$ref": "#/components/schemas/RangeCursor" }
190-
]
191-
}
163+
"type": "object",
164+
"required": ["position"],
165+
"properties": {
166+
"position": {
167+
"type": "Position"
168+
}
169+
},
170+
"additionalProperties": false
171+
},
172+
"RangeCursor": {
173+
"type": "object",
174+
"required": ["range"],
175+
"properties": {
176+
"range": {
177+
"type": "Range"
178+
}
179+
},
180+
"additionalProperties": false
181+
},
182+
"CursorState": {
183+
"oneOf": [
184+
{
185+
"$ref": "#/components/schemas/PositionCursor"
186+
},
187+
{
188+
"$ref": "#/components/schemas/RangeCursor"
189+
}
190+
]
191+
}
192192
}
193193
}
194194
}

0 commit comments

Comments
 (0)