Sign in Join

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

Mailing lists / lazarus / 2014-11

Prevent CodeTools from parsing a piece of code

8 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!

Is there a possibility to prevent the CodeTools from parsing a piece of code while allowing the compiler to parse it? For example some define that's only set for CodeTools, but not for the compiler? This would be really useful for people like me who either work on New compiler features or use newer features in stable (aka older) versions of the IDE. :)

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

Reply by email

Mattias Gaertner
to Sven Barth
Show quoted text 8 lines
Hello together! Is there a possibility to prevent the CodeTools from parsing a piece of code while allowing the compiler to parse it? For example some define that's only set for CodeTools, but not for the compiler? This would be really useful for people like me who either work on New compiler features or use newer features in stable (aka older) versions of the IDE. :)

Tools / Codetools Defines Editor
Edit / Insert Node Below / Define Recurse

Name: InLazIDE
Description: Define InLazIDE everywhere
Variable: InLazIDE
Value: 1

Then you can use anywhere:
{$IFDEF InLazIDE}
only valid in Lazarus source editor
{$ENDIF}

Mattias

Reply by email

Maxim Ganetsky
to Mattias Gaertner

21.11.2014 1:41, Mattias Gaertner ?????:

Show quoted text 24 lines
On Thu, 20 Nov 2014 17:16:40 +0100 Sven Barth wrote: > Hello together! > > Is there a possibility to prevent the CodeTools from parsing a piece of > code while allowing the compiler to parse it? For example some define > that's only set for CodeTools, but not for the compiler? > This would be really useful for people like me who either work on New > compiler features or use newer features in stable (aka older) versions of > the IDE. :) Tools / Codetools Defines Editor Edit / Insert Node Below / Define Recurse Name: InLazIDE Description: Define InLazIDE everywhere Variable: InLazIDE Value: 1 Then you can use anywhere: {$IFDEF InLazIDE} only valid in Lazarus source editor {$ENDIF}

But this won't prevent CodeTools from parsing this code? Maybe we need some {% ...} Codetools enable/disable directive?

Best regards, Maxim Ganetsky mailto:

Reply by email

Sven Barth
to Mattias Gaertner: On Thu, 20 Nov 2014 17:16:40 +0100 Tools / Codetools Defines Editor Edit / Insert Node…
Mattias Gaertner wrote 24 lines
On Thu, 20 Nov 2014 17:16:40 +0100 Sven Barth wrote: > Hello together! > > Is there a possibility to prevent the CodeTools from parsing a piece of > code while allowing the compiler to parse it? For example some define > that's only set for CodeTools, but not for the compiler? > This would be really useful for people like me who either work on New > compiler features or use newer features in stable (aka older) versions of > the IDE. :) Tools / Codetools Defines Editor Edit / Insert Node Below / Define Recurse Name: InLazIDE Description: Define InLazIDE everywhere Variable: InLazIDE Value: 1 Then you can use anywhere: {$IFDEF InLazIDE} only valid in Lazarus source editor {$ENDIF}

Thanks, I will try that. :) Does this work with 1.2.2 already?

Regards,
Sven

Reply by email

Sven Barth
to Sven Barth
"Sven Barth" wrote 13 lines
On 20.11.2014 23:41, Mattias Gaertner wrote: > > On Thu, 20 Nov 2014 17:16:40 +0100 > Sven Barth wrote: > >> Hello together! >> >> Is there a possibility to prevent the CodeTools from parsing a piece of >> code while allowing the compiler to parse it? For example some define >> that's only set for CodeTools, but not for the compiler? >> This would be really useful for people like me who either work on New >> compiler features or use newer features in stable (aka older) versions

of

Show quoted text 18 lines
>> the IDE. :) > > > Tools / Codetools Defines Editor > Edit / Insert Node Below / Define Recurse > > Name: InLazIDE > Description: Define InLazIDE everywhere > Variable: InLazIDE > Value: 1 > > Then you can use anywhere: > {$IFDEF InLazIDE} > only valid in Lazarus source editor > {$ENDIF} Thanks, I will try that. :) Does this work with 1.2.2 already?

To answer myself: yes it does. And it works exactly as intended! :D

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

Reply by email

Sven Barth
to Maxim Ganetsky: 21.11.2014 1:41, Mattias Gaertner ?????: But this won't prevent CodeTools from parsing…
"Maxim Ganetsky" wrote 13 lines
21.11.2014 1:41, Mattias Gaertner ?????: > On Thu, 20 Nov 2014 17:16:40 +0100 > Sven Barth wrote: > >> Hello together! >> >> Is there a possibility to prevent the CodeTools from parsing a piece of >> code while allowing the compiler to parse it? For example some define >> that's only set for CodeTools, but not for the compiler? >> This would be really useful for people like me who either work on New >> compiler features or use newer features in stable (aka older) versions

of

Show quoted text 18 lines
>> the IDE. :) > > > Tools / Codetools Defines Editor > Edit / Insert Node Below / Define Recurse > > Name: InLazIDE > Description: Define InLazIDE everywhere > Variable: InLazIDE > Value: 1 > > Then you can use anywhere: > {$IFDEF InLazIDE} > only valid in Lazarus source editor > {$ENDIF} But this won't prevent CodeTools from parsing this code? Maybe we need

some {% ...} Codetools enable/disable directive?

It works exactly as intended if one uses IFNDEF. And this way it can be used to let the IDE parse a non compiling, but parseable alternative. :)

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

Reply by email

Michael Van Canneyt
to Mattias Gaertner: On Thu, 20 Nov 2014 17:16:40 +0100 Tools / Codetools Defines Editor Edit / Insert Node…
Mattias Gaertner wrote 24 lines
On Thu, 20 Nov 2014 17:16:40 +0100 Sven Barth wrote: > Hello together! > > Is there a possibility to prevent the CodeTools from parsing a piece of > code while allowing the compiler to parse it? For example some define > that's only set for CodeTools, but not for the compiler? > This would be really useful for people like me who either work on New > compiler features or use newer features in stable (aka older) versions of > the IDE. :) Tools / Codetools Defines Editor Edit / Insert Node Below / Define Recurse Name: InLazIDE Description: Define InLazIDE everywhere Variable: InLazIDE Value: 1 Then you can use anywhere: {$IFDEF InLazIDE} only valid in Lazarus source editor {$ENDIF}

Seems like something useful which you could add by default :)

Michael.

Reply by email

Mattias Gaertner
to Michael Van Canneyt
Show quoted text 7 lines
[...] > Then you can use anywhere: > {$IFDEF InLazIDE} > only valid in Lazarus source editor > {$ENDIF} Seems like something useful which you could add by default :)

To be honest: I fear misuse and a decrease in bug reports.

Mattias

Reply by email