This repository was archived by the owner on Jan 15, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,8 @@ class LUParser {
148148 newEntitySections . forEach ( section => {
149149 if ( prebuilts . has ( section . Name ) && section . Type && section . Type !== 'prebuilt' ) {
150150 section . Errors . push ( BuildDiagnostic ( {
151- message : `The model name ${ section . Name } is reserved.`
151+ message : `The model name ${ section . Name } is reserved.` ,
152+ range : section . Range
152153 } ) )
153154 }
154155 } ) ;
Original file line number Diff line number Diff line change @@ -13,12 +13,15 @@ describe('luParser parse test', () => {
1313 let luresource = undefined ;
1414 it ( 'new Entity name should not use reserved keywords' , ( ) => {
1515 let fileContent =
16- `@ ml age
17- @ prebuilt number` ;
16+ `@ ml age\n@ prebuilt number` ;
1817
1918 luresource = luparser . parse ( fileContent ) ;
2019 assert . equal ( luresource . Sections [ 0 ] . Errors . length , 1 ) ;
2120 assert . equal ( luresource . Sections [ 0 ] . Errors [ 0 ] . Message , 'The model name age is reserved.' ) ;
21+ assert . equal ( luresource . Sections [ 0 ] . Errors [ 0 ] . Range . Start . Line , 1 ) ;
22+ assert . equal ( luresource . Sections [ 0 ] . Errors [ 0 ] . Range . Start . Character , 0 ) ;
23+ assert . equal ( luresource . Sections [ 0 ] . Errors [ 0 ] . Range . End . Line , 1 ) ;
24+ assert . equal ( luresource . Sections [ 0 ] . Errors [ 0 ] . Range . End . Character , 9 ) ;
2225 } )
2326} ) ;
2427
You can’t perform that action at this time.
0 commit comments