codetools: ExtractOperand: do not return if cursor in front of expression

git-svn-id: trunk@21984 -
This commit is contained in:
mattias 2009-10-02 18:39:23 +00:00
parent 509396835a
commit 1803fc05ff
2 changed files with 4 additions and 1 deletions

View File

@ -3509,6 +3509,8 @@ begin
Node:=FindDeepestNodeAtPos(CleanPos,true);
StartPos:=FindStartOfTerm(CleanPos,NodeTermInType(Node));
if StartPos<1 then exit;
StartPos:=FindNextNonSpace(Src,StartPos);
if StartPos>CleanPos then exit;
EndPos:=FindEndOfTerm(CleanPos,false,WithAsOperator);
if not WithPostTokens then begin
MoveCursorToCleanPos(CleanPos);
@ -3517,6 +3519,7 @@ begin
EndPos:=CurPos.EndPos;
end;
if EndPos<1 then exit;
DebugLn(['TStandardCodeTool.ExtractOperand "',dbgstr(copy(Src,StartPos,EndPOs-StartPos)),'"']);
Operand:=ExtractCode(StartPos,EndPos,[phpCommentsToSpace]);
Result:=true;
end;

View File

@ -13541,7 +13541,7 @@ begin
Expression := SrcEdit.GetText(True)
else
Expression := SrcEdit.GetOperandFromCaret(CaretPos);
//DebugLn(['TMainIDE.OnSrcNotebookShowHintForSource Expression="',Expression,'"']);
DebugLn(['TMainIDE.OnSrcNotebookShowHintForSource Expression="',Expression,'"']);
if not DebugBoss.Evaluate(Expression, DebugEval) or (DebugEval = '') then
DebugEval := '???';
SmartHintStr := Expression + ' = ' + DebugEval;