mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:17:18 +02:00
cody: dictionary: open package to jump to identifier
git-svn-id: trunk@33858 -
This commit is contained in:
parent
53ecbea0d9
commit
11ec6f1104
@ -28,7 +28,6 @@
|
|||||||
-quickfix for identifier not found
|
-quickfix for identifier not found
|
||||||
-check if identifier still exists
|
-check if identifier still exists
|
||||||
-buttons: add unit to interface, add unit to implementation
|
-buttons: add unit to interface, add unit to implementation
|
||||||
-button: jump to identifier
|
|
||||||
-clean up old entries
|
-clean up old entries
|
||||||
-When, How?
|
-When, How?
|
||||||
-gzip? lot of cpu, may be faster on first load
|
-gzip? lot of cpu, may be faster on first load
|
||||||
@ -1068,6 +1067,7 @@ var
|
|||||||
NewX: integer;
|
NewX: integer;
|
||||||
NewY: integer;
|
NewY: integer;
|
||||||
NewTopLine: integer;
|
NewTopLine: integer;
|
||||||
|
Pkg: TIDEPackage;
|
||||||
begin
|
begin
|
||||||
if not FileExistsUTF8(NewUnitFilename) then begin
|
if not FileExistsUTF8(NewUnitFilename) then begin
|
||||||
IDEMessageDialog('File not found',
|
IDEMessageDialog('File not found',
|
||||||
@ -1075,6 +1075,20 @@ begin
|
|||||||
mtError,[mbCancel]);
|
mtError,[mbCancel]);
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// open package to get proper settings
|
||||||
|
if (NewGroupName<>'') and (NewGroupName<>PackageNameFPCSrcDir) then begin
|
||||||
|
Pkg:=PackageEditingInterface.FindPackageWithName(NewGroupName);
|
||||||
|
if (Pkg=nil) or (CompareFilenames(Pkg.Filename,NewGroupFilename)<>0) then
|
||||||
|
begin
|
||||||
|
if PackageEditingInterface.DoOpenPackageFile(NewGroupFilename,
|
||||||
|
[pofAddToRecent],true)=mrAbort
|
||||||
|
then
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
// load file
|
||||||
NewUnitCode:=CodeToolBoss.LoadFile(NewUnitFilename,true,false);
|
NewUnitCode:=CodeToolBoss.LoadFile(NewUnitFilename,true,false);
|
||||||
if NewUnitCode=nil then begin
|
if NewUnitCode=nil then begin
|
||||||
IDEMessageDialog('File read error',
|
IDEMessageDialog('File read error',
|
||||||
@ -1086,7 +1100,7 @@ begin
|
|||||||
if not CodeToolBoss.FindDeclarationOfPropertyPath(NewUnitCode,NewIdentifier,
|
if not CodeToolBoss.FindDeclarationOfPropertyPath(NewUnitCode,NewIdentifier,
|
||||||
NewCode, NewX, NewY, NewTopLine)
|
NewCode, NewX, NewY, NewTopLine)
|
||||||
then begin
|
then begin
|
||||||
IDEMessageDialog('Identifir not found',
|
IDEMessageDialog('Identifier not found',
|
||||||
'Identifier "'+NewIdentifier+'" not found in unit "'+NewUnitFilename+'"',
|
'Identifier "'+NewIdentifier+'" not found in unit "'+NewUnitFilename+'"',
|
||||||
mtError,[mbCancel]);
|
mtError,[mbCancel]);
|
||||||
exit;
|
exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user