mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 07:37:02 +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;
|
||||
TypeNode: TCodeTreeNode;
|
||||
NewType: String;
|
||||
IgnorePos: TCodePosition;
|
||||
begin
|
||||
Result:=false;
|
||||
|
||||
@ -915,7 +916,13 @@ begin
|
||||
Params.SetIdentifier(Self,@Src[ProcNameAtom.StartPos],nil);
|
||||
Params.Flags:=fdfGlobals+[fdfSearchInParentNodes,fdfSearchInAncestors,
|
||||
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:='';
|
||||
if Params.NewNode<>nil then begin
|
||||
ParameterNode:=Params.NewCodeTool.FindNthParameterNode(Params.NewNode,
|
||||
@ -938,7 +945,7 @@ begin
|
||||
end;
|
||||
//DebugLn(' CompleteLocalVariableAsParameter Dont know: ',Params.NewNode.DescAsString);
|
||||
end;
|
||||
|
||||
|
||||
if NewType='' then begin
|
||||
exit;
|
||||
end;
|
||||
|
@ -194,7 +194,7 @@ type
|
||||
// 1=CursorPos beyond scanned code
|
||||
//-2=X,Y beyond source
|
||||
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;
|
||||
var Caret:TCodeXYPosition): boolean; // true=ok, false=invalid CleanPos
|
||||
function CleanPosToCaretAndTopLine(CleanPos: integer;
|
||||
@ -2045,7 +2045,7 @@ begin
|
||||
end;
|
||||
|
||||
function TCustomCodeTool.CleanPosToCodePos(CleanPos: integer;
|
||||
var CodePos: TCodePosition): boolean;
|
||||
out CodePos: TCodePosition): boolean;
|
||||
var
|
||||
ACode: pointer;
|
||||
begin
|
||||
|
@ -6630,7 +6630,9 @@ function TFindDeclarationTool.CreateParamExprListFromStatement(
|
||||
var ExprType: TExpressionType;
|
||||
BracketClose: char;
|
||||
ExprStartPos, ExprEndPos: integer;
|
||||
|
||||
CurIgnoreErrorAfterPos: Integer;
|
||||
OldFlags: TFindDeclarationFlags;
|
||||
|
||||
procedure RaiseBracketNotFound;
|
||||
begin
|
||||
RaiseExceptionFmt(ctsStrExpectedButAtomFound,[BracketClose,GetAtom]);
|
||||
@ -6650,6 +6652,11 @@ begin
|
||||
BracketClose:=']'
|
||||
else
|
||||
BracketClose:=#0;
|
||||
if IgnoreErrorAfterValid then
|
||||
CurIgnoreErrorAfterPos:=IgnoreErrorAfterCleanedPos
|
||||
else
|
||||
CurIgnoreErrorAfterPos:=-1;
|
||||
OldFlags:=Params.Flags;
|
||||
if BracketClose<>#0 then begin
|
||||
// read parameter list
|
||||
ReadNextAtom;
|
||||
@ -6670,6 +6677,9 @@ begin
|
||||
until false;
|
||||
ExprEndPos:=CurPos.StartPos;
|
||||
// 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);
|
||||
// add expression type to list
|
||||
Result.Add(ExprType);
|
||||
@ -6682,6 +6692,7 @@ begin
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
Params.Flags:=OldFlags;
|
||||
{$IFDEF ShowExprEval}
|
||||
DebugLn('[TFindDeclarationTool.CreateParamExprListFromStatement] END ',
|
||||
'ParamCount=',dbgs(Result.Count),' "',copy(Src,StartPos,40),'"');
|
||||
|
@ -6468,7 +6468,7 @@ begin
|
||||
FillChar(Result,SizeOf(TGtkSelectionData),0);
|
||||
if (ClipboardWidget=nil) or (FormatID=0)
|
||||
or (ClipboardTypeAtoms[ClipboardType]=0) then exit;
|
||||
|
||||
|
||||
TimeID:=1000;
|
||||
repeat
|
||||
repeat
|
||||
|
@ -296,6 +296,7 @@ var FormatAtom, FormatTry: Cardinal;
|
||||
var a: integer;
|
||||
AllID: cardinal;
|
||||
begin
|
||||
//DebugLn('IsFormatSupported Format=',dbgs(Format),' SupportedCnt=',dbgs(SupportedCnt));
|
||||
if Format=0 then begin
|
||||
Result:=false;
|
||||
exit;
|
||||
@ -307,7 +308,7 @@ var FormatAtom, FormatTry: Cardinal;
|
||||
{DebugLn('IsFormatSupported A ',Dbgs(SelData.Selection),
|
||||
' ',HexStr(Cardinal(ClipboardTypeAtoms[ClipboardType]),8),
|
||||
' 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.Format='+dbgs(SelData.Format)
|
||||
);}
|
||||
@ -319,6 +320,7 @@ var FormatAtom, FormatTry: Cardinal;
|
||||
end;
|
||||
SupportedCnt:=SelData.Length div (SelData.Format shr 3);
|
||||
SupportedFormats:=PGdkAtom(SelData.Data);
|
||||
//DebugLn('IsFormatSupported SupportedCnt=',dbgs(SupportedCnt));
|
||||
|
||||
{a:=SupportedCnt-1;
|
||||
while (a>=0) do begin
|
||||
|
@ -2146,7 +2146,6 @@ end;
|
||||
procedure TPkgManager.AddUnitToProjectMainUsesSection(AProject: TProject;
|
||||
const AnUnitName, AnUnitInFilename: string);
|
||||
begin
|
||||
DumpStack;
|
||||
// add unit to project main source file
|
||||
if (pfMainUnitHasUsesSectionForAllUnits in AProject.Flags)
|
||||
and (AProject.MainUnitInfo<>nil) then begin
|
||||
|
Loading…
Reference in New Issue
Block a user