softwareCobbler / luceedebug

line debugger for lucee
GNU Lesser General Public License v2.1
44 stars 15 forks source link

improve PrefixPathTransform with case insensitive comparaison #54

Closed pibica closed 2 months ago

softwareCobbler commented 2 months ago

This looks good, nice find. But, I think instead of direct calls to to toLowerCase, we should use Config.canonicalizePath(String), which will call toLowerCase only on case-insensitive filesystems, and it should already be detecting your filesystem as case insenstive on agent startup. You could do something like add Config to the PrefixPathTransform object constructor and store a ref to it there; the one in DapServer would be the one to use.

pibica commented 2 months ago

The issue of using Config.canonicalizePath(String) is that it uses the case sensitive info of the server only, not the IDE OS. So it will not work on a Linux Server with a debugger on Windows.

softwareCobbler commented 2 months ago

Ah, path math is hard.

One weird case might be a user having somePath/foo.cfc and somePath/FOO.cfc, but why would anyone do that, and it's my understanding that Lucee is case insensitive in this respect anyway, so it's an impossible weird case.

Anyway, it doesn't break anything over here, and it fixes something over there, so in she goes.