Sign in Join

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

Mailing lists / lazarus / 2014-09

Code completion problems with Graph units

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Sven Barth

Hello together!

I'm currently working on a project that uses the good old Graph units (or PtcGraph to be more precise) and I have the problem that code completion is erratic if (Ptc)Graph is in the uses-clause, because the IDE can not find the graphh.inc include file which is at the top of all Graph units. This include file is located in $fpc/packages/graph/src/inc whereas the full Graph units are located in other directories of $fpc/packages/graph/src/.
I've also tried adding the path of the include directory to the "Other source files" or the "Include directories" path. The IDE then either complains that it still can not find the file or it complains that it could not find the end of the file with the cursor still getting positioned at the $include directive.

Any ideas I could try? (besides commenting out the include directive :P)

Lazarus version is 1.2.4 on i386-linux-gtk2

Regards,
Sven

Reply by email

Howard Page-Clark
to Sven Barth
Sven Barth wrote 16 lines
Hello together! I'm currently working on a project that uses the good old Graph units (or PtcGraph to be more precise) and I have the problem that code completion is erratic if (Ptc)Graph is in the uses-clause, because the IDE can not find the graphh.inc include file which is at the top of all Graph units. This include file is located in $fpc/packages/graph/src/inc whereas the full Graph units are located in other directories of $fpc/packages/graph/src/. I've also tried adding the path of the include directory to the "Other source files" or the "Include directories" path. The IDE then either complains that it still can not find the file or it complains that it could not find the end of the file with the cursor still getting positioned at the $include directive. Any ideas I could try? (besides commenting out the include directive :P)

