mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-27 09:09:11 +02:00
IDE: codeexplorer: catch syntax error
git-svn-id: trunk@44356 -
This commit is contained in:
parent
2e34ddcb2f
commit
7e3b2a63bc
@ -799,7 +799,8 @@ begin
|
||||
Result:=CodeNode.DescAsString;
|
||||
end;
|
||||
except
|
||||
on E: ECodeToolError do ; // ignore syntax errors
|
||||
on E: ECodeToolError do
|
||||
Result:=''; // ignore syntax errors
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -2580,31 +2581,36 @@ var
|
||||
CurName: String;
|
||||
begin
|
||||
Result:='';
|
||||
while CodeNode<>nil do begin
|
||||
CurName:='';
|
||||
case CodeNode.Desc of
|
||||
try
|
||||
while CodeNode<>nil do begin
|
||||
CurName:='';
|
||||
case CodeNode.Desc of
|
||||
|
||||
ctnTypeDefinition,ctnVarDefinition,ctnConstDefinition,ctnUseUnit:
|
||||
CurName:=ACodeTool.ExtractIdentifier(CodeNode.StartPos);
|
||||
ctnTypeDefinition,ctnVarDefinition,ctnConstDefinition,ctnUseUnit:
|
||||
CurName:=ACodeTool.ExtractIdentifier(CodeNode.StartPos);
|
||||
|
||||
ctnGenericType:
|
||||
CurName:=ACodeTool.ExtractDefinitionName(CodeNode);
|
||||
ctnGenericType:
|
||||
CurName:=ACodeTool.ExtractDefinitionName(CodeNode);
|
||||
|
||||
ctnEnumIdentifier:
|
||||
CurName:=ACodeTool.ExtractIdentifier(CodeNode.StartPos);
|
||||
ctnEnumIdentifier:
|
||||
CurName:=ACodeTool.ExtractIdentifier(CodeNode.StartPos);
|
||||
|
||||
ctnProcedure:
|
||||
CurName:=ACodeTool.ExtractProcName(CodeNode,[]);
|
||||
ctnProcedure:
|
||||
CurName:=ACodeTool.ExtractProcName(CodeNode,[]);
|
||||
|
||||
ctnProperty:
|
||||
CurName:=ACodeTool.ExtractPropName(CodeNode,false); // property keyword is not needed because there are icons
|
||||
ctnProperty:
|
||||
CurName:=ACodeTool.ExtractPropName(CodeNode,false); // property keyword is not needed because there are icons
|
||||
|
||||
end;
|
||||
if CurName<>'' then begin
|
||||
if Result<>'' then Result:='.'+Result;
|
||||
Result:=CurName+Result;
|
||||
end;
|
||||
CodeNode:=CodeNode.Parent;
|
||||
end;
|
||||
if CurName<>'' then begin
|
||||
if Result<>'' then Result:='.'+Result;
|
||||
Result:=CurName+Result;
|
||||
end;
|
||||
CodeNode:=CodeNode.Parent;
|
||||
except
|
||||
on E: ECodeToolError do
|
||||
Result:=''; // ignore syntax errors
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user