diff --git a/components/codetools/lfmtrees.pas b/components/codetools/lfmtrees.pas index 8549d2eaca..1f3eb93dbd 100644 --- a/components/codetools/lfmtrees.pas +++ b/components/codetools/lfmtrees.pas @@ -987,9 +987,13 @@ begin PrependStr:=PrependStr+'noTree'; end;} if PrependStr<>'' then begin - if Result<>'' then - Result:='/'+Result; - Result:=PrependStr+Result; + if Result<>'' then begin + if ANode is TLFMObjectNode then + Result:='.'+Result + else + Result:='/'+Result; + end; + Result:=PrependStr+Result; end; ANode:=ANode.Parent; end; diff --git a/components/codetools/stdcodetools.pas b/components/codetools/stdcodetools.pas index 30c19f61c0..f769c74d2e 100644 --- a/components/codetools/stdcodetools.pas +++ b/components/codetools/stdcodetools.pas @@ -2372,8 +2372,6 @@ var const VarPropContext: TFindContext): TFindContext; var Params: TFindDeclarationParams; - Identifier: PChar; - OldInput: TFindDeclarationInput; TypeNode: TCodeTreeNode; VariableTypeName, AnUnitName, TypeName: String; begin @@ -2390,11 +2388,9 @@ var LFMObject.NamePosition); end; VariableTypeName:=VarPropContext.Tool.ExtractDefinitionNodeType(VarPropContext.Node); - Identifier:=@VarPropContext.Tool.Src[TypeNode.StartPos] end else if (VarPropContext.Node.Desc=ctnProperty) then begin TypeNode:=VarPropContext.Node; VariableTypeName:=VarPropContext.Tool.ExtractPropType(TypeNode,false,false); - Identifier:=VarPropContext.Tool.GetPropertyTypeIdentifier(TypeNode); end else begin LFMTree.AddError(lfmeObjectIncompatible,LFMObject, LFMObject.Name+' is not a variable' @@ -2410,13 +2406,8 @@ var fdfExceptionOnPredefinedIdent,fdfIgnoreMissingParams, fdfIgnoreOverloadedProcs,fdfIgnoreCurContextNode]; Params.ContextNode:=TypeNode; - Params.SetIdentifier(VarPropContext.Tool,Identifier,nil); try - Params.Save(OldInput); - if VarPropContext.Tool.FindIdentifierInContext(Params) then begin - Params.Load(OldInput,true); - Result:=Params.NewCodeTool.FindBaseTypeOfNode(Params,Params.NewNode); - end; + Result:=VarPropContext.Tool.FindBaseTypeOfNode(Params,TypeNode); except // ignore search/parse errors on E: ECodeToolError do begin diff --git a/components/codetools/tests/testlfmtrees.pas b/components/codetools/tests/testlfmtrees.pas index cdf35fcc38..b37e8548ed 100644 --- a/components/codetools/tests/testlfmtrees.pas +++ b/components/codetools/tests/testlfmtrees.pas @@ -304,7 +304,7 @@ end; procedure TTestLFMTrees.LFMUnitname; begin AddControls; - AddFormUnit(['Button1: TButton']); + AddFormUnit(['Button1: Controls.TButton']); FLFMCode:=AddSource('unit1.lfm',LinesToStr([ 'object Form1: unit1/TForm1', ' object Button1: Controls/TButton',