I think you can use the Codetools Defines Editor (4th item in the Tools menu) to add the include path.
However, I have never figured out exactly how to do that for FPC and Lazarus sources which the Codetools treats specially (even though there is a wiki page that ought to help:
http://wiki.lazarus.freepascal.org/IDE_Window:_Codetools_Defines_Editor).

Howard

Reply by email

Sven Barth
to Howard Page-Clark
Howard Page-Clark wrote 24 lines
On 09/09/2014 21:17, Sven Barth wrote: > Hello together! > > I'm currently working on a project that uses the good old Graph units > (or PtcGraph to be more precise) and I have the problem that code > completion is erratic if (Ptc)Graph is in the uses-clause, because the > IDE can not find the graphh.inc include file which is at the top of all > Graph units. This include file is located in $fpc/packages/graph/src/inc > whereas the full Graph units are located in other directories of > $fpc/packages/graph/src/. > I've also tried adding the path of the include directory to the "Other > source files" or the "Include directories" path. The IDE then either > complains that it still can not find the file or it complains that it > could not find the end of the file with the cursor still getting > positioned at the $include directive. > > Any ideas I could try? (besides commenting out the include directive :P) I think you can use the Codetools Defines Editor (4th item in the Tools menu) to add the include path. However, I have never figured out exactly how to do that for FPC and Lazarus sources which the Codetools treats specially (even though there is a wiki page that ought to help: http://wiki.lazarus.freepascal.org/IDE_Window:_Codetools_Defines_Editor).

Hmm... the interesting thing is that there *is* already an entry especially for Graph (Free Pascal Sources => Free Pascal Source Directory => Packages => extra => graph). But it does not seem to work :/ Maybe that "extra" node is too much there?

Regards,
Sven

Reply by email

Sven Barth
to Sven Barth
Sven Barth wrote 30 lines
On 10.09.2014 00:23, Howard Page-Clark wrote: > On 09/09/2014 21:17, Sven Barth wrote: >> Hello together! >> >> I'm currently working on a project that uses the good old Graph units >> (or PtcGraph to be more precise) and I have the problem that code >> completion is erratic if (Ptc)Graph is in the uses-clause, because the >> IDE can not find the graphh.inc include file which is at the top of all >> Graph units. This include file is located in $fpc/packages/graph/src/inc >> whereas the full Graph units are located in other directories of >> $fpc/packages/graph/src/. >> I've also tried adding the path of the include directory to the "Other >> source files" or the "Include directories" path. The IDE then either >> complains that it still can not find the file or it complains that it >> could not find the end of the file with the cursor still getting >> positioned at the $include directive. >> >> Any ideas I could try? (besides commenting out the include directive :P) > > I think you can use the Codetools Defines Editor (4th item in the Tools > menu) to add the include path. > However, I have never figured out exactly how to do that for FPC and > Lazarus sources which the Codetools treats specially (even though there > is a wiki page that ought to help: > http://wiki.lazarus.freepascal.org/IDE_Window:_Codetools_Defines_Editor). Hmm... the interesting thing is that there *is* already an entry especially for Graph (Free Pascal Sources => Free Pascal Source Directory => Packages => extra => graph). But it does not seem to work :/ Maybe that "extra" node is too much there?

Nope... moving the "graph" node up does not change anything *sigh*

Regards,
Sven

Reply by email

payl
to Sven Barth
On 10.09.2014 07:52, Sven Barth wrote: Nope... moving the "graph" node up does not change anything *sigh*

(Warning: No nice solutions here)
Well I would first try if CodeTools are just unable to find inc file, so I would try to move/copy include file so CodeTools can find it. You noted that sometimes It tells you it's unable to find end of file: Maybe conditionals make CodeTools ignore rest of file? You could try messing with predefined conditionals. Or bruteforce solution: Manually include inc file and then test if everything works.
I wouldn't be surprised if CodeTools couldn't parse this file due to some bug in parsing, there are still some notable bugs there.

Reply by email

Mattias Gaertner
to Sven Barth: Hello together! I'm currently working on a project that uses the good old Graph units (or…
Show quoted text 18 lines
Hello together! I'm currently working on a project that uses the good old Graph units (or PtcGraph to be more precise) and I have the problem that code completion is erratic if (Ptc)Graph is in the uses-clause, because the IDE can not find the graphh.inc include file which is at the top of all Graph units. This include file is located in $fpc/packages/graph/src/inc whereas the full Graph units are located in other directories of $fpc/packages/graph/src/. I've also tried adding the path of the include directory to the "Other source files" or the "Include directories" path. The IDE then either complains that it still can not find the file or it complains that it could not find the end of the file with the cursor still getting positioned at the $include directive. Any ideas I could try? (besides commenting out the include directive :P) Lazarus version is 1.2.4 on i386-linux-gtk2

Under Linux 64bit I can use the 'graph' unit and find declaration finds $fpc/packages/graph/src/unix/graph.pp
Then FD on the {$i graphh.inc} gets me to
$fpc/packages/graph/src/inc/graphh.inc

Works on 2.6.4 and 2.7.1.

It works with unit ptcgraph as well:
$fpc/packages/graph/src/ptcgraph/ptcgraph.pp
$fpc/packages/graph/src/inc/graphh.inc

Have you tried Tools / Rescan FPC source directory?

Note: The FPC source directory has its own search paths. It does not use the project's search paths.

Mattias

Reply by email

Sven Barth
to Mattias Gaertner
"Mattias Gaertner" wrote 35 lines
On Tue, 09 Sep 2014 22:17:38 +0200 Sven Barth wrote: > Hello together! > > I'm currently working on a project that uses the good old Graph units > (or PtcGraph to be more precise) and I have the problem that code > completion is erratic if (Ptc)Graph is in the uses-clause, because the > IDE can not find the graphh.inc include file which is at the top of all > Graph units. This include file is located in $fpc/packages/graph/src/inc > whereas the full Graph units are located in other directories of > $fpc/packages/graph/src/. > I've also tried adding the path of the include directory to the "Other > source files" or the "Include directories" path. The IDE then either > complains that it still can not find the file or it complains that it > could not find the end of the file with the cursor still getting > positioned at the $include directive. > > Any ideas I could try? (besides commenting out the include directive :P) > > Lazarus version is 1.2.4 on i386-linux-gtk2 Under Linux 64bit I can use the 'graph' unit and find declaration finds $fpc/packages/graph/src/unix/graph.pp Then FD on the {$i graphh.inc} gets me to $fpc/packages/graph/src/inc/graphh.inc Works on 2.6.4 and 2.7.1. It works with unit ptcgraph as well: $fpc/packages/graph/src/ptcgraph/ptcgraph.pp $fpc/packages/graph/src/inc/graphh.inc Have you tried Tools / Rescan FPC source directory?

I now did, no difference. I can reproduce it on i368-linux (1.2.4) and i368-win32 (1.2.2). What did work however is copying the graph include files and units to a local directory and including that in "Other sources".

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140910/3cce50b9/attachment.html>

Reply by email

Mattias Gaertner
to Sven Barth
Show quoted text 7 lines
[...] > > Lazarus version is 1.2.4 on i386-linux-gtk2 > > Under Linux 64bit I can use the 'graph' unit and find declaration finds > $fpc/packages/graph/src/unix/graph.pp > Then FD on the {$i graphh.inc} gets me to > $fpc/packages/graph/src/inc/graphh.inc

I tested with linux-i386 and it works too.
So, maybe it's an issue with Lazarus 1.2.4.
Can you test with a 1.3 or a newer 1.2?

I can reproduce it on i368-linux (1.2.4) and i368-win32 (1.2.2). What did work however is copying the graph include files and units to a local directory and including that in "Other sources".

Mattias

Reply by email

Sven Barth
to Mattias Gaertner
"Mattias Gaertner" wrote 8 lines
On Wed, 10 Sep 2014 17:36:19 +0200 Sven Barth wrote: >[...] > > > Lazarus version is 1.2.4 on i386-linux-gtk2 > > > > Under Linux 64bit I can use the 'graph' unit and find declaration

finds

Show quoted text 7 lines
> > $fpc/packages/graph/src/unix/graph.pp > > Then FD on the {$i graphh.inc} gets me to > > $fpc/packages/graph/src/inc/graphh.inc I tested with linux-i386 and it works too. So, maybe it's an issue with Lazarus 1.2.4. Can you test with a 1.3 or a newer 1.2?

With 1.3 it works correctly (at least on Win32 where I tested it). I did not test a newer 1.2 though (you mean 1.2.5 here, right?).

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140911/e38eafde/attachment.html>

Reply by email