[svn] r7214: vs-plugin/trunk: Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n Nemerle.Compi...

VladD2 svnadmin at nemerle.org
Fri Jan 5 23:05:16 CET 2007


Log:
1. Add wildcard to completion list.
2. Work on completion in method header.

Author: VladD2
Date: Fri Jan  5 23:05:13 2007
New Revision: 7214

Modified:
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.MakeCompletionList.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine.Init.n
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/   (props changed)
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Heavy.Tests/   (props changed)
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectOne/   (props changed)
   vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Tests/Refactoring/TestProjectTwo/   (props changed)
   vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Checker.n	Fri Jan  5 23:05:13 2007
@@ -242,7 +242,6 @@
     {
 #if !DEBUG
       when (_start < Environment.TickCount - 2000)
-        //VladD2: À êàê ýòî âûçâàåòñÿ break âíå òåëà öèêëà? Ìîæåò ýòî ñòàðüå?
         return;
 #endif
 

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.MakeCompletionList.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.MakeCompletionList.n	(original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.MakeCompletionList.n	Fri Jan  5 23:05:13 2007
@@ -86,6 +86,7 @@
       //TODO: Ðåàëèçîâàòü êîìëåéøîí äëÿ ïðîñòðàíñòâ èìåí.
 	    //TODO: Ïîïðàâèòü êîìïëåéøîí äëÿ êîíñòðóêòîðîâ.
 
+      completionList.Add(CompletionElem(GlyphType.Const :> int, "_", "wildcard", null));
       completionList.ToArray()
     }
 

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	Fri Jan  5 23:05:13 2007
@@ -53,15 +53,28 @@
         }
         else
         {
-          // Completin in AutoModule
-          if (member.DeclaringType.FullName	== _autoModule)
+          def header = method.Ast.header;
+          def headerLoc = header.Location + method.BodyLocation.FromStart();
+          if (headerLoc.Contains(line, col))
           {
-            _topKeywords;
+            Trace.WriteLine($"# Completion outside body");
+            def retLoc = header.ret_type.Location + method.BodyLocation.FromStart();
+            if (retLoc.Contains(line, col))
+            {
+              def code = source.GetRegion(retLoc);
+              Trace.WriteLine(code);
+              //header.ret_type.
+              array(0); // completion outside body (try conplete types)
+            }
+            else
+              array(0); // completion outside body (try conplete types)
           }
           else
           {
+            //_topKeywords;
             Trace.WriteLine($"# Completion outside body");
-            array(0); // completion outside body (try conplete types)
+            _topKeywords
+            //array(0); // completion outside body (try conplete types)
           }
         }
       }
@@ -437,7 +450,15 @@
             | None => (null)
             }
           }
-          else (null)
+          else
+          {
+            if (method.Ast.header.Location.Contains(line, col))
+            {
+              (null)
+            }
+            else
+              (null)
+          }
 
         | null => (null)
         | _    => throw System.Exception($"Unknown member type '$member'.");

Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/Engine.Init.n
==============================================================================

Modified: vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs
==============================================================================
--- vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs	(original)
+++ vs-plugin/trunk/Nemerle.VsIntegration/LanguageService/NemerleViewFilter.cs	Fri Jan  5 23:05:13 2007
@@ -39,6 +39,7 @@
 				AstToolWindow tw = (AstToolWindow)source.ProjectInfo.ProjectNode.Package
 					.FindToolWindow(typeof(AstToolWindow), 0, true);
 
+				tw.ShowInfo(source);
 				tw.Activate(line + 1, col + 1);
 			}
 		}



More information about the svn mailing list