[svn] r7510: vs-plugin/trunk: Nemerle.Compiler.Utils/Nemerle.Compiler.Utils.csproj Nemerle.Compiler.Utils/...

VladD2 svnadmin at nemerle.org
Sat Mar 3 14:44:02 CET 2007


Log:
Work on ProjectReference.

Author: VladD2
Date: Sat Mar  3 14:43:58 2007
New Revision: 7510

Added:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/MessageType.n
Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Compiler.Utils.csproj
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CompilerConcreteDefinitions/IntelliSenseModeLibraryReferenceManager.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/EngineCallbackStub.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/IEngineCallback.n
   vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Project/ProjectInfo.cs

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Compiler.Utils.csproj
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Compiler.Utils.csproj	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Compiler.Utils.csproj	Sat Mar  3 14:43:58 2007
@@ -150,6 +150,9 @@
   <ItemGroup>
     <Compile Include="Nemerle.Completion2\TextManagement\IProjectSources.n" />
   </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Nemerle.Completion2\TextManagement\MessageType.n" />
+  </ItemGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
        Other similar extension points exist, see Microsoft.Common.targets.

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ExprFinder.n	Sat Mar  3 14:43:58 2007
@@ -119,22 +119,22 @@
     }
     
     // This method accepts Decl as a starting point.
-    public Find(pRoot : Decl, line : int, col : int) : Location * object
-    {
-      if(pRoot == null)
-       (Location.Default, null);
-      else
-      {
-         Init(line, col);
-         ExprWalker().Walk(pRoot, PFinder);
-         if(_pexprObject != null)
-           (_location, _pexprObject)
-         else if(_decl != null)
-          (_location, _decl);
-         else
-          (Location.Default, null);
-      }  
-    }
+    //public Find(pRoot : Decl, line : int, col : int) : Location * object
+    //{
+    //  if(pRoot == null)
+    //   (Location.Default, null);
+    //  else
+    //  {
+    //     Init(line, col);
+    //     ExprWalker().Walk(pRoot, PFinder);
+    //     if(_pexprObject != null)
+    //       (_location, _pexprObject)
+    //     else if(_decl != null)
+    //      (_location, _decl);
+    //     else
+    //      (Location.Default, null);
+    //  }  
+    //}
     
     public Find(pRoot : PExpr, _tRoot : TExpr, line : int, col : int) : Location * object * object
     {

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CompilerConcreteDefinitions/IntelliSenseModeLibraryReferenceManager.n
==============================================================================
Files vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CompilerConcreteDefinitions/IntelliSenseModeLibraryReferenceManager.n	(original) and vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CompilerConcreteDefinitions/IntelliSenseModeLibraryReferenceManager.n	Sat Mar  3 14:43:58 2007 differ

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine-main.n	Sat Mar  3 14:43:58 2007
@@ -15,6 +15,7 @@
 
 using Typed = Nemerle.Compiler.Typedtree;
 using TExpr = Nemerle.Compiler.Typedtree.TExpr;
+using LibRefManager = Nemerle.Completion2.Factories.IntelliSenseModeLibraryReferenceManager;
 
 namespace Nemerle.Completion2
 {
@@ -56,13 +57,31 @@
             // Get assembly references from IDE.
             def asmRefs = _callback.GetAssemblyReferences().ToArray();
             // Update library list.
-            Factories.IntelliSenseModeLibraryReferenceManager.UpdateAssemblies(asmRefs);
+            LibRefManager.UpdateAssemblies(asmRefs);
 
+            try
+            {
             foreach (asm in asmRefs) // Add all asseblies into compiler
               LibrariesManager.AddLibrary(asm);
             
             LoadExternalLibraries(); // reload types information
           }
+            catch
+            {
+              | e =>
+                def errorMag =
+                  if (LibRefManager.UnresolvedAssms.Count > 0)
+                  {
+                    $"Error: $(e.Message)\r\n\r\n"
+                    + LibRefManager.UnresolvedAssms.Values.ToString("\r\n\r\n")
+                    + "\r\n\r\nTry recompile solution or referenced assembies!";
+                  }
+                  else $"Error: $(e.Message)\r\n\r\n";
+
+                _callback.ShowMessage(errorMag, MessageType.Error);
+            }
+
+          }
           
           // next time Init is called, we won't reload libs
           Options.PersistentLibraries = true;

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/EngineCallbackStub.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/EngineCallbackStub.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/EngineCallbackStub.n	Sat Mar  3 14:43:58 2007
@@ -20,5 +20,10 @@
     {
       _assemblyReferences
     }
+
+    public ShowMessage(message : string, messageType : MessageType) : void
+    {
+      Diagnostics.Trace.WriteLine($"$messageType: $message")
+    }
   }
 }
