[Monodevelop-patches-list] r1601 - in trunk/MonoDevelop: build/AddIns build/data/templates/project/CSharp gdldock/gdl gdldock/sources/gdl src/AddIns/BackendBindings/CSharpBinding src/AddIns/BackendBindings/CSharpBinding/Parser src/AddIns/DisplayBindings/SourceEditor src/AddIns/DisplayBindings/SourceEditor/Gui src/Main/Base src/Main/Base/Gui/Components src/Main/Base/Gui/Dialogs/ReferenceDialog src/Main/Base/Gui/Pads/ClassScout src/Main/Base/Gui/Pads/ClassScout/NodeBuilder src/Main/Base/Gui/Pads/HelpBrowser src/Main/Base/Internal/Parser src/Main/Base/Internal/Project/Combine src/Main/Base/Internal/Project/Project src/Main/Base/Services src/Main/Base/Services/ParserService
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sun May 16 16:23:29 EDT 2004
Author: tberman
Date: 2004-05-16 16:23:29 -0400 (Sun, 16 May 2004)
New Revision: 1601
Added:
trunk/MonoDevelop/src/Main/Base/Services/SystemAssemblyService.cs
Modified:
trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin.xml
trunk/MonoDevelop/build/data/templates/project/CSharp/GladeSharpProject.xpt
trunk/MonoDevelop/build/data/templates/project/CSharp/GnomeSharpProject.xpt
trunk/MonoDevelop/build/data/templates/project/CSharp/GtkSharpProject.xpt
trunk/MonoDevelop/gdldock/gdl/ChangeLog
trunk/MonoDevelop/gdldock/gdl/Makefile.am
trunk/MonoDevelop/gdldock/sources/gdl/gdl-dock-item.c
trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Parser.cs
trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
trunk/MonoDevelop/src/Main/Base/ChangeLog
trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs
trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpViewer.cs
trunk/MonoDevelop/src/Main/Base/Internal/Parser/IParser.cs
trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs
trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs
trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/ProjectReference.cs
trunk/MonoDevelop/src/Main/Base/Makefile.am
trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs
trunk/MonoDevelop/src/Main/Base/Services/ParserService/IParserService.cs
Log:
lots of changes, ChangeLogs have more info, here are the highlights:
generated makefiles use /pkg properly (will change to -pkg soon)
solution makefile is generated, this is beta, and was tested with one single solution, so prolly wont work for most.
MonoDoc Resolver: if you hit f1, we attempt to find the docs for the type you are playing with. Doesnt do anything but T: style docs, so it needs lots of love.
Modified: trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin.xml
===================================================================
--- trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin.xml 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/build/AddIns/SharpDevelopCore.addin.xml 2004-05-16 20:23:29 UTC (rev 1601)
@@ -32,6 +32,8 @@
<Extension path = "/Workspace/Services">
<Class id = "MonodocService"
class = "MonoDevelop.Services.MonodocService"/>
+ <Class id = "SystemAssemblyService"
+ class = "MonoDevelop.Services.SystemAssemblyService"/>
<Class id = "ProjectService"
class = "MonoDevelop.Services.DefaultProjectService"/>
<Class id = "FileService"
Modified: trunk/MonoDevelop/build/data/templates/project/CSharp/GladeSharpProject.xpt
===================================================================
--- trunk/MonoDevelop/build/data/templates/project/CSharp/GladeSharpProject.xpt 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/build/data/templates/project/CSharp/GladeSharpProject.xpt 2004-05-16 20:23:29 UTC (rev 1601)
@@ -27,13 +27,12 @@
<Options/>
<References>
- <Reference type="Gac" refto="gtk-sharp.dll" />
- <Reference type="Gac" refto="gdk-sharp.dll" />
- <Reference type="Gac" refto="glib-sharp.dll" />
- <Reference type="Gac" refto="glade-sharp.dll" />
- <Reference type="Gac" refto="pango-sharp.dll" />
- <Reference type="Gac" refto="System.Drawing.dll" />
- <Reference type="Gac" refto="glade-sharp.dll" />
+ <Reference type="Gac" refto="gtk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="gdk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="glib-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="glade-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="pango-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="glade-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</References>
<Resources>
Modified: trunk/MonoDevelop/build/data/templates/project/CSharp/GnomeSharpProject.xpt
===================================================================
--- trunk/MonoDevelop/build/data/templates/project/CSharp/GnomeSharpProject.xpt 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/build/data/templates/project/CSharp/GnomeSharpProject.xpt 2004-05-16 20:23:29 UTC (rev 1601)
@@ -27,13 +27,12 @@
<Options/>
<References>
- <Reference type="Gac" refto="gnome-sharp.dll" />
- <Reference type="Gac" refto="gtk-sharp.dll" />
- <Reference type="Gac" refto="gdk-sharp.dll" />
- <Reference type="Gac" refto="glib-sharp.dll" />
- <Reference type="Gac" refto="glade-sharp.dll" />
- <Reference type="Gac" refto="pango-sharp.dll" />
- <Reference type="Gac" refto="System.Drawing.dll" />
+ <Reference type="Gac" refto="gnome-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="gtk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="gdk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="glib-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="glade-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="pango-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</References>
<Files>
Modified: trunk/MonoDevelop/build/data/templates/project/CSharp/GtkSharpProject.xpt
===================================================================
--- trunk/MonoDevelop/build/data/templates/project/CSharp/GtkSharpProject.xpt 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/build/data/templates/project/CSharp/GtkSharpProject.xpt 2004-05-16 20:23:29 UTC (rev 1601)
@@ -27,12 +27,11 @@
<Options/>
<References>
- <Reference type="Gac" refto="gtk-sharp.dll" />
- <Reference type="Gac" refto="gdk-sharp.dll" />
- <Reference type="Gac" refto="glib-sharp.dll" />
- <Reference type="Gac" refto="glade-sharp.dll" />
- <Reference type="Gac" refto="pango-sharp.dll" />
- <Reference type="Gac" refto="System.Drawing.dll" />
+ <Reference type="Gac" refto="gtk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="gdk-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="glib-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="glade-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
+ <Reference type="Gac" refto="pango-sharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
</References>
<Files>
Modified: trunk/MonoDevelop/gdldock/gdl/ChangeLog
===================================================================
--- trunk/MonoDevelop/gdldock/gdl/ChangeLog 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/gdldock/gdl/ChangeLog 2004-05-16 20:23:29 UTC (rev 1601)
@@ -1,3 +1,7 @@
+2004-05-16 Todd Berman <tberman at sevenl.net>
+
+ * Makefile.am: use safer library referencing
+
2004-04-06 John Luke <jluke at cfl.rr.com>
* Makefile.am: kill DockObject.custom
Modified: trunk/MonoDevelop/gdldock/gdl/Makefile.am
===================================================================
--- trunk/MonoDevelop/gdldock/gdl/Makefile.am 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/gdldock/gdl/Makefile.am 2004-05-16 20:23:29 UTC (rev 1601)
@@ -34,7 +34,7 @@
$(ASSEMBLY): $(build_sources) generated-stamp
mkdir -p ../../build/bin
$(MCS) --unsafe --target library \
- -r glib-sharp -r gtk-sharp -r gdk-sharp \
+ @BASE_DEPENDENCIES_LIBS@ \
$(build_sources) generated/*.cs /out:$(ASSEMBLY) \
&& cp -p $(ASSEMBLY) ../../build/bin/. \
&& cp -p $(srcdir)/$(ASSEMBLY).config ../../build/bin/.
Modified: trunk/MonoDevelop/gdldock/sources/gdl/gdl-dock-item.c
===================================================================
--- trunk/MonoDevelop/gdldock/sources/gdl/gdl-dock-item.c 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/gdldock/sources/gdl/gdl-dock-item.c 2004-05-16 20:23:29 UTC (rev 1601)
@@ -1260,11 +1260,11 @@
g_signal_connect (mitem, "activate",
G_CALLBACK (gdl_dock_item_hide_cb), item);
- /* Lock menuitem */
+ /* Lock menuitem -- Remove by Todd
mitem = gtk_menu_item_new_with_label (_("Lock"));
gtk_menu_shell_append (GTK_MENU_SHELL (item->_priv->menu), mitem);
g_signal_connect (mitem, "activate",
- G_CALLBACK (gdl_dock_item_lock_cb), item);
+ G_CALLBACK (gdl_dock_item_lock_cb), item);*/
}
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/CSharpBindingCompilerManager.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -301,9 +301,10 @@
}
ArrayList compile_files = new ArrayList ();
- ArrayList gac_references = new ArrayList ();
+ ArrayList pkg_references = new ArrayList ();
ArrayList assembly_references = new ArrayList ();
ArrayList project_references = new ArrayList ();
+ ArrayList system_references = new ArrayList ();
ArrayList resources = new ArrayList ();
foreach (ProjectFile finfo in project.ProjectFiles) {
@@ -322,12 +323,17 @@
}
}
}
-
+
+ SystemAssemblyService sas = (SystemAssemblyService)ServiceManager.Services.GetService (typeof (SystemAssemblyService));
foreach (ProjectReference lib in project.ProjectReferences) {
switch (lib.ReferenceType) {
case ReferenceType.Gac:
- string gac_fileName = lib.GetReferencedFileName (project);
- gac_references.Add (Path.GetFileNameWithoutExtension (gac_fileName));
+ string pkg = sas.GetPackageFromFullName (lib.Reference);
+ if (pkg == "MONO-SYSTEM") {
+ system_references.Add (Path.GetFileName (lib.GetReferencedFileName (project)));
+ } else if (!pkg_references.Contains (pkg)) {
+ pkg_references.Add (pkg);
+ }
break;
case ReferenceType.Assembly:
string assembly_fileName = lib.GetReferencedFileName (project);
@@ -361,57 +367,83 @@
}
stream.WriteLine ();
- stream.WriteLine ("RESOURCES = \\");
- for (int i = 0; i < resources.Count; i++) {
- stream.Write (resources[i]);
- if (i != resources.Count - 1)
- stream.WriteLine (" \\");
- else
- stream.WriteLine ();
+ if (resources.Count > 0) {
+ stream.WriteLine ("RESOURCES = \\");
+ for (int i = 0; i < resources.Count; i++) {
+ stream.Write (resources[i]);
+ if (i != resources.Count - 1)
+ stream.WriteLine (" \\");
+ else
+ stream.WriteLine ();
+ }
+ stream.WriteLine ();
+ stream.WriteLine ("RESOURCES_BUILD = $(foreach res,$(RESOURCES), $(addprefix -resource:,$(res)),$(notdir $(res)))");
+ stream.WriteLine ();
}
- stream.WriteLine ();
- stream.WriteLine ("RESOURCES_BUILD = $(foreach res,$(RESOURCES), $(addprefix -resource:,$(res)),$(notdir $(res)))");
- stream.WriteLine ();
- stream.WriteLine ("GAC_REFERENCES = \\");
- for (int i = 0; i < gac_references.Count; i++) {
- stream.Write (gac_references[i]);
- if (i != gac_references.Count - 1)
- stream.WriteLine (" \\");
- else
- stream.WriteLine ();
+ if (pkg_references.Count > 0) {
+ stream.WriteLine ("PKG_REFERENCES = \\");
+ for (int i = 0; i < pkg_references.Count; i++) {
+ stream.Write (pkg_references[i]);
+ if (i != pkg_references.Count - 1)
+ stream.WriteLine (" \\");
+ else
+ stream.WriteLine ();
+ }
+
+ stream.WriteLine ();
+ stream.WriteLine ("PKG_REFERENCES_BUILD = $(addprefix /pkg:, $(PKG_REFERENCES))");
+ stream.WriteLine ();
+ stream.WriteLine ("PKG_REFERENCES_CHECK = $(addsuffix .pkgcheck, $(PKG_REFERENCES))");
}
+
+ if (system_references.Count > 0) {
+ stream.WriteLine ();
+ stream.WriteLine ("SYSTEM_REFERENCES = \\");
+ for (int i = 0; i < system_references.Count; i++) {
+ stream.Write (system_references[i]);
+ if (i != system_references.Count - 1)
+ stream.WriteLine (" \\");
+ else
+ stream.WriteLine ();
+ }
+ stream.WriteLine ();
+ stream.WriteLine ("SYSTEM_REFERENCES_BUILD = $(addprefix /r:, $(SYSTEM_REFERENCES))");
+ stream.WriteLine ();
+ stream.WriteLine ("SYSTEM_REFERENCES_CHECK = $(addsuffix .check, $(SYSTEM_REFERENCES))");
+ stream.WriteLine ();
+ }
- stream.WriteLine ();
- stream.WriteLine ("GAC_REFERENCES_BUILD = $(addprefix /r:, $(GAC_REFERENCES))");
- stream.WriteLine ();
-
- stream.WriteLine ("ASSEMBLY_REFERENCES = \\");
- for (int i = 0; i < assembly_references.Count; i++) {
- stream.Write (assembly_references[i]);
- if (i != assembly_references.Count - 1)
- stream.WriteLine (" \\");
- else
- stream.WriteLine ();
+ if (assembly_references.Count > 0) {
+ stream.WriteLine ("ASSEMBLY_REFERENCES = \\");
+ for (int i = 0; i < assembly_references.Count; i++) {
+ stream.Write (assembly_references[i]);
+ if (i != assembly_references.Count - 1)
+ stream.WriteLine (" \\");
+ else
+ stream.WriteLine ();
+ }
+
+ stream.WriteLine ();
+ stream.WriteLine ("ASSEMBLY_REFERENCES_BUILD = $(addprefix /r:, $(ASSEMBLY_REFERENCES))");
+ stream.WriteLine ();
}
- stream.WriteLine ();
- stream.WriteLine ("ASSEMBLY_REFERENCES_BUILD = $(addprefix /r:, $(ASSEMBLY_REFERENCES))");
- stream.WriteLine ();
-
- stream.WriteLine ("PROJECT_REFERENCES = \\");
- for (int i = 0; i < project_references.Count; i++) {
- stream.Write (project_references[i]);
- if (i != project_references.Count - 1)
- stream.WriteLine (" \\");
- else
- stream.WriteLine ();
+ if (project_references.Count > 0) {
+ stream.WriteLine ("PROJECT_REFERENCES = \\");
+ for (int i = 0; i < project_references.Count; i++) {
+ stream.Write (project_references[i]);
+ if (i != project_references.Count - 1)
+ stream.WriteLine (" \\");
+ else
+ stream.WriteLine ();
+ }
+
+ stream.WriteLine ();
+ stream.WriteLine ("PROJECT_REFERENCES_BUILD = $(addprefix /r:, $(PROJECT_REFERENCES))");
+ stream.WriteLine ();
}
- stream.WriteLine ();
- stream.WriteLine ("PROJECT_REFERENCES_BUILD = $(addprefix /r:, $(PROJECT_REFERENCES))");
- stream.WriteLine ();
-
stream.Write ("MCS_OPTIONS = ");
if (compilerparameters.UnsafeCode) {
stream.Write ("/unsafe ");
@@ -428,13 +460,72 @@
stream.WriteLine ("all: " + outputName);
stream.WriteLine ();
- stream.WriteLine (outputName + ": $(SOURCES) $(RESOURCES)");
- stream.WriteLine ("\tmcs $(MCS_OPTIONS) /target:{0} /out:{1} $(RESOURCES_BUILD) $(GAC_REFERENCES_BUILD) $(ASSEMBLY_REFERENCES_BUILD) $(PROJECT_REFERENCES_BUILD) $(SOURCES)", target, outputName);
+ stream.Write (outputName + ": $(SOURCES)");
+ if (resources.Count > 0) {
+ stream.WriteLine (" $(RESOURCES)");
+ } else {
+ stream.WriteLine ();
+ }
+
+ stream.Write ("\tmcs $(MCS_OPTIONS) /target:{0} /out:{1}", target, outputName);
+ if (resources.Count > 0) {
+ stream.Write (" $(RESOURCES_BUILD)");
+ }
+ if (pkg_references.Count > 0) {
+ stream.Write (" $(PKG_REFERENCES_BUILD)");
+ }
+ if (assembly_references.Count > 0) {
+ stream.Write (" $(ASSEMBLY_REFERENCES_BUILD)");
+ }
+ if (project_references.Count > 0) {
+ stream.Write (" $(PROJECT_REFERENCES_BUILD)");
+ }
+ if (system_references.Count > 0) {
+ stream.Write (" $(SYSTEM_REFERENCES_BUILD)");
+ }
+ stream.WriteLine (" $(SOURCES)");
stream.WriteLine ();
stream.WriteLine ("clean:");
stream.WriteLine ("\trm -f {0}", outputName);
+ stream.WriteLine ();
+ stream.Write ("depcheck: ");
+ if (pkg_references.Count > 0) {
+ stream.Write ("PKG_depcheck ");
+ }
+ if (system_references.Count > 0) {
+ stream.Write ("SYSTEM_depcheck");
+ }
+ stream.WriteLine ();
+ stream.WriteLine ();
+ if (pkg_references.Count > 0) {
+ stream.WriteLine ("PKG_depcheck: $(PKG_REFERENCES_CHECK)");
+ stream.WriteLine ();
+ stream.WriteLine ("%.pkgcheck:");
+ stream.WriteLine ("\t at echo -n Checking for package $(subst .pkgcheck,,$@)...");
+ stream.WriteLine ("\t at if pkg-config --libs $(subst .pkgcheck,,$@) &> /dev/null; then \\");
+ stream.WriteLine ("\t\techo yes; \\");
+ stream.WriteLine ("\telse \\");
+ stream.WriteLine ("\t\techo no; \\");
+ stream.WriteLine ("\t\texit 1; \\");
+ stream.WriteLine ("\tfi");
+ stream.WriteLine ();
+ }
+
+ if (system_references.Count > 0) {
+ stream.WriteLine ("SYSTEM_depcheck: $(SYSTEM_REFERENCES_CHECK)");
+ stream.WriteLine ();
+ stream.WriteLine ("%.check:");
+ stream.WriteLine ("\t at echo -n Checking for $(subst .check,,$@)...");
+ stream.WriteLine ("\t at if [ ! -e `pkg-config --variable=libdir mono`/mono/1.0/$(subst .check,,$@) ]; then \\");
+ stream.WriteLine ("\t\techo no; \\");
+ stream.WriteLine ("\t\texit 1; \\");
+ stream.WriteLine ("\telse \\");
+ stream.WriteLine ("\t\techo yes; \\");
+ stream.WriteLine ("\tfi");
+ }
+
stream.Flush ();
stream.Close ();
}
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/ChangeLog 2004-05-16 20:23:29 UTC (rev 1601)
@@ -1,3 +1,12 @@
+2004-05-16 Todd Berman <tberman at sevenl.net>
+
+ * CSharpBindingCompilerManager.cs: output a much better makefile.
+ now using /pkg, checking for deps, etc.
+ * Parser/Parser.cs: passthrough for Monodoc resolver.
+ * Parser/Resolver.cs: New resolver for identifying a type and sending
+ back a monodoc url for it. It needs to be worked on to return proper
+ M: style urls in addition to T: style urls.
+
2004-05-08 Todd Berman <tberman at sevenl.net>
* CSharpBindingCompilerManager.cs: output /define and /main properly.
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Parser.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Parser.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Parser.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -103,6 +103,11 @@
{
return new Resolver().Resolve(parserService, expression, caretLineNumber, caretColumn, fileName, fileContent);
}
+
+ public string MonodocResolver (IParserService parserService, string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent)
+ {
+ return new Resolver ().MonodocResolver (parserService, expression, caretLineNumber, caretColumn, fileName, fileContent);
+ }
///////// IParser Interface END
}
Modified: trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/AddIns/BackendBindings/CSharpBinding/Parser/Resolver.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -57,7 +57,7 @@
int caretLine;
int caretColumn;
- public ResolveResult Resolve(IParserService parserService, string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent)
+ public IReturnType internalResolve(IParserService parserService, string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent)
{
Console.WriteLine("Start Resolving");
if (expression == null) {
@@ -67,32 +67,6 @@
if (expression == "") {
return null;
}
- if (expression.StartsWith("using ")) {
- // expression[expression.Length - 1] != '.'
- // the period that causes this Resove() is not part of the expression
- if (expression[expression.Length - 1] == '.') {
- return null;
- }
- int i;
- for (i = expression.Length - 1; i >= 0; --i) {
- if (!(Char.IsLetterOrDigit(expression[i]) || expression[i] == '_' || expression[i] == '.')) {
- break;
- }
- }
- // no Identifier before the period
- if (i == expression.Length - 1) {
- return null;
- }
- string t = expression.Substring(i + 1);
-// Console.WriteLine("in Using Statement");
- string[] namespaces = parserService.GetNamespaceList(t);
- if (namespaces == null || namespaces.Length <= 0) {
- return null;
- }
- return new ResolveResult(namespaces);
- }
-
- Console.WriteLine("Not in Using");
this.caretLine = caretLineNumber;
this.caretColumn = caretColumn;
@@ -173,7 +147,64 @@
type = new ReturnType("System.Array");
}
Console.WriteLine("Here: Type is " + type.FullyQualifiedName);
- IClass returnClass = SearchType(type.FullyQualifiedName, cu);
+ return type;
+ }
+
+ public string MonodocResolver (IParserService parserService, string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent)
+ {
+ if (expression == null) {
+ return null;
+ }
+ expression = expression.TrimStart (null);
+ if (expression == "") {
+ return null;
+ }
+ IReturnType retType = internalResolve (parserService, expression, caretLineNumber, caretColumn, fileName, fileContent);
+ IClass retClass = SearchType (retType.FullyQualifiedName, cu);
+ if (retClass == null)
+ return null;
+
+ Console.WriteLine (retClass.FullyQualifiedName);
+ return "T:" + retClass.FullyQualifiedName;
+ }
+
+ public ResolveResult Resolve(IParserService parserService, string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent)
+ {
+ if (expression == null) {
+ return null;
+ }
+ expression = expression.TrimStart(null);
+ if (expression == "") {
+ return null;
+ }
+ if (expression.StartsWith("using ")) {
+ // expression[expression.Length - 1] != '.'
+ // the period that causes this Resove() is not part of the expression
+ if (expression[expression.Length - 1] == '.') {
+ return null;
+ }
+ int i;
+ for (i = expression.Length - 1; i >= 0; --i) {
+ if (!(Char.IsLetterOrDigit(expression[i]) || expression[i] == '_' || expression[i] == '.')) {
+ break;
+ }
+ }
+ // no Identifier before the period
+ if (i == expression.Length - 1) {
+ return null;
+ }
+ string t = expression.Substring(i + 1);
+// Console.WriteLine("in Using Statement");
+ string[] namespaces = parserService.GetNamespaceList(t);
+ if (namespaces == null || namespaces.Length <= 0) {
+ return null;
+ }
+ return new ResolveResult(namespaces);
+ }
+
+ Console.WriteLine("Not in Using");
+ IReturnType type = internalResolve (parserService, expression, caretLineNumber, caretColumn, fileName, fileContent);
+ IClass returnClass = SearchType (type.FullyQualifiedName, cu);
if (returnClass == null) {
// Try if type is Namespace:
string n = SearchNamespace(type.FullyQualifiedName, cu);
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/ChangeLog 2004-05-16 20:23:29 UTC (rev 1601)
@@ -1,3 +1,9 @@
+2004-05-16 Todd Berman <tberman at sevenl.net>
+
+ * Gui/SourceEditorView.cs: Implement beta monodoc resolving.
+ This works only with types for right now, so its now 100% of what
+ you would expect.
+
2004-05-09 Todd Berman <tberman at sevenl.net>
* Gui/SourceEditorView.cs: bring current with gtk-sharp cvs.
Modified: trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs
===================================================================
--- trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/AddIns/DisplayBindings/SourceEditor/Gui/SourceEditorView.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -9,12 +9,14 @@
using MonoDevelop.Core.AddIns.Conditions;
using MonoDevelop.Core.AddIns;
using MonoDevelop.Internal.Templates;
+using MonoDevelop.Internal.Parser;
using MonoDevelop.Core.Services;
using MonoDevelop.SourceEditor.CodeCompletion;
using MonoDevelop.SourceEditor.InsightWindow;
using MonoDevelop.EditorBindings.Properties;
using MonoDevelop.EditorBindings.FormattingStrategy;
using MonoDevelop.Gui.Utils;
+using MonoDevelop.Gui;
using MonoDevelop.Services;
using GtkSourceView;
@@ -180,6 +182,54 @@
completionWindow.ShowCompletionWindow (triggerChar, triggerIter, true);
}
+
+ bool MonodocResolver ()
+ {
+ TextIter insertIter = buf.GetIterAtMark (buf.InsertMark);
+ TextIter triggerIter = TextIter.Zero;
+ try {
+ do {
+ switch (insertIter.Char[0]) {
+ case ' ':
+ case '\t':
+ case '.':
+ case '(':
+ case '[':
+ triggerIter = insertIter;
+ break;
+ }
+ if (!triggerIter.Equals (TextIter.Zero))
+ break;
+ insertIter.ForwardChar ();
+ } while (insertIter.LineOffset != 0);
+ triggerIter.ForwardChar ();
+ } catch {
+ return false;
+ }
+ insertIter = triggerIter;
+ IParserService parser = (IParserService)ServiceManager.Services.GetService (typeof (IParserService));
+ string fileName = ParentEditor.DisplayBinding.ContentName;
+ IExpressionFinder expressionFinder = parser.GetExpressionFinder(fileName);
+ string expression = expressionFinder == null ? TextUtilities.GetExpressionBeforeOffset(this, insertIter.Offset) : expressionFinder.FindExpression(buf.GetText(buf.StartIter, insertIter, true), insertIter.Offset - 2);
+ if (expression == null) return false;
+ Console.WriteLine ("Expression: {" + expression + "}");
+ string type = parser.MonodocResolver (expression, insertIter.Line + 1, insertIter.LineOffset + 1, fileName, buf.Text);
+ if (type == null || type.Length == 0)
+ return false;
+
+ foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) {
+ if (content.ContentName == GettextCatalog.GetString ("Documentation")) {
+ ((HelpViewer)content).LoadUrl (type);
+ content.WorkbenchWindow.SelectWindow ();
+ return true;
+ }
+ }
+ HelpViewer new_content = new HelpViewer ();
+ new_content.LoadUrl (type);
+ WorkbenchSingleton.Workbench.ShowView (new_content);
+
+ return true;
+ }
protected override bool OnKeyPressEvent (Gdk.EventKey evnt)
{
@@ -191,31 +241,36 @@
switch (state) {
case Normal:
switch (key) {
- case Gdk.Key.Tab:
- if (IndentSelection ())
- return true;
- break;
+ case Gdk.Key.Tab:
+ if (IndentSelection ())
+ return true;
+ break;
+ case Gdk.Key.F1:
+ case Gdk.Key.KP_F1:
+ if (MonodocResolver ())
+ return true;
+ break;
}
break;
case Shift:
switch (key) {
- case Gdk.Key.ISO_Left_Tab:
- if (UnIndentSelection ())
- return true;
- break;
- case Gdk.Key.Delete:
- DeleteLine ();
+ case Gdk.Key.ISO_Left_Tab:
+ if (UnIndentSelection ())
return true;
+ break;
+ case Gdk.Key.Delete:
+ DeleteLine ();
+ return true;
}
break;
case Control:
switch (key) {
- case Gdk.Key.space:
- TriggerCodeComplete ();
- return true;
- case Gdk.Key.l:
- DeleteLine ();
- return true;
+ case Gdk.Key.space:
+ TriggerCodeComplete ();
+ return true;
+ case Gdk.Key.l:
+ DeleteLine ();
+ return true;
}
break;
}
Modified: trunk/MonoDevelop/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/ChangeLog 2004-05-16 20:23:29 UTC (rev 1601)
@@ -1,3 +1,30 @@
+2004-05-16 Todd Berman <tberman at sevenl.net>
+
+ * Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs: fix to use
+ the new SystemAssemblySerivce.
+ * Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs: ^^
+ * Gui/Components/SdMenuCommand.cs: remove useless code, use the proper
+ overload.
+ * Gui/Pads/ClassScout/ClassScout.cs: revert semi-fix of r1600 and add
+ a new fix that might or might not work, but will not cause the speed
+ issues of the previous fix.
+ * Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuiler.cs:
+ ^^
+ * Gui/Pads/HelpBrowser/HelpViewer.cs: indenting fix.
+ * Services/SystemAssemblyService.cs: new service for identifying
+ system assemblies (mono installed + pc'd assemblies)
+ * Services/ParserService/DefaultParserService.cs:
+ * Services/ParserService/IParserService.cs: passthrough for monodoc
+ resolver.
+ * Makefile.am: add SystemAssemblyService
+ * Internal/Project/Project/ProjectReference.cs: proper reference
+ information.
+ * Internal/Project/Project/AbstractProject.cs: remove windows .ToUpper
+ hack.
+ * Internal/Project/Combine/Combine.cs: start of solution level
+ makefiles.
+ * Internal/Parser/IParser.cs: monodoc resolver addition.
+
2004-05-10 Todd Berman <tberman at sevenl.net>
* Gui/Workbench/DefaultWorkbench.cs: Attempt non-metacity toplevel fix
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Components/SdMenuCommand.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -60,18 +60,9 @@
}
}
- public SdMenuCommand (string text) : base ()
+ public SdMenuCommand (string text) : base (text)
{
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService (typeof(IResourceService));
- StringParserService parserService = (StringParserService)ServiceManager.Services.GetService (typeof(StringParserService));
-
- localizedText = parserService.Parse (text);
-
- Gtk.AccelLabel label = new Gtk.AccelLabel (localizedText);
- label.Xalign = 0;
- label.UseUnderline = true;
- this.Child = label;
- label.AccelWidget = this;
+ localizedText = text;
}
public SdMenuCommand(ConditionCollection conditionCollection, object caller, string label) : this(stringParserService.Parse(label))
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/GacReferencePanel.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -58,7 +58,7 @@
ScrolledWindow sc = new ScrolledWindow ();
sc.AddWithViewport (treeView);
this.Add (sc);
- Shadow = ShadowType.None;
+ Shadow = ShadowType.In;
ShowAll ();
}
@@ -70,13 +70,13 @@
store.SetValue (iter, 3, true);
selectDialog.AddReference(ReferenceType.Gac,
(string)store.GetValue (iter, 0),
- (string)store.GetValue (iter, 2));
+ (string)store.GetValue (iter, 4));
} else {
store.SetValue (iter, 3, false);
selectDialog.RemoveReference (ReferenceType.Gac,
(string)store.GetValue (iter, 0),
- (string)store.GetValue (iter, 2));
+ (string)store.GetValue (iter, 4));
}
}
@@ -85,7 +85,7 @@
Gtk.TreeIter looping_iter;
store.GetIterFirst (out looping_iter);
do {
- if ((string)store.GetValue (looping_iter, 2) == refLoc) {
+ if ((string)store.GetValue (looping_iter, 4) == refLoc) {
store.SetValue (looping_iter, 3, newstate);
return;
}
@@ -117,6 +117,7 @@
Items.Add(item);
}
#endif
+ #if false
System.Reflection.MethodInfo gac = typeof (System.Environment).GetMethod ("internalGetGacPath", System.Reflection.BindingFlags.Static|System.Reflection.BindingFlags.NonPublic);
if (gac == null) {
Console.WriteLine (GettextCatalog.GetString ("ERROR: non-mono runtime detected, please use the mono runtime for this piece of MonoDevelop for the time being"));
@@ -135,6 +136,15 @@
}
}
}
+ #endif
+ SystemAssemblyService sas = (SystemAssemblyService)ServiceManager.Services.GetService (typeof (SystemAssemblyService));
+ foreach (string assemblyPath in sas.AssemblyPaths) {
+ try {
+ System.Reflection.AssemblyName an = System.Reflection.AssemblyName.GetAssemblyName (assemblyPath);
+ store.AppendValues (an.Name, an.Version.ToString (), System.IO.Path.GetFileName (assemblyPath), false, an.FullName);
+ }catch {
+ }
+ }
}
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/ReferenceDialog/SelectReferenceDialog.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -86,7 +86,7 @@
AddNonGacReference (refInfo);
break;
case ReferenceType.Gac:
- AddGacReference (refInfo);
+ AddGacReference (refInfo, configureProject);
break;
}
}
@@ -103,10 +103,10 @@
refTreeStore.AppendValues (System.IO.Path.GetFileName (refInfo.Reference), refInfo.ReferenceType.ToString (), System.IO.Path.GetFullPath (refInfo.GetReferencedFileName (configureProject)), refInfo);
}
- void AddGacReference (ProjectReference refInfo)
+ void AddGacReference (ProjectReference refInfo, IProject referencedProject)
{
gacRefPanel.SignalRefChange (refInfo.Reference, true);
- refTreeStore.AppendValues (refInfo.Reference, refInfo.ReferenceType.ToString (), refInfo.Reference, refInfo);
+ refTreeStore.AppendValues (System.IO.Path.GetFileNameWithoutExtension (refInfo.GetReferencedFileName (referencedProject)), refInfo.ReferenceType.ToString (), refInfo.Reference, refInfo);
}
public void RemoveReference (ReferenceType referenceType, string referenceName, string referenceLocation)
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/ClassScout.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -167,13 +167,11 @@
bool addParseInfo ()
{
- try {
- if (add_e != null) {
+ if (add_e != null) {
+ lock (add_e) {
AddParseInformation (Nodes, add_e);
- add_e = null;
}
- } catch {
- OnProjectFilesChanged (null, null);
+ add_e = null;
}
return false;
}
@@ -187,13 +185,11 @@
bool removeParseInfo ()
{
- try {
- if (remove_e != null) {
+ if (remove_e != null) {
+ lock (remove_e) {
RemoveParseInformation (Nodes, remove_e);
- remove_e = null;
}
- } catch {
- OnProjectFilesChanged (null, null);
+ remove_e = null;
}
return false;
}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/ClassScout/NodeBuilder/DefaultDotNetClassScoutNodeBuilder.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -1,4 +1,4 @@
-// <file>
+// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike at icsharpcode.net"/>
@@ -48,9 +48,12 @@
languageConversion.ConversionFlags = ConversionFlags.None;
}
+ private object locker = new object ();
public void AddToClassTree(TreeNode parentNode, ParseInformationEventArgs e)
{
- AddToClassTree(parentNode, e.FileName, (ICompilationUnit)e.ParseInformation.MostRecentCompilationUnit);
+ lock (locker) {
+ AddToClassTree(parentNode, e.FileName, (ICompilationUnit)e.ParseInformation.MostRecentCompilationUnit);
+ }
}
public void RemoveFromClassTree(TreeNode parentNode, ParseInformationEventArgs e) {
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpViewer.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpViewer.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Pads/HelpBrowser/HelpViewer.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -72,29 +72,29 @@
public void LoadUrl (string url)
{
if (url.StartsWith("#"))
- {
- html_viewer.JumpToAnchor(url.Substring(1));
- return;
- }
-
+ {
+ html_viewer.JumpToAnchor(url.Substring(1));
+ return;
+ }
+
Node node;
string res = mds.HelpTree.RenderUrl (url, out node);
if (res != null) {
Render (res, node, url);
}
- }
-
- public void Render (string text, Node matched_node, string url)
- {
- CurrentUrl = url;
-
+ }
+
+ public void Render (string text, Node matched_node, string url)
+ {
+ CurrentUrl = url;
+
Gtk.HTMLStream stream = html_viewer.Begin ("text/html");
-
+
stream.Write ("<html><body>");
- stream.Write (text);
- stream.Write ("</body></html>");
- html_viewer.End (stream, HTMLStreamStatus.Ok);
+ stream.Write (text);
+ stream.Write ("</body></html>");
+ html_viewer.End (stream, HTMLStreamStatus.Ok);
}
public override void Load (string s)
Modified: trunk/MonoDevelop/src/Main/Base/Internal/Parser/IParser.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Parser/IParser.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Parser/IParser.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -137,6 +137,8 @@
string fileName,
string fileContent);
+ string MonodocResolver (IParserService parserService, string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent);
+
ArrayList IsAsResolve (IParserService parserService, string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent);
ArrayList CtrlSpace(IParserService parserService, int caretLine, int caretColumn, string fileName);
Modified: trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Project/Combine/Combine.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -34,6 +34,7 @@
/// </summary>
string startProject = null;
bool singleStartup = true;
+ string path = null;
ArrayList entries = new ArrayList();
@@ -178,7 +179,7 @@
{
XmlDocument doc = new XmlDocument();
doc.Load(filename);
- string path = Path.GetDirectoryName(filename);
+ path = Path.GetDirectoryName(filename);
XmlElement root = doc.DocumentElement;
@@ -527,12 +528,46 @@
public void GenerateMakefiles ()
{
+ ArrayList projects = new ArrayList ();
foreach (CombineEntry entry in entries) {
- if (entry is ProjectCombineEntry)
+ if (entry is ProjectCombineEntry) {
entry.GenerateMakefiles ();
+ projects.Add (((ProjectCombineEntry)entry).Project);
+ }
else
Console.WriteLine ("Dont know how to generate makefiles for " + entry);
}
+
+ StreamWriter stream = new StreamWriter (Path.Combine (path, "Makefile"));
+
+ stream.Write ("all: ");
+ foreach (IProject proj in projects) {
+ stream.Write ("Makefile.{0}.all", proj.Name);
+ }
+ stream.WriteLine ();
+ stream.WriteLine ();
+
+ stream.Write ("clean: ");
+ foreach (IProject proj in projects) {
+ stream.Write ("Makefile.{0}.clean", proj.Name);
+ }
+ stream.WriteLine ();
+ stream.WriteLine ();
+
+ stream.Write ("depcheck: ");
+ foreach (IProject proj in projects) {
+ stream.Write ("Makefile.{0}.depcheck", proj.Name);
+ }
+ stream.WriteLine ();
+ stream.WriteLine ();
+
+ foreach (IProject proj in projects) {
+ stream.WriteLine ("Makefile.{0}.%:", proj.Name);
+ stream.WriteLine ("\t@$(MAKE) -f $(subst .$*,,$@) $*");
+ }
+
+ stream.Flush ();
+ stream.Close ();
}
protected virtual void OnStartupPropertyChanged(EventArgs e)
Modified: trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/AbstractProject.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -178,8 +178,7 @@
{
if (filename == null) return false;
foreach (ProjectFile file in projectFiles) {
- // WINDOWS DEPENDENCY:
- if (file.Name.ToUpper() == filename.ToUpper()) {
+ if (file.Name == filename) {
return true;
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/ProjectReference.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/ProjectReference.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Internal/Project/Project/ProjectReference.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -98,7 +98,7 @@
return reference;
case ReferenceType.Gac:
- string file = ((IParserService)ServiceManager.Services.GetService (typeof (IParserService))).LoadAssemblyFromGac (reference);
+ string file = ((IParserService)ServiceManager.Services.GetService (typeof (IParserService))).LoadAssemblyFromGac (GetPathToGACAssembly (this));
return file == String.Empty ? reference : file;
case ReferenceType.Project:
IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.Services.GetService(typeof(IProjectService));
@@ -135,11 +135,11 @@
Debug.Assert(refInfo.ReferenceType == ReferenceType.Gac);
string[] info = refInfo.Reference.Split(',');
- if (info.Length < 4) {
- return info[0];
- }
+ //if (info.Length < 4) {
+ return info[0];
+ // }
- string aName = info[0];
+ /*string aName = info[0];
string aVersion = info[1].Substring(info[1].LastIndexOf('=') + 1);
string aPublicKey = info[3].Substring(info[3].LastIndexOf('=') + 1);
@@ -149,7 +149,7 @@
Path.DirectorySeparatorChar + "GAC" +
Path.DirectorySeparatorChar + aName +
Path.DirectorySeparatorChar + aVersion + "__" + aPublicKey +
- Path.DirectorySeparatorChar + aName + ".dll";
+ Path.DirectorySeparatorChar + aName + ".dll";*/
}
public object Clone()
Modified: trunk/MonoDevelop/src/Main/Base/Makefile.am
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Makefile.am 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Makefile.am 2004-05-16 20:23:29 UTC (rev 1601)
@@ -215,6 +215,7 @@
./Services/Toolbar/ToolbarService.cs \
./Services/MonodocService.cs \
./Services/IDebuggerService.cs \
+./Services/SystemAssemblyService.cs \
./Internal/Undo/IUndoableOperation.cs \
./Internal/Undo/UndoStack.cs \
./Internal/Undo/UndoQueue.cs \
Modified: trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Services/ParserService/DefaultParserService.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -817,6 +817,19 @@
}
}
+ public string MonodocResolver (string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent)
+ {
+ try {
+ IParser parser = GetParser (fileName);
+ if (parser != null) {
+ return parser.MonodocResolver (this, expression, caretLineNumber, caretColumn, fileName, fileContent);
+ }
+ return null;
+ } catch {
+ return null;
+ }
+ }
+
protected void OnParseInformationAdded(ParseInformationEventArgs e)
{
if (ParseInformationAdded != null) {
Modified: trunk/MonoDevelop/src/Main/Base/Services/ParserService/IParserService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/ParserService/IParserService.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Services/ParserService/IParserService.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -68,6 +68,7 @@
int caretColumn,
string fileName,
string fileContent);
+ string MonodocResolver (string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent);
ArrayList IsAsResolve (string expression, int caretLineNumber, int caretColumn, string fileName, string fileContent);
ArrayList CtrlSpace(IParserService parserService, int caretLine, int caretColumn, string fileName);
void AddReferenceToCompletionLookup(IProject project, ProjectReference reference);
Added: trunk/MonoDevelop/src/Main/Base/Services/SystemAssemblyService.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Services/SystemAssemblyService.cs 2004-05-11 02:19:29 UTC (rev 1600)
+++ trunk/MonoDevelop/src/Main/Base/Services/SystemAssemblyService.cs 2004-05-16 20:23:29 UTC (rev 1601)
@@ -0,0 +1,178 @@
+using System;
+using System.IO;
+using System.Collections;
+using System.Diagnostics;
+
+using MonoDevelop.Core.Services;
+
+namespace MonoDevelop.Services {
+ public class SystemAssemblyService : AbstractService
+ {
+ Hashtable assemblyPathToPackage = new Hashtable ();
+ Hashtable assemblyFullNameToPath = new Hashtable ();
+
+ public ICollection AssemblyPaths
+ {
+ get {
+ return assemblyPathToPackage.Keys;
+ }
+ }
+
+ public string GetPackageFromFullName (string fullname)
+ {
+ if (!assemblyFullNameToPath.Contains (fullname))
+ return String.Empty;
+
+ string path = (string)assemblyFullNameToPath[fullname];
+ if (!assemblyPathToPackage.Contains (path))
+ return String.Empty;
+
+ return (string)assemblyPathToPackage[path];
+ }
+
+ public override void InitializeService ()
+ {
+ base.InitializeService ();
+ //Pull up assemblies from the installed mono system.
+ string prefix = Path.GetDirectoryName (typeof (int).Assembly.Location);
+ foreach (string assembly in Directory.GetFiles (Path.Combine (Path.Combine (prefix, "mono"), "1.0"), "*.dll")) {
+ AddAssembly (assembly, "MONO-SYSTEM");
+ }
+
+ string search_dirs = Environment.GetEnvironmentVariable ("PKG_CONFIG_PATH");
+ string libpath = Environment.GetEnvironmentVariable ("PKG_CONFIG_LIBPATH");
+ if (libpath == null || libpath.Length == 0) {
+ string path_dirs = Environment.GetEnvironmentVariable ("PATH");
+ foreach (string pathdir in path_dirs.Split (':')) {
+ if (pathdir == null)
+ continue;
+ if (File.Exists (pathdir + Path.DirectorySeparatorChar + "pkg-config")) {
+ libpath = pathdir + Path.DirectorySeparatorChar + "../lib/pkgconfig/";
+ break;
+ }
+ }
+ }
+ search_dirs += ":" + libpath;
+ if (search_dirs != null && search_dirs.Length > 0) {
+ foreach (string pcdir in search_dirs.Split (':')) {
+ if (pcdir == null)
+ continue;
+
+ if (Directory.Exists (pcdir)) {
+ //try {
+ foreach (string pcfile in Directory.GetFiles (pcdir, "*.pc")) {
+ ParsePCFile (pcfile);
+ }
+ //} catch { }
+ }
+ }
+ }
+ }
+
+ private void ParsePCFile (string pcfile)
+ {
+ ArrayList fullassemblies = null;
+ using (StreamReader reader = new StreamReader (pcfile)) {
+ string line;
+ while ((line = reader.ReadLine ()) != null) {
+ string lowerLine = line.ToLower ();
+ if (lowerLine.StartsWith ("libs:") && lowerLine.IndexOf (".dll") != -1) {
+ string choppedLine = line.Substring (5).Trim ();
+ if (choppedLine.IndexOf ("-lib:") != -1 || choppedLine.IndexOf ("/lib:") != -1) {
+ fullassemblies = GetAssembliesWithLibInfo (choppedLine, pcfile);
+ } else {
+ fullassemblies = GetAssembliesWithoutLibInfo (choppedLine, pcfile);
+ }
+ }
+ }
+ }
+
+ if (fullassemblies == null)
+ return;
+
+ foreach (string assembly in fullassemblies) {
+ AddAssembly (assembly, pcfile);
+ }
+ }
+
+ private void AddAssembly (string assemblyfile, string pcfile)
+ {
+ if (!File.Exists (assemblyfile))
+ return;
+
+ try {
+ System.Reflection.AssemblyName an = System.Reflection.AssemblyName.GetAssemblyName (assemblyfile);
+ assemblyFullNameToPath[an.FullName] = assemblyfile;
+ assemblyPathToPackage[assemblyfile] = Path.GetFileNameWithoutExtension (pcfile);
+ } catch {
+ }
+ }
+
+ private ArrayList GetAssembliesWithLibInfo (string line, string file)
+ {
+ ArrayList references = new ArrayList ();
+ ArrayList libdirs = new ArrayList ();
+ ArrayList retval = new ArrayList ();
+ foreach (string piece in line.Split (' ')) {
+ if (piece.ToLower ().Trim ().StartsWith ("/r:") || piece.ToLower ().Trim ().StartsWith ("-r:")) {
+ references.Add (ProcessPiece (piece.Substring (3).Trim (), file));
+ } else if (piece.ToLower ().Trim ().StartsWith ("/lib:") || piece.ToLower ().Trim ().StartsWith ("-lib:")) {
+ libdirs.Add (ProcessPiece (piece.Substring (5).Trim (), file));
+ }
+ }
+
+ foreach (string refrnc in references) {
+ foreach (string libdir in libdirs) {
+ if (File.Exists (libdir + Path.DirectorySeparatorChar + refrnc)) {
+ retval.Add (libdir + Path.DirectorySeparatorChar + refrnc);
+ }
+ }
+ }
+
+ return retval;
+ }
+
+ private ArrayList GetAssembliesWithoutLibInfo (string line, string file)
+ {
+ ArrayList references = new ArrayList ();
+ foreach (string reference in line.Split (' ')) {
+ if (reference.ToLower ().Trim ().StartsWith ("/r:") || reference.ToLower ().Trim ().StartsWith ("-r:")) {
+ string final_ref = reference.Substring (3).Trim ();
+ references.Add (ProcessPiece (final_ref, file));
+ }
+ }
+ return references;
+ }
+
+ private string ProcessPiece (string piece, string pcfile)
+ {
+ int start = piece.IndexOf ("${");
+ if (start == -1)
+ return piece;
+
+ int end = piece.IndexOf ("}");
+ if (end == -1)
+ return piece;
+
+ string variable = piece.Substring (start + 2, end - start - 2);
+ string interp = GetVariableFromPkgConfig (variable, Path.GetFileNameWithoutExtension (pcfile));
+ return ProcessPiece (piece.Replace ("${" + variable + "}", interp), pcfile);
+ }
+
+ private string GetVariableFromPkgConfig (string var, string pcfile)
+ {
+ ProcessStartInfo psi = new ProcessStartInfo ("pkg-config");
+ psi.RedirectStandardOutput = true;
+ psi.UseShellExecute = false;
+ psi.Arguments = String.Format ("--variable={0} {1}", var, pcfile);
+ Process p = new Process ();
+ p.StartInfo = psi;
+ p.Start ();
+ p.WaitForExit ();
+ string ret = p.StandardOutput.ReadToEnd ().Trim ();
+ if (ret == null || ret.Length == 0)
+ return String.Empty;
+ return ret;
+ }
+ }
+}
More information about the Monodevelop-patches-list
mailing list