Cannot import and compile from VS Code
Hi,
I'm trying out VS Code with IRIS for Health 2023.2 (not available in above dropdown) in a local container. I can open read-only files in the Objectscript viewer and have a local folder connected to the correct namespace. However, when I make changes and try the "import and compile" option, I get:
ERROR #16006: Document <filepath> name is invalid
The first four chars of <filepath> appear to have been truncated
Here is my settings.json
{
"security.workspace.trust.untrustedFiles": "open",
"workbench.colorTheme": "InterSystems Default Dark",
"intersystems.servers": {
"local_docker": {
"webServer": {
"scheme": "http",
"host": "localhost",
"port": 9492
},
"username": "_system"
},
}
}
I only see these options when I search for "compile" in the VS Code palette
.png)
I get the error when I choose "import and compile" from here
.png)
It looks like you are trying to use "Import and Compile" with an XML export. This won't work, as it only supports UDL-format exports. VS Code users can create those exports from the ObjectScript view.
Based on the hl7, inc and mac folders visible in your screenshot it looks like you might want to set the following in your VS Code settings before using the export if you want to replicate that style.
I also suggest you start off by opening an empty folder in VS Code, then export into that. This will avoid polluting your existing working folder structure while you get the hang of using VS Code with InterSystems servers.
Thanks John. Our codebase is made up of the exported cls (*.cls.xml not *.cls), so I guess we need to move to storing native class files in source to be able to use that functionality?
Yes, I recommend you migrate away from using XML exports of class definitions.