[svn] r6534: vs-plugin/trunk: ConsoleTest/Program.cs Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/...

VladD2 svnadmin at nemerle.org
Wed Aug 16 15:55:21 CEST 2006


Log:
Sync with old svn.

Author: VladD2
Date: Wed Aug 16 15:55:08 2006
New Revision: 6534

Modified:
   vs-plugin/trunk/ConsoleTest/Program.cs
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/CompletionElem.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n
   vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs
   vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Resources.Designer.cs
   vs-plugin/trunk/Nemerle.VsIntegration/Resources.resx

Modified: vs-plugin/trunk/ConsoleTest/Program.cs
==============================================================================
--- vs-plugin/trunk/ConsoleTest/Program.cs	(original)
+++ vs-plugin/trunk/ConsoleTest/Program.cs	Wed Aug 16 15:55:08 2006
@@ -12,6 +12,7 @@
 			Test1 test = new Test1();
 			test.Init();
 
+			test.Complete_Complete_aliased_type();
 			test.Complete_GlabalNs_in_NestedNs();
 			test.FindByLocation_Ns1_Ns2_Ns3_ClassInNestenNs();
 			test.FindByLocation_Method_Class2_Method();

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n	Wed Aug 16 15:55:08 2006
@@ -89,9 +89,6 @@
         {
           mutable bodyCode = getText(location.Line, location.Column, location.EndLine, location.EndColumn);
 
-          //when (bodyCode.StartsWith("{")) bodyCode = " " + bodyCode.Substring(1);
-          //when (bodyCode.EndsWith  ("}")) bodyCode = bodyCode.Substring(0, bodyCode.Length - 1) + " ";
-
           // This prevents inlining during the typifying.
           //
           bodyCode += "\n;*/; EERRRROORR";

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n	Wed Aug 16 15:55:08 2006
@@ -176,27 +176,27 @@
                 {
                 | XmlNodeType.Element =>
 
-                  when (xml.Name == "member" &&
-                        xml.MoveToAttribute("name") &&
-                        xml.Value == "T:System.String")
+                  when (xml.Name == "member"
+                    && xml.MoveToAttribute("name")
+                    && xml.Value == "T:System.String")
                   {
                     def getText()
                     {
-                      ret :
+                      if (xml.Read()) 
+                        match (xml.NodeType)
                       {
-                        while (xml.Read()) match (xml.NodeType)
-                        {
-                        | XmlNodeType.Text       => ret(xml.Value)
-                        | XmlNodeType.EndElement => ret("")
-                        | _ => ()
+                        | XmlNodeType.Text       => xml.Value
+                        | XmlNodeType.EndElement => ""
+                        | _                      => getText()
                         }
+                      else
                         ""
                       }
-                    }
 
                     mutable summary = "";
 
-                    while (xml.Read()) match (xml.NodeType)
+                    while (xml.Read())
+                      match (xml.NodeType)
                     {
                     | XmlNodeType.Element    when xml.Name == "summary" => summary = getText()
                     | XmlNodeType.EndElement when xml.Name == "member"  => ret("\n" + summary);

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/CompletionElem.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/CompletionElem.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/CompletionElem.n	Wed Aug 16 15:55:08 2006
@@ -28,16 +28,28 @@
       match (node.Value) // : NamespaceTree.TypeInfoCache
       {
         // TypeInfo loaded or parsed
-        | Cached(ty)                  => _glyphType = GlyphIndexFromTypeDecl(ty.GetTydecl());
+        | Cached(ty)                  =>
+          def typeDecl = ty.GetTydecl();
+          _glyphType = GlyphIndexFromTypeDecl(typeDecl) :> int;
+          _info = GetTypeKindName(typeDecl);
+
         // ambiguous TypeInfo loaded or parsed
-        | CachedAmbiguous(_typeInfos) => _glyphType = GlyphType.Snippet :> int;
+        | CachedAmbiguous(_typeInfos) =>
+          _glyphType = GlyphType.Snippet :> int;
+          _info = "ambiguous ";
+
         // TypeInfo of external type not yet loaded
         | NotLoaded(extType)          => _glyphType = GlyphIndexFromSysType(extType.SystemType);
         | NotLoadedList(_extTypes)    => _glyphType = GlyphType.Snippet :> int;
-        | NamespaceReference          => _glyphType = GlyphType.Namespace :> int;
+        | NamespaceReference          =>
+          _glyphType = GlyphType.Namespace :> int;
+          _info = "namespace ";
+
         | MacroCall                   => _glyphType = GlyphType.Macro :> int;
         | No => throw ArgumentException("Tish function can't process nade wich value is No!")
       }
+
+      _info += node.GetDisplayName();
     }
 
     GlyphIndexFromSysType(sysType : Type) : int
@@ -53,19 +65,24 @@
       result :> int;
     }
 
-    GlyphIndexFromTypeDecl(typeDecl : Typedtree.TypeDeclaration) : int
+    GetTypeKindName(typeDecl : Typedtree.TypeDeclaration) : string
     {
-      def result = match (typeDecl)
+      | Class         => "class "
+      | Alias(ty)     => "alias: " + GetTypeKindName(ty.TypeInfo.GetTydecl())
+      | Interface     => "interface "
+      | Variant       => "variant"
+      | VariantOption => "variant option"
+      | Enum          => "enum "
+    }
+
+    GlyphIndexFromTypeDecl(typeDecl : Typedtree.TypeDeclaration) : GlyphType
       {
         | Class         => GlyphType.Class
-        | Alias         => GlyphType.Class //{ ty : MType; }
+        | Alias(ty)     => GlyphIndexFromTypeDecl(ty.TypeInfo.GetTydecl())
         | Interface     => GlyphType.Interface
         | Variant       => GlyphType.Variant //{ members : list [TypeInfo]; }
         | VariantOption => GlyphType.VariantOption
         | Enum          => GlyphType.Enum
-      };
-
-      result :> int;
     }
 
     public override ToString() : string { _displayName }

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Content/Class1.n	Wed Aug 16 15:55:08 2006
@@ -1,4 +1,5 @@
-using /*using*/System;
+using /*using*/System.Console;
+//using System;
 
 namespace Ns1
 {
@@ -10,7 +11,8 @@
       {
         public Method() : void
         {
-          Sy/*Complete glabal ns:-0*/
+          Sy/*Complete glabal ns:-0*/;
+          sb/*Complete aliased type:-0*/;
         }
       }
     }

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Tests.n	Wed Aug 16 15:55:08 2006
@@ -63,6 +63,16 @@
     }
 
     [Test]
