codetools: added TCodeContextInfoItem.AsDebugString

git-svn-id: trunk@56506 -
This commit is contained in:
mattias 2017-11-27 14:41:27 +00:00
parent 0d87d46948
commit c43215a213
2 changed files with 18 additions and 1 deletions

View File

@ -497,7 +497,7 @@ type
Allowed: TFindFileAtCursorFlags = DefaultFindFileAtCursorAllowed;
StartPos: PCodeXYPosition = nil): boolean;
// get code context
// get code context (aka parameter hints)
function FindCodeContext(Code: TCodeBuffer; X,Y: integer;
out CodeContexts: TCodeContextInfo): boolean;
function ExtractProcedureHeader(Code: TCodeBuffer; X,Y: integer;

View File

@ -338,6 +338,7 @@ type
Params: TStringList;
ResultType: string;
destructor Destroy; override;
function AsDebugString(WithExpr: boolean): string;
end;
{ TCodeContextInfo }
@ -4357,5 +4358,21 @@ begin
inherited Destroy;
end;
function TCodeContextInfoItem.AsDebugString(WithExpr: boolean): string;
var
i: Integer;
begin
Result:=ProcName+'(';
if Params<>nil then
for i:=0 to Params.Count-1 do begin
if i>0 then Result+=',';
Result+=Params[i];
end;
Result+=')';
if ResultType<>'' then Result+=':'+ResultType;
if WithExpr then
Result+=' '+ExprTypeToString(Expr);
end;
end.