[Monodevelop-patches-list] r1054 - in trunk/MonoDevelop/src/Main/Base: Commands Gui/CompletionDatabaseWizard
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sat Feb 28 05:04:10 EST 2004
Author: iainmc
Date: 2004-02-28 05:04:10 -0500 (Sat, 28 Feb 2004)
New Revision: 1054
Modified:
trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs
trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/CreateDBGenerator.cs
trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/CreatingGenerator.cs
trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/GenerateDatabase.cs
trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/UseExistingGenerator.cs
Log:
Moved code completion folder creation so it is only created if it is going to be populated.
Made the check to see if we have a code completion database more robust
Modified: trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs 2004-02-28 03:44:11 UTC (rev 1053)
+++ trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs 2004-02-28 10:04:10 UTC (rev 1054)
@@ -50,23 +50,14 @@
public class StartCodeCompletionWizard : AbstractCommand
{
- private string CreateCodeCompletionDir()
- {
- FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
- PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
- string path = propertyService.ConfigDirectory + System.IO.Path.DirectorySeparatorChar + "CodeCompletionData";
- if (!Directory.Exists(path))
- Directory.CreateDirectory(path);
- propertyService.SetProperty ("SharpDevelop.CodeCompletion.DataDirectory", path);
- propertyService.SaveProperties ();
- return fileUtilityService.GetDirectoryNameWithSeparator(path);
- }
public override void Run()
{
- string path = CreateCodeCompletionDir();
- string codeCompletionProxyFile = path + "CodeCompletionProxyDataV02.bin";
+ PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
+ string path = propertyService.GetProperty ("SharpDevelop.CodeCompletion.DataDirectory", null);
+ string codeCompletionProxyFile = path + Path.DirectorySeparatorChar + "CodeCompletionProxyDataV02.bin";
+ Console.WriteLine("checking for existence of {0}", codeCompletionProxyFile);
- if (!File.Exists(codeCompletionProxyFile)) {
+ if (!File.Exists (codeCompletionProxyFile)) {
RunWizard();
DefaultParserService parserService = (DefaultParserService)ServiceManager.Services.GetService(typeof(IParserService));
parserService.LoadProxyDataFile();
Modified: trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/CreateDBGenerator.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/CreateDBGenerator.cs 2004-02-28 03:44:11 UTC (rev 1053)
+++ trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/CreateDBGenerator.cs 2004-02-28 10:04:10 UTC (rev 1054)
@@ -16,6 +16,7 @@
public bool Fast;
public void Generate(IProgressMonitor progress)
{
+ string path = this.CreateCodeCompletionDir();
DefaultParserService parserService = (DefaultParserService)ICSharpCode.Core.Services.ServiceManager.Services.GetService(typeof(DefaultParserService));
Console.WriteLine("using path " + path);
if (Fast) {
Modified: trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/CreatingGenerator.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/CreatingGenerator.cs 2004-02-28 03:44:11 UTC (rev 1053)
+++ trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/CreatingGenerator.cs 2004-02-28 10:04:10 UTC (rev 1054)
@@ -13,6 +13,16 @@
{
public abstract class CreatingGenerator
{
- public string path;
+ public string CreateCodeCompletionDir()
+ {
+ FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
+ PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
+ string path = propertyService.ConfigDirectory + System.IO.Path.DirectorySeparatorChar + "CodeCompletionData";
+ if (!Directory.Exists (path))
+ Directory.CreateDirectory (path);
+ propertyService.SetProperty ("SharpDevelop.CodeCompletion.DataDirectory", path);
+ propertyService.SaveProperties ();
+ return fileUtilityService.GetDirectoryNameWithSeparator (path);
+ }
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/GenerateDatabase.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/GenerateDatabase.cs 2004-02-28 03:44:11 UTC (rev 1053)
+++ trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/GenerateDatabase.cs 2004-02-28 10:04:10 UTC (rev 1054)
@@ -89,12 +89,7 @@
{
try {
druidHost.Destroy();
- PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
- string path = propertyService.GetProperty("SharpDevelop.CodeCompletion.DataDirectory", String.Empty);
- if (gen is CreatingGenerator)
- ((CreatingGenerator)gen).path = path;
-
GeneratorProgress gp = new GeneratorProgress(gen);
} catch (Exception e) {
Console.WriteLine("Failed with exception " + e.GetType().Name + ": " + e.Message);
Modified: trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/UseExistingGenerator.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/UseExistingGenerator.cs 2004-02-28 03:44:11 UTC (rev 1053)
+++ trunk/MonoDevelop/src/Main/Base/Gui/CompletionDatabaseWizard/UseExistingGenerator.cs 2004-02-28 10:04:10 UTC (rev 1054)
@@ -27,11 +27,7 @@
if (!File.Exists(fileUtilityService.GetDirectoryNameWithSeparator(Path) + "CodeCompletionProxyDataV02.bin"))
throw new PathNotCodeCompletionDatabaseException(Path + " does not contain valid code completion data");
-
- PropertyService propertyService = (PropertyService) ServiceManager.Services.GetService (typeof(PropertyService));
- IProperties properties = (IProperties)propertyService;
-
- properties.SetProperty("SharpDevelop.CodeCompletion.DataDirectory", Path);
+ PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
propertyService.SetProperty ("SharpDevelop.CodeCompletion.DataDirectory", Path);
propertyService.SaveProperties ();
progress.Worked(2, "Referenced existing database");
More information about the Monodevelop-patches-list
mailing list