diff --git a/src/bscPlugin/codeActions/CodeActionsProcessor.spec.ts b/src/bscPlugin/codeActions/CodeActionsProcessor.spec.ts index 408dea559..07e2f3201 100644 --- a/src/bscPlugin/codeActions/CodeActionsProcessor.spec.ts +++ b/src/bscPlugin/codeActions/CodeActionsProcessor.spec.ts @@ -152,13 +152,16 @@ describe('CodeActionsProcessor', () => { program.validate(); - //there should be no code actions since this is a brs file - const codeActions = program.getCodeActions( - file.pathAbsolute, - // DoSometh|ing() - util.createRange(2, 28, 2, 28) - ); - expect(codeActions).to.be.empty; + //the ImportStatement code action should be missing since this is a brs file + expect( + program.getCodeActions( + file.pathAbsolute, + // DoSometh|ing() + util.createRange(2, 28, 2, 28) + ).map(x => x.title).sort() + ).to.eql([ + `Add xml script import "pkg:/source/lib.brs" into component "ChildScene"` + ]); }); it('suggests class imports', () => { @@ -226,6 +229,104 @@ describe('CodeActionsProcessor', () => { `import "pkg:/source/Animals.bs"` ]); }); - }); + it('sugests import script tag for function from not-imported file', () => { + program.setFile('components/comp1.xml', trim` + + +