Sign in Join

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

Mailing lists / lazarus / 2010-06

Improving Lazarus and Include file handling [feature request]

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

Lazarus IDE is already very generous with errors in code - yet still allows syntax highlighting or jumping around inside the code. Can Lazarus IDE be improved just a little bit more with Include file handling. The tiOPF project (and some of my projects) use include files for the Compiler Mode and enabling AnsiString support. If I browse such a file, not via a Lazarus Package or not via the Project that owns that unit, then Lazarus IDE can't find the include file - this is generally ok. Unfortunately this then causes code navigation to fail as well. eg: Ctrl+Shift+(up|down) stops working. By simply commenting the Include line like shown below allows Lazarus IDE to navigate the code again.

Can Lazarus IDE be made to be more lenient when it comes to Include files outside the Interface and Implementation sections? Actually just ignoring Include files errors when the {$I xxx} is before the Implementation section would also work (I think). At least just so the code navigation works.

-------------------------------
 unit tiObjects;

-{$I tiDefines.inc}
+{.$I tiDefines.inc}

interface
uses
....
----------------------

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email

Mattias Gaertner
to Graeme Geldenhuys
Show quoted text 19 lines
Hi, Lazarus IDE is already very generous with errors in code - yet still allows syntax highlighting or jumping around inside the code. Can Lazarus IDE be improved just a little bit more with Include file handling. The tiOPF project (and some of my projects) use include files for the Compiler Mode and enabling AnsiString support. If I browse such a file, not via a Lazarus Package or not via the Project that owns that unit, then Lazarus IDE can't find the include file - this is generally ok. Unfortunately this then causes code navigation to fail as well. eg: Ctrl+Shift+(up|down) stops working. By simply commenting the Include line like shown below allows Lazarus IDE to navigate the code again. Can Lazarus IDE be made to be more lenient when it comes to Include files outside the Interface and Implementation sections? Actually just ignoring Include files errors when the {$I xxx} is before the Implementation section would also work (I think). At least just so the code navigation works.

Yes.
A quick fix could be added. So you can right click on the message and then get some options:

Check configuration
Search
Create file
Ignore/skip
Comment
Remove

I'm not sure what is the best solution for 'ignore'. Should the Ignore be stored to disk? I fear users will forget that they defined an Ignore and will wonder why the IDE behaves "buggy". So the Ignores should be somehow shown at a prominent place. Any ideas?

Notes:
The Ignore will be defined for the whole directory, not only the specific file.
Similar can be done for "unit not found".

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 22 lines
On Tue, 22 Jun 2010 09:00:23 +0200 Graeme Geldenhuys wrote: > Hi, > > Lazarus IDE is already very generous with errors in code - yet still > allows syntax highlighting or jumping around inside the code. Can > Lazarus IDE be improved just a little bit more with Include file > handling. The tiOPF project (and some of my projects) use include > files for the Compiler Mode and enabling AnsiString support. If I > browse such a file, not via a Lazarus Package or not via the Project > that owns that unit, then Lazarus IDE can't find the include file - > this is generally ok. Unfortunately this then causes code navigation > to fail as well. eg: Ctrl+Shift+(up|down) stops working. By simply > commenting the Include line like shown below allows Lazarus IDE to > navigate the code again. > > Can Lazarus IDE be made to be more lenient when it comes to Include > files outside the Interface and Implementation sections? Actually just > ignoring Include files errors when the {$I xxx} is before the > Implementation section would also work (I think). At least just so the > code navigation works.

I'm all for Graeme's request. It's very annoying that the slightest error has such consequences.

Show quoted text 17 lines
Yes. A quick fix could be added. So you can right click on the message and then get some options: Check configuration Search Create file Ignore/skip Comment Remove I'm not sure what is the best solution for 'ignore'. Should the Ignore be stored to disk? I fear users will forget that they defined an Ignore and will wonder why the IDE behaves "buggy". So the Ignores should be somehow shown at a prominent place. Any ideas?

Several, in fact:
- Add a menu item in the above list 'Show ignore list';
- And then add a similar button in the Codetools configuration dialog.
- Also, please show these options when you encounter a parsing error somewhere.
- Add a configuration option to code tools 'ignore errors in files not part of project'

The last one is the first I'll use :-)

Show quoted text 5 lines
Notes: The Ignore will be defined for the whole directory, not only the specific file. Similar can be done for "unit not found".

Why not for the file ? I would expect 2 menu items: Ignore/skip all in this file
Ignore/skip all in this directory

Michael.

Reply by email

Mattias Gaertner
to Michael Van Canneyt
Show quoted text 50 lines
On Tue, 22 Jun 2010, Mattias Gaertner wrote: > On Tue, 22 Jun 2010 09:00:23 +0200 > Graeme Geldenhuys wrote: > >> Hi, >> >> Lazarus IDE is already very generous with errors in code - yet still >> allows syntax highlighting or jumping around inside the code. Can >> Lazarus IDE be improved just a little bit more with Include file >> handling. The tiOPF project (and some of my projects) use include >> files for the Compiler Mode and enabling AnsiString support. If I >> browse such a file, not via a Lazarus Package or not via the Project >> that owns that unit, then Lazarus IDE can't find the include file - >> this is generally ok. Unfortunately this then causes code navigation >> to fail as well. eg: Ctrl+Shift+(up|down) stops working. By simply >> commenting the Include line like shown below allows Lazarus IDE to >> navigate the code again. >> >> Can Lazarus IDE be made to be more lenient when it comes to Include >> files outside the Interface and Implementation sections? Actually just >> ignoring Include files errors when the {$I xxx} is before the >> Implementation section would also work (I think). At least just so the >> code navigation works. I'm all for Graeme's request. It's very annoying that the slightest error has such consequences. > > Yes. > A quick fix could be added. So you can right click on the message and > then get some options: > > Check configuration > Search > Create file > Ignore/skip > Comment > Remove > > I'm not sure what is the best solution for 'ignore'. > Should the Ignore be stored to disk? I fear users will forget that they > defined an Ignore and will wonder why the IDE behaves "buggy". So the > Ignores should be somehow shown at a prominent place. > Any ideas? Several, in fact: - Add a menu item in the above list 'Show ignore list';

