How to control auto naming when git structure differs from IRIS structure? #1603
-
Question about the naming of classes and routines: The structure we have in Git is like this:
In IRIS, these are stored like this:
Currently we're using this and it has a mapping table for routines and classes: We're moving to use VS code with client-side editing using this vscode-objectscript extension. When creating a new class or routine in VS code, the name is set to rtn.newRoutine1 or cls.Package1.newClass1 in the header and therefore gets saved into a new folder in IRIS, so the end result in IRIS looks like this:
I know that if you change the name on the first line to remove cls. and rtn. before first saving and then save, they get saved to the correct place, but I was wondering if there was a way to control this in the extension? I can see there are some settings regarding the naming that refer to the export settings.
Any suggestions other than changing the structure in the Git repo? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Hi @jer-war, that's a great question! You are correct that the "objectscript.export": {
"folder": "", // Empty string because there's no intermediate folder between your workspace root and the sources (like "src")
"addCategory": true, // You are using the cls and rtn subfolders for now
"map": {},
"atelier": true,
"generated": false,
"filter": "",
"exactFilter": "",
"category": "*",
"maxConcurrentConnections": 0,
"mapped": true
}, Note that these settings are not used for syncing classes and routines to the server. In that case the extension will use the name that's in the text regardless of the file path. You do not need to change your repository structure. |
Beta Was this translation helpful? Give feedback.
I just checked the code and that's not working because we don't have a
rtn
category. The default categories arecls
,int
,inc
,mac
,dfi
,oth
. TheaddCategory
setting accepts an object value instead of just a boolean. This worked for me:This will override the defaults for mac, int and inc files but will still use the defaults for everything else. This use of
addCategory
is undocumented but sh…