@@ -88,7 +88,7 @@ function isBeforeOrEqual(line1: number, col1: number, line2: number, col2: numbe
8888}
8989
9090export function filterInstanceVariables ( variables : LJVariable [ ] ) : LJVariable [ ] {
91- return variables . filter ( v => ! v . name . includes ( "#" ) ) ;
91+ return variables . filter ( v => ! v . internalName . includes ( "#" ) ) ;
9292}
9393
9494export function filterDuplicateVariables ( variables : LJVariable [ ] ) : LJVariable [ ] {
@@ -104,20 +104,20 @@ export function filterDuplicateVariables(variables: LJVariable[]): LJVariable[]
104104// Sorts variables by their position or name
105105function sortVariables ( variables : LJVariable [ ] ) : LJVariable [ ] {
106106 return variables . sort ( ( left , right ) => {
107- if ( ! left . position && ! right . position ) return compareVariableNames ( left , right ) ;
107+ if ( ! left . position && ! right . position ) return compareVariableNames ( left . internalName , right . internalName ) ;
108108 if ( ! left . position ) return 1 ;
109109 if ( ! right . position ) return - 1 ;
110110 if ( left . position . lineStart !== right . position . lineStart ) return left . position . lineStart - right . position . lineStart ;
111111 if ( left . position . colStart !== right . position . colStart ) return right . position . colStart - left . position . colStart ;
112- return compareVariableNames ( left , right ) ;
112+ return compareVariableNames ( left . internalName , right . internalName ) ;
113113 } ) ;
114114}
115115
116- function compareVariableNames ( a : LJVariable , b : LJVariable ) : number {
117- if ( a . name . startsWith ( "#" ) && b . name . startsWith ( "#" ) ) return getOriginalVariableName ( a . name ) . localeCompare ( getOriginalVariableName ( b . name ) ) ;
118- if ( a . name . startsWith ( "#" ) ) return 1 ;
119- if ( b . name . startsWith ( "#" ) ) return - 1 ;
120- return a . name . localeCompare ( b . name ) ;
116+ function compareVariableNames ( a : string , b : string ) : number {
117+ if ( a . startsWith ( "#" ) && b . startsWith ( "#" ) ) return getOriginalVariableName ( a ) . localeCompare ( getOriginalVariableName ( b ) ) ;
118+ if ( a . startsWith ( "#" ) ) return 1 ;
119+ if ( b . startsWith ( "#" ) ) return - 1 ;
120+ return a . localeCompare ( b ) ;
121121}
122122
123123function normalizeVariableRefinements ( variables : LJVariable [ ] ) : LJVariable [ ] {
0 commit comments