codetools: class completion: if unit was parsed with error: reraise error

git-svn-id: trunk@29105 -
This commit is contained in:
mattias 2011-01-18 10:03:16 +00:00
parent 08cadf3903
commit 666cc1741f
2 changed files with 6 additions and 1 deletions

View File

@ -456,7 +456,7 @@ var
Pos2: Integer;
begin
//DebugLn(['TCodeCompletionCodeTool.CheckWholeUnitParsed ',EndOfSourceFound,' LastErrorMessage="',LastErrorMessage,'" LastErrorCurPos=',dbgs(LastErrorCurPos)]);
if EndOfSourceFound then exit;
if EndOfSourceFound and (not LastErrorValid) then exit;
Pos1:=0;
Pos2:=0;
if Node1<>nil then Pos1:=Node1.StartPos;
@ -6169,6 +6169,10 @@ begin
ANode:=FCompletingStartNode;
while (ANode<>nil) do begin
if ANode.Desc=ctnProcedure then begin
if ANode.FirstChild=nil then begin
debugln(['TCodeCompletionCodeTool.InsertMissingClassSemicolons warning: broken proc node: ',CleanPosToStr(ANode.StartPos)]);
exit;
end;
ProcCode:=ExtractProcHead(ANode,[phpWithStart,
phpWithoutClassKeyword,
phpWithVarModifiers,phpWithParameterNames,phpWithResultType,

View File

@ -787,6 +787,7 @@ begin
+' TPascalParserTool.MoveCursorFirstProcSpecifier: '
+' (ProcNode=nil) or (ProcNode.Desc<>ctnProcedure)');
end;
if ProcNode.FirstChild=nil then exit;
MoveCursorToNodeStart(ProcNode.FirstChild);
ReadNextAtom;
if AtomIsIdentifier(false) then begin