diff --git a/components/codetools/customcodetool.pas b/components/codetools/customcodetool.pas index 829929ae20..f0029003d1 100644 --- a/components/codetools/customcodetool.pas +++ b/components/codetools/customcodetool.pas @@ -1459,10 +1459,10 @@ var CloseBracket, AntiCloseBracket: TCommonAtomFlag; procedure RaiseBracketNotFound; begin - if CloseBracket=cafRoundBracketOpen then - SaveRaiseExceptionFmt(ctsBracketNotFound,['(']) + if CloseBracket=cafRoundBracketClose then + SaveRaiseExceptionFmt(ctsBracketNotFound,[')']) else - SaveRaiseExceptionFmt(ctsBracketNotFound,['[']); + SaveRaiseExceptionFmt(ctsBracketNotFound,[']']); end; begin diff --git a/components/codetools/finddeclarationtool.pas b/components/codetools/finddeclarationtool.pas index 71bb35c8bb..f65d06ea6e 100644 --- a/components/codetools/finddeclarationtool.pas +++ b/components/codetools/finddeclarationtool.pas @@ -2058,6 +2058,7 @@ var AbsCursorPos: integer; IdentStartPos, IdentEndPos: integer; IdentAdded: boolean; + ClassStr: String; begin Result:=''; if FindDeclaration(CursorPos,AllFindSmartFlags, @@ -2080,6 +2081,11 @@ begin ctnConstDefinition: Result:=Result+'const '; ctnEnumIdentifier: Result:=Result+'enum '; end; + + // add class name + ClassStr := NewTool.ExtractClassName(NewNode, False); + if ClassStr <> '' then Result := Result + ClassStr + '.'; + NewTool.MoveCursorToNodeStart(NewNode); NewTool.ReadNextAtom; Result:=Result+NewTool.GetAtom; @@ -2112,7 +2118,7 @@ begin // ToDo: ppu, ppw, dcu files Result:=Result+NewTool.ExtractProcHead(NewNode, - [phpWithStart,phpWithVarModifiers,phpWithParameterNames, + [phpAddClassName,phpWithStart,phpWithVarModifiers,phpWithParameterNames, phpWithDefaultValues,phpWithResultType,phpWithOfObject]); IdentAdded:=true; end; @@ -2127,6 +2133,13 @@ begin NewTool.MoveCursorToNodeStart(IdentNode); NewTool.ReadNextAtom; Result:=Result+NewTool.GetAtom+' '; + + if NewNode.Desc = ctnProperty then + begin // add class name + ClassStr := NewTool.ExtractClassName(NewNode, False); + if ClassStr <> '' then Result := Result + ClassStr + '.'; + end; + NewTool.ReadNextAtom; Result:=Result+NewTool.GetAtom+' '; IdentAdded:=true; @@ -7134,9 +7147,9 @@ function TFindDeclarationTool.CheckParameterSyntax(CursorNode: TCodeTreeNode; procedure RaiseBracketNotOpened; begin if CurPos.Flag=cafRoundBracketClose then - SaveRaiseExceptionFmt(ctsBracketNotFound,['[']) + SaveRaiseExceptionFmt(ctsBracketNotFound,['(']) else - SaveRaiseExceptionFmt(ctsBracketNotFound,['(']); + SaveRaiseExceptionFmt(ctsBracketNotFound,['[']); end; function CheckIdentifierAndParameterList: boolean; forward; diff --git a/components/codetools/pascalreadertool.pas b/components/codetools/pascalreadertool.pas index 41be5f0984..ece1a4f7d8 100644 --- a/components/codetools/pascalreadertool.pas +++ b/components/codetools/pascalreadertool.pas @@ -460,6 +460,19 @@ function TPascalReaderTool.ExtractClassName(ClassNode: TCodeTreeNode; var Len: integer; begin if ClassNode<>nil then begin + if ClassNode.Desc <> ctnClass then + begin + // find class of node + repeat + ClassNode := ClassNode.Parent; + if (ClassNode = nil) or (ClassNode.Desc in AllCodeSections) then + begin + Result := ''; + Exit; + end; + until ClassNode.Desc = ctnClass; + end; + if ClassNode.Desc=ctnClass then begin ClassNode:=ClassNode.Parent; if (ClassNode<>nil) and (ClassNode.Desc=ctnGenericType) then @@ -469,6 +482,7 @@ begin exit; end; end; + Len:=1; while (ClassNode.StartPos+Len<=SrcLen) and (IsIdentChar[Src[ClassNode.StartPos+Len]]) do diff --git a/components/codetools/stdcodetools.pas b/components/codetools/stdcodetools.pas index e25b919913..a6e51973cb 100644 --- a/components/codetools/stdcodetools.pas +++ b/components/codetools/stdcodetools.pas @@ -4702,7 +4702,7 @@ begin dec(CurPos.StartPos,3); while true do begin if (CurPos.StartPos>=1) - and ((Src[CurPos.StartPos+11]='*') and (Src[CurPos.StartPos]='(')) then + and ((Src[CurPos.StartPos+1]='*') and (Src[CurPos.StartPos]='(')) then begin Result:=true; exit;