@@ -219,7 +219,7 @@ describe("Test completion of object attributes", () => {
219219
220220describe ( "Test completion of attribute with references to xvrs" , ( ) => {
221221 it ( "Expect Xvrs for attribute that references Xvrs" , ( ) => {
222- const content = loadFile ( "completionAttrRefs.cnfg" ) ;
222+ const content = loadFile ( "completion/ completionAttrRefs.cnfg" ) ;
223223 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
224224 const cnfg = parseSepticSync ( doc . getText ( ) ) ;
225225 const offset = doc . offsetAt ( Position . create ( 13 , 28 ) ) ;
@@ -230,7 +230,7 @@ describe("Test completion of attribute with references to xvrs", () => {
230230 expect ( variableCompItems . length ) . to . equal ( 2 ) ;
231231 } ) ;
232232 it ( "Expect Mvrs for attribute that references Mvrs" , ( ) => {
233- const content = loadFile ( "completionAttrRefs.cnfg" ) ;
233+ const content = loadFile ( "completion/ completionAttrRefs.cnfg" ) ;
234234 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
235235 const cnfg = parseSepticSync ( doc . getText ( ) ) ;
236236 const offset = doc . offsetAt ( Position . create ( 17 , 19 ) ) ;
@@ -242,7 +242,7 @@ describe("Test completion of attribute with references to xvrs", () => {
242242 expect ( variableCompItems [ 0 ] . label ) . to . equal ( "MvrTest" ) ;
243243 } ) ;
244244 it ( "Expect completion of xvr in-between existing attr values" , ( ) => {
245- const content = loadFile ( "completionAttrRefs.cnfg" ) ;
245+ const content = loadFile ( "completion/ completionAttrRefs.cnfg" ) ;
246246 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
247247 const cnfg = parseSepticSync ( doc . getText ( ) ) ;
248248 const offset = doc . offsetAt ( Position . create ( 27 , 20 ) ) ;
@@ -253,7 +253,7 @@ describe("Test completion of attribute with references to xvrs", () => {
253253 expect ( variableCompItems . length ) . to . equal ( 2 ) ;
254254 } ) ;
255255 it ( "Expect no completion of xvr non-reference attribute" , ( ) => {
256- const content = loadFile ( "completionAttrRefs.cnfg" ) ;
256+ const content = loadFile ( "completion/ completionAttrRefs.cnfg" ) ;
257257 const doc = TextDocument . create ( "" , "" , 0 , content ) ;
258258 const cnfg = parseSepticSync ( doc . getText ( ) ) ;
259259 const offset = doc . offsetAt ( Position . create ( 20 , 20 ) ) ;
@@ -265,6 +265,21 @@ describe("Test completion of attribute with references to xvrs", () => {
265265 } ) ;
266266} ) ;
267267
268+ describe ( "Test completion of attribute enum datatype" , ( ) => {
269+ it ( "Expect Xvrs for attribute that references Xvrs" , ( ) => {
270+ const content = "Evr: TestEvr\nUserInput= \n" ;
271+ const doc = TextDocument . create ( "" , "" , 0 , content ) ;
272+ const cnfg = parseSepticSync ( doc . getText ( ) ) ;
273+ const offset = doc . offsetAt ( Position . create ( 1 , 11 ) ) ;
274+ const compItems = getObjectCompletion ( offset , cnfg , cnfg , doc ) ;
275+ const variableCompItems = compItems . filter (
276+ ( item ) => item . kind === CompletionItemKind . EnumMember
277+ ) ;
278+ const enums = SepticMetaInfoProvider . getInstance ( ) . getObjectDocumentation ( "Evr" ) ?. attributes . find ( attr => attr . name === "UserInput" ) ?. enums ;
279+ expect ( variableCompItems . length ) . to . equal ( enums ?. length ) ;
280+ } ) ;
281+ } ) ;
282+
268283describe ( "Test calc completion" , ( ) => {
269284 it ( "Completion suggest Xvrs" , ( ) => {
270285 const text = `Mvr: TestMvr\nEvr: TestEvr\nCalcPvr: TestCalc\nAlg= " "\n` ;
0 commit comments