rokucommunity / bslint

A linter for BrightScript and BrighterScript.
MIT License
28 stars 15 forks source link

Problem in file reported in problems panel once for event location the script is included #46

Open chrisdp opened 2 years ago

chrisdp commented 2 years ago

As shown in the image below bslint problems are being displayed for the same line one for every time the script is included in a component:

image

Ideally we would now show the same error the a given line more than once.

TwitchBronBron commented 2 years ago

@elsassph how would you feel about combining all of these diagnostics into a single diagnostic? Something to the effect of:

"Using unitialized variable 'internalFocusedNodeChanged' when this file is included in 25 scopes ['components/comp1.xml', 'components/comp2.xml', ...]"

elsassph commented 2 years ago

Yeah I've been following brighterscript way of reporting the error. Could be combined for sure.

TwitchBronBron commented 1 year ago

We've started migrating some of the brighterscript issues towards this pattern as well. See this function for an example:

https://github.com/rokucommunity/brighterscript/blob/master/src/bscPlugin/validation/ScopeValidator.ts#L341