Skip to content

Commit 060d561

Browse files
committed
dap-config: add eval, only define hl for hl projects
1 parent e58c91d commit 060d561

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

src/HaxeClasspath.hx

+27-8
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,35 @@ class HaxeClasspath {
113113
public static function getDapConfig(?hxml:String = "build.hxml"):Void {
114114
try {
115115
var data = getClasspath(hxml, true);
116+
Sys.println('{');
117+
118+
if (data.target == 'hl') {
119+
Sys.println([
120+
' {',
121+
' name="HashLink",',
122+
' request="launch",',
123+
' type="hl",',
124+
' cwd="${data.cwd}",',
125+
' classPaths={${data.classpath.map(cp -> "\'" + cp + "\'").join(", ")}},',
126+
' program="${data.out}"',
127+
' },'
128+
].join('\n'));
129+
}
130+
116131
Sys.println([
117-
'{',
118-
' name="HashLink",',
119-
' request="launch",',
120-
' type="hl",',
121-
' cwd="${data.cwd}",',
122-
' classPaths={${data.classpath.map(cp -> "\'" + cp + "\'").join(", ")}},',
123-
' program="${data.out}"',
124-
'}'
132+
' {',
133+
' name="Eval",',
134+
' request="launch",',
135+
' type="eval",',
136+
' cwd="${data.cwd}",',
137+
' classPaths={${data.classpath.map(cp -> "\'" + cp + "\'").join(", ")}},',
138+
' haxeExecutable={executable="haxe"},',
139+
' args="${hxml}",',
140+
' trace=true,',
141+
' },'
125142
].join('\n'));
143+
144+
Sys.println('}');
126145
} catch (e) {
127146
Utils.displayError(Std.string(e));
128147
}

0 commit comments

Comments
 (0)