File tree Expand file tree Collapse file tree 2 files changed +22
-6
lines changed
modifiers/scopeTypeStages Expand file tree Collapse file tree 2 files changed +22
-6
lines changed Original file line number Diff line number Diff line change @@ -3,23 +3,23 @@ import {
3
3
EveryScopeModifier ,
4
4
Target ,
5
5
} from "../../../typings/target.types" ;
6
- import ScopeTypeTarget from "../../targets/ScopeTypeTarget " ;
6
+ import NotebookCellTarget from "../../targets/NotebookCellTarget " ;
7
7
import { ProcessedTargetsContext } from "../../../typings/Types" ;
8
8
import { ModifierStage } from "../../PipelineStages.types" ;
9
9
10
10
export default class implements ModifierStage {
11
11
constructor ( private modifier : ContainingScopeModifier | EveryScopeModifier ) { }
12
12
13
- run ( context : ProcessedTargetsContext , target : Target ) : ScopeTypeTarget [ ] {
13
+ run ( context : ProcessedTargetsContext , target : Target ) : NotebookCellTarget [ ] {
14
14
if ( this . modifier . type === "everyScope" ) {
15
15
throw new Error ( `Every ${ this . modifier . type } not yet implemented` ) ;
16
16
}
17
17
18
18
return [
19
- new ScopeTypeTarget ( {
20
- delimiter : "\n" ,
21
- ... target ,
22
- scopeType : this . modifier . scopeType ,
19
+ new NotebookCellTarget ( {
20
+ editor : target . editor ,
21
+ isReversed : target . isReversed ,
22
+ contentRange : target . contentRange ,
23
23
} ) ,
24
24
] ;
25
25
}
Original file line number Diff line number Diff line change
1
+ import { Range , TextEditor } from "vscode" ;
2
+ import BaseTarget from "./BaseTarget" ;
3
+
4
+ interface NotebookCellTargetParameters {
5
+ editor : TextEditor ;
6
+ isReversed : boolean ;
7
+ contentRange : Range ;
8
+ }
9
+
10
+ export default class NotebookCellTarget extends BaseTarget {
11
+ constructor ( parameters : NotebookCellTargetParameters ) {
12
+ super ( parameters ) ;
13
+ this . scopeType = "notebookCell" ;
14
+ this . delimiter = "\n" ;
15
+ }
16
+ }
You can’t perform that action at this time.
0 commit comments