mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 06:22:30 +02:00
added debugging for clipboard
git-svn-id: trunk@8603 -
This commit is contained in:
parent
575c6d1810
commit
fa3cda85f5
@ -866,6 +866,7 @@ var
|
|||||||
ParameterNode: TCodeTreeNode;
|
ParameterNode: TCodeTreeNode;
|
||||||
TypeNode: TCodeTreeNode;
|
TypeNode: TCodeTreeNode;
|
||||||
NewType: String;
|
NewType: String;
|
||||||
|
IgnorePos: TCodePosition;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
|
|
||||||
@ -915,7 +916,13 @@ begin
|
|||||||
Params.SetIdentifier(Self,@Src[ProcNameAtom.StartPos],nil);
|
Params.SetIdentifier(Self,@Src[ProcNameAtom.StartPos],nil);
|
||||||
Params.Flags:=fdfGlobals+[fdfSearchInParentNodes,fdfSearchInAncestors,
|
Params.Flags:=fdfGlobals+[fdfSearchInParentNodes,fdfSearchInAncestors,
|
||||||
fdfFindVariable,fdfIgnoreCurContextNode];
|
fdfFindVariable,fdfIgnoreCurContextNode];
|
||||||
if not FindIdentifierInContext(Params) then exit;
|
CleanPosToCodePos(VarNameAtom.StartPos,IgnorePos);
|
||||||
|
IgnoreErrorAfter:=IgnorePos;
|
||||||
|
try
|
||||||
|
if not FindDeclarationOfIdentAtCursor(Params) then exit;
|
||||||
|
finally
|
||||||
|
ClearIgnoreErrorAfter;
|
||||||
|
end;
|
||||||
NewType:='';
|
NewType:='';
|
||||||
if Params.NewNode<>nil then begin
|
if Params.NewNode<>nil then begin
|
||||||
ParameterNode:=Params.NewCodeTool.FindNthParameterNode(Params.NewNode,
|
ParameterNode:=Params.NewCodeTool.FindNthParameterNode(Params.NewNode,
|
||||||
|
@ -194,7 +194,7 @@ type
|
|||||||
// 1=CursorPos beyond scanned code
|
// 1=CursorPos beyond scanned code
|
||||||
//-2=X,Y beyond source
|
//-2=X,Y beyond source
|
||||||
function CleanPosToCodePos(CleanPos: integer;
|
function CleanPosToCodePos(CleanPos: integer;
|
||||||
var CodePos:TCodePosition): boolean; // true=ok, false=invalid CleanPos
|
out CodePos:TCodePosition): boolean; // true=ok, false=invalid CleanPos
|
||||||
function CleanPosToCaret(CleanPos: integer;
|
function CleanPosToCaret(CleanPos: integer;
|
||||||
var Caret:TCodeXYPosition): boolean; // true=ok, false=invalid CleanPos
|
var Caret:TCodeXYPosition): boolean; // true=ok, false=invalid CleanPos
|
||||||
function CleanPosToCaretAndTopLine(CleanPos: integer;
|
function CleanPosToCaretAndTopLine(CleanPos: integer;
|
||||||
@ -2045,7 +2045,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TCustomCodeTool.CleanPosToCodePos(CleanPos: integer;
|
function TCustomCodeTool.CleanPosToCodePos(CleanPos: integer;
|
||||||
var CodePos: TCodePosition): boolean;
|
out CodePos: TCodePosition): boolean;
|
||||||
var
|
var
|
||||||
ACode: pointer;
|
ACode: pointer;
|
||||||
begin
|
begin
|
||||||
|
@ -6630,6 +6630,8 @@ function TFindDeclarationTool.CreateParamExprListFromStatement(
|
|||||||
var ExprType: TExpressionType;
|
var ExprType: TExpressionType;
|
||||||
BracketClose: char;
|
BracketClose: char;
|
||||||
ExprStartPos, ExprEndPos: integer;
|
ExprStartPos, ExprEndPos: integer;
|
||||||
|
CurIgnoreErrorAfterPos: Integer;
|
||||||
|
OldFlags: TFindDeclarationFlags;
|
||||||
|
|
||||||
procedure RaiseBracketNotFound;
|
procedure RaiseBracketNotFound;
|
||||||
begin
|
begin
|
||||||
@ -6650,6 +6652,11 @@ begin
|
|||||||
BracketClose:=']'
|
BracketClose:=']'
|
||||||
else
|
else
|
||||||
BracketClose:=#0;
|
BracketClose:=#0;
|
||||||
|
if IgnoreErrorAfterValid then
|
||||||
|
CurIgnoreErrorAfterPos:=IgnoreErrorAfterCleanedPos
|
||||||
|
else
|
||||||
|
CurIgnoreErrorAfterPos:=-1;
|
||||||
|
OldFlags:=Params.Flags;
|
||||||
if BracketClose<>#0 then begin
|
if BracketClose<>#0 then begin
|
||||||
// read parameter list
|
// read parameter list
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
@ -6670,6 +6677,9 @@ begin
|
|||||||
until false;
|
until false;
|
||||||
ExprEndPos:=CurPos.StartPos;
|
ExprEndPos:=CurPos.StartPos;
|
||||||
// find expression type
|
// find expression type
|
||||||
|
if (CurIgnoreErrorAfterPos>=ExprStartPos) then
|
||||||
|
Params.Flags:=Params.Flags-[fdfExceptionOnNotFound];
|
||||||
|
//DebugLn('TFindDeclarationTool.CreateParamExprListFromStatement CurIgnoreErrorAfterPos=',dbgs(CurIgnoreErrorAfterPos),' ExprStartPos=',dbgs(ExprStartPos));
|
||||||
ExprType:=FindExpressionResultType(Params,ExprStartPos,ExprEndPos);
|
ExprType:=FindExpressionResultType(Params,ExprStartPos,ExprEndPos);
|
||||||
// add expression type to list
|
// add expression type to list
|
||||||
Result.Add(ExprType);
|
Result.Add(ExprType);
|
||||||
@ -6682,6 +6692,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Params.Flags:=OldFlags;
|
||||||
{$IFDEF ShowExprEval}
|
{$IFDEF ShowExprEval}
|
||||||
DebugLn('[TFindDeclarationTool.CreateParamExprListFromStatement] END ',
|
DebugLn('[TFindDeclarationTool.CreateParamExprListFromStatement] END ',
|
||||||
'ParamCount=',dbgs(Result.Count),' "',copy(Src,StartPos,40),'"');
|
'ParamCount=',dbgs(Result.Count),' "',copy(Src,StartPos,40),'"');
|
||||||
|
@ -296,6 +296,7 @@ var FormatAtom, FormatTry: Cardinal;
|
|||||||
var a: integer;
|
var a: integer;
|
||||||
AllID: cardinal;
|
AllID: cardinal;
|
||||||
begin
|
begin
|
||||||
|
//DebugLn('IsFormatSupported Format=',dbgs(Format),' SupportedCnt=',dbgs(SupportedCnt));
|
||||||
if Format=0 then begin
|
if Format=0 then begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
exit;
|
exit;
|
||||||
@ -307,7 +308,7 @@ var FormatAtom, FormatTry: Cardinal;
|
|||||||
{DebugLn('IsFormatSupported A ',Dbgs(SelData.Selection),
|
{DebugLn('IsFormatSupported A ',Dbgs(SelData.Selection),
|
||||||
' ',HexStr(Cardinal(ClipboardTypeAtoms[ClipboardType]),8),
|
' ',HexStr(Cardinal(ClipboardTypeAtoms[ClipboardType]),8),
|
||||||
' SelData.Target='+dbgs(SelData.Target),' AllID='+dbgs(AllID),
|
' SelData.Target='+dbgs(SelData.Target),' AllID='+dbgs(AllID),
|
||||||
' SelData.TheType='+dbgs(SelData.TheType),' '+dbgs(gdk_atom_intern('ATOM',0)),
|
' SelData.TheType='+dbgs(SelData.TheType)+' ATOM='+dbgs(gdk_atom_intern('ATOM',0))+' Name="'+gdk_atom_name(SelData.TheType)+'"',
|
||||||
' SelData.Length='+dbgs(SelData.Length),
|
' SelData.Length='+dbgs(SelData.Length),
|
||||||
' SelData.Format='+dbgs(SelData.Format)
|
' SelData.Format='+dbgs(SelData.Format)
|
||||||
);}
|
);}
|
||||||
@ -319,6 +320,7 @@ var FormatAtom, FormatTry: Cardinal;
|
|||||||
end;
|
end;
|
||||||
SupportedCnt:=SelData.Length div (SelData.Format shr 3);
|
SupportedCnt:=SelData.Length div (SelData.Format shr 3);
|
||||||
SupportedFormats:=PGdkAtom(SelData.Data);
|
SupportedFormats:=PGdkAtom(SelData.Data);
|
||||||
|
//DebugLn('IsFormatSupported SupportedCnt=',dbgs(SupportedCnt));
|
||||||
|
|
||||||
{a:=SupportedCnt-1;
|
{a:=SupportedCnt-1;
|
||||||
while (a>=0) do begin
|
while (a>=0) do begin
|
||||||
|
@ -2146,7 +2146,6 @@ end;
|
|||||||
procedure TPkgManager.AddUnitToProjectMainUsesSection(AProject: TProject;
|
procedure TPkgManager.AddUnitToProjectMainUsesSection(AProject: TProject;
|
||||||
const AnUnitName, AnUnitInFilename: string);
|
const AnUnitName, AnUnitInFilename: string);
|
||||||
begin
|
begin
|
||||||
DumpStack;
|
|
||||||
// add unit to project main source file
|
// add unit to project main source file
|
||||||
if (pfMainUnitHasUsesSectionForAllUnits in AProject.Flags)
|
if (pfMainUnitHasUsesSectionForAllUnits in AProject.Flags)
|
||||||
and (AProject.MainUnitInfo<>nil) then begin
|
and (AProject.MainUnitInfo<>nil) then begin
|
||||||
|
Loading…
Reference in New Issue
Block a user