Jump to content
Tommi Prami

New feature request: Open dfm as Text if malformed (vote if care)

Recommended Posts

Would be nice IDE would always convert binary to text, if there are one. Got hit by that this summer, there still was few binay dfm's in our repository.

Edited by Tommi Prami

Share this post


Link to post
6 minutes ago, Tommi Prami said:

Would be nice IDE would always convert binary to text, if there are one. Got hit by that this summer, there still was few binay dfm's in our repository.

Not sure the IDE should do that. There are tools to convert. If you want to convert, then use those tools. If the IDE did this automatically then that would be painful for people who wanted to use binary.

  • Like 1

Share this post


Link to post
3 minutes ago, David Heffernan said:

Doesn't seem to me like this is a very significant problem given that you can just open the file in a text editor yourself.

And find file from disk and the spot, sure diff to repo will help, but still, would be life saver when this happens. 

Not for everyone for sure. 

Edited by Tommi Prami

Share this post


Link to post
18 minutes ago, Tommi Prami said:

And find file from disk and the spot, sure diff to repo will help, but still, would be life saver when this happens. 

You are massively overstating this. Finding a file from disk is not difficult. Yes it takes a few seconds, but then it's not like this issue happens regularly. Every feature takes resources to implement. Given the immense problems that the entire Delphi product has, I for one would be disappointed if Emba spent resources on features like this that bring so little benefit.

Share this post


Link to post
48 minutes ago, David Heffernan said:

You are massively overstating this. Finding a file from disk is not difficult. Yes it takes a few seconds, but then it's not like this issue happens regularly. Every feature takes resources to implement. Given the immense problems that the entire Delphi product has, I for one would be disappointed if Emba spent resources on features like this that bring so little benefit.

Not overstating, but if something takes few seconds or even 30sec if you forget the file name few times, still it is extra work.

 

And finding the error,. in trivial case, just take a diff and see. 

But consider this, you stumble upon old form. Then you fix all the naming conventions, change components from one that should not be used to equal one and so on. There might be easily hundreds of changes. and try to find error from there. Not common, usually Delphi does not screw it up,. but as I stated, sometimes it is easier to edit the dfm with text editor.

 

And even if you look at the dfm in text form in ide, you might touch keyboard in such a place that it is nightmare to find the error, if lot of changes.

 

I think I would benefit from this, not weekly but monthly maybe when I am doing something massive search and replace stuff etc. 
 

One step closer would be that IDE and RLINK would tell the line on which error is. At least bes guess..

Share this post


Link to post

If you have a binary DFM that cannot be loaded by the reader i suspect it cannot be written down (converted) to textformat either (?). Anyways, i run Visual Code parallel with the IDE to manage "huge" dfm's and "prune" them from IDE/3rd party peculiarities. A change that would make me happy is if the IDE reload could close the dependent units before reloading so that it works "more often".

Share this post


Link to post
2 hours ago, David Heffernan said:

You are massively overstating this. Finding a file from disk is not difficult. Yes it takes a few seconds, but then it's not like this issue happens regularly. Every feature takes resources to implement. Given the immense problems that the entire Delphi product has, I for one would be disappointed if Emba spent resources on features like this that bring so little benefit.

You are massively underestimating this 😛
If you refactor a base component other visual components dervive from, loading/opening projects might fail. I support the Idea that the ide still loads the dfm as text. Right now it does not allow me to look at it, which is cumbersome. Just like WPF in VS where I always get the XAML editor but not a visual editor when the XAML is invalid.

  • Like 1

Share this post


Link to post
26 minutes ago, Memnarch said:

You are massively underestimating this 😛

Maybe. I guess I might not be encountering the problem regularly. You must be facing it very regularly I guess. 

 

28 minutes ago, Memnarch said:

If you refactor a base component other visual components dervive from, loading/opening projects might fail. I support the Idea that the ide still loads the dfm as text. Right now it does not allow me to look at it, which is cumbersome. Just like WPF in VS where I always get the XAML editor but not a visual editor when the XAML is invalid.

Isn't that a different issue? 

Share this post


Link to post
8 minutes ago, David Heffernan said:

Maybe. I guess I might not be encountering the problem regularly. You must be facing it very regularly I guess.

I'm encountering this problem regularly when some component isn't installed in the IDE or is installed but in a different (usually older) version. It would be nice to simply open that dfm as text and be able to make rudimentary changes to it. Most of the time it is enough to remove or change some properties from the dfm to make it load normally. The IDE always offers to delete a property or control, but I don't trust it (and I have reasons for that).

Currently I open the dfm in a text editor but that's rather inconvenient.

  • Like 1

Share this post


Link to post
3 hours ago, Der schöne Günther said:

But what if the DFM is not in text, but binary form?

Binary DFM are devils work and must be burnt at the stake whilst vigorously waving pitchforks and shouting obscenities. :classic_cheerleader:

  • Version control systems handle them poorly (not that text DFMs are far better in this regard, but, you can manage, once you move any pictures to a datamodule). Actually they are just binary blobs most of the time and will consume unnecessary storage
  • Everything else, the other guys said

 

  • Like 3

Share this post


Link to post
27 minutes ago, dummzeuch said:

I'm encountering this problem regularly when some component isn't installed in the IDE or is installed but in a different (usually older) version. It would be nice to simply open that dfm as text and be able to make rudimentary changes to it. Most of the time it is enough to remove or change some properties from the dfm to make it load normally. The IDE always offers to delete a property or control, but I don't trust it (and I have reasons for that).

Currently I open the dfm in a text editor but that's rather inconvenient.

OK, this is making more sense to me, and I can better appreciate the inconvenience.

  • Like 1

Share this post


Link to post

Perhaps a simple "Open as text" in the context menu of a DFM in the project manager may be sufficient.

  • Like 4

Share this post


Link to post
On 9/16/2020 at 3:53 PM, Uwe Raabe said:

Perhaps a simple "Open as text" in the context menu of a DFM in the project manager may be sufficient.

This would help in some cases, still would have manual steps. Better than nothing tough. if it would highlight position in the DFM IDE things where problem is, that would make this pretty good, IMHO.  Problem is, I think, I believe sometimes you can't open project, I think, if there is some special case (I think I've encountered this)

 

Would not help if RLINK fails at compile time, which is kind of corner case. But problem still. 

DFMCheck Andy released is very good, unfortunately we have one or more components that has structure that will not work with it. We are looking into it, could we fix it somehow.

 

 

Edited by Tommi Prami

Share this post


Link to post
On 9/16/2020 at 2:53 PM, Uwe Raabe said:

Perhaps a simple "Open as text" in the context menu of a DFM in the project manager may be sufficient.

 
 
 

Sounds like an excellent suggestion!

 

Share this post


Link to post
On 9/16/2020 at 2:53 PM, Uwe Raabe said:

Perhaps a simple "Open as text" in the context menu of a DFM in the project manager may be sufficient.

It's already possible file - open enter or select the desired dfm (if you enter the filename you must add the .dfm extenstion). The IDE will open the file as text. It will just not focus the invalid lines.

Edited by Lajos Juhász

Share this post


Link to post
On 9/18/2020 at 1:18 PM, Lajos Juhász said:

It's already possible file - open enter or select the desired dfm (if you enter the filename you must add the .dfm extenstion). The IDE will open the file as text. It will just not focus the invalid lines.

Not very convenient, I think.

 

-Tee- 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×