r/PLC • u/desrtfx 800xA|Ac400/500/800|S+ • 4d ago
Engineering Question Formatter for Structured Text
I need to consult the hive-mind here.
Does anybody have a good formatter for Structured Text (dialect is secondary). I need it to be able to properly indent multiple commented lines as, unfortunately, the original creator of the programs (a lot) has decided to disable certain parts with the (# and #) comments and yet uses the (* and *) comments in between the outer comments.
I've inherited this program (which is quite huge) and need to sift through it. Can't just simply omit/delete the commented out code as it is absolutely possible that it will be used at any given time in the future.
The original creator didn't want to think about a mechanism to disable certain parts (each part reflects a particular "Control Unit").
I would be very grateful for any recommendation. My google-fu and my VSCode extension search didn't bring decent results.
Edit: I cannot use any AI as assistant because of the sensitivity of the data. This is also the reason I have to be so vague here in my descriptions. (The bane of working in system-critical infrastructure.)
View all comments
Show parent comment
1
u/TheFern3 Software Engineer 4d ago
Then you gotta learn how to use grep awk or make a script to parse examples of what you have replace sensitive data then ask ai or just figure out how to do that by yourself like we did before ai lol
But what’s the issue you have with the project? If is just comments what are you really fixing here?