Closed jamiejackson closed 1 year ago
(huh didn't mean to close)
This is now pathTransforms
(plural), but the syntax is as you show it - a JSON array literal. It can be of length 0, 1, or many. The first matching prefix wins. If no match is found, no transform takes place.
I don't know how it'll play with a multiroot workspace, I think a debug launch config is per workspace, so ${workspaceRoot}
is always a single value. It would seem natural for it to find files across both workspaces, assuming it's being given absolute paths.
Thanks! I'll try it out in the next few days.
I haven't tried it with multiple mappings yet but I have verified that a single mapping does work inside of the new array structure. PR to fix up the docs and references: #15
I'll report back when I've verified the behavior of multiple mappings.
@softwareCobbler , could you describe how precedence works when multiple (potentially "nested") mappings are specified? I looked at the new munging code but it wasn't obvious how it worked, from a quick read-through.
Good news, the multiple pathTransforms
seems to be working!
Regarding precedence: This order works:
"pathTransforms": [
{
"idePrefix": "/Users/jjackson/projects/hudx/hudx_mura_fork/app/core",
"cfPrefix": "/var/www/wwwroot/core"
},
{
"idePrefix": "${workspaceFolder}/cfml/deployment_root",
"cfPrefix": "/var/www"
},
]
The reverse order doesn't work. It says the file doesn't exist and asks if I want to add it. For example, if I set a breakpoint in /Users/jjackson/projects/hudx/hudx_mura_fork/app/core/mura/content/contentServer.cfc
, it wants to create a file in /Users/jjackson/projects/hudx/hudx/cfml/deployment_root/wwwroot/core/mura/content/contentServer.cfc
.
In other words, the lower the array index (i.e., physically higher in the config file), the higher the precedence. Is that what you had in mind? My brain works the opposite way but that's probably just subjective.
Regardless of how it shakes out, I can send a documentation PR on it, if you'd like.
Never mind, I just reread your comments:
The first matching prefix wins.
That's what we've got already, so I'll send a documentation PR.
Added documentation to #15.
I don't know how it'll play with a multiroot workspace, I think a debug launch config is per workspace, so ${workspaceRoot} is always a single value. It would seem natural for it to find files across both workspaces, assuming it's being given absolute paths.
I found the ${workspaceFolder:my_folder_name}
syntax in the VS code docs. It's working well, so far. I like that it (along with the hudx.code-workspace
workspace definition) is portable, so my team can use it from SCM without needing personal versions.
"configurations": [
{
"type": "cfml",
"request": "attach",
"name": "Debug HUDX Lucee",
"hostName": "local.hudx.net",
"port": 10000,
"pathTransforms": [
{
"idePrefix": "${workspaceFolder:mura}/app/core",
"cfPrefix": "/var/www/wwwroot/core"
},
{
"idePrefix": "${workspaceFolder:hudx}/cfml/deployment_root",
"cfPrefix": "/var/www"
},
]
}
]
I may end up documenting this, too.
I think I need multiple
pathTransform
s.I think (because I'm new to vs code) I want a multi-root workspace as follows:
Since I bake the Mura core into my image, it's not available in my_site_cfml. I have Mura checked out separately.
I'd want something like:
I could probably work around it with symlinks or something, but it would be good to have native support.
It might get a little tricky because layering would need to be accommodated. (It would probably make sense to have increasing precedent as you append to the
pathTransform
array.