Overall, I'm a bit disappointed that this feature is only available for this one specific setup. I think it should be usable as soon as i have an active server connection to a namespace in iris.

If the connection is defined in a .vscode/settings.json, then the files should be exported to the src folder ((or whatever is defined in the setting objectscript.export.folder)) next to the .vscode folder.

Additionally, it would be nice if this feature will be registered as a separat command in vscode, such that is not anymore necessary that the project explorer view is displayed (which is only the case if at least one server-side virtual folder is defined in the current multi-root-workspace).

I had the same problem, that this feature simply didn't seem to work — but now I have found a way to make it work.

For this feature to work, the active server connection must be defined in the .code-workspace file.
I have described more details here: https://community.intersystems.com/post/how-export-project-visual-studio...

I had previously assumed that it was sufficient for the feature if there was an active server connection in the first place, regardless of where it was defined.

I just found a combination of vs code workspace configuration that worked! 🎉

You have to use a Multi-Root-Workspace with at least one folder in the local filesystem (usually the folder in which the .code-workspace file is stored) and at least one server-side virtual folder.
The later is necessary to enable the Project Explorer in the InterSystems view container, where you can select the "Export Project Contents" option.
AFAIK, this is the only way to execute this command in VS Code.

The feature "Export Project Content" now only works as expected, if (and in my experience only if) the  IRIS server connection is defined in the .code-workspace file of the current workspace.

{
  "folders": [
    {
      "name": "Local Root Folder"
      "path": ".",
    },
    {
      "name": "Server Folder: local-iris:IRISAPP (read-only)",
      "uri": "isfs-readonly://local-iris:irisapp/?mapped=0&system=0",
    },
  ],
  "settings": {
    "intersystems.servers": {
      "local-iris": {
        "webServer": {
          "scheme": "http",
          "host": "localhost",
          "port": 52773,
        },
        "username": "_SYSTEM",
      },
    },
    "objectscript.conn": {
      "server": "local-iris",
      "ns": "IRISAPP",
      "active": true,
    },
  },
}

It won't work (as reported here and in other posts) if there is an active server connection that is defined in any other place, e.g. in .vscode/settings.json.

@Brett Saviano is this what you meant in your previous answer?
 

I, in fact, do have the other use case where I want to export all contents of my project to my filesystem so that I am able to use local, client-side Git as VSC. But I always get the same error message "There are no folders in the current workspace ..." like reported by @Pietro Di Leo 

But my workspace has folders, so I don't understand what's missing to use this feature or if it is a bug.

@Brett Saviano do you have any suggestions for the use case?

I even took a look at the vs code extension sourcecode, but did not understand which exact conditions lead to the error message: https://github.com/intersystems-community/vscode-objectscript/blob/14bd8...
 

I solved this as described in the following post (and comments): https://community.intersystems.com/node/507036

But since this approach is somewhat cumbersome and some time has passed since, I wonder if anyone has found a better way to deliver static files via WebApp and put the IRIS login page in front of it for authentication?

Since having AutoCompile enabled comes with security issues and won't even work out-of-the-box from IRIS version 2025.1 onwards (see https://docs.intersystems.com/iris20251/csp/docbook/changes/index.html#C...) I came up with a solution without the need of enabling the AutoCompile-option in the WebApp:

We just have to make sure that the index.csp is compiled once. To do so, we call $SYSTEM.CSP.LoadPageDir("/my-app", "ck") right after we create the WebApplication programmatically.

Example from our IPM module.xml:

    <!-- Compile all csp files of webapp /my-app -->
    <Invoke Class="%SYSTEM.CSP" Method="LoadPageDir" CheckStatus="true">
        <Arg>/my-app</Arg>
        <Arg>ck</Arg>
    </Invoke>