Roald87 / TcBlack

Opnionated code formatter for TwinCAT.
MIT License
103 stars 11 forks source link

Add support for interfaces to objects #39

Closed kdorsel closed 4 years ago

kdorsel commented 4 years ago

Close #30

Roald87 commented 4 years ago

Hi thanks for all the work you keep putting into this project!

I did not plan to implement this feature into the 0.2 milestone, because the interfaces are saved in a .TcIO file, instead of a .TcPOU file. I thought adding support for interfaces would also require the need for a TcIo class analogue of the TcPou class.

However, I just tried it out and no special TcIo class is needed, because is just looks at the Declaration node in the xml file.

I can move interface support to 0.2 version, but a two things need to be added.

  1. Add the extra test I mentioned in the change request
  2. When TcBlack is called with the --project option, it currently only looks for .TcPou files. So this would also need to look for .TcIO files for this feature to work completely.