@@ -9,31 +9,34 @@ export function runEntireFile() {
9
9
vscode . commands . executeCommand ( "jupyter.execSelectionInteractive" , text ) ;
10
10
}
11
11
12
- export function runInferredCodeBlock ( ) {
12
+ export function runInferredCodeBlock ( ) : void {
13
13
const textEditor = vscode . window . activeTextEditor ;
14
- console . log ( ' textEditor' , textEditor ) ;
14
+ console . log ( " textEditor" , textEditor ) ;
15
15
if ( ! textEditor ) {
16
16
return ;
17
17
}
18
18
19
19
const initialCursorPosition = textEditor ?. selection . anchor ;
20
- console . log ( ' initialCursorPosition' , initialCursorPosition ) ;
20
+ console . log ( " initialCursorPosition" , initialCursorPosition ) ;
21
21
22
22
const expandedCodeRange = getExpandedCodeRegion (
23
23
textEditor ,
24
24
initialCursorPosition
25
25
) ;
26
- console . log ( ' expandedCodeRange' , expandedCodeRange ) ;
26
+ console . log ( " expandedCodeRange" , expandedCodeRange ) ;
27
27
28
28
const text = textEditor . document . getText ( expandedCodeRange ) ;
29
- console . log ( ' text' , text ) ;
29
+ console . log ( " text" , text ) ;
30
30
vscode . commands . executeCommand ( "jupyter.execSelectionInteractive" , text ) ;
31
31
32
32
// TODO: move cursor to end of range
33
33
const endPosition = new Position ( expandedCodeRange . end . line + 1 , 0 ) ;
34
34
const newSelection = new Selection ( endPosition , endPosition ) ;
35
35
textEditor . selections = [ newSelection ] ;
36
+ }
36
37
38
+ export function runInferredCodeBlockAndMoveDown ( ) : void {
39
+ runInferredCodeBlock ( ) ;
37
40
}
38
41
39
42
function getExpandedCodeRegion (
@@ -42,13 +45,13 @@ function getExpandedCodeRegion(
42
45
) : Range {
43
46
// Assuming that no text is selected
44
47
const beginRange = new Range ( initialPosition , initialPosition ) ;
45
- console . log ( ' beginRange' , beginRange ) ;
48
+ console . log ( " beginRange" , beginRange ) ;
46
49
47
50
const initialIndentText = getInitialIndentText ( editor , initialPosition ) ;
48
- console . log ( ' initialIndentText' , initialIndentText ) ;
51
+ console . log ( " initialIndentText" , initialIndentText ) ;
49
52
50
53
const finalRange = expandRangeDownward ( editor , beginRange , initialIndentText ) ;
51
- console . log ( ' finalRange' , finalRange ) ;
54
+ console . log ( " finalRange" , finalRange ) ;
52
55
return finalRange ;
53
56
}
54
57
@@ -89,7 +92,7 @@ function expandRangeDownward(
89
92
document . lineAt ( nextLineNum ) . text . match ( expandRegex )
90
93
) {
91
94
nextLineNum += 1 ;
92
- console . log ( ' adding a line number' )
95
+ console . log ( " adding a line number" ) ;
93
96
}
94
97
95
98
const endPosition = document . lineAt ( nextLineNum + 1 ) . range . end ;
0 commit comments