mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-04 04:18:22 +01:00
codetools: find declaration: fixed inherited
git-svn-id: trunk@30889 -
This commit is contained in:
parent
53b56fb01a
commit
52a0595c1a
@ -7191,15 +7191,20 @@ var
|
||||
ProcNode: TCodeTreeNode;
|
||||
ClassOfMethodContext: TFindContext;
|
||||
HasIdentifier: Boolean;
|
||||
Context: TFindContext;
|
||||
begin
|
||||
// for example: inherited A;
|
||||
// inherited skips the class and begins to search in the ancestor class
|
||||
if (ExprType.Context.Node<>StartNode) or (ExprType.Context.Node=nil)
|
||||
then begin
|
||||
if ExprType.Desc=xtNone then
|
||||
Context:=CreateFindContext(Self,StartNode)
|
||||
else
|
||||
Context:=ExprType.Context;
|
||||
|
||||
if (Context.Node<>StartNode) or (Context.Node=nil) then begin
|
||||
MoveCursorToCleanPos(CurAtom.StartPos);
|
||||
RaiseIllegalQualifierFound;
|
||||
end;
|
||||
if (not NodeIsInAMethod(ExprType.Context.Node)) then begin
|
||||
if (not NodeIsInAMethod(Context.Node)) then begin
|
||||
MoveCursorToCleanPos(CurAtom.StartPos);
|
||||
RaiseException(ctsInheritedKeywordOnlyAllowedInMethods);
|
||||
end;
|
||||
@ -7221,11 +7226,11 @@ var
|
||||
{$ENDIF}
|
||||
|
||||
// find ancestor of class of method
|
||||
ProcNode:=ExprType.Context.Node.GetNodeOfType(ctnProcedure);
|
||||
ProcNode:=Context.Node.GetNodeOfType(ctnProcedure);
|
||||
Params.Save(OldInput);
|
||||
Params.Flags:=[fdfExceptionOnNotFound]
|
||||
+fdfGlobals*Params.Flags;
|
||||
ExprType.Context.Tool.FindClassOfMethod(ProcNode,Params,true);
|
||||
Context.Tool.FindClassOfMethod(ProcNode,Params,true);
|
||||
ClassOfMethodContext:=CreateFindContext(Params);
|
||||
|
||||
// find class ancestor
|
||||
@ -7234,6 +7239,7 @@ var
|
||||
ClassOfMethodContext.Tool.FindAncestorOfClass(ClassOfMethodContext.Node,
|
||||
Params,true);
|
||||
|
||||
ExprType.Desc:=xtContext;
|
||||
if HasIdentifier then begin
|
||||
// search identifier only in class ancestor
|
||||
Params.Load(OldInput,false);
|
||||
|
||||
@ -28,9 +28,10 @@
|
||||
ToDo:
|
||||
- guess for in
|
||||
- guess parameter
|
||||
- guess <i>:=expression
|
||||
- guess j:=<i>
|
||||
- Extend uses section when adding to a class
|
||||
- Fix bug: adding types with comments
|
||||
- Fix bug: insert at beginning of proc, if identifier is in sub proc
|
||||
- Target implementation
|
||||
- Target interface
|
||||
- Target program
|
||||
|
||||
Loading…
Reference in New Issue
Block a user