@@ -210,7 +210,7 @@ export class CradleEditor {
210210 tries [ entryClass . subtype ] = new DynamicTrie (
211211 async ( x ) => {
212212 try {
213- let result =
213+ const result =
214214 await this . _lspApi . lspTrieRetrieve ( {
215215 type : entryClass . subtype ,
216216 prefix : x ,
@@ -564,21 +564,21 @@ export class CradleEditor {
564564
565565 const pos = context . pos ;
566566 const tree = syntaxTree ( context . state ) ;
567- let node = tree . resolve ( pos , - 1 ) ;
567+ const node = tree . resolve ( pos , - 1 ) ;
568568
569569 let options : Array < { label : string ; type : string ; info ?: string } > = [ ] ;
570- let from = node . from ;
571- let to = node . to ;
570+ const from = node . from ;
571+ const to = node . to ;
572572
573- let path = this . getParent ( node , 'BlockMapping' ) ;
573+ const path = this . getParent ( node , 'BlockMapping' ) ;
574574 if ( path && path . length >= 2 && path . length <= 7 ) {
575- let section = path [ 1 ] ;
575+ const section = path [ 1 ] ;
576576 if ( section && section . firstChild ) {
577- let sectxt = context . state . doc . sliceString (
577+ const sectxt = context . state . doc . sliceString (
578578 section . firstChild . from ,
579579 section . firstChild . to ,
580580 ) ;
581- let parent = node . parent ;
581+ const parent = node . parent ;
582582 if ( sectxt == 'entries' && parent != null ) {
583583 if (
584584 parent . name == 'Key' ||
@@ -657,7 +657,7 @@ export class CradleEditor {
657657
658658 const pos = context . pos ;
659659 const tree = syntaxTree ( context . state ) ;
660- let node = tree . resolve ( pos , - 1 ) ;
660+ const node = tree . resolve ( pos , - 1 ) ;
661661
662662 let options : Array < { label : string ; type : string } > = [ ] ;
663663 let from = node . from ;
@@ -935,12 +935,12 @@ export class CradleEditor {
935935 enter : ( syntaxNode ) => {
936936 const node = syntaxNode . node ;
937937 if ( node . name === 'CradleLink' ) {
938- let typeNode = node . getChildren ( 'CradleLinkType' ) ;
939- let valueNode = node . getChildren ( 'CradleLinkValue' ) ;
938+ const typeNode = node . getChildren ( 'CradleLinkType' ) ;
939+ const valueNode = node . getChildren ( 'CradleLinkValue' ) ;
940940 if ( ! typeNode || ! valueNode ) return true ;
941941
942- let type = text . slice ( typeNode [ 0 ] . from , typeNode [ 0 ] . to ) ;
943- let value = text . slice ( valueNode [ 0 ] . from , valueNode [ 0 ] . to ) ;
942+ const type = text . slice ( typeNode [ 0 ] . from , typeNode [ 0 ] . to ) ;
943+ const value = text . slice ( valueNode [ 0 ] . from , valueNode [ 0 ] . to ) ;
944944
945945 entries . push ( {
946946 type,
@@ -953,8 +953,8 @@ export class CradleEditor {
953953 } ,
954954 } ) ;
955955
956- let artifacts : Array < { type : string ; value : string } > = [ ] ;
957- let entities : Array < { type : string ; value : string } > = [ ] ;
956+ const artifacts : Array < { type : string ; value : string } > = [ ] ;
957+ const entities : Array < { type : string ; value : string } > = [ ] ;
958958 for ( const entry of entries ) {
959959 if ( this . entryClasses ?. [ entry . type ] . type === 'entity' ) {
960960 entities . push ( entry ) ;
@@ -994,8 +994,8 @@ export class CradleEditor {
994994 node . name == 'Frontmatter' ||
995995 node . name == 'FrontMatterContent'
996996 ) {
997- let frontmatter = text . slice ( node . from , node . to ) ;
998- let yml = frontmatter
997+ const frontmatter = text . slice ( node . from , node . to ) ;
998+ const yml = frontmatter
999999 . substring ( 3 , frontmatter . length - 4 )
10001000 . trim ( ) ;
10011001 try {
@@ -1063,9 +1063,9 @@ export class CradleEditor {
10631063 }
10641064 }
10651065 } catch ( e : any ) {
1066- var loc = e . mark ;
1067- var from = loc ? loc . position : 0 ;
1068- var to = from ;
1066+ const loc = e . mark ;
1067+ const from = loc ? loc . position : 0 ;
1068+ const to = from ;
10691069 diagnostics . push ( {
10701070 from : from ,
10711071 to : to ,
0 commit comments