Sign in Join

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

Mailing lists / lazarus / 2001-12

Small bugs in code completion

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

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

Jarto Tarpio

Mattias,

If you start a new project without saving anything and use code completion, the IDE will ask if you want to create a new unit1. That's because TMainIDE.DoOpenEditorUnit checks if the unit-file exists before checking if the SourceNotebook already has it. An easy fix is to rearrange code in TMainIDE.DoOpenEditorUnit so that FileExists will be checked later.

The code completion also adds class comments even if no procedure bodies are added. This results in extra class comments during every new code completion. This is easily fixed: (line 829 in CodeCompletionTool.pas)

      // insert class comment
      if MissingNodenil then begin
        ClassStartComment:=GetIndentStr(Indent)
                            +'{ '+ExtractClassName(ClassNode,false)+' }';
ASourceChangeCache.Replace(gtEmptyLine,gtEmptyLine,InsertPos,InsertPos,
           ClassStartComment);
      end;

/jarto

Reply by email

Mattias Gaertner
to Jarto Tarpio
Show quoted text 5 lines
If you start a new project without saving anything and use code completion, the IDE will ask if you want to create a new unit1. That's because TMainIDE.DoOpenEditorUnit checks if the unit-file exists before checking if the SourceNotebook already has it. An easy fix is to rearrange code in TMainIDE.DoOpenEditorUnit so that FileExists will be checked later.

Thx. Fixed.

The code completion also adds class comments even if no procedure bodies are added. This results in extra class comments during every new code completion.

Fixed.

Also fixed end of implementation node, which resulted in adding new procs to initialization section.

Mattias

Reply by email