mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 21:19:07 +02:00
MG: fixed find declaration warning of searching again in system unit
git-svn-id: trunk@3476 -
This commit is contained in:
parent
c7ad8d7fd2
commit
f47cc0335c
@ -55,6 +55,7 @@ interface
|
|||||||
{ $DEFINE ShowSearchPaths}
|
{ $DEFINE ShowSearchPaths}
|
||||||
{ $DEFINE ShowTriedFiles}
|
{ $DEFINE ShowTriedFiles}
|
||||||
{ $DEFINE ShowTriedContexts}
|
{ $DEFINE ShowTriedContexts}
|
||||||
|
{ $DEFINE ShowTriedParentContexts}
|
||||||
{ $DEFINE ShowTriedIdentifiers}
|
{ $DEFINE ShowTriedIdentifiers}
|
||||||
{ $DEFINE ShowExprEval}
|
{ $DEFINE ShowExprEval}
|
||||||
{ $DEFINE ShowFoundIdentifier}
|
{ $DEFINE ShowFoundIdentifier}
|
||||||
@ -1533,7 +1534,7 @@ var
|
|||||||
begin
|
begin
|
||||||
// search next in parent
|
// search next in parent
|
||||||
ContextNode:=ContextNode.Parent;
|
ContextNode:=ContextNode.Parent;
|
||||||
{$IFDEF ShowTriedIdentifiers}
|
{$IFDEF ShowTriedParentContexts}
|
||||||
writeln('[TFindDeclarationTool.FindIdentifierInContext] Searching in Parent ContextNode=',ContextNode.DescAsString);
|
writeln('[TFindDeclarationTool.FindIdentifierInContext] Searching in Parent ContextNode=',ContextNode.DescAsString);
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
case ContextNode.Desc of
|
case ContextNode.Desc of
|
||||||
@ -2139,6 +2140,8 @@ begin
|
|||||||
// -> find class name
|
// -> find class name
|
||||||
MoveCursorToNodeStart(ProcContextNode);
|
MoveCursorToNodeStart(ProcContextNode);
|
||||||
ReadNextAtom; // read keyword
|
ReadNextAtom; // read keyword
|
||||||
|
if UpAtomIs('CLASS') then
|
||||||
|
ReadNextAtom;
|
||||||
ReadNextAtom; // read classname
|
ReadNextAtom; // read classname
|
||||||
ClassNameAtom:=CurPos;
|
ClassNameAtom:=CurPos;
|
||||||
ReadNextAtom;
|
ReadNextAtom;
|
||||||
@ -2895,6 +2898,7 @@ begin
|
|||||||
CurPos.StartPos:=-1;
|
CurPos.StartPos:=-1;
|
||||||
RaiseExceptionFmt(ctsUnitNotFound,[AnUnitName]);
|
RaiseExceptionFmt(ctsUnitNotFound,[AnUnitName]);
|
||||||
end else if NewCode=TCodeBuffer(Scanner.MainCode) then begin
|
end else if NewCode=TCodeBuffer(Scanner.MainCode) then begin
|
||||||
|
// Searching again in hidden unit
|
||||||
writeln('WARNING: Searching again in hidden unit: "',NewCode.Filename,'"');
|
writeln('WARNING: Searching again in hidden unit: "',NewCode.Filename,'"');
|
||||||
end else begin
|
end else begin
|
||||||
// source found -> get codetool for it
|
// source found -> get codetool for it
|
||||||
@ -3013,20 +3017,22 @@ begin
|
|||||||
Result:=FindIdentifierInUsedUnit('ObjPas',Params);
|
Result:=FindIdentifierInUsedUnit('ObjPas',Params);
|
||||||
if Result then exit;
|
if Result then exit;
|
||||||
end;
|
end;
|
||||||
// try hidden used unit 'system'
|
if (CurUnitType>sutSystem) then begin
|
||||||
if (CurUnitType>sutSystem)
|
// try hidden used unit 'system'
|
||||||
and CompareSrcIdentifiers(Params.Identifier,PChar(SystemAlias))
|
if not CompareSrcIdentifiers(Params.Identifier,'system')
|
||||||
or CompareSrcIdentifiers(Params.Identifier,'system') then begin
|
then begin
|
||||||
// the system unit name itself is searched -> rename searched identifier
|
|
||||||
Params.Save(OldInput);
|
|
||||||
try
|
|
||||||
Params.SetIdentifier(Self,PChar(SystemAlias),nil);
|
|
||||||
Result:=FindIdentifierInUsedUnit(SystemAlias,Params);
|
Result:=FindIdentifierInUsedUnit(SystemAlias,Params);
|
||||||
finally
|
end else begin
|
||||||
Params.Load(OldInput);
|
// the system unit name itself is searched -> rename searched identifier
|
||||||
|
Params.Save(OldInput);
|
||||||
|
try
|
||||||
|
Params.SetIdentifier(Self,PChar(SystemAlias),nil);
|
||||||
|
Result:=FindIdentifierInUsedUnit(SystemAlias,Params);
|
||||||
|
finally
|
||||||
|
Params.Load(OldInput);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end else
|
end;
|
||||||
Result:=FindIdentifierInUsedUnit(SystemAlias,Params);
|
|
||||||
if Result then exit;
|
if Result then exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user