From f3c1dbda7ac4681973b18a580242ef0184fec295 Mon Sep 17 00:00:00 2001 From: Bronley Plumb Date: Thu, 14 Apr 2022 09:58:03 -0400 Subject: [PATCH] Create object fixes (#568) * Move CreateObject validation into plugin * Only add single CreateObject diagnostics for all scopes * Don't flag component library CreateObject calls * Fix lint issues --- src/Scope.spec.ts | 50 +++++++ src/Scope.ts | 82 +----------- src/bscPlugin/BscPlugin.ts | 10 +- src/bscPlugin/validation/ScopeValidator.ts | 143 ++++++++++++++++++--- src/util.ts | 7 + 5 files changed, 195 insertions(+), 97 deletions(-) diff --git a/src/Scope.spec.ts b/src/Scope.spec.ts index 311c7bc9a..62553bafc 100644 --- a/src/Scope.spec.ts +++ b/src/Scope.spec.ts @@ -210,6 +210,56 @@ describe('Scope', () => { ]); }); + it('only adds a single diagnostic when the file is used in multiple scopes', () => { + program.setFile('components/Comp1.xml', trim` + + +