I was looking at the great example submitted a while ago by @Randall_Ken about WebCore and DevExtreme https://karmobile.net/Test/ using VSC... and after a while realized that the IDE is removing some section of code!
In detail, this "complete/original" component
is "chunked" into this "reduced" one
just after having shown the form in the design mode (^F12 on mac) and received warning messages about Property Margins non existing it seems that the IDE is removing properties and corrupting the code?!?
Herebelow a video showing the full process, with my remarks in english
I've done another test this morning, herebelow the steps done:
- extracted the zip file (last item downloaded from https://karmobile.net/Test/ into a directory
- opened into Visual Studio Code
- initialized git local rep in order to track the differences
- first commit then first run (all OK)
- added .gitignore file in order to ignore TMSWeb directory
- CTRL+F12 on MainFrm.pas in order to open the [Design] mode (had to do it twice, first time is not going to fire the designer, it opens a blank tab... that is happening often also with other projects)
- During MainForm.pas [Design] opening two dialog boxes giving warning about "Error reading property divList.Margins: Property Margins does not exist." and "Error reading property divHeader.Margins: Property Margins does not exist." anyway form design opens OK
- Run again, everything is still OK
- back to MainForm.pas [Design] right-mouse / View As Text click ... source code is still OK
- back to tab MainForm.pas [Design] clicked on the divList TWebHTMLDiv component ==> only NOW I see in the component inspector that ElementID is blank - then, looking at form text source a lot of stuff has been modified / cutted off
- saved the form... git shows a LOT of modifications (lines re-arranging; lines deleted) have a look at attached picture
it seems that the problem is triggered by clicking on components following in the "property not existing" warning received before.
Last but not least, NO problem at all when doing all above in Delphi...
It was an oversight that Margins was still published in Delphi while it shouldn't.
Next update will address this. For now, set in Delphi under margins all values back to defaults so it isn't persisted in the DFM.
Thanks Bruno, good to know that next update will fix it.
Is it possible to ignore obsolete/useless properties and left them inside the code?
That way it could be possible to have a mixed development flow [Delphi + TMS Web/FNC components] / [VSC + TMS Web/FNC components] but it's important that the code is not "wipened away" by any side.