\ No newline at end of file

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/IEngineCallback.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/IEngineCallback.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/IEngineCallback.n	Sat Mar  3 14:43:58 2007
@@ -7,5 +7,6 @@
   public interface IEngineCallback
   {
     GetAssemblyReferences() : IEnumerable[string];
+    ShowMessage(message : string, messageType : MessageType) : void;
   }
 }
\ No newline at end of file

Added: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/MessageType.n
==============================================================================
--- (empty file)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/TextManagement/MessageType.n	Sat Mar  3 14:43:58 2007
@@ -0,0 +1,10 @@
+namespace Nemerle.Completion2
+{
+	public enum MessageType
+	{
+    | Info
+    | Hint
+    | Warning
+    | Error
+	}
+}

Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerleConstants.cs	Sat Mar  3 14:43:58 2007
@@ -27,6 +27,7 @@
 		public const string LanguageName      = "Nemerle";
 		public const string FileExtension     = ".n";
 		public const string ProjectExtension  = "nproj";
+		public const string ProductName = "Nemerle Visual Studio Integration";
 		public const string ProductDetails    = "Nemerle Visual Studio Integration\r\nVersion 1.0";
 
 		// Attention, GUID LanguageServiceGuidString also has to be changed there:

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Project/ProjectInfo.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Project/ProjectInfo.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Project/ProjectInfo.cs	Sat Mar  3 14:43:58 2007
@@ -132,6 +132,25 @@
 		/// <summary>Watchers for project assemble reference.</summary>
 		List<FileSystemWatcher> _assembleReferenceWatchers = new List<FileSystemWatcher>();
 
+		#region IEngineCallback Members
+
+
+		public void ShowMessage(string message, MessageType messageType)
+		{
+			OLEMSGICON icon = OLEMSGICON.OLEMSGICON_CRITICAL;
+			switch (messageType)
+			{
+				case MessageType.Error:   icon = OLEMSGICON.OLEMSGICON_CRITICAL; break;
+				case MessageType.Hint:    icon = OLEMSGICON.OLEMSGICON_INFO;     break;
+				case MessageType.Info:    icon = OLEMSGICON.OLEMSGICON_INFO;     break;
+				case MessageType.Warning: icon = OLEMSGICON.OLEMSGICON_WARNING;  break;
+			}
+			OLEMSGBUTTON buttons = OLEMSGBUTTON.OLEMSGBUTTON_OK;
+			OLEMSGDEFBUTTON defaultButton = OLEMSGDEFBUTTON.OLEMSGDEFBUTTON_FIRST;
+			VsShellUtilities.ShowMessageBox(ProjectNode.ProjectMgr.Site,
+				message, NemerleConstants.ProductName, icon, buttons, defaultButton);
+		}
+
 		IEnumerable<string> IEngineCallback.GetAssemblyReferences()
 		{
 			ResetAssembleReferenceWatchers();
@@ -157,6 +176,8 @@
 			}
 		}
 
+		#endregion
+
 		private void AddAssembleReferenceWatcher(string filePath)
 		{
 			string path = Path.GetDirectoryName(filePath);



More information about the svn mailing list