From d054dea35c91ae5aee3e3c91ed1c49123f081fa6 Mon Sep 17 00:00:00 2001 From: mattias Date: Sat, 9 Jul 2011 21:36:19 +0000 Subject: [PATCH] codetools: identifier completion: do not clear on change git-svn-id: trunk@31625 - --- components/codetools/codetoolmanager.pas | 4 +-- components/codetools/identcompletiontool.pas | 28 -------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/components/codetools/codetoolmanager.pas b/components/codetools/codetoolmanager.pas index 1293aef154..ec85d06b16 100644 --- a/components/codetools/codetoolmanager.pas +++ b/components/codetools/codetoolmanager.pas @@ -5163,8 +5163,8 @@ begin CTIncreaseChangeStamp(FCodeNodeTreeChangeStep); if NodesDeleting then begin CTIncreaseChangeStamp(FCodeTreeNodesDeletedStep); - if (IdentifierList<>nil) and (not FIdentifierListUpdating) then - IdentifierList.ToolTreeNodesDeleting(Tool,NodesDeleting); + // Note: IdentifierList nodes do not need to be cleared, because Node + // is accessed via GetNode, which checks if nodes were deleted end; end; diff --git a/components/codetools/identcompletiontool.pas b/components/codetools/identcompletiontool.pas index d1ae06be9e..51f045a651 100644 --- a/components/codetools/identcompletiontool.pas +++ b/components/codetools/identcompletiontool.pas @@ -231,7 +231,6 @@ type function StartUpAtomInFrontIs(const s: string): boolean; function StartUpAtomBehindIs(const s: string): boolean; function CompletePrefix(const OldPrefix: string): string; - procedure ToolTreeNodesDeleting(Tool: TCustomCodeTool; NodesDeleting: boolean); function CalcMemSize: PtrUInt; public property Context: TFindContext read FContext write FContext; @@ -828,33 +827,6 @@ begin end; end; -procedure TIdentifierList.ToolTreeNodesDeleting(Tool: TCustomCodeTool; - NodesDeleting: boolean); -var - ItemNode: TAVLTreeNode; - Item: TIdentifierListItem; -begin - if Tool=nil then exit; - if FIdentView.Count=0 then exit; - if (FUsedTools=nil) or (ilfUsedToolsNeedsUpdate in FFlags) then begin - Exclude(FFlags,ilfUsedToolsNeedsUpdate); - // create list of all used tools - if FUsedTools=nil then - FUsedTools:=TAVLTree.Create - else - FUsedTools.Clear; - ItemNode:=FItems.FindLowest; - while ItemNode<>nil do begin - Item:=TIdentifierListItem(ItemNode.Data); - if (Item.Tool<>nil) and (FUsedTools.Find(Item.Tool)=nil) then - FUsedTools.Add(Item.Tool); - ItemNode:=FItems.FindSuccessor(ItemNode); - end; - end; - if FUsedTools.Find(Tool)=nil then exit; - Clear; -end; - function TIdentifierList.CalcMemSize: PtrUInt; var i: Integer;