-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Debug adapters should get the current open folder #7435
Comments
@roblourens Initially we had a 'cwd' attribute as part of the protocol for 'launch' and 'attach'. But later we decided to remove all 'standard' attributes from the the 'launch' and 'attach' requests because they are highly debugger specific. So every debug adapter can introduce a 'cwd' in their package.json. I suggest that you introduce a mandatory attribute 'cwd' and set its default value to ${workspaceRoot}. Add this to your default launch config as well. |
What do you mean 'highly debugger specific'? Seems like it would be applicable to any other client implementing the debug protocol. I'm trying to make the config simpler, but adding a mandatory property that should have the same value 100% of the time has the opposite effect. |
@roblourens with 'highly debugger specific' I was referring to the whole set of attributes that we had initially. I agree, 'cwd' is probably one of the generic attributes. My reluctance to introduce any 'side channel' attributes not visible to the user in his launch config, comes from my bad experience with any implicit, behind-the-scene magic: if I see a launch config, I see the whole picture. If you want to glob for files automatically, why not making this explicit? I've seen many project folders with nested sub projects that had their own launch configs. Globbing at the root folder will probably not exclude the sub projects, which might be confusing. Having an explicit attribute where a user can specify from where to start the globbing seems to me a more transparent and flexible approach. Do you consider to have an optional attribute where the user could override the default globbing behaviour? |
I agree in principle but it doesn't seem like magic to me because the user explicitly opened that folder. I would definitely allow them to override it for subprojects. I understand if you don't want to add it, at least specifying 'cwd' would still be simpler than figuring out 'webRoot' which is the property I want to get rid of. |
@roblourens I'm not sure that I understand 'cwd' any better than 'webRoot' in the context of a web project. But you can use/introduce whatever you want. What I don't understand is why you think that 'figuring out webRoot' is difficult? If a user is asked to create a new launch config, she will pick the Chrome Debug type and that will create launch configs that have the |
In a really simple web project, you have some files that get built to And then even in simple cases, I've found that some people are confused about what it should be set to, and I want to make it as simple as possible. |
@weinand @isidorn - It would be interesting to use #8645 to start the debug adapter with the workspaceRoot path via I probably wouldn't do this for webRoot like I said in June - like Andre said,
Changing the webRoot is somewhat common, and seeing the webRoot is necessary to understanding the behavior of chrome-debug. But I think that changing 'cwd' is more common, and people will already understand it if they need to change it. Thoughts? |
If the extension contributes a startSessionCommand it can manipulate the launch.json as it sees fit, thus adding a |
@roblourens since we can manipulate the launch.json in the extension's |
I think there used to be a 'cwd' property automatically sent over set to the current directory. Why was it removed? I'd like to make my launch config simpler by globbing for files inside the user's open folder.
The text was updated successfully, but these errors were encountered: