[lazarus] Small bugs in code completion

Jarto Tarpio jarto at starsoft.fi
Sat Dec 15 15:53:24 EST 2001


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 MissingNode<>nil then begin 
        ClassStartComment:=GetIndentStr(Indent) 
                            +'{ '+ExtractClassName(ClassNode,false)+' }'; 
        
ASourceChangeCache.Replace(gtEmptyLine,gtEmptyLine,InsertPos,InsertPos, 
           ClassStartComment); 
      end;

/jarto






More information about the Lazarus mailing list