@@ -7,7 +7,7 @@ import * as vscode from 'vscode';
77import { getDeepestNode , findNextWord , findPrevWord , getNode } from './util' ;
88import { Node , CssNode , Rule , Property } from 'EmmetNode' ;
99
10- export function nextItemStylesheet ( startOffset : vscode . Position , endOffset : vscode . Position , editor : vscode . TextEditor , rootNode : Node ) : vscode . Selection | undefined {
10+ export function nextItemStylesheet ( startOffset : vscode . Position , endOffset : vscode . Position , rootNode : Node ) : vscode . Selection | undefined {
1111 let currentNode = < CssNode > getNode ( rootNode , endOffset , true ) ;
1212 if ( ! currentNode ) {
1313 currentNode = < CssNode > rootNode ;
@@ -17,12 +17,12 @@ export function nextItemStylesheet(startOffset: vscode.Position, endOffset: vsco
1717 }
1818 // Full property is selected, so select full property value next
1919 if ( currentNode . type === 'property' && startOffset . isEqual ( currentNode . start ) && endOffset . isEqual ( currentNode . end ) ) {
20- return getSelectionFromProperty ( currentNode , editor . document , startOffset , endOffset , true , 'next' ) ;
20+ return getSelectionFromProperty ( currentNode , startOffset , endOffset , true , 'next' ) ;
2121 }
2222
2323 // Part or whole of propertyValue is selected, so select the next word in the propertyValue
2424 if ( currentNode . type === 'property' && startOffset . isAfterOrEqual ( ( < Property > currentNode ) . valueToken . start ) && endOffset . isBeforeOrEqual ( ( < Property > currentNode ) . valueToken . end ) ) {
25- let singlePropertyValue = getSelectionFromProperty ( currentNode , editor . document , startOffset , endOffset , false , 'next' ) ;
25+ let singlePropertyValue = getSelectionFromProperty ( currentNode , startOffset , endOffset , false , 'next' ) ;
2626 if ( singlePropertyValue ) {
2727 return singlePropertyValue ;
2828 }
@@ -31,7 +31,7 @@ export function nextItemStylesheet(startOffset: vscode.Position, endOffset: vsco
3131 // Cursor is in the selector or in a property
3232 if ( ( currentNode . type === 'rule' && endOffset . isBefore ( ( < Rule > currentNode ) . selectorToken . end ) )
3333 || ( currentNode . type === 'property' && endOffset . isBefore ( ( < Property > currentNode ) . valueToken . end ) ) ) {
34- return getSelectionFromNode ( currentNode , editor . document ) ;
34+ return getSelectionFromNode ( currentNode ) ;
3535 }
3636
3737 // Get the first child of current node which is right after the cursor
@@ -46,11 +46,11 @@ export function nextItemStylesheet(startOffset: vscode.Position, endOffset: vsco
4646 currentNode = currentNode . parent ;
4747 }
4848
49- return getSelectionFromNode ( nextNode , editor . document ) ;
49+ return getSelectionFromNode ( nextNode ) ;
5050
5151}
5252
53- export function prevItemStylesheet ( startOffset : vscode . Position , endOffset : vscode . Position , editor : vscode . TextEditor , rootNode : CssNode ) : vscode . Selection | undefined {
53+ export function prevItemStylesheet ( startOffset : vscode . Position , endOffset : vscode . Position , rootNode : CssNode ) : vscode . Selection | undefined {
5454 let currentNode = < CssNode > getNode ( rootNode , startOffset , false ) ;
5555 if ( ! currentNode ) {
5656 currentNode = rootNode ;
@@ -61,19 +61,19 @@ export function prevItemStylesheet(startOffset: vscode.Position, endOffset: vsco
6161
6262 // Full property value is selected, so select the whole property next
6363 if ( currentNode . type === 'property' && startOffset . isEqual ( ( < Property > currentNode ) . valueToken . start ) && endOffset . isEqual ( ( < Property > currentNode ) . valueToken . end ) ) {
64- return getSelectionFromNode ( currentNode , editor . document ) ;
64+ return getSelectionFromNode ( currentNode ) ;
6565 }
6666
6767 // Part of propertyValue is selected, so select the prev word in the propertyValue
6868 if ( currentNode . type === 'property' && startOffset . isAfterOrEqual ( ( < Property > currentNode ) . valueToken . start ) && endOffset . isBeforeOrEqual ( ( < Property > currentNode ) . valueToken . end ) ) {
69- let singlePropertyValue = getSelectionFromProperty ( currentNode , editor . document , startOffset , endOffset , false , 'prev' ) ;
69+ let singlePropertyValue = getSelectionFromProperty ( currentNode , startOffset , endOffset , false , 'prev' ) ;
7070 if ( singlePropertyValue ) {
7171 return singlePropertyValue ;
7272 }
7373 }
7474
7575 if ( currentNode . type === 'property' || ! currentNode . firstChild || ( currentNode . type === 'rule' && startOffset . isBeforeOrEqual ( currentNode . firstChild . start ) ) ) {
76- return getSelectionFromNode ( currentNode , editor . document ) ;
76+ return getSelectionFromNode ( currentNode ) ;
7777 }
7878
7979 // Select the child that appears just before the cursor
@@ -83,12 +83,12 @@ export function prevItemStylesheet(startOffset: vscode.Position, endOffset: vsco
8383 }
8484 prevNode = < CssNode > getDeepestNode ( prevNode ) ;
8585
86- return getSelectionFromProperty ( prevNode , editor . document , startOffset , endOffset , false , 'prev' ) ;
86+ return getSelectionFromProperty ( prevNode , startOffset , endOffset , false , 'prev' ) ;
8787
8888}
8989
9090
91- function getSelectionFromNode ( node : Node , document : vscode . TextDocument ) : vscode . Selection | undefined {
91+ function getSelectionFromNode ( node : Node ) : vscode . Selection | undefined {
9292 if ( ! node ) {
9393 return ;
9494 }
@@ -98,7 +98,7 @@ function getSelectionFromNode(node: Node, document: vscode.TextDocument): vscode
9898}
9999
100100
101- function getSelectionFromProperty ( node : Node , document : vscode . TextDocument , selectionStart : vscode . Position , selectionEnd : vscode . Position , selectFullValue : boolean , direction : string ) : vscode . Selection | undefined {
101+ function getSelectionFromProperty ( node : Node , selectionStart : vscode . Position , selectionEnd : vscode . Position , selectFullValue : boolean , direction : string ) : vscode . Selection | undefined {
102102 if ( ! node || node . type !== 'property' ) {
103103 return ;
104104 }
0 commit comments