missionpinball / mpf-ls

Mission Pinball Framework Language Server
5 stars 8 forks source link

Bug: mpf-ls complains about a missing object #18

Open worldpeace-germany opened 1 year ago

worldpeace-germany commented 1 year ago

Hi,

I have this section in my config

lights: led_strip_0_led_1: number: 0-0-1 subtype: led type: rgb tags: group1 led_strip_0_led_2: number: 0-0-2 subtype: led type: rgb tags: group1 led_strip_0_led_3: previous: led_strip_0_led_2 #this line shows as error subtype: led type: rgb tags: group1

The marked line shows

Could not find led_strip_0_led_2 of type lights.mpf-ls(13)

The light is defined a few lines above, so I would consider this being a bug. The solution is: the file above was a lights_config.yaml but it was not referenced in yaml.conf. So essentially it was never being used anyways. For a syntax check it doesn't make sense to have such a behavior. As soon as I reference the lights file in my main config the error is gone. There are no lights defined in the main config file.

Maybe that can be fixed in a future version. Thanks.

jabdoa2 commented 1 year ago

Yes that is a bug. We should ignore files which are not referenced.