Skip to content

Commit 41a771f

Browse files
committed
Partial fix for issue 95 - set all scopes but Local as expensive.
This makes the debug hover tips work better. But if you want to look at a variable in a higher scope, you have to select that scope in the callstack so the variable is a "local" variable in that scope.
1 parent 1b4eff0 commit 41a771f

File tree

1 file changed

+14
-15
lines changed
  • src/PowerShellEditorServices.Protocol/DebugAdapter

1 file changed

+14
-15
lines changed

src/PowerShellEditorServices.Protocol/DebugAdapter/Scope.cs

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,33 @@
33
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
44
//
55

6-
using System;
7-
using System.Collections.Generic;
8-
using System.Linq;
9-
using System.Text;
10-
using System.Threading.Tasks;
11-
126
namespace Microsoft.PowerShell.EditorServices.Protocol.DebugAdapter
137
{
148
public class Scope
159
{
16-
// /** name of the scope (as such 'Arguments', 'Locals') */
17-
// name: string;
10+
/// <summary>
11+
/// Gets or sets the name of the scope (as such 'Arguments', 'Locals')
12+
/// </summary>
1813
public string Name { get; set; }
1914

20-
// /** The variables of this scope can be retrieved by passing the value of variablesReference to the VariablesRequest. */
21-
// variablesReference: number;
15+
/// <summary>
16+
/// Gets or sets the variables of this scope can be retrieved by passing the
17+
/// value of variablesReference to the VariablesRequest.
18+
/// </summary>
2219
public int VariablesReference { get; set; }
2320

24-
// /** If true, the number of variables in this scope is large or expensive to retrieve. */
25-
// expensive: boolean;
21+
/// <summary>
22+
/// Gets or sets a boolean value indicating if number of variables in
23+
/// this scope is large or expensive to retrieve.
24+
/// </summary>
2625
public bool Expensive { get; set; }
2726

2827
public static Scope Create(VariableScope scope)
2928
{
30-
return new Scope
31-
{
29+
return new Scope {
3230
Name = scope.Name,
33-
VariablesReference = scope.Id
31+
VariablesReference = scope.Id,
32+
Expensive = (scope.Name != VariableContainerDetails.LocalScopeName)
3433
};
3534
}
3635
}

0 commit comments

Comments
 (0)