@@ -10,14 +10,34 @@ export class PythonInlineValueProvider implements InlineValuesProvider {
10
10
11
11
public async provideInlineValues ( document : TextDocument , viewPort : Range , context : InlineValueContext ) : Promise < InlineValue [ ] > {
12
12
console . log ( "inline provider" ) ;
13
- let variables = await resolveInlineVariables ( {
14
- uri : document . uri . toString ( ) ,
15
- viewPort : viewPort ,
16
- stoppedLocation : context . stoppedLocation ,
17
- } ) ;
13
+ let a = JSON . stringify ( context ) ;
14
+ const allValues : InlineValue [ ] = [ ] ;
15
+
16
+ for ( let l = 0 ; l <= context . stoppedLocation . end . line ; l ++ ) {
17
+ const line = document . lineAt ( l ) ;
18
+ var re = / \b [ a - z A - Z _ ] [ a - z A - Z 0 - 9 _ ] * \b / g;
19
+ do {
20
+ var m = re . exec ( line . text ) ;
21
+ if ( m ) {
22
+ const varName = m [ 0 ] ;
23
+ const rng = new Range ( l , m . index , l , m . index + varName . length ) ;
24
+
25
+ //allValues.push(new vscode.InlineValueText(r, `${varName}: some value`));
26
+ allValues . push ( new InlineValueVariableLookup ( rng , varName ) ) ;
27
+ //allValues.push(new vscode.InlineValueEvaluatableExpression(r, varName));
28
+ }
29
+ } while ( m ) ;
30
+ }
31
+
32
+ return allValues ;
33
+ // let variables = await resolveInlineVariables({
34
+ // uri: document.uri.toString(),
35
+ // viewPort: viewPort,
36
+ // stoppedLocation: context.stoppedLocation,
37
+ // });
38
+
18
39
return [ ] ;
19
40
}
20
-
21
41
}
22
42
23
43
// tslint:disable-next-line:interface-name
@@ -43,5 +63,6 @@ export interface InlineVariable {
43
63
}
44
64
45
65
export async function resolveInlineVariables ( inlineParams : InlineParams ) : Promise < InlineVariable [ ] > {
46
- return < InlineVariable [ ] > await executeCommand ( "vscode.python.resolveInlineVariables" , JSON . stringify ( inlineParams ) ) ;
47
- }
66
+ debug . startDebugging ;
67
+ return < InlineVariable [ ] > await executeCommand ( "vscode.debug.resolveInlineVariables" , JSON . stringify ( inlineParams ) ) ;
68
+ }
0 commit comments