Skip to content

Commit

Permalink
dap-config: add eval, only define hl for hl projects
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Aug 31, 2024
1 parent e58c91d commit 060d561
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions src/HaxeClasspath.hx
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,35 @@ class HaxeClasspath {
public static function getDapConfig(?hxml:String = "build.hxml"):Void {
try {
var data = getClasspath(hxml, true);
Sys.println('{');

if (data.target == 'hl') {
Sys.println([
' {',
' name="HashLink",',
' request="launch",',
' type="hl",',
' cwd="${data.cwd}",',
' classPaths={${data.classpath.map(cp -> "\'" + cp + "\'").join(", ")}},',
' program="${data.out}"',
' },'
].join('\n'));
}

Sys.println([
'{',
' name="HashLink",',
' request="launch",',
' type="hl",',
' cwd="${data.cwd}",',
' classPaths={${data.classpath.map(cp -> "\'" + cp + "\'").join(", ")}},',
' program="${data.out}"',
'}'
' {',
' name="Eval",',
' request="launch",',
' type="eval",',
' cwd="${data.cwd}",',
' classPaths={${data.classpath.map(cp -> "\'" + cp + "\'").join(", ")}},',
' haxeExecutable={executable="haxe"},',
' args="${hxml}",',
' trace=true,',
' },'
].join('\n'));

Sys.println('}');
} catch (e) {
Utils.displayError(Std.string(e));
}
Expand Down

0 comments on commit 060d561

Please sign in to comment.