rokucommunity / vscode-brightscript-language

A Visual Studio Code extension for Roku's BrightScript language
MIT License
104 stars 41 forks source link

"Not in scope" warnings are shown even though the function/etc is defined in a parent component #556

Open simon-grantham opened 3 months ago

simon-grantham commented 3 months ago

"Not in scope" warnings are underlined in code and percolated to file explorer even thought the definition is in scope in a parent component ( ie. current component defined as extending a parent, and so on up the derivation chain.)

TwitchBronBron commented 3 months ago

Can you provide a sample project or zip reproducing the issue? Typically are valid issues, due to some OTHER scope not having the required imports.

simon-grantham commented 3 months ago

Will do...

simon-grantham commented 3 months ago

We see this one scattered enormously through our code base, but in creating an example, I realize it is due to us creating "Abstract Components" (or abstract derivations thereof). That is, the Abstract Component is invoking methods it expects to be defined in components that are extensions of the "Abstract Component". We do not create dummy (empty) definitions in the "Abstract Component" because, like all good compilers ;) , we want to have an error thrown at compile time.

Regardless, I have attached an example as promised.

simple-videoplayer-channel.zip

grep -rin --include=*.brs "issues/556"

TwitchBronBron commented 3 months ago

Yeah, that's the exact issue I was expecting to see. So you currently have 2 options at this point: