Sign in Join

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

Mailing lists / lazarus / 2001-12

Updates

33 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

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

Mattias Gaertner

Hi all,

- editopts->codetools->autotooltipsymbtools activated

This option activates or deactivates the smart hints in the source editor. These hints are currently only showing the word underneath the mouse cursor, but eventually they will show the declaration just like Delphi.

- added syntax highlighters (xml,lfm) for
*.lfm *.dfm *.xfm *.xml *.xsd *.xsl *.xslt *.dtd files.
- added error position and message to all of TCodeToolManager.
- fixed mem leak in editor options (mapped color attributes)

Mattias

Reply by email

Shane Miller

Changes:

- Added a TCalendar component. It currently appears on the MISC tab in the IDE. There are a number of display options available to the designer.

Shane

Reply by email

Mattias Gaertner
to Jarto Tarpio: I decided to check out the status of Lazarus this weekend as it was a while since I last…
The IDE has really improved a lot. Especially the source editor. It's fast as lightning.

Thx. Although it can be much faster. The LCL is currently not clipping, the syntax highlighting creates and destroys far too many strings with every repaint, and the search and replace is also not optimized.

Open file at cursor is not implemented yet, so I decided to give it a try to see if I could be of help. After a few hours of reading old code, I'm sure I could implement that.

What old code?

There seems to be two functions that are used for finding the word under the cursor: GetWordFromCaret and TextUnderCursor. These two should maybe be combined?

I removed TextUnderCursor, since it was not used. You can use GetWordFromCaret, although I think, the code should be changed. TSourceEditor.StartFindAndReplace uses

with EditorComponent do
  s := GetWordAtRowCol(CaretXY);

which returns the word at the cursor, considering the current highlighter.

Anyway, these won't work with include files as both stop at a dot.

And include files and units depends on the corresponding search path. So, a simple word at cursor function will not work for many fpc/lcl sources. The codetools will know about the search paths as soon as I finished the codetool editor.

Interestingly enough, uniteditor.pas also contains OpenAtCursorClicked, which is commented out. So someone is maybe already working on this?

Yes, Shane did, a long time ago. No one is currently working on that.

Feel free to give me something to work on. I'm not familiar with GTK-programming, but I could give a helping hand with the IDE.

Great!
If you don't know, where to start, here are some features, which don't need gtk and should also be easy enough to start:

-Find Text History (see Moleskine)
-Makefile and bash hilighting
-Find in files
-MessageDialog Editor (see GExperts)
-Backup Project to directory
-compare files (diff output)
-Macro Start: Ctrl-Shift-R, End: Ctrl-Shift-R, Play: Ctrl-Shift-P (see official synedit cvs)
-Incremental Search: Ctrl-E
+typed letters in statusbar
-Colors for Object inspector

Mattias

Reply by email

Shane Miller

Added:

- TWatchesDlg. Select "View - Watches" and a watches dialog appears. Currently, watches aren't enabled. You can add and delte watches by pressing the insert and delete buttons when the watches dialog is active. I will be adding "Add Watch At Cursor" shortly.

Shane

Reply by email

Mattias Gaertner
to Jarto Tarpio: I decided to check out the status of Lazarus this weekend as it was a while since I last…
Show quoted text 5 lines
I'll have a look which one I'll choose. Meanwhile, I completed Open assume I don't have write permissions to cvs, so here's the code. FindPasFile can be moved to another unit. I just don't know yet, where you prefer to have such functions. The path- problem is solved with a constant path for the moment.

I added it.
I extended the path with the project directory and the lazarus source directory. Also the files are checked like fpc case-sensitive, lowercase, uppercase.

This one doesn't support inc-files yet as GetWordAtRowCol doesn't return the extension.

And the directories..
But it is a start.

Mattias

Reply by email

Jarto Tarpio
to Jarto Tarpio: I'll have a look which one I'll choose. Meanwhile, I completed Open assume I don't have…
Mattias wrote
I extended the path with the project directory and the lazarus source directory. Also the files are checked like fpc case-sensitive, lowercase, uppercase.

Here's another version. I shortened FindPasFile a bit and made a GetFilenameAtRowCol (mostly from synedit) which also works with include files and directories too.

/jarto

function TMainIDE.DoOpenFileAtCursor(Sender:
TObject):TModalResult;
var SE: TSourceEditor;
    FName,SPath: String;
  function FindPasFile(var FName: String; SPath: String): Boolean;
  //  Searches for FName in Spath
  //  If FName is not found, we'll check extensions pp and pas too
  //  Returns true if found. FName contains the full file+path in that case
  var TempFile,TempPath,CurPath,Ext: String;
      i,p,c: Integer;
  begin
    if SPath='' then SPath:='.';
    Result:=true;
    for i:=0 to 2 do begin
      case i of
        1: Ext:='.pp';
        2: Ext:='.pas';
        else Ext:='';
      end;
      TempPath:=SPath;
      while TempPath'' do begin
        p:=pos(';',TempPath);
        if p=0 then p:=length(TempPath)+1;
        CurPath:=copy(TempPath,1,p-1)+'/';
        Delete(TempPath,1,p);
        for c:=0 to 2 do begin
          case c of
            0: TempFile:=FName;
            1: TempFile:=LowerCase(FName);
            2: TempFile:=UpperCase(FName);
          end;
          TempFile:=ExpandFileName(CurPath+TempFile+Ext);
          if FileExists(TempFile) then begin
            FName:=TempFile;
            exit;
          end;
        end;
      end;
    end;
    result:=false;
  end;
  function GetFilenameAtRowCol(XY: TPoint): string;
  var
    Line,IdChars: string;
    Len, Stop: integer;
  begin
    Result := '';
    if (XY.Y >= 1) and (XY.Y <= SE.EditorComponent.Lines.Count) then begin
      Line := SE.EditorComponent.Lines.Strings[XY.Y - 1];
      Len := Length(Line);
      if (XY.X >= 1) and (XY.X <= Len + 1) then begin
        IdChars := ',;:[]{}() ''';
        Stop := XY.X;
        while (Stop <= Len) and (pos(Line[Stop],IdChars)=0) do
          Inc(Stop);
        while (XY.X > 1) and (pos(Line[XY.X - 1],IdChars)=0) do
          Dec(XY.X);
        if Stop > XY.X then
          Result := Copy(Line, XY.X, Stop - XY.X);
      end;
    end;
  end;
begin
  writeln('TMainIDE.DoOpenFileAtCursor');
  Result:=mrCancel;
  SE:=SourceNoteBook.GetActiveSE;
  if SE=nil then exit;
  FName:=GetFilenameAtRowCol(SE.EditorComponent.CaretXY);
  if FName='' then exit;
  SPath:=ExtractFilePath(Project.ProjectFile)+';'
        +EnvironmentOptions.LazarusDirectory+'/lcl;'
        +EnvironmentOptions.LazarusDirectory+'/designer';
  if FindPasFile(FName,SPath) then begin
    result:=mrOk;
    EnvironmentOptions.LastOpenDialogDir:=ExtractFilePath(FName);
    if DoOpenEditorFile(FName,false)=mrOk then begin
      EnvironmentOptions.AddToRecentOpenFiles(FName);
      SaveEnvironment;
    end;
  end;
end;

Reply by email

Mattias Gaertner
to Jarto Tarpio: I'll have a look which one I'll choose. Meanwhile, I completed Open assume I don't have…

Hi all,

OpenFileAtCursor:
I added the path of the active file to the search path and made it windows compatible.

Small changes:

- added perl hilighter
- added Yes-To-All to Search&Replace
- replace dialog will now try to not hide the found location
- open file will not try any longer to open lrs files as lfm files.
- find text should now focus the text field

Mattias

Reply by email

Jarto Tarpio

Hi,

I decided to check out the status of Lazarus this weekend as it was a while since I last downloaded and tested it. It was impressive to install the compiler with one rpm-command and to see how all the source compiled nicely after a cvs co.

