Skip to content
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

Extend scenarios when dynamic configuration providers will be shown for Run and Debug #193828

Closed
WardenGnaw opened this issue Sep 22, 2023 · 9 comments · Fixed by #196768
Closed
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues insiders-released Patch has been released in VS Code Insiders under-discussion Issue is under discussion for relevance, priority, approach
Milestone

Comments

@WardenGnaw
Copy link
Member

Automatic (dynamic) debug providers are only displayed when there is an active file. If a user tries to Run and Debug without an active file, the dynamic debug providers are not shown.

This feature request is looking to enhance the hueristic used to determine when to show the automatic debug configuration providers.

Hueristic proposals:

  • Look at the open folder file types and enable dynamic providers for those file / languages.
  • Combine an activation event and a dynamic configuration provider.

I'm also open to other heurestics other folks might have in mind.

@isidorn isidorn added debug Debug viewlet, configurations, breakpoints, adapter issues under-discussion Issue is under discussion for relevance, priority, approach labels Sep 22, 2023
@isidorn
Copy link
Contributor

isidorn commented Sep 22, 2023

fyi @connor4312 for ideas

@timheuer
Copy link
Member

Hot take: the same problems we think we're trying to solve already exist for non-dynamic debuggers. NodeJS shows up for me when I'm in a .NET app today, so it's already not 'smart' in that sense, and I just feel that showing dynamic providers could map to the same model.

@WardenGnaw
Copy link
Member Author

the same problems we think we're trying to solve already exist for non-dynamic debuggers.

Two questions from this:

  1. Are we using dynamic configuration providers correctly? We are using dynamic configurations just so we don't have to write these configurations to launch.json
  2. If we are not, is there a way to make initial configuration providers use the machine storage instead of launch.json.

E.g.
https://github.com/microsoft/vscode/blob/720fb55092665562fec8fa2ae27f5eeb5561510e/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.ts#L432C10-L432C10

@isidorn
Copy link
Contributor

isidorn commented Sep 26, 2023

@timheuer yes - that is a correct hot take! We have this heuristic to determine what debugger to use, and we use that heuristic whenever there is NO launch.json file. Thus we use it to decide what dynamic configuration provider to use, what debug extension to ask to try to launch without a launch.json etc...

No, there is not way to make initial configuration provider use the machine storage instead of launch.json.

What I tried to say in my initial comment, is that we have to improve the general heuristic for auto-picking a debugger. However since this is a problem that we have for all languages since day 1 of vscode I suggest that we wait for @roblourens to chime in. He is currently focused on Copilot Chat work so it might take a bit of time. Thanks for understanding.

@roblourens
Copy link
Member

Automatic (dynamic) debug providers are only displayed when there is an active file.

I don't think that's true, isn't this a dynamic debug config provider?

image

Maybe you aren't activating your extension on onDebugDynamicConfigurations:...?

@WardenGnaw
Copy link
Member Author

WardenGnaw commented Sep 28, 2023

C# Dev Kit has it in its package.json

image

Automatic (dynamic) debug providers are only displayed when there is an active file.

This is for the F5 (Run and Debug), not selecting the Show all automatic debug configurations

@roblourens
Copy link
Member

I don't think the automatic config providers are shown in that case though?

But here we will invoke your DA with no file open
image

@WardenGnaw
Copy link
Member Author

I don't think the automatic config providers are shown in that case though?

Thats the issue, we want F5 to show the C# dynamic provider instead of the initial configuraiton providers of .NET5+ and .NET Core since those will be hidden if C# Dev Kit is installed.

We dont use initial configuration providers because we want the configurations to be saved in the machine memory.

@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Nov 6, 2023
@VSCodeTriageBot VSCodeTriageBot added this to the November 2023 milestone Nov 6, 2023
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Nov 7, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues insiders-released Patch has been released in VS Code Insiders under-discussion Issue is under discussion for relevance, priority, approach
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants