[svn] r7112: vs-plugin/trunk: Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GlyphType.n Nemerle.Com...

VladD2 svnadmin at nemerle.org
Sun Dec 17 17:23:16 CET 2006


Log:
Refactoring.

Author: VladD2
Date: Sun Dec 17 17:23:14 2006
New Revision: 7112

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GlyphType.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleDropDownMember.cs

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GlyphType.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GlyphType.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/GlyphType.n	Sun Dec 17 17:23:14 2006
@@ -18,6 +18,7 @@
     | Namespace     = 6 * 15
     | Operator      = 6 * 15
     | Property      = 6 * 17
+    | Struct        = 6 * 18 // not tested!
     | Macro         = 6 * 20
     | Local         = 6 * 23
     | Snippet       = 205

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.n	Sun Dec 17 17:23:14 2006
@@ -16,7 +16,6 @@
 using SCG = System.Collections.Generic;
 using SR  = System.Reflection;
 
-
 namespace Nemerle.Completion2
 {
   public delegate AddHiddenRegion(location : Location, text : string, isExpanded : bool) : void;
@@ -31,10 +30,10 @@
     [Accessor] _errors        : list[CompilerMessage];
 
     public CompleteWord(
-      [NotNull] filePath : string,
+      /*[NotNull]*/ filePath : string,
                 line     : int,
                 col      : int,
-      [NotNull] source   : ISource
+      /*[NotNull]*/ source   : ISource
     )
       : array[CompletionElem]
     {
@@ -335,7 +334,13 @@
 #endif
           method.EnsureCompiled();
 #if !DEBUG
-        } catch { _ => () }
+        }
+        catch
+        {
+          e =>
+            Trace.WriteLine("Exception occur in retrive error messages:");
+            Trace.WriteLine($"Error:$(e.Message)");
+        }
 #endif
         foreach (cm in method.BodyMessages)
           yield cm;

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/ScanLexer.n	Sun Dec 17 17:23:14 2006
@@ -656,8 +656,7 @@
             if (pos >= reader.Length && (tok :> Token.WhiteSpace).value == " ")
               match (_tokenInfo.Token)
               {
-              | Keyword (name) when name == "using"
-              | Operator(name) when name == "|"     => TR.MemberSelect
+              | Keyword ("override") | Keyword ("using") | Operator("|") => TR.MemberSelect
               | _                                   => TR.None
               }
             else

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleDropDownMember.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleDropDownMember.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleDropDownMember.cs	Sun Dec 17 17:23:14 2006
@@ -62,21 +62,23 @@
 
 		public static int GetGlyph(TypeBuilder builder)
 		{
-			int kind = 
-				builder.IsDelegate?       2:
-				builder.IsEnum?           3:
-				builder.IsInterface?      8:
-				builder.IsVariantOption? 22:
-				builder.IsStruct?        18:
-				0;
-
-			int modifier = 
-				builder.IsInternal?  1:
-				builder.IsProtected? 3:
-				builder.IsPrivate?   4:
-				0;
+			GlyphType kind = 
+				builder.IsDelegate?       GlyphType.Delegate:
+				builder.IsEnum?           GlyphType.Enum:
+				builder.IsInterface?      GlyphType.Interface:
+				builder.IsVariantOption?  GlyphType.VariantOption:
+				builder.IsStruct?         GlyphType.Struct:
+				GlyphType.Class;
+
+			GlyphSubtype modifier = 
+				builder.IsInternal && builder.IsProtected? 
+				                     GlyphSubtype.ProtectedInternal:
+				builder.IsInternal?  GlyphSubtype.Internal:
+				builder.IsProtected? GlyphSubtype.Protected:
+				builder.IsPrivate?   GlyphSubtype.Private:
+				GlyphSubtype.Public;
 
-			return kind * 6 + modifier;
+			return (int)kind | (int)modifier;
 		}
 
 		private static DropDownMember CreateMember(IMember member)



More information about the svn mailing list