SuperFactoryManager icon indicating copy to clipboard operation
SuperFactoryManager copied to clipboard

Add lint for diagnosing resources not stacking due to having same path but different namespace in resourcelocation

Open TeamDman opened this issue 2 months ago • 1 comments
trafficstars

https://discord.com/channels/967118679370264627/967119184209264790/1417624291142406154

Consider the setup

-- Centrifuge -> fluid tank
-- sfm:fluid:bumblezone:honey -> sfm:fluid:justteamythings:honey
every 20 ticks do
	input fluid:: from centrifuge
    output fluid:: to tank
end

The execution trace would look like

  • discover input slot 1000 fluid:bumblezone:honey
  • discover output slot 1000 fluid:justteamythings:honey
  • inputslot0 moveTo outputslot0
    • peek extraction -> 1000 bumblezone:honey
    • peek insertion -> remainder 1000 bumblezone:honey
    • toMove = 1000 - 1000 = 0

https://github.com/TeamDman/SuperFactoryManager/blob/dbe4d49e947f8dcb24e1062daa0f41b2243c5572/src/main/java/ca/teamdman/sfml/ast/OutputStatement.java#L135-L160

User observes no resource movement (and no errors or warnings); a frustrating situation.

This scenario is programmatically detectable.

Potential future experience:

  1. User writes program and assigns labels
  2. Program builds with no warnings
  3. User expected move operation is not performed
  4. User activates advanced logging
  5. Program executes with advanced logging once
  6. Advanced logging automatically turns off

We already have the logger mechanism, so we could call .warn(callback -> inside which we can do the callback after checking so that the check isn't always running

TeamDman avatar Sep 19 '25 03:09 TeamDman

we also have distance calculations available from the intellisense logic we can use to maybe check if a user has made a typo

TeamDman avatar Sep 19 '25 03:09 TeamDman