Skip to content

Commit 572a53a

Browse files
committed
Add configuration for RPG symbolic name source (name/label)
1 parent 6540656 commit 572a53a

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,26 @@
135135
}
136136
}
137137
},
138+
{
139+
"id": "vscode-db2i.codegen",
140+
"title": "Code generation",
141+
"properties": {
142+
"vscode-db2i.codegen.rpgSymbolicNameSource": {
143+
"type": "string",
144+
"order": 0,
145+
"description": "Descriptor to use for RPG symbolic names in data structure",
146+
"default": "Name",
147+
"enum": [
148+
"Name",
149+
"Label"
150+
],
151+
"enumDescriptions": [
152+
"Use the column name",
153+
"Use the column label\n'Extended metadata' must be set to true in the JDBC configuration"
154+
]
155+
}
156+
}
157+
},
138158
{
139159
"id": "vscode-db2i.visualExplain",
140160
"title": "Visual Explain",

src/views/results/contributes.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,26 @@
2525
"default": false
2626
}
2727
}
28+
},
29+
{
30+
"id": "vscode-db2i.codegen",
31+
"title": "Code generation",
32+
"properties": {
33+
"vscode-db2i.codegen.rpgSymbolicNameSource": {
34+
"type": "string",
35+
"order": 0,
36+
"description": "Descriptor to use for RPG symbolic names in data structure",
37+
"default": "Name",
38+
"enum": [
39+
"Name",
40+
"Label"
41+
],
42+
"enumDescriptions": [
43+
"Use the column name",
44+
"Use the column label\n'Extended metadata' must be set to true in the JDBC configuration"
45+
]
46+
}
47+
}
2848
}
2949
],
3050
"views": {

src/views/results/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ async function runHandler(options?: StatementInfo) {
391391
let content = `**free\n\n`
392392
+ `// statement: ${statementDetail.content}\n\n`
393393
+ `// Row data structure\n`
394-
+ queryResultToRpgDs(result, Configuration.get(`resultsets.columnHeadings`));
394+
+ queryResultToRpgDs(result, Configuration.get(`codegen.rpgSymbolicNameSource`));
395395
const textDoc = await vscode.workspace.openTextDocument({ language: 'rpgle', content });
396396
await vscode.window.showTextDocument(textDoc);
397397
chosenView.setLoadingText(`RPG data structure generated.`, false);

0 commit comments

Comments
 (0)