haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Diagnostics error occurs when an @ is used in the file path

Open RustyMoyher opened this issue 6 years ago • 7 comments

If the path of a file has an @ in it, an error will occur with diagnostics.

For example, I have a folder called @Projects. This causes the error to occur in VSCode when I save.

Invalid format: Projects/FlixelTut/source/PlayState.hx

The issue appears to be a compiler bug, probably a string.split() that goes wrong. Based on discussions with @Gama11 in Discord, we believe that Haxe does a a naive string split on @, assuming that can't appear in file paths.

RustyMoyher avatar Apr 01 '19 22:04 RustyMoyher

I... don't think this can be fixed in the old protocol.

Simn avatar Apr 02 '19 17:04 Simn

Why not? The @displaymode can only appear at the end, right?

Gama11 avatar Apr 02 '19 17:04 Gama11

Yes but the position is also separated with a @. It's file@pos@mode, and the mode is optional. So with fi@le@pos@mode we are in a bad spot.

Simn avatar Apr 02 '19 17:04 Simn

I'm not sure that can actually happen though? Or is @ a valid character in a module name?

The original issue here is with @ in an earlier part of the path.

Gama11 avatar Apr 02 '19 17:04 Gama11

Not sure what you mean, something like /something/@Projects/File.hx@12@position is just the case I mention. Or do you think we should try to find the File.hx first and then take it from there?

Simn avatar Apr 02 '19 18:04 Simn

Something like that, yeah.

Gama11 avatar Apr 02 '19 18:04 Gama11

Should be fine now that diagnostics have been moved to Json RPC

kLabz avatar Jul 19 '24 20:07 kLabz