Sign in Join

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

Mailing lists / lazarus / 2015-02

CodeToolManager: file was not reached by scanner

5 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

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

Valdas Jankūnas

Hello,

today I bumped on to problem:

- in Lazarus IDE I opened unit file "irankiai.pas" which is listed in
Project Inspector;
- placed cursor in body of one functions;
- tried to view declaration of that function -> Shift+Ctrl+Up

after that cursor jumped in to main unit at "end." line, Message Window complains that "Codetools, Errors: 1" and "pagrindinis.pas(175,1) Error: cursor pos outside of code", console reports (IDE compiled with CTDEBUG):

### TCodeToolManager.HandleException: "file was not reached by scanner" at Line=983 Col=36 in
"/home/senbuvis/Mano_popieriai/Programavimas/Lazarus/Programos/Pantografo_modeliavimas/Programa/Moduliai/irankiai.pas" ### TCodeToolManager.HandleException: "cursor pos outside of code" at Line=179 Col=4 in
"/home/senbuvis/Mano_popieriai/Programavimas/Lazarus/Programos/Pantografo_modeliavimas/Programa/Moduliai/pagrindinis.pas"

This happen only inside that "irankiai.pas" unit.

I don't understand why this happens and how to fix this problem. Some advice?

Sorry for my bad english.

Valdas Jank?nas

Reply by email

Mattias Gaertner
to Valdas Jankūnas
Show quoted text 25 lines
Hello, today I bumped on to problem: - in Lazarus IDE I opened unit file "irankiai.pas" which is listed in Project Inspector; - placed cursor in body of one functions; - tried to view declaration of that function -> Shift+Ctrl+Up after that cursor jumped in to main unit at "end." line, Message Window complains that "Codetools, Errors: 1" and "pagrindinis.pas(175,1) Error: cursor pos outside of code", console reports (IDE compiled with CTDEBUG): ### TCodeToolManager.HandleException: "file was not reached by scanner" at Line=983 Col=36 in "/home/senbuvis/Mano_popieriai/Programavimas/Lazarus/Programos/Pantografo_modeliavimas/Programa/Moduliai/irankiai.pas" ### TCodeToolManager.HandleException: "cursor pos outside of code" at Line=179 Col=4 in "/home/senbuvis/Mano_popieriai/Programavimas/Lazarus/Programos/Pantografo_modeliavimas/Programa/Moduliai/pagrindinis.pas" This happen only inside that "irankiai.pas" unit. I don't understand why this happens and how to fix this problem. Some advice?

It means codetools parsed the unit, but the parser didn't come to the position, where the cursor is. For example if there is an "end." in front. Search for the "end."
You can find out in "Code Explorer" what the parser found.

Another possibility is that irankiai.pas is/was an include file. Open irankiai.pas, then IDE menu / Source / View Unit information / clear include cache.

Mattias

Reply by email

Valdas Jankūnas
to Mattias Gaertner

Hello,

I managed to fix that problem but in unexplainable manner:

2015.02.27 18:03, Mattias Gaertner ra??:

It means codetools parsed the unit, but the parser didn't come to the position, where the cursor is. For example if there is an "end." in front. Search for the "end." You can find out in "Code Explorer" what the parser found.

I checked all "end.", it appears only in ".pas" files, only once in every file.

Another possibility is that irankiai.pas is/was an include file. Open irankiai.pas, then IDE menu / Source / View Unit information / clear include cache.

Unit Information shows that unit "irankiai.pas" is included by main unit "pagrindinis.pas". If I press "Goto Include Directive" then cursor jumps at line "unit pagrindinis;" in main unit and message window shows same error.
I tried to clear include cache - it help little: I can Ctrl+Up,Down in "irankiai.pas". But if I in another unit do Ctrl+LeftMause on function name which is implemented in unit "irankiai.pas" then problem arises. Unit "irankai" is in Uses clause in implementation section in main unit, so I moved that unit usage in interface section - that helped. And then again, restored it in to implementation section - no problems. Strange.

Valdas Jank?nas

Reply by email

Mattias Gaertner
to Valdas Jankūnas
Show quoted text 15 lines
[...] > Another possibility is that irankiai.pas is/was an include file. > Open irankiai.pas, then IDE menu / Source / View Unit information / > clear include cache. Unit Information shows that unit "irankiai.pas" is included by main unit "pagrindinis.pas". If I press "Goto Include Directive" then cursor jumps at line "unit pagrindinis;" in main unit and message window shows same error. I tried to clear include cache - it help little: I can Ctrl+Up,Down in "irankiai.pas". But if I in another unit do Ctrl+LeftMause on function name which is implemented in unit "irankiai.pas" then problem arises. Unit "irankai" is in Uses clause in implementation section in main unit, so I moved that unit usage in interface section - that helped. And then again, restored it in to implementation section - no problems. Strange.

Can you reproduce the problem when moving the "uses" back to implementation?

Mattias

Reply by email

Valdas Jankūnas
to Mattias Gaertner

...

Show quoted text 6 lines
> unit, so I moved that unit usage in interface section - that helped. And > then again, restored it in to implementation section - no problems. Strange. Can you reproduce the problem when moving the "uses" back to implementation?

Yes I did that - no problems. Sadly, when problem was there I do not make a snapshot of ".lazarus" dir for deeper investigation.

If problem will arise again then I'll try to localize source of it.

Valdas Jank?nas

Reply by email