AL icon indicating copy to clipboard operation
AL copied to clipboard

launch.json file

Open pmohanakrishna opened this issue 9 years ago • 2 comments

Is it mandatory to create launch.json file under vscode folder or can we create directly as other files? folder name also should be same vscode? how does it know server details first time while creating launch.json file? what if we have multiple servicetiers?

pmohanakrishna avatar Dec 22 '16 12:12 pmohanakrishna

and what are these parameters in launch.json? are they mandatory? can be changed? "name": "Publish", "projectRoot": "${workspaceRoot}", "packageFileName": "${command.resolvePackageFileName}",

pmohanakrishna avatar Dec 22 '16 12:12 pmohanakrishna

Yes, the the launch.json file must be located inside the .vscode folder. This is just how VSCode works. If you don't have a launch.json file (or have it in a wrong location), then next time you press F5, VSCode will offer you to create a new one and will place it where needed.

The server details are currently initialized to static values (localhost, Navision_main, etc). This is done for easier setup on the gallery image, but may change in the future when the extension becomes globally available.

About other parameters:

  • "name" can be customized, this is just for you to identify the configuration
  • "projectRoot" and "packageFileName" point to project folder and the name of the .navx file which should be deployed. ${} syntax means that values will be resolved at runtime. Typically you should not change these, but if you put correct paths there, it should work as well.

By the way, you can have multiple configurations in the launch.json file, see an example below. Then if you switch to Debug pane in VSCode (Ctrl+Shift+D), you would be able to select an active configuration in the top-left corner.

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "al",
            "request": "publish",
            "name": "Publish to main",
            "projectRoot": "${workspaceRoot}",
            "packageFileName": "${command.resolvePackageFileName}",
            "server": "http://localhost",
            "serverInstance": "Navision_main",
            "windowsAuthentication": true
        },
        {
            "type": "al",
            "request": "publish",
            "name": "Publish to other server",
            "projectRoot": "${workspaceRoot}",
            "packageFileName": "${command.resolvePackageFileName}",
            "server": "http://localhost",
            "serverInstance": "Other",
            "windowsAuthentication": true
        }
    ]
}

defr0std avatar Dec 22 '16 13:12 defr0std