HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.12k stars 652 forks source link

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

Open RustyMoyher opened 5 years ago

RustyMoyher commented 5 years ago

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.

Simn commented 5 years ago

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

Gama11 commented 5 years ago

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

Simn commented 5 years ago

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.

Gama11 commented 5 years ago

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.

Simn commented 5 years ago

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?

Gama11 commented 5 years ago

Something like that, yeah.

kLabz commented 2 months ago

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