The IDE has really improved a lot. Especially the source editor. It's fast as lightning. A lot more responsive than Kylix. There sure is still lots of missing functionality but this project looks promising.

Open file at cursor is not implemented yet, so I decided to give it a try to see if I could be of help. After a few hours of reading old code, I'm sure I could implement that.

There seems to be two functions that are used for finding the word under the cursor: GetWordFromCaret and TextUnderCursor. These two should maybe be combined? Anyway, these won't work with include files as both stop at a dot. Interestingly enough, uniteditor.pas also contains OpenAtCursorClicked, which is commented out. So someone is maybe already working on this?

Feel free to give me something to work on. I'm not familiar with GTK-programming, but I could give a helping hand with the IDE.

/jarto

Reply by email

Jarto Tarpio
to Jarto Tarpio
Mattias Gaertner wrote 14 lines
If you don't know, where to start, here are some features, which don't need gtk and should also be easy enough to start: -Find Text History (see Moleskine) -Makefile and bash hilighting -Find in files -MessageDialog Editor (see GExperts) -Backup Project to directory -compare files (diff output) -Macro Start: Ctrl-Shift-R, End: Ctrl-Shift-R, Play: Ctrl-Shift-P (see official synedit cvs) -Incremental Search: Ctrl-E +typed letters in statusbar -Colors for Object inspector

I'll have a look which one I'll choose. Meanwhile, I completed Open assume I don't have write permissions to cvs, so
here's the code. FindPasFile can be moved to another unit. I just don't know yet, where you prefer to have such functions. The path- problem is solved with a constant path for the moment.

This one doesn't support inc-files yet as GetWordAtRowCol doesn't return the extension.

/jarto

function TMainIDE.DoOpenFileAtCursor(Sender: TObject):TModalResult;
var SE: TSourceEditor;
    FName,SPath: String;
  function FindPasFile(var FName: String; SPath: String): Boolean;
  //  Searches for FName in Spath
  //  If FName is not found, we'll check extensions pp and pas too
  //  Returns true if found. FName contains the full file+path in that case
  var TempFile,TempPath,Ext: String;
      i,p: Integer;
  begin
    if SPath='' then SPath:='.';
    for i:=0 to 2 do begin
      case i of
        1: Ext:='.pp';
        2: Ext:='.pas';
        else Ext:='';
      end;
      TempPath:=SPath;
      while TempPath'' do begin
        p:=pos(';',TempPath);
        if p=0 then p:=length(TempPath)+1;
        TempFile:=copy(TempPath,1,p-1)+'/'+FName+Ext;
        Delete(TempPath,1,p);
        if FileExists(TempFile) then begin
          result:=true;
          FName:=ExpandFileName(TempFile);
          exit;
        end;
      end;
    end;
    result:=false;
  end;
begin
  writeln('TMainIDE.DoOpenFileAtCursor');
  Result:=mrCancel;
  SE:=SourceNoteBook.GetActiveSE;
  if SE=nil then exit;
  FName:=SE.EditorComponent.GetWordAtRowCol(SE.EditorComponent.CaretXY);
  FName:=Lowercase(FName);
  SPath:='.;lcl;designer'; //Take this from project options later when available
  if FindPasFile(FName,SPath) then begin
    result:=mrOk;
    EnvironmentOptions.LastOpenDialogDir:=ExtractFilePath(FName);
    if DoOpenEditorFile(FName,false)=mrOk then begin
      EnvironmentOptions.AddToRecentOpenFiles(FName);
      SaveEnvironment;
    end;
  end;
end;

Reply by email

Jarto Tarpio
to Shane Miller: Lazarus does hang once in a while for some reson which is related to the hints. At this…

Hi Shane,

Lazarus does hang once in a while for some reson which is related to the hints. At this point I just remember to not move the mouse when I run Lazarus until it's done loading.

As I wrote, the problem is with disabling and enabling the hinttimers during mousemove while the editor starts. You can verify this by just adding an exit in the beginning of the HintTimerClick- code. No hints-code is executed but the ide hangs if you move the mouse over the editor during startup.

I have spent a lot of time tracking this down last week and posted two patches that fix this problem in both uniteditor.pp and main.pp. My fix is based on letting the timers run all the time. I handle the enbling/disabling with a separate HintCounter.

I can redo the patches once more so you'll get fresh patches to apply if I just get a green light from you.

I want to complete the breakpoints dialog and the Add Breakpoints dialog soon. However I see you are having some issue with the TComboBox? Can you explain that a bit for me?

TComboBox.SetFocus doesn't give focus to the combobox. Make a simple project with one button and one combobox to test this. Also notice that the focus disappears somewhere just before the combobox if you move focus by pressing tab.

/jarto

Reply by email

Shane Miller

Changes:

- Fixed setfocus for TComboBox. Now when you to ComboBox1.SetFocus the edit box of the combo gets focus and you can type

- Same thing for TMemo and other controls that use an underlying scrollwindow

Shane

Reply by email

Shane Miller
to Shane Miller: Changes: - Breakpoints are added to breakpoints dialog when you click on the gutter. …

Currently you can't do much with the TListView like sorting and alignment but in the next few days I'll add:

- Sorting by columns
- Setting specific columns to hidden/visible
- Justification specific to each column
- Resizable specific to column
- Auto-sizable columns that expand based on the data they contain
- Max/Min widths for columns
- Row heights
- Forground and background colors specific to rows
- Add images to cells
and anything else I can figure out in the next few days.

I will look at the hints tomorrow. Perhaps I can find a fix to the underlying problem.

Thanks
Shane

Earlier message 42 lines
----- Original Message ----- From: "Luis R. Hilario" To: Sent: Tuesday, December 18, 2001 7:48 PM Subject: Re: [lazarus] Updates > Shane Miller wrote: > > > > Changes: > > > > > > - TListView 80% completed. > > Good news for me. > I was implementing it, but badly (to my way of understanding the > things). > Is that not I am a teacher as you. > http://www.luis-digital.8m.com/klinton/linuxfacturas.gif > > The columns can be aligned: of right to left for the numbers and of left > to right for the characters? > > It would be able also to fix the "Hints" as priority? > Simply not it can do anything with the present problem of the "Hints". > > A lot thanks. > > -- > |------------------------------| > | Luis R. Hilario | > | http://www.luis-digital.8m.com | > |------------------------------| > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > _________________________________________________________________ > To unsubscribe: mail with > "unsubscribe" as the Subject > archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Mattias Gaertner

Hi all,

- fixed TOpenDialog: typed but not selected filename is not any longer ignored
- open file shortcut in sourceeditor works now
- find declaration of parsed include directives
- IDE now checks if files are text files
- IDE now checks for write permissions and sets ReadOnly

Mattias

Reply by email

Mattias Gaertner

Hi all,

- complete-code and jump-to-method will now jump to the syntax error, if any
- nicer filenames for quick-syntax-check
- added GUID and ALIAS-proc-specifier parsing

Mattias

Reply by email

Luis R. Hilario
to Shane Miller: Lazarus does hang once in a while for some reson which is related to the hints. At this…
Shane Miller wrote
Lazarus does hang once in a while for some reson which is related to the hints. At this point I just remember to not move the mouse when I run Lazarus until it's done loading.

I do not have problems when Lazarus initiates.
In my case: Lazarus always hang my system when move the mouse upon the components.
If the code of the mister Tarpio fixes the problem, in the meantime would be good to use it.

I want to complete the breakpoints dialog and the Add Breakpoints dialog soon.
Thanks by:
//Example alignment of columns.
//      Columns.Item[1].Alignment := caRight;
|------------------------------| | Luis R. Hilario | | http://www.luis-digital.8m.com | |------------------------------| _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com

Reply by email

Jarto Tarpio
to Shane Miller: Currently you can't do much with the TListView like sorting and alignment but in the next…
Shane wrote
I will look at the hints tomorrow. Perhaps I can find a fix to the underlying problem.

If you want to find the Real Reason, you have to dig deep and find out why the Timer-code hangs:

HintTimer.Enabled:=false;
HintTimer.Enabled:=true;

This happens only in MouseMove during startup. I haven't been able to crash it otherwise when I've tried to make a simple testcase.

IMHO your time would be better spent finishing TListView and fixing the focus-problem in TComboBox which prevents us from using Find-history.

Please consider applying the two patches I posted last week.

/jarto

Reply by email

Shane Miller

Changes:

- Breakpoints are added to breakpoints dialog when you click on the gutter. They don't automatically change the line number in the dialog when lines are added to the source.

- TListView 80% completed.  You can now add items like Delphi:
   var  LI : TListItem;
   Begin
      LI := ListView1.Items.Add;
      LI.Caption := 'something';
      LI.SubItems.Add('subitem 1');
  end;
  Columns can be added and deleted.  This is not FULLY tested but it's usable at this point.

Shane

Reply by email

Shane Miller

Lazarus does hang once in a while for some reson which is related to the hints. At this point I just remember to not move the mouse when I run Lazarus until it's done loading.

I want to complete the breakpoints dialog and the Add Breakpoints dialog soon. However I see you are having some issue with the TComboBox? Can you explain that a bit for me?

Thanks
Shane

>> 12/19/01 12:26AM >>>
Shane wrote
I will look at the hints tomorrow. Perhaps I can find a fix to the underlying problem.

If you want to find the Real Reason, you have to dig deep and find out why the Timer-code hangs:

HintTimer.Enabled:=false;
HintTimer.Enabled:=true;

This happens only in MouseMove during startup. I haven't been able to crash it otherwise when I've tried to make a simple testcase.

IMHO your time would be better spent finishing TListView and fixing the focus-problem in TComboBox which prevents us from using Find-history.

Please consider applying the two patches I posted last week.

/jarto

_________________________________________________________________ To unsubscribe: mail with
"unsubscribe" as the Subject
archives at http://www.miraclec.com/list_archives/lazarus

Reply by email

Luis R. Hilario
to Shane Miller: Changes: - Breakpoints are added to breakpoints dialog when you click on the gutter. …
Shane Miller wrote 5 lines
Changes: - TListView 80% completed.

Good news for me.
I was implementing it, but badly (to my way of understanding the things).
Is that not I am a teacher as you.
http://www.luis-digital.8m.com/klinton/linuxfacturas.gif

The columns can be aligned: of right to left for the numbers and of left to right for the characters?

It would be able also to fix the "Hints" as priority? Simply not it can do anything with the present problem of the "Hints".

A lot thanks.

|------------------------------| | Luis R. Hilario | | http://www.luis-digital.8m.com | |------------------------------| _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com

Reply by email

Mattias Gaertner

Hi all,

There are two new functions in the IDE:

1. 'Find block end' - This is an advanced version of 'go to matching bracket'. It will jump between brackets, pascal comment brackets, 'begin'..'end', 'repeat'..'until', 'try'..'finally', ... To use it, define a key in Environment -> Editor Options -> Key Mappings.

2. 'Guess unclosed block'
Although the freepascal compiler has very good error messages, so that the error position most of time points to the error, there are cases, where the error position does not help. Most of the cases involves a missing 'begin' or 'end'. 'Guess unclosed block' tries to find these blocks. It searches for blocks, which start and end have different indenting. For example, it will find:

begin
  while do
  end;  // this end needs a begin
  if expr then begin  // begin needs an end
end;

To use it you can define a key or use Tools->Guess unclosed block. 'Guess unclosed block' will search the next unclosed block after the cursor.

Mattias

Reply by email

Unknown author
to Mattias Gaertner: -added TCanvas.Pie, TCanvas.Ellipse -fixed save as of resource code (.lrs) and text form…

Hi Mattias

Mattias Gaertner wrote 7 lines
Hi all, -added TCanvas.Pie, TCanvas.Ellipse -fixed save as of resource code (.lrs) and text form data (.lfm) -fixed stupid "file not text file" message, if file does not exists -fixed saving of resource code without form data -prevent loading of old lfm file on save as

Seems to me that the fixes to lfm/lrs saving got lost again. It worked well for me but since my last update the errors are there again.

Could you please check this (Sorry, but at the moment I still don't know enough about the IDE-code, otherwise I'd try to find out myself)

bye,

Stefan

--------------------------------------------------------- Stefan Hille email: 48155 Muenster voice: 0251/664695

Reply by email

Mattias Gaertner
to Mattias Gaertner: -added TCanvas.Pie, TCanvas.Ellipse -fixed save as of resource code (.lrs) and text form…
Show quoted text 12 lines
Saving a new unit/form with a name other than unit1 will not always change the {$I unit1.lrs} line in the initialization section Here's what I found out: a) It works only if the path where the project is located is also in the include path (Run->Compiler-Options->Search-Path->Include-Path) -> This should be documented or (better) the project path should always be appended to the include-path

You should see what Delphi/Kylix can/will do with such things ... :) Ok, forget Delphi and include files.
Lazarus will eventually fully support include files and the idea raised many months ago, that the IDE should be able to keep resource and backup files in sub dirs, so that lazarus project dirs will not contain that many files as a Delphi project. But these features are not yet fully implemented. The IDE have to check smartly the compiler options and tell the values to the codetools. On the other hand, saving a project unit outside the unit search path, should create a dialog to ask the user whether altering the search path. Since I'm busy, I don't know when I will add it. I think, these are not very difficult features, so anyone can add them.

Show quoted text 7 lines
> I did not fix your bug report: > " - The lfm/lrs are not always written to disk although changes were made" That one was from Marc. You already described the problem with multi-level undo&redo and I know this is difficult. As a workaround we could always save the lfm to a temporary file and compare it with the original (ok, not nice but i should work).

I think, that this is the only proper way. Ok, not lfm files, but binary object memory streams. Delphi does it the same. The only drawback are big streams like images which could be very slow. But that can be solved.

good night,
Mattias

Reply by email

Unknown author
to Shane Miller: Lazarus does hang once in a while for some reson which is related to the hints. At this…

Hi Jarto,

Jarto Tarpio wrote 6 lines
[..hinttimer..] I have spent a lot of time tracking this down last week and posted two patches that fix this problem in both uniteditor.pp and main.pp. My fix is based on letting the timers run all the time. I handle the enbling/disabling with a separate HintCounter.

I'm currently trying to fix this issue. Can you please send me your patches.

I can redo the patches once more so you'll get fresh patches to apply if I just get a green light from you.

Don't think this is neccessary, I'll get around with the old ones.

bye,

Stefan

--------------------------------------------------------- Stefan Hille email: 48155 Muenster voice: 0251/664695

Reply by email

Mattias Gaertner
to Mattias Gaertner: -added TCanvas.Pie, TCanvas.Ellipse -fixed save as of resource code (.lrs) and text form…
Show quoted text 13 lines
Hi Mattias On Fri, Dec 28, 2001 at 01:29:45PM +0100, Mattias Gaertner wrote: > Hi all, > > -added TCanvas.Pie, TCanvas.Ellipse > -fixed save as of resource code (.lrs) and text form data (.lfm) > -fixed stupid "file not text file" message, if file does not exists > -fixed saving of resource code without form data > -prevent loading of old lfm file on save as Seems to me that the fixes to lfm/lrs saving got lost again. It worked well for me but since my last update the errors are there again.

The fixes are still there.

I did not fix your bug report:
" - The lfm/lrs are not always written to disk although changes were made"

Mattias

Reply by email

Mattias Gaertner

Hi all,

-added TCanvas.Pie, TCanvas.Ellipse
-fixed save as of resource code (.lrs) and text form data (.lfm) -fixed stupid "file not text file" message, if file does not exists -fixed saving of resource code without form data
-prevent loading of old lfm file on save as

Mattias

Reply by email

Mattias Gaertner

Hi folks,

Some updates for compiler options:
- linker options fixed and multiple linker options
- added Show Hints for unused project units
You can now use the program file like Delphi to
compile all units and there will be no stupid
hint message, that a unit is not used in the main
program.
- added error count
- The Test button was renamed to 'Show Options' and will now show the options passed to the compiler.
- Include Assertion Code option added
- 'use Compiler Config file' option fixed.

Mattias

Reply by email

Shane Miller

Changes:

- Modified TListView to use TImageList and display images correctly. Setting a TListItem's imageindex causes an image to be displayed in the appropriate row.

- Modified TCustomImageList to notify it's owners of changes to the list.

Shane

Reply by email

Mattias Gaertner

Hi all,

Many codetool updates. The big new feature is:
Find Declaration now searches in used units and hidden used units like the system unit. I have only tested it under Linux. For bsd and windows, I need some testers.

Of course, find declaration is still incomplete. Still missing: 'inherited' keyword, expression operators, operator overloading, proc overloading, interfaces, property access 'read' and 'write', reading IDE compiler options, protected visibility, caching, ...

Also there are two bugs, that are independent of find declaration, but makes it feel clumsy:
- Focus is not always set to source editor
- source editor sometimes scrolls to the right

Changes:
!!! - renamed key 'Find block end' to 'Find block other end'

New:
- new function: 'Find block start' (see editor options -> Key Mapping) Jump to start of block. A block is here for example 'begin'..'end', 'repeat'..'until', brackets, 'try'..'finally', 'procedure'.., 'implementation'.., 'unit'.., 'class'.., 'published'..
- parser now gives hints, which proc or block is not closed.
- parser now checks begin..end blocks for keywords, so that errors are found earlier
- linux system unit can now be parsed without errors
- find declaration of source name identifier
- find declaration of default class ancestor 'TObject'
- find declaration of used units
- find declaration of hidden units: system, objpas, heaptrc, lineinfo

Fixes:
- fixed guess-unclosed-blocks 'end of source ot found' error
- parser now recognizes string constants at end of line
- parser recognizes keywords: external, public, internproc, iternconst
- Find block functions can now distinguish between case statement and variant record.
- 'file' keyword is now allowed as type
- parser now understands begin..end at end of implementation section
- operator result identifier is now parsed correctly
- parser now understands constant proc types
- reading backwards now recognizes 'of object', 'class of', 'class;', 'class function', 'class procedure'
- reading backwards now recognizes string constants at end of line
- reading backwards now recognizes delphi comment at end of line

Mattias

Reply by email

Unknown author
to Mattias Gaertner: -added TCanvas.Pie, TCanvas.Ellipse -fixed save as of resource code (.lrs) and text form…

Hi Mattias

Mattias Gaertner wrote 6 lines
On Thu, 3 Jan 2002 01:29:58 +0100 wrote: > Seems to me that the fixes to lfm/lrs saving got lost again. It > worked well for me but since my last update the errors are there again. The fixes are still there.

You're right, I ran into another one:-(

Problem:

Saving a new unit/form with a name other than unit1 will not always change the

     {$I unit1.lrs}
  line in the initialization section

Here's what I found out:

a) It works only if the path where the project is located is also in the include path (Run->Compiler-Options->Search-Path->Include-Path)

-> This should be documented or (better) the project path should always be appended to the include-path

b) It'll only work if the file "unit1.lrs" exists in the Include-Path, otherwise the exception

### TCodeToolManager.HandleException: "include file not found "unit1.lrs"" at Line=25 Col=7 in
"/home/stoppok/usr/src/leasyroute/tmp/xunit10.pas

