Closed philliphoff closed 1 year ago
@MregXN You can investigate on this one first.
Hi, @philliphoff. Is that mean the local dapr.yaml file should be read by this extension and properties in this file needs to be filled in task.json and launch.json?
No, the suggestion is that, if the tasks.json
and launch.json
files omit the property that would normally point to the one and only dapr.yaml
in the repo, the extension, when running the task and/or launching the debugger would simply assume that that dapr.yaml
is the one to be used in the dapr run -f ...
command. The .json
files need not be changed. We're just saying that the user doesn't need to tell the extension (in the .json
files) which file to use because the extension can figure it out at the time it actually needs to use it.
Hi, @philliphoff. I wanna confirm my understanding is correct with following code snippet.
tasks.json:
{
"label": "dapr",
"type": "dapr",
// "runFile": "./dapr.yaml"
}
launch.json:
{
"name": "Launch Dapr",
"request": "launch",
"type": "dapr",
//"runFile": "${workspaceFolder}/dapr.yaml",
"preLaunchTask": "dapr"
}
If users do not specify a runFile (e.g., it is commented out in the code snippet), but task and launch configurations of type "dapr" still exist, extension should automatically use the dapr.yaml in the workspace without modifying these two json files. Is this right?
If users do not specify a runFile (e.g., it is commented out in the code snippet), but task and launch configurations of type "dapr" still exist, extension should automatically use the dapr.yaml in the workspace without modifying these two json files. Is this right?
Correct, there is no need to modify the configuration files; the extension should just assume use of the run file in the workspace (when it actually invokes the task/launch).
Thinking about this more, there may be a subtlety here in that we should probably make this assumption only when no other properties are specified.
For example, make the assumption in this case (because there's no properties that would otherwise be placed in a run file):
{
"dapr": "dapr",
"type": "dapr"
}
But not in this case (because the app ID is specified, indicating an explicit configuration of an app)
{
"dapr": "dapr",
"type": "dapr",
"appId": "my-app"
}
Closed with #300.
If a Dapr task definition or debug launch configuration has been defined without an explicit run file, infer the
dapr.yaml
at the root of the workspace (if present). This will make creation/scaffolding of such configuration files simpler.