fixed some typos and added class names for smart hints from Tomas Gregorovic

git-svn-id: trunk@8922 -
This commit is contained in:
mattias 2006-03-12 23:25:38 +00:00
parent 2efffcd1b1
commit 520044e849
4 changed files with 34 additions and 7 deletions

View File

@ -1459,10 +1459,10 @@ var CloseBracket, AntiCloseBracket: TCommonAtomFlag;
procedure RaiseBracketNotFound;
begin
if CloseBracket=cafRoundBracketOpen then
SaveRaiseExceptionFmt(ctsBracketNotFound,['('])
if CloseBracket=cafRoundBracketClose then
SaveRaiseExceptionFmt(ctsBracketNotFound,[')'])
else
SaveRaiseExceptionFmt(ctsBracketNotFound,['[']);
SaveRaiseExceptionFmt(ctsBracketNotFound,[']']);
end;
begin

View File

@ -2058,6 +2058,7 @@ var
AbsCursorPos: integer;
IdentStartPos, IdentEndPos: integer;
IdentAdded: boolean;
ClassStr: String;
begin
Result:='';
if FindDeclaration(CursorPos,AllFindSmartFlags,
@ -2080,6 +2081,11 @@ begin
ctnConstDefinition: Result:=Result+'const ';
ctnEnumIdentifier: Result:=Result+'enum ';
end;
// add class name
ClassStr := NewTool.ExtractClassName(NewNode, False);
if ClassStr <> '' then Result := Result + ClassStr + '.';
NewTool.MoveCursorToNodeStart(NewNode);
NewTool.ReadNextAtom;
Result:=Result+NewTool.GetAtom;
@ -2112,7 +2118,7 @@ begin
// ToDo: ppu, ppw, dcu files
Result:=Result+NewTool.ExtractProcHead(NewNode,
[phpWithStart,phpWithVarModifiers,phpWithParameterNames,
[phpAddClassName,phpWithStart,phpWithVarModifiers,phpWithParameterNames,
phpWithDefaultValues,phpWithResultType,phpWithOfObject]);
IdentAdded:=true;
end;
@ -2127,6 +2133,13 @@ begin
NewTool.MoveCursorToNodeStart(IdentNode);
NewTool.ReadNextAtom;
Result:=Result+NewTool.GetAtom+' ';
if NewNode.Desc = ctnProperty then
begin // add class name
ClassStr := NewTool.ExtractClassName(NewNode, False);
if ClassStr <> '' then Result := Result + ClassStr + '.';
end;
NewTool.ReadNextAtom;
Result:=Result+NewTool.GetAtom+' ';
IdentAdded:=true;
@ -7134,9 +7147,9 @@ function TFindDeclarationTool.CheckParameterSyntax(CursorNode: TCodeTreeNode;
procedure RaiseBracketNotOpened;
begin
if CurPos.Flag=cafRoundBracketClose then
SaveRaiseExceptionFmt(ctsBracketNotFound,['['])
SaveRaiseExceptionFmt(ctsBracketNotFound,['('])
else
SaveRaiseExceptionFmt(ctsBracketNotFound,['(']);
SaveRaiseExceptionFmt(ctsBracketNotFound,['[']);
end;
function CheckIdentifierAndParameterList: boolean; forward;

View File

@ -460,6 +460,19 @@ function TPascalReaderTool.ExtractClassName(ClassNode: TCodeTreeNode;
var Len: integer;
begin
if ClassNode<>nil then begin
if ClassNode.Desc <> ctnClass then
begin
// find class of node
repeat
ClassNode := ClassNode.Parent;
if (ClassNode = nil) or (ClassNode.Desc in AllCodeSections) then
begin
Result := '';
Exit;
end;
until ClassNode.Desc = ctnClass;
end;
if ClassNode.Desc=ctnClass then begin
ClassNode:=ClassNode.Parent;
if (ClassNode<>nil) and (ClassNode.Desc=ctnGenericType) then
@ -469,6 +482,7 @@ begin
exit;
end;
end;
Len:=1;
while (ClassNode.StartPos+Len<=SrcLen)
and (IsIdentChar[Src[ClassNode.StartPos+Len]]) do

View File

@ -4702,7 +4702,7 @@ begin
dec(CurPos.StartPos,3);
while true do begin
if (CurPos.StartPos>=1)
and ((Src[CurPos.StartPos+11]='*') and (Src[CurPos.StartPos]='(')) then
and ((Src[CurPos.StartPos+1]='*') and (Src[CurPos.StartPos]='(')) then
begin
Result:=true;
exit;