diff --git a/.gitattributes b/.gitattributes index 3826cce103..28757aba29 100644 --- a/.gitattributes +++ b/.gitattributes @@ -820,6 +820,7 @@ components/codetools/examples/scanexamples/genericsexample.pas svneol=native#tex components/codetools/examples/scanexamples/getcontextexample.pas svneol=native#text/plain components/codetools/examples/scanexamples/getterexample1.pas svneol=native#text/plain components/codetools/examples/scanexamples/identcomplexample.pas svneol=native#text/plain +components/codetools/examples/scanexamples/include/BrokenIncFile2.inc svneol=native#text/plain components/codetools/examples/scanexamples/indentation.pas svneol=native#text/plain components/codetools/examples/scanexamples/initvars1.pas svneol=native#text/plain components/codetools/examples/scanexamples/methodjump1.pas svneol=native#text/plain diff --git a/components/codetools/examples/addmethod.lpr b/components/codetools/examples/addmethod.lpr index 85b6b41dba..75f72fda57 100644 --- a/components/codetools/examples/addmethod.lpr +++ b/components/codetools/examples/addmethod.lpr @@ -48,22 +48,11 @@ var MethodDefinition: String; CleanMethodDefinition: String; i: Integer; - Options: TCodeToolsOptions; begin // Example: find declaration of 'TObject' - // setup the Options - Options:=TCodeToolsOptions.Create; - // setup your paths - writeln('Config=',ConfigFilename); - if FileExists(ConfigFilename) then begin - // To not parse the FPC sources every time, the options are saved to a file. - Options.LoadFromFile(ConfigFilename); - end; - Options.InitWithEnvironmentVariables; - CodeToolBoss.Init(Options); - // save the options and the FPC unit links results. - Options.SaveToFile(ConfigFilename); + // init the codetools + CodeToolBoss.SimpleInit(ConfigFilename); // load the file Filename:=AppendPathDelim(GetCurrentDir)+'scanexamples'+PathDelim @@ -106,8 +95,6 @@ begin raise Exception.Create('Explore failed'); writeln('Method added: '); writeln(Code.Source); - - Options.Free; end. diff --git a/components/codetools/examples/scanexamples/brokenfilenames.pas b/components/codetools/examples/scanexamples/brokenfilenames.pas index e2fda2a9d7..a9fce97537 100644 --- a/components/codetools/examples/scanexamples/brokenfilenames.pas +++ b/components/codetools/examples/scanexamples/brokenfilenames.pas @@ -6,7 +6,7 @@ interface uses - Classes, + cLasses, CustApp, biglettersunit, // must be fixed to BigLettersUnit biglettersunit in 'biglettersunit.pas',// -> BigLettersUnit.pas @@ -19,7 +19,7 @@ uses {$ENDIF}; {$I BROKENincfiles.inc}// must be fixed to brokenincfiles.inc -{$I ../ScanInstances/BROKENincfile2.inc}// must be fixed to ../scaninstances/brokenincfiles.inc +{$I ../scanexamples/include/BROKENincfile2.inc}// must be fixed to include/BrokenIncFile2.inc implementation diff --git a/components/codetools/examples/scanexamples/include/BrokenIncFile2.inc b/components/codetools/examples/scanexamples/include/BrokenIncFile2.inc new file mode 100644 index 0000000000..e69de29bb2