Skip to content

Commit 8487b7c

Browse files
committed
[audio] Code completion fix
1 parent 7ec573e commit 8487b7c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

runtime/src/ceramic/macros/AudioFiltersMacro.hx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ class AudioFiltersMacro {
191191
#elseif (web && !completion && !display)
192192
final classRef = Context.getLocalClass().get();
193193
final classPos = Context.getPosInfos(classRef.pos);
194-
final filePath = Path.join([Sys.getCwd(), Context.getPosInfos(Context.currentPos()).file]);
194+
var filePath = Context.getPosInfos(Context.currentPos()).file;
195+
if (!Path.isAbsolute(filePath)) {
196+
filePath = Path.join([Sys.getCwd(), filePath]);
197+
}
195198
addFilterReference({
196199
pack: [].concat(classRef.pack ?? []),
197200
name: classRef.name,
@@ -256,7 +259,10 @@ class AudioFiltersMacro {
256259
}
257260
final classRef = Context.getLocalClass().get();
258261
final classPos = Context.getPosInfos(classRef.pos);
259-
final filePath = Path.join([Sys.getCwd(), Context.getPosInfos(Context.currentPos()).file]);
262+
var filePath = Context.getPosInfos(Context.currentPos()).file;
263+
if (!Path.isAbsolute(filePath)) {
264+
filePath = Path.join([Sys.getCwd(), filePath]);
265+
}
260266
addWorkletReference({
261267
pack: [].concat(classRef.pack ?? []),
262268
name: classRef.name,

0 commit comments

Comments
 (0)