Jeffrey Drumm · Feb 8, 2022

VS Code: Moving Classes Between Namespaces

Is there a straightforward workflow in VS Code for moving a class from one namespace to another on the same server? With Caché/IRIS Studio, it was a (sort of) simple export/change namespace in file menu/import operation. But in VS Code it's not obvious (to me, at least). 

I can add multiple namespaces to a workspace, but when using isfs:// paths I see only a "Download" option and no "Upload" or "Import/Compile." When I'm navigating the local file tree, I see Import options, but no way to select the namespace into which I want to import.

I've worked around this by creating the package name on the isfs:// path as "folders," adding a file for the classname, then pasting the code from the source class to the new classname "file." I can then compile and get the end result I desire, but not quite in a way I find intuitive.

Product version: IRIS 2021.2
0 483
Discussion (8)3
Log in or sign up to continue

@Jeffrey Drumm 
VS Code isn't a CI/CD tool so it wasn't specifically designed for this but it is doable if you're working client-side. You can export files from one namespace, change the namespace in your settings.json file and then import and compile.

Nice and easy...

That's like having an anteroom into bedroom and living room. There is always just one door open. If you want to go into bedroom, you have to brick the door of the living room and make a break through into the bedroom. The way back into living room is the same, just vice versa...

@Brett Saviano ,

Apologies if I'm seeming a little dense here, but what's the relevance of CI/CD to the workflow I described? In my experience the need to move code from one work area to another has been fairly common, and while it's not a streamlined operation in IRIS Studio, it at least doesn't require editing configuration files.

I'm not talking about big projects here, just the sort of stuff you need to do in healthcare integration (custom business hosts, scheduled tasks, or utility methods used in business rules/DTLs).

Is VS Code simply the wrong tool for my needs? I use it for other projects and very much like it as an editor, so was hopeful it would be an effective replacement for IRIS Studio.

@Jeffrey Drumm 
Sorry, I assumed you were asking this in the context of CI. AFAIK the only way to do this is what I described. If you would like a way to do this using server-side editing, please file an enhancement request issue in the GitHub repo.

Enhancement request filed. Thanks!

When you have ISFS configured to multiple namespaces, you can just use copy-paste ability to copy files between isfs folder, or with using real folder.

I've followed up with you on Github, as this does not appear to work for me (either ctrl/left-click/drag or copy/paste).