IDE: quick fix add local var: check identifier at position

git-svn-id: trunk@45340 -
This commit is contained in:
mattias 2014-06-04 19:16:01 +00:00
parent a7c4d5af38
commit 23870bf288
2 changed files with 6 additions and 7 deletions

View File

@ -2284,10 +2284,7 @@ begin
else if IsMsgID(MsgLine,FPCMsgIDThereWereErrorsCompiling,
fMsgItemThereWereErrorsCompiling)
then
MsgLine.Urgency:=mluVerbose
else if IsMsgID(MsgLine,FPCMsgIDIdentifierNotFound,fMsgItemIdentifierNotFound)
then
MsgLine.Flags:=MsgLine.Flags+[mlfLeftToken];
MsgLine.Urgency:=mluVerbose;
inherited AddMsgLine(MsgLine);
end;

View File

@ -430,8 +430,7 @@ begin
exit;
if not Msg.HasSourcePosition or not IsValidIdent(Identifier) then exit;
// check if message position is at end of identifier
// (FPC gives position of end of identifier)
// check if message position is at identifier
Code:=CodeToolBoss.LoadFile(Msg.GetFullFilename,true,false);
if Code=nil then exit;
if not CodeToolBoss.Explore(Code,Tool,false) then exit;
@ -440,7 +439,10 @@ begin
if Node=nil then exit;
if not (Node.Desc in AllPascalStatements) then exit;
Tool.MoveCursorToCleanPos(CleanPos);
Tool.ReadPriorAtom;
if mlfLeftToken in Msg.Flags then
Tool.ReadPriorAtom
else
Tool.ReadNextAtom;
if not Tool.AtomIs(Identifier) then exit;
Tool.ReadPriorAtom;
if (Tool.CurPos.Flag in [cafPoint,cafRoundBracketClose,cafEdgedBracketClose,