[svn] r6573: vs-plugin/trunk: ConsoleTest/Program.cs
Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/...
VladD2
svnadmin at nemerle.org
Wed Aug 23 19:43:52 CEST 2006
Log:
1. Fix hints.
2. Add tests.
Author: VladD2
Date: Wed Aug 23 19:43:42 2006
New Revision: 6573
Modified:
vs-plugin/trunk/ConsoleTest/Program.cs
vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.MakeCompletionList.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.Compiler.Utils/Utils.n
vs-plugin/trunk/Nemerle.VsIntegration/NemerlePackage.cs
Modified: vs-plugin/trunk/ConsoleTest/Program.cs
==============================================================================
--- vs-plugin/trunk/ConsoleTest/Program.cs (original)
+++ vs-plugin/trunk/ConsoleTest/Program.cs Wed Aug 23 19:43:42 2006
@@ -12,6 +12,8 @@
Test1 test = new Test1();
test.Init();
+ test.Complete_generic_type_cast();
+ test.Complete_type_cast();
test.Complete_namespace();
test.Complete_vars_with_same_name();
test.Complete_in_match_variant_3();
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 Wed Aug 23 19:43:42 2006
@@ -67,7 +67,7 @@
completionList.Add(CompletionElem(glyphType :> int, value.Name, "", overloads));
- | Node(name, node) =>
+ | Node(_, node) =>
completionList.Add(CompletionElem(
node.Value.GetGlyphIndex() :> int, name, "", overloads));
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 23 19:43:42 2006
@@ -27,7 +27,7 @@
match (locations)
{
| [] => ()
- | first :: [] => SetLocation (first);
+ | first :: [] => SetLocation(first);
| first :: tail => SetStartEndLocation(first, tail.Last);
}
}
@@ -272,22 +272,32 @@
{
node.EnsureCached();
- def text = match (node.Value) // : NamespaceTree.TypeInfoCache
+ def makeTypeName(ty)
+ {
+ def kind = ty.GetTydecl().GetTypeKindName();
+
+ def name = ty.FullName + (if (ty.Typarms.IsEmpty) ""
+ else "[" + ty.Typarms.Map(p => p.Name).ToString(", ") + "]");
+
+ kind + name
+ }
+
+ def name = node.GetDisplayName();
+
+ match (node.Value) // : NamespaceTree.TypeInfoCache
{
// TypeInfo loaded or parsed
- | Cached(ty) => ty.GetTydecl().GetTypeKindName() + " "
+ | Cached(ty) => makeTypeName(ty)
// ambiguous TypeInfo loaded or parsed
- | CachedAmbiguous(typeInfos) => "ambiguous (" + typeInfos.Map(
- ty => ty.GetTydecl().GetTypeKindName()).ToString(", ") + ") "
+ | CachedAmbiguous(typeInfos) =>
+ "ambiguous:\n\t" + typeInfos.Map(makeTypeName).ToString("\n\t")
- | NamespaceReference => "namespace ";
- | MacroCall => "macro "
+ | NamespaceReference => "namespace " + name;
+ | MacroCall => "macro " + name
// TypeInfo of external type not yet loaded
| NotLoaded | NotLoadedList | No =>
throw ArgumentException("Tish function can't process nade wich value is No!")
}
-
- text + node.GetDisplayName()
}
public static MakeHint(this macroCall : PExpr.MacroCall) : string
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 23 19:43:42 2006
@@ -26,17 +26,6 @@
{
def builder = Text.StringBuilder();
- /*
- match (Overloads[0])
- {
- | Local => ()
- | Node => ()
- | Overload(overload) =>
- _ = builder.AppendLine(XmlDocReader.GetText(overload.Member));
- | Overloads => assert(false);
- }
- */
-
foreach (overload in Overloads)
{
| Local (value) => _ = builder.AppendLine(value.MakeHint());
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 23 19:43:42 2006
@@ -47,7 +47,7 @@
}
- public Method5() : void
+ public Method6() : void
{
def a : A = D();
@@ -57,7 +57,7 @@
}
}
- public Method6() : void
+ public Method7() : void
{
def testVariable = 1;
def TestVariable = 1;
@@ -65,11 +65,23 @@
testVariab/*Complete vars with same name:-0*/
}
- public Method7() : void
+ public Method8() : void
{
System.Console./*Complete namespace:-0*/
}
+ public Method9() : void
+ {
+ def a : A = D();
+ def b = a :> /*Complete type cast:-0*/
+ }
+
+ public Method10() : void
+ {
+ def a : A = D();
+ def b = a : System.Collections.Generic.IL/*Complete generic type cast:-0*/;
+ }
+
xxx : TestVariant2;
}
}
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 23 19:43:42 2006
@@ -14,6 +14,24 @@
public partial class Test1
{
[Test]
+ public Complete_generic_type_cast() : void
+ {
+ def file = FilePath1;
+ def (line, col) = ReadLocation(file, "Complete generic type cast");
+ def result = _project.CompleteWord(file, line, col, GetTextFromFile(file, _, _, _, _));
+ Assert.Greater(result.Length, 0);
+ }
+
+ [Test]
+ public Complete_type_cast() : void
+ {
+ def file = FilePath1;
+ def (line, col) = ReadLocation(file, "Complete type cast");
+ def result = _project.CompleteWord(file, line, col, GetTextFromFile(file, _, _, _, _));
+ Assert.Greater(result.Length, 0);
+ }
+
+ [Test]
public Complete_namespace() : void
{
def file = FilePath1;
Modified: vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n
==============================================================================
--- vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n (original)
+++ vs-plugin/trunk/Nemerle.Compiler.Utils/Utils.n Wed Aug 23 19:43:42 2006
@@ -65,8 +65,8 @@
| Class => "class "
| Alias(ty) => "alias: " + GetTypeKindName(ty.TypeInfo.GetTydecl())
| Interface => "interface "
- | Variant => "variant"
- | VariantOption => "variant option"
+ | Variant => "variant "
+ | VariantOption => "variant option "
| Enum => "enum "
}
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 23 19:43:42 2006
@@ -79,7 +79,7 @@
[ProvideLanguageExtension(typeof(NemerleLanguage), GlobalConstants.FileExtension)]
[Guid(GlobalConstants.PackageGuidString)]
[RegisterSnippets(GlobalConstants.LanguageServiceGuidString,
- false, 131, GlobalConstants.LanguageName,
+ false, 100, GlobalConstants.LanguageName,
@"CodeSnippets\SnippetsIndex.xml",
@"CodeSnippets\Snippets\",
@"CodeSnippets\Snippets\")
More information about the svn
mailing list