+    public Complete_Complete_aliased_type() : void
+    {
+      def file = FilePath1;
+      def (line, col) = ReadLocation(file, "Complete aliased type");
+      def result = _project.CompleteWord(file, line, col, GetTextFromFile(file, _, _, _, _));
+      Assert.IsNotNull(result, "result is null");
+      Assert.AreEqual(1, result.Length, "Expected 1 elements.");
+    }
+
+    [Test]
     public FindByLocation_Method_Main() : void
     {
       def file = FilePath1;
@@ -121,7 +131,7 @@
       def file = FilePath1;
       def (line, col) = ReadLocation(file, "using");
       def decl = _project.GetActiveDecl(file, line, col);
-      CheckUsing(decl, "System");
+      CheckUsing(decl, "System.Console");
     }
   }
 }

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Engine/ProjectInfo.cs	Wed Aug 16 15:55:08 2006
@@ -28,15 +28,11 @@
 			_engine    = new Engine(new TraceWriter()); // ÷ňîáű ďŕđńĺđ đŕáîňŕë.
 
 			if (location != null)
-			{
 				_projectLocation = location;
-			}
 			else
-			{
 				_projectLocation = Path.GetDirectoryName(fileName);
-			}
 
-			if (_projectLocation.EndsWith("\\") == false)
+			if (!_projectLocation.EndsWith("\\"))
 				_projectLocation += "\\";
 		}
 

Modified: vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs	Wed Aug 16 15:55:08 2006
@@ -60,8 +60,7 @@
 	//] //LOGVIEWID_Code
 	[PackageRegistration(UseManagedResourcesOnly = true)]
 	[ProvideLoadKey("standard", "1.0",
-	 "Visual Studio Integration of " + GlobalConstants.LanguageName 
-		+ " language", "RSDN.ru", 1)
+		"Nemerle VS Integration", "rsdn.ru / nemerle.org", 104)
 	]
 	[ProvideService(typeof(NemerleLanguage), ServiceName = GlobalConstants.LanguageName)]
 	[ProvideService(typeof(INemerleLibraryManager))]

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Resources.Designer.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Resources.Designer.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Resources.Designer.cs	Wed Aug 16 15:55:08 2006
@@ -70,6 +70,15 @@
         }
         
         /// <summary>
+        ///   Looks up a localized string similar to KHJ1HZR1P2EMZKCRZCMAMCZEMPKEPEZJP1CEKQCEHDICAKMARHCTK9KJM8IMARZ3QEZCJ2RQIKEMHZR0MAE1JEQKZAIPCMP2PAE2EZZIMCJ8K9ZJAHI0EKD9MDAPE2HC.
+        /// </summary>
+        internal static string _104 {
+            get {
+                return ResourceManager.GetString("104", resourceCulture);
+            }
+        }
+        
+        /// <summary>
         ///   Looks up a localized string similar to Application.
         /// </summary>
         internal static string Application {

Modified: vs-plugin/trunk/Nemerle.VsIntegration/Resources.resx
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/Resources.resx	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/Resources.resx	Wed Aug 16 15:55:08 2006
@@ -220,4 +220,7 @@
   <data name="OutputFile1" xml:space="preserve">
     <value>Output File</value>
   </data>
+  <data name="104" xml:space="preserve">
+    <value>KHJ1HZR1P2EMZKCRZCMAMCZEMPKEPEZJP1CEKQCEHDICAKMARHCTK9KJM8IMARZ3QEZCJ2RQIKEMHZR0MAE1JEQKZAIPCMP2PAE2EZZIMCJ8K9ZJAHI0EKD9MDAPE2HC</value>
+  </data>
 </root>
\ No newline at end of file



More information about the svn mailing list