softwareCobbler / luceedebug

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

The editor could not be opened because the file was not found. #53

Closed pibica closed 1 month ago

pibica commented 2 months ago

Configuration: Lucee server on a Windows machine with luceedebug configured The default lucee index.cfm is located here: E:\dev\bin\Lucee\lucee-express\webapps\ROOT\index.cfm

vscode with luceedebug extension on another Windows machine The default lucee index.cfm is located here: E:\MyServer\webapps\ROOT\index.cfm

launch.json:

        {
          "idePrefix":    "e:\\MyServer\\webapps",
          "serverPrefix": "e:\\dev\\bin\\lucee\\lucee-express\\webapps"
        }

When setting a breakpoint in index.cfm

debugBreakpointBinding:

Breakpoints luceedebug has:
  (ide)    e:\MyServer\webapps\ROOT\index.cfm:2 (bound)
  (server) e:\dev\bin\lucee\lucee-express\webapps\root\index.cfm:2 (bound)

Path transforms:
  PrefixPathTransform{idePrefix='e:\MyServer\webapps', serverPrefix='e:\dev\bin\Lucee\lucee-express\webapps'}

Files luceedebug knows about (all filenames are as the server sees them, and match against breakpoint 'server' paths):
  cipage.java
  componentpage.java
  componentpageimpl.java
  e:\dev\bin\lucee\lucee-express\lucee-server\context\components\org\lucee\cfml\component.cfc
  e:\dev\bin\lucee\lucee-express\webapps\root\application.cfc
  e:\dev\bin\lucee\lucee-express\webapps\root\index.cfm
  pageimpl.java

the breakpoint is bound, but the breakpoint is reached, vscode displays this error:

image

and try to open E:\dev\bin\lucee\lucee-express\webapps\root\index.cfm (server path) instead of e:\MyServer\webapps\ROOT\index.cfm (ide path)

if I change the launch.json by (the drive letter is now in capital letter):

        {
          "idePrefix": "E:\\MyServer\\webapps",
          "serverPrefix": "E:\\dev\\bin\\lucee\\lucee-express\\webapps"
        }

debugBreakpointBinding:

Breakpoints luceedebug has:
  (ide)    e:\MyServer\webapps\ROOT\index.cfm:2 (unbound)
  (server) e:\myserver\webapps\root\index.cfm:2 (unbound)

Path transforms:
  PrefixPathTransform{idePrefix='E:\MyServer\webapps', serverPrefix='E:\dev\bin\lucee\lucee-express\webapps'}

Files luceedebug knows about (all filenames are as the server sees them, and match against breakpoint 'server' paths):
  cipage.java
  componentpage.java
  componentpageimpl.java
  e:\dev\bin\lucee\lucee-express\lucee-server\context\components\org\lucee\cfml\component.cfc
  e:\dev\bin\lucee\lucee-express\webapps\root\application.cfc
  e:\dev\bin\lucee\lucee-express\webapps\root\index.cfm
  pageimpl.java

The breakpooint is no longer bound

Both issues are related to the way the replacement of prefix is done in PrefixPathTransform I've a PR to fix both issues