+1

- And then add a similar button in the Codetools configuration dialog.

+1

- Also, please show these options when you encounter a parsing error somewhere.

Show how?

- Add a configuration option to code tools 'ignore errors in files not part of project'

For every Ignore there must be a definition for each depending function what to do otherwise.

Show quoted text 11 lines
The last one is the first I'll use :-) > > Notes: > The Ignore will be defined for the whole directory, not only the > specific file. > Similar can be done for "unit not found". Why not for the file ? I would expect 2 menu items: Ignore/skip all in this file Ignore/skip all in this directory

If an include file can not be found for one file it can not be found for any other file in the same directory, because they share the same search paths.

Mattias

Reply by email

Michael Van Canneyt
to Mattias Gaertner
Mattias Gaertner wrote 56 lines
>> On Tue, 22 Jun 2010 09:00:23 +0200 >> Graeme Geldenhuys wrote: >> >>> Hi, >>> >>> Lazarus IDE is already very generous with errors in code - yet still >>> allows syntax highlighting or jumping around inside the code. Can >>> Lazarus IDE be improved just a little bit more with Include file >>> handling. The tiOPF project (and some of my projects) use include >>> files for the Compiler Mode and enabling AnsiString support. If I >>> browse such a file, not via a Lazarus Package or not via the Project >>> that owns that unit, then Lazarus IDE can't find the include file - >>> this is generally ok. Unfortunately this then causes code navigation >>> to fail as well. eg: Ctrl+Shift+(up|down) stops working. By simply >>> commenting the Include line like shown below allows Lazarus IDE to >>> navigate the code again. >>> >>> Can Lazarus IDE be made to be more lenient when it comes to Include >>> files outside the Interface and Implementation sections? Actually just >>> ignoring Include files errors when the {$I xxx} is before the >>> Implementation section would also work (I think). At least just so the >>> code navigation works. > > I'm all for Graeme's request. It's very annoying that the slightest error > has such consequences. > >> >> Yes. >> A quick fix could be added. So you can right click on the message and >> then get some options: >> >> Check configuration >> Search >> Create file >> Ignore/skip >> Comment >> Remove >> >> I'm not sure what is the best solution for 'ignore'. >> Should the Ignore be stored to disk? I fear users will forget that they >> defined an Ignore and will wonder why the IDE behaves "buggy". So the >> Ignores should be somehow shown at a prominent place. >> Any ideas? > > Several, in fact: > - Add a menu item in the above list 'Show ignore list'; +1 > - And then add a similar button in the Codetools configuration dialog. +1 > - Also, please show these options when you encounter a parsing error somewhere. Show how?

Same popup in the messages window. Not just when reporting missing files.

Show quoted text 5 lines
> - Add a configuration option to code tools 'ignore errors in files not part of project' For every Ignore there must be a definition for each depending function what to do otherwise.

Eh ?

Show quoted text 17 lines
> The last one is the first I'll use :-) > >> >> Notes: >> The Ignore will be defined for the whole directory, not only the >> specific file. >> Similar can be done for "unit not found". > > Why not for the file ? I would expect 2 menu items: > Ignore/skip all in this file > Ignore/skip all in this directory If an include file can not be found for one file it can not be found for any other file in the same directory, because they share the same search paths.

Ah. That means that if

{$i myfile.inc}

does not exist, then any other reference to *myfile.inc* in the same directory will also be ignored. Yes, this is correct.

Michael.

Reply by email

Graeme Geldenhuys
to Mattias Gaertner: On Tue, 22 Jun 2010 09:00:23 +0200 Yes. A quick fix could be added. So you can right…
Mattias Gaertner wrote
Yes. A quick fix could be added. So you can right click on the message and then get some options:

Do you mean those popup menus in the Messages window? I guess that could work.

Here are some of the errors I get when simply opening a tiOPF unit (while the current project doesn't use tiOPF). In each case I placed the edit cursor in a interface section on a method. Then tried to jump to it's implementation section using Ctrl+Shift+DownArrow

/home/graemeg/programming/3rdParty/tiOPF2/src/Options/tiDataset.pas(50,4) Error: no pascal code found (first token is )

/home/graemeg/programming/3rdParty/tiOPF2/src/Options/tiEncryptSimple.pas(3,4) Error: "interface" expected, but found

/home/graemeg/programming/3rdParty/tiOPF2/src/Options/tiOIDInt64.pas(10,4) Error: "interface" expected, but found

In the first example the {$I xxx} was before the 'unit tiDataset' line
- normally I place include files after the 'unit XXX' line, but I didn't write the code contained in tiDataset.pas unit.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email