Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-06

IDE problems when using record helper types

12 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bernd

I have found a few problems (they are all related but some symptoms even cause the codetools to produce errors when attempting to autocomplete, also refactor/rename will not reliably work as a result of this. I have put together a program that declares a lot of stuff in the type section to be able to demonstrate all kinds of possible combinations of direct and auto-dereferenced method calls of records and record helpers.

Attached is a demo program with comments inside that explain the problems. When I have some more time I will also file a bug (I think one bug should be enough, although the problem shows itself with multiple different symptoms?)

Bernd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HelperSyntax.lpr
Type: application/octet-stream
Size: 2510 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120628/fd58380b/attachment.obj>

Reply by email

Mattias Gaertner
to Bernd

Bernd hat am 28. Juni 2012 um 17:34 geschrieben:

Show quoted text 12 lines
I have found a few problems (they are all related but some symptoms even cause the codetools to produce errors when attempting to autocomplete, also refactor/rename will not reliably work as a result of this. I have put together a program that declares a lot of stuff in the type section to be able to demonstrate all kinds of possible combinations of direct and auto-dereferenced method calls of records and record helpers. Attached is a demo program with comments inside that explain the problems. When I have some more time I will also file a bug (I think one bug should be enough, although the problem shows itself with multiple different symptoms?)

At the moment the codetools simply skips the "helper of" keywords. Nothing was implemented.

Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120628/58e08f94/attachment.html>

Reply by email

Bernd
to Mattias Gaertner

2012/6/28 Mattias Gaertner :

At the moment the codetools simply skips the "helper of" keywords. Nothing was implemented.

Should I create a feature request or is it already in the pipeline? I assume that since the codetools can already deal with modeswitch autoderef it is now only a matter of making it add the helper methods to the record and the record fields to the helper and all the problems should magically go away?

Because the more I use this syntax the more I like it. I have already translated all my needed libpurple structs and functions into Objects with methods but I also want to wrap some of the already existing glib2 types from the glib2 unit that are also needed and the only way to make it all neatly fit together and look and feel like Object Pascal and not like C seem to be the record helpers.

Reply by email

Mattias Gaertner
to Bernd
Show quoted text 11 lines
2012/6/28 Mattias Gaertner : > At the moment the codetools simply skips the "helper of" keywords. > > Nothing was implemented. Should I create a feature request or is it already in the pipeline? I assume that since the codetools can already deal with modeswitch autoderef it is now only a matter of making it add the helper methods to the record and the record fields to the helper and all the problems should magically go away?

"autoderef" is the ability to omit the ^ operator and simply use the point.

Show quoted text 6 lines
Because the more I use this syntax the more I like it. I have already translated all my needed libpurple structs and functions into Objects with methods but I also want to wrap some of the already existing glib2 types from the glib2 unit that are also needed and the only way to make it all neatly fit together and look and feel like Object Pascal and not like C seem to be the record helpers.

Eventually it will be implemented, but I have currently no plans to do it.

Mattias

Reply by email

Bernd
to Mattias Gaertner

2012/7/1 Mattias Gaertner :

"autoderef" is the ability to omit the ^ operator and simply use the point.

I know. I wanted to say that I assume this other feature [autoderef] will also start working with records that have helpers (once the helpers are parsed) without too much effort.

If its not planned to implement this then I'm going to file a feature request so it won't be forgotten (and if really nobody wants to implement it then I'm going to try) because imho the code tools should support all valid syntax constructs, especially such extremely useful ones that make life so much easier.

Reply by email

Mattias Gaertner
to Bernd
Show quoted text 8 lines
2012/7/1 Mattias Gaertner : > "autoderef" is the ability to omit the ^ operator and simply use the > point. I know. I wanted to say that I assume this other feature [autoderef] will also start working with records that have helpers (once the helpers are parsed) without too much effort.

Yes.

Show quoted text 5 lines
If its not planned to implement this then I'm going to file a feature request so it won't be forgotten (and if really nobody wants to implement it then I'm going to try) because imho the code tools should support all valid syntax constructs, especially such extremely useful ones that make life so much easier.

The codetools should support it. But I have other priorities.

Mattias

Reply by email

Bernd
to Mattias Gaertner

2012/7/1 Mattias Gaertner :

The codetools should support it. But I have other priorities.

In an earlier post you said it simply skips the helper keyword, does this mean they are parsed as if they were just normal records (or classes) or did I misunderstand this and the code tools actually do know these types as something special already?

Can you tell me the relevant units where these things happen and where I should start looking for it if I (hypotetically) wanted to try implementing it?

Bernd

Reply by email

Mattias Gaertner
to Bernd
Show quoted text 8 lines
2012/7/1 Mattias Gaertner : > The codetools should support it. But I have other priorities. In an earlier post you said it simply skips the helper keyword, does this mean they are parsed as if they were just normal records (or classes) or did I misunderstand this and the code tools actually do know these types as something special already?

They have a two special sub nodes, one for the "helper" and one for "for identifier". Otherwise they are treated as class/object/....

Can you tell me the relevant units where these things happen and where I should start looking for it if I (hypotetically) wanted to try implementing it?

unit components/codetools/finddeclarationtool.pas
The codetools searches backwards recursively until an identifier is found. So normally it can skip most code and simply compare the names of types. The result issored in a cache for later searches. With helpers this system no longer works.

Mattias

Reply by email

Ing. Héctor F. Fiandor Rosario
to Bernd: 2012/7/1 Mattias Gaertner : I know. I wanted to say that I assume this other feature…

Dear friends:

i am a new users in BD and i would like to test the SQLite, but really, i can?t understand very well the tutorials obtained.

I will appreciate very much to get in contact with one of the list?s member who has experience in SQLite to get a simple sample to reproduce from zero.

thanks in advance

Ing. H?ctor F. Fiandor Rosario

Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas Infomed: http://www.sld.cu/

Reply by email

Reinier Olislagers

On 1-7-2012 22:59, Ing. H?ctor F. Fiandor Rosario wrote:> Dear friends:

Show quoted text 11 lines
i am a new users in BD and i would like to test the SQLite, but really, i can?t understand very well the tutorials obtained. I will appreciate very much to get in contact with one of the list?s member who has experience in SQLite to get a simple sample to reproduce from zero. thanks in advance Ing. H?ctor F. Fiandor Rosario

H?ctor,

Please don't try to start a new thread by replying to another thread. It now appears as if you're responding to the "IDE problems when using record helper types" thread.

It would help if you said which tutorials you used and what parts you didn't understand/where it went wrong....

Actually, perhaps this might be better suited for a forum conversation as you can easily add screenshots etc, but perhaps that's just me.

I don't know all the tricks of using Lazarus, but I did extend the SQLDB Tutorial1 on the wiki a bit.
I've been interested in adding some notes to make it more useful for sqlite; perhaps now is the time to do that based on e.g. your feedback of what wasn't understandable.

Thanks,
Reinier (aka BigChimp on the wiki/forum)

Reply by email

Reinier Olislagers
to Reinier Olislagers
Reinier Olislagers wrote 9 lines
On 1-7-2012 22:59, Ing. H?ctor F. Fiandor Rosario wrote:> Dear friends: > I will appreciate very much to get in contact with one of the list?s > member who has experience in SQLite to get a simple sample to reproduce > from zero. I don't know all the tricks of using Lazarus, but I did extend the SQLDB Tutorial1 on the wiki a bit. I've been interested in adding some notes to make it more useful for sqlite; perhaps now is the time to do that based on e.g. your feedback of what wasn't understandable.

Just updated SQLDB Tutorial1 on the wiki
http://wiki.lazarus.freepascal.org/SQLdb_Tutorial1

As usual, corrections/additions to the page welcome...

Reinier (aka BigChimp on the wiki/forum)

Reply by email

waldo kitty
to Reinier Olislagers: On 1-7-2012 22:59, Ing. H?ctor F. Fiandor Rosario wrote:> Dear friends: Please don't try…
Reinier Olislagers wrote
On 1-7-2012 22:59, Ing. H?ctor F. Fiandor Rosario wrote:> Dear friends: > > i am a new users in BD and i would like to test the SQLite, but really, > i can?t understand very well the tutorials obtained.

[trim]

Please don't try to start a new thread by replying to another thread. It now appears as if you're responding to the "IDE problems when using record helper types" thread.

plus it is almost impossible to break/split the thread if and when others reply to the original post of yours :/ especially considering how the message-ids play in the reply-to linkages :(

not trying to be mean or ugly but just pointing out the reality...

Reply by email