will be raised.
(Since this file can't be there as long as the project has not been compiled

Here's some debugging output from a session wher I first saved a new form as yunit1.pas (without unit1.lrs).

<<<< snip
TMainIDE.DoNewUnit end
TMainIDE.DoSaveEditorUnit A PageIndex=4 SaveAs=FALSE SaveToTestDir=FALSE TPascalParserTool.BuildTree A OnlyInterfaceNeeded=FALSE TPascalParserTool.BuildTree A OnlyInterfaceNeeded=TRUE TPascalParserTool.BuildTree A OnlyInterfaceNeeded=FALSE TPascalParserTool.BuildTree A OnlyInterfaceNeeded=TRUE TPascalParserTool.BuildTree A OnlyInterfaceNeeded=FALSE ### TCodeToolManager.HandleException: "include file not found "unit1.lrs"" at Li
ne=24 Col=7 in "/home/stoppok/usr/src/leasyroute/tmp/yunit1.pas" TPascalParserTool.BuildTree A OnlyInterfaceNeeded=FALSE ### TCodeToolManager.HandleException: "include file not found "unit1.lrs"" at Line=24 Col=7 in "/home/stoppok/usr/src/leasyroute/tmp/yunit1.pas"

>>> snap

Then I openend another new form, created an empty file unit1.lrs, and saved as yunit2.pas.

<<<< snip
inIDE.DoNewUnit end
TMainIDE.DoSaveEditorUnit A PageIndex=5 SaveAs=FALSE SaveToTestDir=FALSE TPascalParserTool.BuildTree A OnlyInterfaceNeeded=FALSE ### TCodeToolManager.HandleException: "include file not found "unit1.lrs"" at Li
ne=24 Col=7 in "unit1.pas"
TPascalParserTool.BuildTree A OnlyInterfaceNeeded=TRUE WARNING: [GTKKeySnooper] Pressed key (0xFFFF) already pressed (LC=0x40024) WARNING: [GTKKeySnooper] Pressed key (0x79) already pressed (LC=0x59) WARNING: [GTKKeySnooper] Pressed key (0xFFFF) already pressed (LC=0x40027) WARNING: [GTKKeySnooper] Pressed key (0xFFFF) already pressed (LC=0x40027) WARNING: [GTKKeySnooper] Pressed key (0xFFFF) already pressed (LC=0x40027) TPascalParserTool.BuildTree A OnlyInterfaceNeeded=FALSE TPascalParserTool.BuildTree A OnlyInterfaceNeeded=TRUE TPascalParserTool.BuildTree A OnlyInterfaceNeeded=FALSE TPascalParserTool.BuildTree A OnlyInterfaceNeeded=FALSE ### TCodeToolManager.HandleException: "include file not found "yunit2.lrs"" at Line=24 Col=7 in "/home/stoppok/usr/src/leasyroute/tmp/yunit2.pas"

Show quoted text 5 lines
>>> snap I did not fix your bug report: " - The lfm/lrs are not always written to disk although changes were made"

That one was from Marc. You already described the problem with multi-level undo&redo and I know this is difficult. As a workaround we could always save the lfm to a temporary file and compare it with the original (ok, not nice but i should work).

good night,

Stefan

--------------------------------------------------------- Stefan Hille email: 48155 Muenster voice: 0251/664695

Reply by email

Mattias Gaertner

Hi all,

Fixes:
- fixed "build lazarus": stop on error
- fixed starting codetools in unknown include files
- fixed mem leaks in TListView and IDE
- fixed codetools expression operators in parameters
- fixed proc find next in classes
- fixed jump to method: cursor after proc head

Changes:
- find declaration now caches identifiers of interface sections
- jump to method -> if cursor is in a sub proc withou forward declaration then parent proc is tried. For example:

procedure A;
  procedure B;
  begin
    |
  end;
begin
end;

Method jumping in B will first search the forward declaration of B and then searching the forward declaration of A.

Mattias

Reply by email

Mattias Gaertner

Hi all,

Find declaration will now find procs by checking the parameter types, which is important for overloading. This is done, by evaluating the type of each expression. Many operators and predefined types are already supported. It would be too much text, to explain, which one work, and which one not. Hopefully the list will grow complete in the next week. Because there is no caching yet, searching a proc can be very slow.

Still missing:
- operator overloading, some automatic type conversions, caching, 'protected' keyword, 'inherited' keyword, interfaces, ppu files, ppw files, dcu files ...

Mattias

Reply by email