mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 22:18:15 +02:00
IDE: renamed some lazdoc to fpdoc
git-svn-id: trunk@34822 -
This commit is contained in:
parent
3b215059ba
commit
dedcacd54d
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -4148,6 +4148,7 @@ ide/findunitdlg.lfm svneol=native#text/plain
|
||||
ide/findunitdlg.pas svneol=native#text/plain
|
||||
ide/formeditor.pp svneol=native#text/pascal
|
||||
ide/fpcsrcscan.pas svneol=native#text/pascal
|
||||
ide/fpdocediticons.lrs svneol=native#text/pascal
|
||||
ide/fpdoceditwindow.lfm svneol=native#text/plain
|
||||
ide/fpdoceditwindow.pas svneol=native#text/plain
|
||||
ide/fpdochints.pas svneol=native#text/plain
|
||||
@ -4328,7 +4329,6 @@ ide/lazarusmanager.pas svneol=native#text/pascal
|
||||
ide/lazbuild.lpi svneol=native#text/plain
|
||||
ide/lazbuild.lpr svneol=native#text/plain
|
||||
ide/lazconf.pp svneol=native#text/pascal
|
||||
ide/lazdoc.lrs svneol=native#text/pascal
|
||||
ide/macropromptdlg.pas svneol=native#text/pascal
|
||||
ide/main.pp svneol=native#text/pascal
|
||||
ide/mainbar.pas svneol=native#text/pascal
|
||||
|
116
ide/codehelp.pas
116
ide/codehelp.pas
@ -28,12 +28,12 @@ unit CodeHelp;
|
||||
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
{off $DEFINE VerboseLazDoc}
|
||||
{off $DEFINE VerboseLazDocFails}
|
||||
{off $DEFINE VerboseCodeHelp}
|
||||
{off $DEFINE VerboseCodeHelpFails}
|
||||
{off $DEFINE VerboseHints}
|
||||
|
||||
{$IFDEF VerboseLazDoc}
|
||||
{$DEFINE VerboseLazDocFails}
|
||||
{$IFDEF VerboseCodeHelp}
|
||||
{$DEFINE VerboseCodeHelpFails}
|
||||
{$ENDIF}
|
||||
|
||||
interface
|
||||
@ -828,7 +828,7 @@ begin
|
||||
finally
|
||||
MemStream.Free;
|
||||
end;
|
||||
{$ifdef VerboseLazDoc}
|
||||
{$ifdef VerboseCodeHelp}
|
||||
if Result<>'' then
|
||||
DebugLn(['TLazFPDocFile.GetChildValuesAsString Node=',Node.NodeName,' Result=',Result]);
|
||||
{$endif}
|
||||
@ -1100,9 +1100,9 @@ function TCodeHelpManager.DoCreateFPDocFileForSource(const SrcFilename: string;
|
||||
end;
|
||||
end;
|
||||
|
||||
function SelectNewLazDocPaths(const Title, BaseDir: string): string;
|
||||
function SelectNewFPDocPaths(const Title, BaseDir: string): string;
|
||||
begin
|
||||
Result:=LazSelectDirectory('Choose LazDoc directory for '+Title,BaseDir);
|
||||
Result:=LazSelectDirectory('Choose FPDoc directory for '+Title,BaseDir);
|
||||
if (Result<>'') then
|
||||
Result:=CreateRelativePath(Result,BaseDir);
|
||||
end;
|
||||
@ -1112,8 +1112,8 @@ var
|
||||
AProject: TLazProject;
|
||||
APackage: TLazPackage;
|
||||
p: Integer;
|
||||
LazDocPaths: String;
|
||||
LazDocPackageName: String;
|
||||
FPDocPaths: String;
|
||||
FPDocPackageName: String;
|
||||
NewPath: String;
|
||||
BaseDir: String;
|
||||
Code: TCodeBuffer;
|
||||
@ -1154,32 +1154,32 @@ begin
|
||||
if NewOwner is TLazProject then begin
|
||||
AProject:=TLazProject(NewOwner);
|
||||
BaseDir:=ExtractFilePath(AProject.ProjectInfoFile);
|
||||
if AProject.LazDocPaths='' then
|
||||
AProject.LazDocPaths:=SelectNewLazDocPaths(AProject.ShortDescription,BaseDir);
|
||||
LazDocPaths:=AProject.LazDocPaths;
|
||||
LazDocPackageName:=GetModuleOwnerName(AProject);
|
||||
if AProject.FPDocPaths='' then
|
||||
AProject.FPDocPaths:=SelectNewFPDocPaths(AProject.ShortDescription,BaseDir);
|
||||
FPDocPaths:=AProject.FPDocPaths;
|
||||
FPDocPackageName:=GetModuleOwnerName(AProject);
|
||||
end else if NewOwner is TLazPackage then begin
|
||||
APackage:=TLazPackage(NewOwner);
|
||||
BaseDir:=APackage.DirectoryExpanded;
|
||||
if APackage.LazDocPaths='' then
|
||||
APackage.LazDocPaths:=SelectNewLazDocPaths(APackage.Name,BaseDir);
|
||||
LazDocPaths:=APackage.LazDocPaths;
|
||||
LazDocPackageName:=GetModuleOwnerName(APackage);
|
||||
if APackage.FPDocPaths='' then
|
||||
APackage.FPDocPaths:=SelectNewFPDocPaths(APackage.Name,BaseDir);
|
||||
FPDocPaths:=APackage.FPDocPaths;
|
||||
FPDocPackageName:=GetModuleOwnerName(APackage);
|
||||
end else if NewOwner=LazarusHelp then begin
|
||||
BaseDir:=EnvironmentOptions.LazarusDirectory;
|
||||
LazDocPaths:=GetIDESrcFPDocPath;
|
||||
LazDocPackageName:=IDEProjectName;
|
||||
FPDocPaths:=GetIDESrcFPDocPath;
|
||||
FPDocPackageName:=IDEProjectName;
|
||||
end else begin
|
||||
DebugLn(['TCodeHelpManager.DoCreateFPDocFileForSource unknown owner type ',dbgsName(NewOwner)]);
|
||||
NewOwner:=nil;
|
||||
exit;
|
||||
end;
|
||||
|
||||
IDEMacros.CreateAbsoluteSearchPath(LazDocPaths,BaseDir);
|
||||
IDEMacros.CreateAbsoluteSearchPath(FPDocPaths,BaseDir);
|
||||
|
||||
p:=1;
|
||||
repeat
|
||||
NewPath:=GetNextDirectoryInSearchPath(LazDocPaths,p);
|
||||
NewPath:=GetNextDirectoryInSearchPath(FPDocPaths,p);
|
||||
if not FilenameIsAbsolute(NewPath) then
|
||||
NewPath:=AppendPathDelim(BaseDir)+NewPath;
|
||||
if DirPathExistsCached(NewPath) then begin
|
||||
@ -1196,17 +1196,17 @@ begin
|
||||
if AVLNode<>nil then
|
||||
FSrcToDocMap.FreeAndDelete(AVLNode);
|
||||
// create fpdoc file
|
||||
if CreateFPDocFile(Result,LazDocPackageName,CurUnitName)=nil then
|
||||
if CreateFPDocFile(Result,FPDocPackageName,CurUnitName)=nil then
|
||||
Result:='';
|
||||
exit;
|
||||
end;
|
||||
until false;
|
||||
|
||||
// no valid directory found
|
||||
DebugLn(['TCodeHelpManager.DoCreateFPDocFileForSource LazDocModul="',LazDocPackageName,'" LazDocPaths="',LazDocPaths,'" ']);
|
||||
MessageDlg(lisLDNoValidLazDocPath,
|
||||
Format(lisLDDoesNotHaveAnyValidLazDocPathUnableToCreateTheFpdo, [
|
||||
LazDocPackageName, #13, SrcFilename]), mtError, [mbCancel], 0);
|
||||
DebugLn(['TCodeHelpManager.DoCreateFPDocFileForSource FPDocModul="',FPDocPackageName,'" FPDocPaths="',FPDocPaths,'" ']);
|
||||
MessageDlg(lisLDNoValidFPDocPath,
|
||||
Format(lisLDDoesNotHaveAnyValidFPDocPathUnableToCreateTheFpdo, [
|
||||
FPDocPackageName, #13, SrcFilename]), mtError, [mbCancel], 0);
|
||||
finally
|
||||
PkgList.Free;
|
||||
end;
|
||||
@ -1345,7 +1345,7 @@ begin
|
||||
end;
|
||||
CacheWasUsed:=false;
|
||||
|
||||
{$IFDEF VerboseLazDoc}
|
||||
{$IFDEF VerboseCodeHelp}
|
||||
DebugLn(['TCodeHelpManager.LoadFPDocFile parsing ',ADocFile.Filename]);
|
||||
{$ENDIF}
|
||||
CallDocChangeEvents(chmhDocChanging,ADocFile);
|
||||
@ -1518,20 +1518,20 @@ var
|
||||
if TObject(PkgList[i]) is TLazProject then begin
|
||||
AProject:=TLazProject(PkgList[i]);
|
||||
AnOwner:=AProject;
|
||||
if AProject.LazDocPaths='' then continue;
|
||||
if AProject.FPDocPaths='' then continue;
|
||||
BaseDir:=ExtractFilePath(AProject.ProjectInfoFile);
|
||||
if BaseDir='' then continue;
|
||||
// add lazdoc paths of project
|
||||
if SearchInPath(AProject.LazDocPaths,BaseDir,Filename) then
|
||||
// add fpdoc paths of project
|
||||
if SearchInPath(AProject.FPDocPaths,BaseDir,Filename) then
|
||||
exit(true);
|
||||
end else if TObject(PkgList[i]) is TLazPackage then begin
|
||||
APackage:=TLazPackage(PkgList[i]);
|
||||
AnOwner:=APackage;
|
||||
if APackage.LazDocPaths='' then continue;
|
||||
if APackage.FPDocPaths='' then continue;
|
||||
BaseDir:=APackage.Directory;
|
||||
if BaseDir='' then continue;
|
||||
// add lazdoc paths of package
|
||||
if SearchInPath(APackage.LazDocPaths,BaseDir,Filename) then begin
|
||||
// add fpdoc paths of package
|
||||
if SearchInPath(APackage.FPDocPaths,BaseDir,Filename) then begin
|
||||
exit(true);
|
||||
end else if AnOwner=nil then
|
||||
AnOwner:=APackage;
|
||||
@ -1555,7 +1555,7 @@ var
|
||||
end;
|
||||
|
||||
// finally: check if in user directories
|
||||
if SearchInPath(EnvironmentOptions.LazDocPaths,'',Filename) then
|
||||
if SearchInPath(EnvironmentOptions.FPDocPaths,'',Filename) then
|
||||
begin
|
||||
AnOwner:=nil;
|
||||
exit(true);
|
||||
@ -1602,7 +1602,7 @@ begin
|
||||
end;
|
||||
CacheWasUsed:=false;
|
||||
|
||||
{$IFDEF VerboseLazDoc}
|
||||
{$IFDEF VerboseCodeHelp}
|
||||
DebugLn(['TCodeHelpManager.GetFPDocFilenameForSource searching SrcFilename=',SrcFilename]);
|
||||
{$ENDIF}
|
||||
|
||||
@ -1617,7 +1617,7 @@ begin
|
||||
if AnOwner=nil then
|
||||
DebugLn(['TCodeHelpManager.GetFPDocFilenameForSource Hint: file without owner: ',SrcFilename])
|
||||
else
|
||||
debugln(['TCodeHelpManager.GetFPDocFilenameForSource Hint: Owner has no lazdoc paths: ',SrcFilename]);
|
||||
debugln(['TCodeHelpManager.GetFPDocFilenameForSource Hint: Owner has no fpdoc paths: ',SrcFilename]);
|
||||
end;
|
||||
|
||||
// save to cache
|
||||
@ -1633,11 +1633,11 @@ begin
|
||||
if (Result='') and CreateIfNotExists then begin
|
||||
Result:=DoCreateFPDocFileForSource(SrcFilename,AnOwner);
|
||||
end;
|
||||
{$IFDEF VerboseLazDoc}
|
||||
{$IFDEF VerboseCodeHelp}
|
||||
DebugLn(['TCodeHelpManager.GetFPDocFilenameForSource SrcFilename="',SrcFilename,'" Result="',Result,'"']);
|
||||
{$ENDIF}
|
||||
end;
|
||||
{$ifdef VerboseLazDoc}
|
||||
{$ifdef VerboseCodeHelp}
|
||||
DebugLn(['TCodeHelpManager.GetFPDocFilenameForSource ',dbgsName(AnOwner)]);
|
||||
{$endif}
|
||||
end;
|
||||
@ -1654,7 +1654,7 @@ begin
|
||||
Result:='';
|
||||
CacheWasUsed:=false;
|
||||
APackage:=TLazPackage(PkgFile.LazPackage);
|
||||
if APackage.LazDocPaths='' then exit;
|
||||
if APackage.FPDocPaths='' then exit;
|
||||
BaseDir:=APackage.DirectoryExpanded;
|
||||
if BaseDir='' then exit;
|
||||
|
||||
@ -1672,7 +1672,7 @@ begin
|
||||
if not FilenameIsPascalUnit(SrcFilename) then exit;
|
||||
SrcFilename:=ExtractFileNameOnly(SrcFilename)+'.xml';
|
||||
|
||||
Result:=SearchFileInPath(SrcFilename,BaseDir,APackage.LazDocPaths,';',
|
||||
Result:=SearchFileInPath(SrcFilename,BaseDir,APackage.FPDocPaths,';',
|
||||
ctsfcDefault);
|
||||
end;
|
||||
|
||||
@ -1765,10 +1765,10 @@ var
|
||||
SearchPath: String;
|
||||
begin
|
||||
Result:=false;
|
||||
if (Pkg=nil) or (Pkg.LazDocPaths='') then exit;
|
||||
if (Pkg=nil) or (Pkg.FPDocPaths='') then exit;
|
||||
// check if the file is in the search path
|
||||
Path:=ExtractFilePath(FPDocFile.Filename);
|
||||
SearchPath:=Pkg.LazDocPaths;
|
||||
SearchPath:=Pkg.FPDocPaths;
|
||||
if not IDEMacros.CreateAbsoluteSearchPath(SearchPath,Pkg.Directory)
|
||||
then
|
||||
exit;
|
||||
@ -1798,10 +1798,10 @@ begin
|
||||
end;
|
||||
|
||||
// check if in the doc path of the project
|
||||
if (AProject<>nil) and (AProject.LazDocPaths<>'')
|
||||
if (AProject<>nil) and (AProject.FPDocPaths<>'')
|
||||
and FilenameIsAbsolute(AProject.ProjectInfoFile) then begin
|
||||
Path:=ExtractFilePath(FPDocFile.Filename);
|
||||
SearchPath:=AProject.LazDocPaths;
|
||||
SearchPath:=AProject.FPDocPaths;
|
||||
IDEMacros.CreateAbsoluteSearchPath(SearchPath,
|
||||
ExtractFilePath(AProject.ProjectInfoFile));
|
||||
SearchPath:=TrimSearchPath(SearchPath,'');
|
||||
@ -1857,7 +1857,7 @@ end;
|
||||
function TCodeHelpManager.ExpandFPDocLinkID(const LinkID,
|
||||
DefaultUnitName: string; TheOwner: TObject): string;
|
||||
|
||||
function SearchLazDocFile(SearchPath: string;
|
||||
function SearchFPDocFile(SearchPath: string;
|
||||
const BaseDir, AUnitname: string): string;
|
||||
var
|
||||
FPDocFilename: String;
|
||||
@ -1891,7 +1891,7 @@ begin
|
||||
APackage:=TLazPackage(TheOwner);
|
||||
if (APackage.FindUnit(FirstIdentifier)=nil) then begin
|
||||
// the unit is not owned.
|
||||
if SearchLazDocFile(APackage.LazDocPaths,APackage.DirectoryExpanded,
|
||||
if SearchFPDocFile(APackage.FPDocPaths,APackage.DirectoryExpanded,
|
||||
FirstIdentifier)='' then
|
||||
begin
|
||||
// and there is no fpdoc file for this identifier
|
||||
@ -1901,7 +1901,7 @@ begin
|
||||
end;
|
||||
end else if TheOwner is TLazProject then begin
|
||||
AProject:=TLazProject(TheOwner);
|
||||
if SearchLazDocFile(AProject.LazDocPaths,
|
||||
if SearchFPDocFile(AProject.FPDocPaths,
|
||||
ExtractFilePath(AProject.ProjectInfoFile),FirstIdentifier)='' then
|
||||
begin
|
||||
// there is no fpdoc file for this identifier
|
||||
@ -2089,15 +2089,15 @@ begin
|
||||
FPDocFilename:='';
|
||||
if ModuleOwner is TLazProject then begin
|
||||
AProject:=TLazProject(ModuleOwner);
|
||||
if (AProject.LazDocPaths<>'') then begin
|
||||
if (AProject.FPDocPaths<>'') then begin
|
||||
BaseDir:=ExtractFilePath(AProject.ProjectInfoFile);
|
||||
FPDocFilename:=FindFPDocFilename(BaseDir,AProject.LazDocPaths,AUnitName);
|
||||
FPDocFilename:=FindFPDocFilename(BaseDir,AProject.FPDocPaths,AUnitName);
|
||||
end;
|
||||
end else if ModuleOwner is TLazPackage then begin
|
||||
Pkg:=TLazPackage(ModuleOwner);
|
||||
if Pkg.LazDocPaths<>'' then begin
|
||||
if Pkg.FPDocPaths<>'' then begin
|
||||
BaseDir:=Pkg.Directory;
|
||||
FPDocFilename:=FindFPDocFilename(BaseDir,Pkg.LazDocPaths,AUnitName);
|
||||
FPDocFilename:=FindFPDocFilename(BaseDir,Pkg.FPDocPaths,AUnitName);
|
||||
end;
|
||||
end;
|
||||
//DebugLn(['TCodeHelpManager.GetLinkedFPDocNode FPDocFilename=',FPDocFilename]);
|
||||
@ -2221,14 +2221,14 @@ begin
|
||||
// get the declaration chain
|
||||
Result:=GetDeclarationChain(Code,X,Y,ListOfPCodeXYPosition,CacheWasUsed);
|
||||
if Result<>chprSuccess then begin
|
||||
{$IFDEF VerboseLazDocFails}
|
||||
{$IFDEF VerboseCodeHelpFails}
|
||||
DebugLn(['TCodeHelpManager.GetElementChain GetDeclarationChain failed ',Code.Filename,' x=',x,' y=',y]);
|
||||
{$ENDIF}
|
||||
exit;
|
||||
end;
|
||||
if (not CacheWasUsed) and (not Complete) then exit(chprParsing);
|
||||
|
||||
{$IFDEF VerboseLazDoc}
|
||||
{$IFDEF VerboseCodeHelp}
|
||||
DebugLn(['TCodeHelpManager.GetElementChain init the element chain: ListOfPCodeXYPosition.Count=',ListOfPCodeXYPosition.Count,' ...']);
|
||||
{$ENDIF}
|
||||
// init the element chain
|
||||
@ -2342,7 +2342,7 @@ begin
|
||||
//DumpExceptionBackTrace;
|
||||
end;
|
||||
end;
|
||||
{$ifdef VerboseLazDoc}
|
||||
{$ifdef VerboseCodeHelp}
|
||||
debugln(['TCodeHelpManager.GetHTMLHint ',HTMLHint]);
|
||||
{$endif}
|
||||
end;
|
||||
@ -2451,7 +2451,7 @@ begin
|
||||
or ((CTNode.Desc in [ctnProcedure,ctnProcedureHead])
|
||||
and (CTTool.ProcNodeHasSpecifier(CTNode,psOVERRIDE)))
|
||||
then begin
|
||||
{$ifdef VerboseLazDoc}
|
||||
{$ifdef VerboseCodeHelp}
|
||||
debugln(['TCodeHelpManager.GetHTMLHint searching for inherited of ',CTNode.DescAsString,' ',dbgs(XYPos)]);
|
||||
{$endif}
|
||||
OldXYPos:=XYPos;
|
||||
@ -2462,13 +2462,13 @@ begin
|
||||
or (CTNode=OldCTNode)
|
||||
or (CTNode=nil)
|
||||
then begin
|
||||
{$ifdef VerboseLazDoc}
|
||||
{$ifdef VerboseCodeHelp}
|
||||
debugln(['TCodeHelpManager.GetHTMLHint inherited not found: ',dbgs(OldXYPos)]);
|
||||
{$endif}
|
||||
break;
|
||||
end;
|
||||
end else begin
|
||||
{$ifdef VerboseLazDoc}
|
||||
{$ifdef VerboseCodeHelp}
|
||||
debugln(['TCodeHelpManager.GetHTMLHint not searching inherited for ',CTNode.DescAsString]);
|
||||
{$endif}
|
||||
break;
|
||||
@ -2504,7 +2504,7 @@ begin
|
||||
end else
|
||||
Result:=chprFailed;
|
||||
end;
|
||||
{$ifdef VerboseLazDoc}
|
||||
{$ifdef VerboseCodeHelp}
|
||||
debugln(['TCodeHelpManager.GetHTMLHint ',HTMLHint]);
|
||||
{$endif}
|
||||
end;
|
||||
|
@ -307,8 +307,8 @@ type
|
||||
FAskForFilenameOnNewFile: boolean;
|
||||
FLowercaseDefaultFilename: boolean;
|
||||
|
||||
// lazdoc
|
||||
FLazDocPaths: string;
|
||||
// fpdoc
|
||||
FFPDocPaths: string;
|
||||
|
||||
// language ID (see LazarusTranslations in translations.pas)
|
||||
fLanguageID: string;
|
||||
@ -554,8 +554,8 @@ type
|
||||
property LowercaseDefaultFilename: boolean read FLowercaseDefaultFilename
|
||||
write FLowercaseDefaultFilename;
|
||||
|
||||
// lazdoc
|
||||
property LazDocPaths: string read FLazDocPaths write FLazDocPaths;
|
||||
// fpdoc
|
||||
property FPDocPaths: string read FFPDocPaths write FFPDocPaths;
|
||||
|
||||
// language
|
||||
property LanguageID: string read fLanguageID write fLanguageID;
|
||||
@ -593,7 +593,7 @@ function SimpleDirectoryCheck(const OldDir, NewDir,
|
||||
NotFoundErrMsg: string; out StopChecking: boolean): boolean;
|
||||
|
||||
const
|
||||
DefaultLazDocPath = '$(LazarusDir)/docs/xml/lcl';
|
||||
DefaultFPDocPath = '$(LazarusDir)/docs/xml/lcl';
|
||||
DefaultMsgViewFocus = {$IFDEF Windows}true{$ELSE}false{$ENDIF};
|
||||
MaxComboBoxCount: integer = 20;
|
||||
EnvOptsConfFileName = 'environmentoptions.xml';
|
||||
@ -835,8 +835,8 @@ begin
|
||||
(* TODO: maybe revert relations. Create this in Debugger, and call environmentoptions for the configstore only? *)
|
||||
FDebuggerConfig := TDebuggerConfigStore.Create;
|
||||
|
||||
// lazdoc
|
||||
FLazDocPaths:=SetDirSeparators(DefaultLazDocPath);
|
||||
// FPdoc
|
||||
FFPDocPaths:=SetDirSeparators(DefaultFPDocPath);
|
||||
end;
|
||||
|
||||
destructor TEnvironmentOptions.Destroy;
|
||||
@ -1242,10 +1242,10 @@ begin
|
||||
FLowercaseDefaultFilename:=XMLConfig.GetValue(
|
||||
Path+'LowercaseDefaultFilename/Value',true);
|
||||
|
||||
//lazdoc
|
||||
FLazDocPaths := XMLConfig.GetValue(Path+'LazDoc/Paths', DefaultLazDocPath);
|
||||
// fpdoc
|
||||
FFPDocPaths := XMLConfig.GetValue(Path+'LazDoc/Paths', DefaultFPDocPath);
|
||||
if FileVersion<=105 then
|
||||
FLazDocPaths:=LineBreaksToDelimiter(FLazDocPaths,';');
|
||||
FFPDocPaths:=LineBreaksToDelimiter(FFPDocPaths,';');
|
||||
|
||||
// 'new items'
|
||||
FNewUnitTemplate:=XMLConfig.GetValue(Path+'New/UnitTemplate/Value',FileDescNamePascalUnit);
|
||||
@ -1554,8 +1554,8 @@ begin
|
||||
XMLConfig.SetDeleteValue(Path+'LowercaseDefaultFilename/Value',
|
||||
FLowercaseDefaultFilename,true);
|
||||
|
||||
// lazdoc
|
||||
XMLConfig.SetDeleteValue(Path+'LazDoc/Paths',FLazDocPaths,DefaultLazDocPath);
|
||||
// fpdoc
|
||||
XMLConfig.SetDeleteValue(Path+'LazDoc/Paths',FFPDocPaths,DefaultFPDocPath);
|
||||
|
||||
// 'new items'
|
||||
XMLConfig.SetDeleteValue(Path+'New/UnitTemplate/Value',FNewUnitTemplate,FileDescNamePascalUnit);
|
||||
|
@ -176,8 +176,8 @@ type
|
||||
procedure UpdateCaption;
|
||||
procedure UpdateValueControls;
|
||||
procedure UpdateInheritedControls;
|
||||
procedure OnLazDocChanging(Sender: TObject; LazDocFPFile: TLazFPDocFile);
|
||||
procedure OnLazDocChanged(Sender: TObject; LazDocFPFile: TLazFPDocFile);
|
||||
procedure OnFPDocChanging(Sender: TObject; FPDocFPFile: TLazFPDocFile);
|
||||
procedure OnFPDocChanged(Sender: TObject; FPDocFPFile: TLazFPDocFile);
|
||||
procedure LoadGUIValues(Element: TCodeHelpElement);
|
||||
procedure MoveToInherited(Element: TCodeHelpElement);
|
||||
function GetDefaultDocFile(CreateIfNotExists: Boolean = False): TLazFPDocFile;
|
||||
@ -285,8 +285,8 @@ begin
|
||||
|
||||
Reset;
|
||||
|
||||
CodeHelpBoss.AddHandlerOnChanging(@OnLazDocChanging);
|
||||
CodeHelpBoss.AddHandlerOnChanged(@OnLazDocChanged);
|
||||
CodeHelpBoss.AddHandlerOnChanging(@OnFPDocChanging);
|
||||
CodeHelpBoss.AddHandlerOnChanged(@OnFPDocChanged);
|
||||
Application.AddOnIdleHandler(@ApplicationIdle);
|
||||
|
||||
Name := NonModalIDEWindowNames[nmiwFPDocEditorName];
|
||||
@ -700,7 +700,7 @@ begin
|
||||
end else
|
||||
Caption := strCaption + lisCodeHelpNoTagCaption;
|
||||
{$IFDEF VerboseCodeHelp}
|
||||
DebugLn(['TLazDocForm.UpdateCaption ',Caption]);
|
||||
DebugLn(['TFPDocEditor.UpdateCaption ',Caption]);
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
@ -788,20 +788,20 @@ begin
|
||||
exit;
|
||||
end;
|
||||
|
||||
// start getting the lazdoc element chain
|
||||
// start getting the fpdoc element chain
|
||||
LDResult:=CodeHelpBoss.GetElementChain(Code,CaretXY.X,CaretXY.Y,true,
|
||||
NewChain,CacheWasUsed);
|
||||
case LDResult of
|
||||
chprParsing:
|
||||
begin
|
||||
Include(FFlags,fpdefChainNeedsUpdate);
|
||||
DebugLn(['TFPDocEditForm.UpdateChain ToDo: still parsing LazDocBoss.GetElementChain for ',fSourceFilename,' ',dbgs(CaretXY)]);
|
||||
DebugLn(['TFPDocEditForm.UpdateChain ToDo: still parsing CodeHelpBoss.GetElementChain for ',fSourceFilename,' ',dbgs(CaretXY)]);
|
||||
exit;
|
||||
end;
|
||||
chprFailed:
|
||||
begin
|
||||
{$IFDEF VerboseLazDocFails}
|
||||
DebugLn(['TFPDocEditForm.UpdateChain failed LazDocBoss.GetElementChain for ',fSourceFilename,' ',dbgs(CaretXY)]);
|
||||
{$IFDEF VerboseFPDocFails}
|
||||
DebugLn(['TFPDocEditForm.UpdateChain failed CodeHelpBoss.GetElementChain for ',fSourceFilename,' ',dbgs(CaretXY)]);
|
||||
{$ENDIF}
|
||||
exit;
|
||||
end;
|
||||
@ -827,18 +827,18 @@ begin
|
||||
OpenXMLButton.Hint:='';
|
||||
end;
|
||||
|
||||
procedure TFPDocEditor.OnLazDocChanging(Sender: TObject;
|
||||
LazDocFPFile: TLazFPDocFile);
|
||||
procedure TFPDocEditor.OnFPDocChanging(Sender: TObject;
|
||||
FPDocFPFile: TLazFPDocFile);
|
||||
begin
|
||||
if fpdefWriting in FFlags then exit;
|
||||
if (fChain<>nil) and (fChain.IndexOfFile(LazDocFPFile)>=0) then
|
||||
if (fChain<>nil) and (fChain.IndexOfFile(FPDocFPFile)>=0) then
|
||||
InvalidateChain
|
||||
else if (fDocFile<>nil) and (fDocFile=LazDocFPFile) then
|
||||
else if (fDocFile<>nil) and (fDocFile=FPDocFPFile) then
|
||||
Include(FFlags,fpdefTopicNeedsUpdate);
|
||||
end;
|
||||
|
||||
procedure TFPDocEditor.OnLazDocChanged(Sender: TObject;
|
||||
LazDocFPFile: TLazFPDocFile);
|
||||
procedure TFPDocEditor.OnFPDocChanged(Sender: TObject;
|
||||
FPDocFPFile: TLazFPDocFile);
|
||||
begin
|
||||
if fpdefWriting in FFlags then exit;
|
||||
|
||||
@ -1266,7 +1266,7 @@ begin
|
||||
if fChain.DocFile=TopicDocFile then
|
||||
TopicChanged:=false;
|
||||
end else begin
|
||||
DebugLn(['TLazDocForm.Save WriteNode FAILED']);
|
||||
DebugLn(['TFPDocEditor.Save WriteNode FAILED']);
|
||||
end;
|
||||
end;
|
||||
if TopicChanged then begin
|
||||
@ -1351,7 +1351,7 @@ var
|
||||
begin
|
||||
Result:=Test;
|
||||
if not Test then exit;
|
||||
DebugLn(['TLazDocForm.WriteNode ERROR ',Msg]);
|
||||
DebugLn(['TFPDocEditor.WriteNode ERROR ',Msg]);
|
||||
if Interactive then begin;
|
||||
if Element.FPDocFile<>nil then
|
||||
CurName:=Element.FPDocFile.Filename
|
||||
@ -1570,6 +1570,6 @@ end;
|
||||
|
||||
initialization
|
||||
// then the items
|
||||
{$I lazdoc.lrs}
|
||||
{$I fpdocediticons.lrs}
|
||||
|
||||
end.
|
||||
|
@ -112,7 +112,7 @@ begin
|
||||
if (Position<0) or (Position>=CodeToolBoss.IdentifierList.GetFilteredCount) then
|
||||
exit;
|
||||
Item:=CodeToolBoss.IdentifierList.FilteredItems[Position];
|
||||
DebugLn(['TFPDocHintProvider.ReadLazDocData Identifier=',Item.Identifier]);
|
||||
DebugLn(['TFPDocHintProvider.DoUpdateHint Identifier=',Item.Identifier]);
|
||||
try
|
||||
FBaseURL:='';
|
||||
FHTMLHint:='<HTML><BODY>No help available.</BODY></HTML>';
|
||||
@ -126,15 +126,15 @@ begin
|
||||
[chhoDeclarationHeader],
|
||||
FBaseURL,FHTMLHint,CacheWasUsed);
|
||||
if HelpResult<>chprSuccess then begin
|
||||
DebugLn(['TFPDocHintProvider.ReadLazDocData FAILED Unit=',Item.Identifier]);
|
||||
DebugLn(['TFPDocHintProvider.DoUpdateHint FAILED Unit=',Item.Identifier]);
|
||||
end;
|
||||
exit;
|
||||
end;
|
||||
DebugLn(['TFPDocHintProvider.ReadLazDocData FAILED no node ',NodeDescriptionAsString(Item.DefaultDesc),' Identifier=',Item.Identifier]);
|
||||
DebugLn(['TFPDocHintProvider.DoUpdateHint FAILED no node ',NodeDescriptionAsString(Item.DefaultDesc),' Identifier=',Item.Identifier]);
|
||||
exit;
|
||||
end;
|
||||
if (Item.Tool.Scanner=nil) then exit;
|
||||
//DebugLn(['TFPDocHintProvider.ReadLazDocData Src=',copy(Item.Tool.Src,Node.StartPos,30),' ',Node.DescAsString]);
|
||||
//DebugLn(['TFPDocHintProvider.DoUpdateHint Src=',copy(Item.Tool.Src,Node.StartPos,30),' ',Node.DescAsString]);
|
||||
|
||||
// search the position of the identifier, not the keyword
|
||||
CleanPos:=Node.StartPos;
|
||||
@ -153,15 +153,15 @@ begin
|
||||
|
||||
// get help text
|
||||
if (not Item.Tool.CleanPosToCaret(CleanPos,Caret)) then begin
|
||||
DebugLn(['TFPDocHintProvider.ReadLazDocData FAILED CleanPosToCaret Tool=',Item.Tool.MainFilename,' CleanPos=',CleanPos,' SrcLen=',Item.Tool.SrcLen]);
|
||||
DebugLn(['TFPDocHintProvider.DoUpdateHint FAILED CleanPosToCaret Tool=',Item.Tool.MainFilename,' CleanPos=',CleanPos,' SrcLen=',Item.Tool.SrcLen]);
|
||||
exit;
|
||||
end;
|
||||
//DebugLn(['TFPDocHintProvider.ReadLazDocData ',Item.Identifier,' ',Item.Tool.MainFilename,' ',Caret.Code.Filename,' ',Caret.X,',',Caret.Y]);
|
||||
//DebugLn(['TFPDocHintProvider.DoUpdateHint ',Item.Identifier,' ',Item.Tool.MainFilename,' ',Caret.Code.Filename,' ',Caret.X,',',Caret.Y]);
|
||||
HelpResult:=CodeHelpBoss.GetHTMLHint(Caret.Code,Caret.X,Caret.Y,
|
||||
[chhoDeclarationHeader],
|
||||
FBaseURL,FHTMLHint,CacheWasUsed);
|
||||
if HelpResult<>chprSuccess then begin
|
||||
DebugLn(['TFPDocHintProvider.ReadLazDocData FAILED Identifier=',Item.Identifier]);
|
||||
DebugLn(['TFPDocHintProvider.DoUpdateHint FAILED Identifier=',Item.Identifier]);
|
||||
exit;
|
||||
end;
|
||||
finally
|
||||
|
@ -353,7 +353,7 @@ var
|
||||
begin
|
||||
for i:=0 to PackageGraph.Count-1 do begin
|
||||
Pkg:=PackageGraph.Packages[i];
|
||||
if Pkg.LazDocPaths='' then continue;
|
||||
if Pkg.FPDocPaths='' then continue;
|
||||
if (SysUtils.CompareText(Prefix,copy(Pkg.Name,1,length(Prefix)))=0) then
|
||||
fItems.AddPackage(Pkg);
|
||||
end;
|
||||
|
@ -67,7 +67,7 @@ end;
|
||||
|
||||
procedure TFpDocOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
|
||||
begin
|
||||
LazDocPathsGroupBox.Caption := lisCodeHelpPathsGroupBox;
|
||||
LazDocPathsGroupBox.Caption := lisCodeHelpGroupBox;
|
||||
LazDocAddPathButton.Caption := lisCodeHelpAddPathButton;
|
||||
LazDocDeletePathButton.Caption := lisCodeHelpDeletePathButton;
|
||||
|
||||
@ -77,13 +77,13 @@ end;
|
||||
procedure TFpDocOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
with AOptions as TEnvironmentOptions do
|
||||
SplitString(LazDocPaths, ';', LazDocListBox.Items);
|
||||
SplitString(FPDocPaths, ';', LazDocListBox.Items);
|
||||
end;
|
||||
|
||||
procedure TFpDocOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
with AOptions as TEnvironmentOptions do
|
||||
LazDocPaths := StringListToText(LazDocListBox.Items, ';', true);
|
||||
FPDocPaths := StringListToText(LazDocListBox.Items, ';', true);
|
||||
end;
|
||||
|
||||
procedure TFpDocOptionsFrame.LazDocAddPathButtonClick(Sender: TObject);
|
||||
|
@ -90,13 +90,13 @@ end;
|
||||
procedure TProjectLazDocOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
with AOptions as TProject do
|
||||
SplitString(LazDocPaths, ';', LazDocListBox.Items, True);
|
||||
SplitString(FPDocPaths, ';', LazDocListBox.Items, True);
|
||||
end;
|
||||
|
||||
procedure TProjectLazDocOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
|
||||
begin
|
||||
with AOptions as TProject do
|
||||
LazDocPaths := StringListToText(LazDocListBox.Items, ';', True);
|
||||
FPDocPaths := StringListToText(LazDocListBox.Items, ';', True);
|
||||
end;
|
||||
|
||||
class function TProjectLazDocOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
|
||||
|
@ -3331,6 +3331,8 @@ resourcestring
|
||||
// path edit dialog
|
||||
lisPathEditSelectDirectory = 'Select directory';
|
||||
lisPathEditSearchPaths = 'Search paths:';
|
||||
lisPckSearchPathsForFpdocXmlFilesMultiplePathsMustBeSepa = 'Search paths for'
|
||||
+' fpdoc xml files. Multiple paths must be separated by semicolon.';
|
||||
lisPathEditMovePathDown = 'Move path down';
|
||||
lisPathEditMovePathUp = 'Move path up';
|
||||
lisPathEditBrowse = 'Browse';
|
||||
@ -3422,9 +3424,9 @@ resourcestring
|
||||
lisLDTheUnitIsNotOwnedBeAnyPackageOrProjectPleaseAddThe = 'The unit %s is '
|
||||
+'not owned be any package or project.%sPlease add the unit to a package '
|
||||
+'or project.%sUnable to create the fpdoc file.';
|
||||
lisLDNoValidLazDocPath = 'No valid LazDoc path';
|
||||
lisLDDoesNotHaveAnyValidLazDocPathUnableToCreateTheFpdo = '%s does not have '
|
||||
+'any valid LazDoc path.%sUnable to create the fpdoc file for %s';
|
||||
lisLDNoValidFPDocPath = 'No valid FPDoc path';
|
||||
lisLDDoesNotHaveAnyValidFPDocPathUnableToCreateTheFpdo = '%s does not have '
|
||||
+'any valid FPDoc path.%sUnable to create the fpdoc file for %s';
|
||||
lisErrorReadingXML = 'Error reading XML';
|
||||
lisErrorReadingXmlFile = 'Error reading xml file %s%s%s%s%s';
|
||||
lisPkgThisFileIsNotInAnyLoadedPackage = 'This file is not in any loaded package.';
|
||||
@ -4136,6 +4138,8 @@ resourcestring
|
||||
lisPckOptsAutomaticallyRebuildAsNeeded = 'Automatically rebuild as needed';
|
||||
lisPckOptsAutoRebuildWhenRebuildingAll = 'Auto rebuild when rebuilding all';
|
||||
lisPckOptsManualCompilationNeverAutomatically = 'Manual compilation (never automatically)';
|
||||
lisPckPackage = 'Package:';
|
||||
lisPckClearToUseThePackageName = 'Clear to use the package name';
|
||||
lisPckOptsAddPathsToDependentPackagesProjects = 'Add paths to dependent packages/projects';
|
||||
lisPckOptsInclude = 'Include';
|
||||
lisPckOptsObject = 'Object';
|
||||
@ -4457,7 +4461,7 @@ resourcestring
|
||||
lisEONOTEOnlyAbsolutePathsAreSupportedNow = 'NOTE: only absolute paths are supported now';
|
||||
lisCodeHelpConfirmreplace = 'Confirm replace';
|
||||
lisCodeHelpReplaceButton = 'Replace';
|
||||
lisCodeHelpPathsGroupBox = 'FPDoc files path';
|
||||
lisCodeHelpGroupBox = 'FPDoc settings';
|
||||
lisCodeHelpHintBoldFormat = 'Insert bold formatting tag';
|
||||
lisCodeHelpHintItalicFormat = 'Insert italic formatting tag';
|
||||
lisCodeHelpHintUnderlineFormat = 'Insert underline formatting tag';
|
||||
|
@ -2853,9 +2853,9 @@ begin
|
||||
xmlconfig.SetDeleteValue(Path+'General/Title/Value', Title,'');
|
||||
xmlconfig.SetDeleteValue(Path+'General/UseAppBundle/Value', UseAppBundle, True);
|
||||
|
||||
// lazdoc
|
||||
// fpdoc
|
||||
xmlconfig.SetDeleteValue(Path+'LazDoc/Paths',
|
||||
SwitchPathDelims(CreateRelativeSearchPath(LazDocPaths,ProjectDirectory),
|
||||
SwitchPathDelims(CreateRelativeSearchPath(FPDocPaths,ProjectDirectory),
|
||||
fCurStorePathDelim),
|
||||
'');
|
||||
|
||||
@ -3427,9 +3427,9 @@ begin
|
||||
Path+'General/AutoCreateForms/Value', true);
|
||||
end;
|
||||
|
||||
// Lazdoc
|
||||
// fpdoc
|
||||
if not LoadParts then begin
|
||||
LazDocPaths := SwitchPathDelims(xmlconfig.GetValue(Path+'LazDoc/Paths', ''),
|
||||
FPDocPaths := SwitchPathDelims(xmlconfig.GetValue(Path+'LazDoc/Paths', ''),
|
||||
fPathDelimChanged);
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user