Closed elsassph closed 4 years ago
sourceRoot is only used to adjust source map paths when using BrighterScript to transpile your project from a staging directory. The extension does not use BrighterScript at all when packaging the project for debug. From what I can tell, you should delete sourceRoot and sourceDirs, and set rootDir to "./src".
I think your only issue is that you need to tell the debugger where the root of your Roku project resides...and that's exactly what rootDir is for.
So just to be clear, if this is your project structure:
And you aren't doing any type of pre-build, then your launch config (and bsconfig) should look like this:
{
"rootDir": "./src",
}
That tells the language server (and roku-deploy) to treat project/src
as the root of your project.
I'll try again by changing rootDir
, but we have resources and manifest outside of src
.
So you're right I can make it work with rootDir: "src"
and in the files moving ../manifest
into place.
I had issues because { src: "../manifest", dest: "." }
causes unintuitive "can not unlink 'out/.roku-deploy-staging'" errors, but it works with { src: "../manifest", dest: "manifest" }
.
I know I should change our project structure but we have half a dozen of projects with this odd organisation.
{ src: "../manifest", dest: "." }
is invalid, and { src: "../manifest", dest: "manifest" }
is correct. Here's the rule from roku-deploy:
As far as the cryptic error message, it's pretty hard in roku-deploy to know what you intended to do until runtime, since we support globs. But for single file paths, I think we might be able to better detect that. I'll open an issue on roku-deploy and see what we can do.
So, is this issue resolved for you?
Yes I'm good now.
Our project is organised (for some reason):
So
bsconfig.json
has:rootDir: "."
andsourceRoot: "src/"
And VSCode
launch.json
for debugging has:"sourceDirs": [ "${workspaceFolder}/src" ]
Now the problem is that
BreakpointManager
callsLocationManager.getStagingLocations
with source roots in this order:project/
project/src/
which crashes during breakpoint insertion because it tries to create a breakpoint in
project/out/.staging/src/source/main.brs