Skip to content

Add proper variable scoping support in the DebugService #28

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

Closed
daviwil opened this issue Nov 9, 2015 · 5 comments
Closed

Add proper variable scoping support in the DebugService #28

daviwil opened this issue Nov 9, 2015 · 5 comments
Assignees
Labels
Issue-Enhancement A feature request (enhancement).
Milestone

Comments

@daviwil
Copy link
Contributor

daviwil commented Nov 9, 2015

Currently the DebugService only gathers variables from the local scope when the debugger stops. Ideally all available variable scopes should be provided, both the global scope and all dynamic scopes in between that and the local scope. Non-local scopes should not be expanded by default though. The debugger client will ask for a given scope to be expanded when necessary.

@daviwil daviwil added Issue-Enhancement A feature request (enhancement). Up for Grabs Will shepherd PRs. labels Nov 9, 2015
@daviwil daviwil added this to the 0.2.0 milestone Nov 16, 2015
@rkeithhill
Copy link
Contributor

I'm starting to look at this. I really want to have Global, Script and Local nodes in the variables window. This would be very similar to the JavaScript debug variables window:

vscjavascriptvaribles

I propose that we do the following:

  • Local shows the results of Get-Variable -Scope <number> where number is based on which stackframe has been selected in the Callstack debug window with 0 for the topmost, 1 for the next one down in the list, etc.
  • Script shows the results of Get-Variable -Scope Script
  • Global shows the results of Get-Variable -Scope Global

I'm considering filtering out AllScope, Constant variables for all of the above scopes which would remove the useless $true/$false "variables" but that would also remove the following variables as well: ExecutionContext, Host, PID, PSHome, PSVersionTable, ShellId. That seems reasonable to me but would appreciate feedback on this.

Note that I'm suggesting changing the current "Locals" to "Local" because "Scripts" doesn't make sense and I think JavaScript has set a good precedent.

@daviwil daviwil modified the milestones: 0.2.0, 0.3.0 Nov 20, 2015
@daviwil daviwil removed the Up for Grabs Will shepherd PRs. label Dec 1, 2015
@daviwil
Copy link
Contributor Author

daviwil commented Dec 1, 2015

👍 All sounds great to me!

@Jaykul
Copy link

Jaykul commented Dec 2, 2015

Of those, the only one I imagine is routinely useful for debugging is the ExecutionContext (and maybe Host) -- the rest are actually static, right? However, if I were doing it, I'd leave the AllScope variables in Global.

@rkeithhill
Copy link
Contributor

@daviwil How about we close this issue and I open three new enhancement issues - variables organization/filtering, indicating which variables have changed values since last debug stop and updating variables when user modifies (or adds) a variable in the debug console.

@daviwil
Copy link
Contributor Author

daviwil commented Dec 3, 2015

Sounds great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

3 participants