[nemerle] r8431 committed - Working on Integration: Implementing code hints.

0 views
Skip to first unread message

codesite...@google.com

unread,
Nov 8, 2009, 6:56:48 PM11/8/09
to nemer...@googlegroups.com
Revision: 8431
Author: v...@rsdn.ru
Date: Sun Nov 8 15:56:08 2009
Log: Working on Integration: Implementing code hints.
http://code.google.com/p/nemerle/source/detail?r=8431

Modified:
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Hints/HintHelper.n
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Hints/SubHintForType.n

/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n

/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n

/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/BackgroundWorks/Engine-GetGoToInfo.n

/nemerle/trunk/VsIntegration/Nemerle.VisualStudio/GUI/WpfHint/Parsing/HintParser.cs

=======================================
--- /nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Hints/HintHelper.n
Fri Nov 6 11:41:29 2009
+++ /nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Hints/HintHelper.n
Sun Nov 8 15:56:08 2009
@@ -18,32 +18,197 @@
{
module HintHelper
{
+ public HtmlMangling(str : string) : string
+ {
+ str.Replace(">", "&gt;").Replace("<", "&lt;").Replace("&", "&amp;")
+ }
+
+ public MakeTextHintForLocalFunc(header : TFunHeader) : string *
Func[string, string]
+ {
+ def cnv = SubHintForType();
+ def types = header.decl.Type.Fix().FunReturnTypeAndParms().UnSome();
+ def text = MakeFuncHint(cnv, false, header, p => p.Name, types,
null);
+ //def text = $"(function parameter) $(param.name) :
$(cnv.TypeVarToString(param.ty))";
+ ("(local function) " + text, cnv.GetDelayedHintHendler())
+ }
+
+ public MakeTextHintForTParameter(param : TParameter) : string *
Func[string, string]
+ {
+ def cnv = SubHintForType();
+ def text = $"(function parameter) $(param.name) :
$(cnv.TypeVarToString(param.ty))";
+ (text, cnv.GetDelayedHintHendler())
+ }
+
+ public MakeTextHintForLocalValue(value : LocalValue) : string *
Func[string, string]
+ {
+ def cnv = SubHintForType();
+ def text = IO.sprintf("(%s) %s%s",
+ value.GetKindText(),
+ value.Name,
+ match (value.ValKind)
+ {
+ | Function => cnv.TypeVarToString(value.Type)
+ | _ => " : " + cnv.TypeVarToString(value.Type)
+ });
+
+ def definedIn = value.DefinedIn.ToString();
+ def text = if (value.UsedIn.Exists(use => use.ToString() !=
definedIn))
+ $"$text<lb/>defined in $definedIn";
+ else text;
+
+ (text, cnv.GetDelayedHintHendler())
+ }
+
public MakeTextHintForReferenceTExpr(expr : TExpr) : string *
Func[string, string]
{
def makeText(expr : TExpr)
{
- //| TExpr.ConstantObjectRef(_, _o)
- //| TExpr.StaticPropertyRef(_, _o)
- //| TExpr.FieldMember (_, _o)
- //| TExpr.PropertyMember (_, _o)
-
+ | TExpr.StaticPropertyRef(from, prop) =>
MakeTextHintForTExprStaticPropertyRef(from, prop)
+ | TExpr.PropertyMember(obj, prop) =>
MakeTextHintForTExprPropertyMember(obj, prop)
+ | TExpr.StaticRef(MType.Class as from, prop is IProperty, []) =>
MakeTextHintForTExprStaticPropertyRef(from, prop)
| LocalFunRef(decl, tyArgs) as fRef =>
MakeTextHintForTExprLocalFunRef(fRef, decl, tyArgs)
+ | StaticRef(MType.Class as ty, fld is IField, tyArgs2) =>
MakeTextHintForTExprStaticFieldRef(ty, fld, tyArgs2)
+ | ConstantObjectRef(from, fld) =>
MakeTextHintForTExprStaticFieldRef(from, fld, [])
| FieldMember(obj, fld) => MakeTextHintForTExprFieldMember(obj,
fld)
-
- | TExpr.MethodRef(obj, method, typeArgs, notvirtual) =>
- MakeTextHintForTExprMethodRef(expr, obj, method, typeArgs,
notvirtual)
-
- //| TExpr.LocalFunRef (_o, _)
- //| TExpr.StaticRef(MType.Class(ti, tyArgs1), method is IField,
tyArgs2) =>
- //| TExpr.StaticRef(MType.Class(ti, tyArgs1), method is IProperty,
tyArgs2) =>
- | TExpr.StaticRef(MType.Class(ti, tyArgs1), method is IMethod,
tyArgs2) =>
- MakeTextHintForTExprStaticRef(expr, ti, tyArgs1, method, tyArgs2)
-
+ | MethodRef(obj, method, typeArgs, notvirtual) =>
MakeTextHintForTExprMethodRef(expr, obj, method, typeArgs, notvirtual)
+ | StaticRef(MType.Class(ti, tyArgs1), method is IMethod, tyArgs2)
=> MakeTextHintForTExprStaticMethodRef(expr, ti, tyArgs1, method, tyArgs2)
| _ => (expr.ToString(), null)
}

makeText(expr)
}
+
+ MakeTextHintForTExprProperty(
+ cnv : SubHintForType,
+ inferred : bool,
+ declType : MType,
+ prop : IProperty,
+ doc : XmlDocInfo
+ )
+ : string
+ {
+ def old = cnv.ExpandTypeArgs;
+ cnv.ExpandTypeArgs = inferred;
+
+ def (paramsTypes, propTy) =
+ match (declType.TypeOfMember(prop))
+ {
+ | MType.Fun(MType.Tuple(parms), to) when prop.IsIndexer =>
(parms, to)
+ | MType.Fun(param, to) when prop.IsIndexer =>
([param], to)
+ | to => ([],
to)
+ };
+
+ def paramsStr =
+ if (prop.IsIndexer)
+ {
+ def mkName(p : TParameter) : string
+ {
+ def name = p.Name;
+ match (if (doc == null) null else doc.Params.Find((k, _) => k
== name))
+ {
+ | Some((_, txt)) => $"<hint value='name'>$txt</hint>"
+ | _ => name
+ }
+ }
+ def getter = prop.GetGetter();
+ def setter = prop.GetSetter();
+ if (getter != null)
+ "[" + MakeParamsHint(cnv, getter.Header.parms, paramsTypes,
mkName) + "]"
+ else if (setter != null)
+ "[" + MakeParamsHint(cnv, setter.Header.parms.Filter(p =>
p.Name != "value"),
+ paramsTypes, mkName) + "]"
+ else "[?]";
+ }
+ else null;
+
+ def res = MakeAccessModifiers(prop)
+ + cnv.TypeVarToString(declType) + ".<b>" + prop.Name + "</b>" +
paramsStr + " : "
+ + cnv.TypeVarToString(propTy);
+
+ cnv.ExpandTypeArgs = old;
+
+ res
+ }
+
+ MakeGetterAndSetterHint(prop : IProperty) : string
+ {
+ def getter = prop.GetGetter();
+ def setter = prop.GetSetter();
+ if (getter == null && setter == null)
+ null
+ else
+ {
+ "<lb/>"
+ + (if (getter != null) "<keyword><hint value='get'>This property
has getter</hint></keyword> " else null)
+ + (if (setter != null) "<keyword><hint value='set'>This property
has setter</hint></keyword>" else null)
+ }
+ }
+
+ MakeTextHintForTExprStaticPropertyRef(from : MType.Class, prop :
IProperty) : string * Func[string, string]
+ {
+ def cnv = SubHintForType();
+ def doc = GetDoc(prop);
+
+ def res = "Static property: " + MakeTextHintForTExprProperty(cnv,
false, from, prop, doc)
+ + (if (IsGeneric(from))
+ "<lb/>Inferred: " + MakeTextHintForTExprProperty(cnv,
true, from, prop, doc)
+ else null)
+ + MakeGetterAndSetterHint(prop);
+
+ (res + GetDocText(doc), cnv.GetDelayedHintHendler())
+ }
+
+ MakeTextHintForTExprPropertyMember(obj : TExpr, prop : IProperty) :
string * Func[string, string]
+ {
+ def cnv = SubHintForType();
+ def doc = GetDoc(prop);
+ def from = obj.Type.Fix();
+ def res = "Instance property: " + MakeTextHintForTExprProperty(cnv,
false, from, prop, doc)
+ + (if (IsGeneric(from)) "<lb/>Inferred: " +
MakeTextHintForTExprProperty(cnv, true, from, prop, doc)
+ else null)
+ + MakeGetterAndSetterHint(prop);
+
+ (res + GetDocText(prop), cnv.GetDelayedHintHendler())
+ }
+
+
+ MakeTextHintForField(cnv : SubHintForType, inferred : bool, declType :
TyVar, fld : IField, fldType : TyVar) : string
+ {
+ def old = cnv.ExpandTypeArgs;
+ cnv.ExpandTypeArgs = inferred;
+ def res = MakeAccessModifiers(fld)
+ + cnv.TypeVarToString(declType) + ".<b>" + fld.Name + "</b> : "
+ + cnv.TypeVarToString(fldType);
+ cnv.ExpandTypeArgs = old;
+
+ res
+ }
+
+ public MakeTextHintForTExprStaticFieldRef(ty : MType.Class, fld :
IField, tyArgs2 : list[TyVar]) : string * Func[string, string]
+ {
+ def cnv = SubHintForType();
+
+ def fldTy = ty.TypeOfMember(fld);
+ def res = "Static field: " + MakeTextHintForField(cnv, false, ty,
fld, fldTy)
+ + if (IsGeneric(ty)) "<lb/>Inferred: " +
MakeTextHintForField(cnv, true, ty, fld, fldTy)
+ else null;
+
+ def x = if (tyArgs2.IsEmpty) null else $"<bl/> !tyArgs2.IsEmpty
(..$tyArgs2) !!!";
+ (res + GetDocText(fld) + x, cnv.GetDelayedHintHendler())
+ }
+
+ public MakeTextHintForTExprFieldMember(obj : TExpr, fld : IField) :
string * Func[string, string]
+ {
+ def cnv = SubHintForType();
+
+ def objTy = obj.Type.Fix();
+ def fldTy = objTy.TypeOfMember(fld);
+ def res = "Instace field: " + MakeTextHintForField(cnv, false,
obj.Type, fld, fldTy)
+ + if (IsGeneric(objTy)) "<lb/>Inferred: " +
MakeTextHintForField(cnv, true, obj.Type, fld, fldTy)
+ else null;
+
+ (res + GetDocText(fld), cnv.GetDelayedHintHendler())
+ }

MakeTextHintForTExprLocalFunRef(
expr : TExpr.LocalFunRef,
@@ -69,18 +234,10 @@
}

def definedIn = func.DefinedIn.ToString();
-
- mutable text;
-
- foreach (use in func.UsedIn)
- {
- when (use.ToString() != definedIn)
- {
- text += $"<lb/>defined in $definedIn";
- break;
- }
- }
-
+ def text = if (func.UsedIn.Exists(use => use.ToString() !=
definedIn))
+ $"<lb/>defined in $definedIn";
+ else null;
+
def methodInfo = if (tyArgs.IsEmpty) "(local function) " +
methodType()
else "(generic local function) " + methodType()
+ "<lb/> Inferred: " + inferredType();
@@ -97,47 +254,18 @@
NList.FoldLeft2(tyParams, tyArgs, tyMap,
fun(tyParam, tyArg, tyMap){ tyMap[tyParam.Name] = tyArg; tyMap });
}
-
- /*[Flags]
- enum TypeFormat
- {
- | Normal
- | NoExpandTypeArgs
- }*/
-
- public MakeTextForType(ti : TypeInfo, tyArgs : list[TyVar]) : string *
string * string
- {
- def tyMap = MakeTyParamsToTyArgsMap(ti.Typarms, tyArgs, Hashtable());
- def tyToStr(tyParamBame : string)
- {
- tyMap[tyParamBame].ToString()
- }
- def makeStrForType(ti : TypeInfo) : string * string * string * _
- {
- def (prefix1, prefix2, prefix3, usedTyParams) =
- if (ti.DeclaringType != null) makeStrForType(ti.DeclaringType)
- else
- {
- def ns = ti.NamespaceNode.Parent.GetDisplayName();
- (ns, ns, ns, [])
- };
- def tyParmsNames : list[string] = ti.Typarms.Map(_.Name);
- def unusdTyParams =
tyParmsNames.ExcludeLazy(usedTyParams).ToList();
- def newUsedTyParams = usedTyParams + tyParmsNames;
- def name = ti.Name;
- def (str1, str2, str3) =
- if (unusdTyParams.IsEmpty()) (name, name, name)
- else ($<#$name[..$(unusdTyParams; ", "; tyToStr)]#>,
$<#$name[..$unusdTyParams]#>, name);
-
- if (prefix1.IsNullOrEmpty())
- (str1, str2, str3, newUsedTyParams)
- else
- ($"$prefix1.$str1", $"$prefix2.$str2", $"$prefix3.$str3",
newUsedTyParams)
- }
-
- def (str1, str2, str3, _) = makeStrForType(ti);
-
- (str1, str2, str3)
+
+ MakeParamsHint(
+ cnv : Utils.Convert,
+ parms : list[TParameter],
+ parmsTypes : list[TyVar],
+ mkName : TParameter -> string
+ )
+ : string
+ {
+ def argsStrs = parms.Map2Lazy(parmsTypes,
+ (p, t) => $"<pname>$(mkName(p))</pname> <ptype>:
$(cnv.TypeVarToString(t))</ptype>");
+ $"<params>..$argsStrs</params>"
}

MakeFuncHint(
@@ -151,15 +279,14 @@
def (argsTypes, retType) = sign;
def parms = header.parms;
def retTyStr = cnv.TypeVarToString(retType);
- def argsStrs = parms.Map2Lazy(argsTypes,
- (p, t) => $"<pname>$(mkName(p))</pname> <ptype>:
$(cnv.TypeVarToString(t))</ptype>");
+ def argsStrs = MakeParamsHint(cnv, parms, argsTypes, mkName);
_ = doc;
def name = "<b>" + header.Name + "</b>";
//def isCtor = name.Contains(".ctor");
def tyParams = header.typarms;
def methodTyParams = if (inferred || tyParams.IsEmpty) "" else
$<#[..$tyParams]#>;

- $<#$name$methodTyParams(<params>..$argsStrs</params>) : $retTyStr#>
+ $<#$name$methodTyParams($argsStrs) : $retTyStr#>
}

MakeMethodHint(
@@ -205,7 +332,7 @@
$"<keyword>$mods</keyword> "
}

- public MakeTextHintForTExprStaticRef(
+ public MakeTextHintForTExprStaticMethodRef(
expr : TExpr,
ti : TypeInfo,
tyArgs1 : list[TyVar],
@@ -295,17 +422,13 @@
(res, cnv.GetDelayedHintHendler())
}

- public MakeTextHintForTExprFieldMember(obj : TExpr, fld : IField) :
string * Func[string, string]
- {
- def cnv = SubHintForType();
- def doc = GetDoc(fld);
-
- def ty = obj.Type.Fix().TypeOfMember(fld);
- def res = "Instace field: " + cnv.TypeVarToString(obj.Type) + ".<b>"
+ fld.Name + "</b> : "
- + cnv.TypeVarToString(ty)
- + GetDocText(doc);
-
- (res, cnv.GetDelayedHintHendler())
+ IsGeneric(ty : TyVar) : bool
+ {
+ match (ty.Hint)
+ {
+ | Some(MType.Class(_, _ :: _)) => true
+ | _ => false
+ }
}

//private static GetDocText(mtype : MType, location : Location) :
string
@@ -314,6 +437,14 @@

// if (info != null) "\n" + info.GetText() else ""
//}
+
+ private static GetDocText(member : IMember) : string
+ {
+ def info = XmlDocReader.GetInfo(member, member.Location);
+
+ if (info != null) $"<lb/><b><hint
value='Documetnation'>$(info.GetText())</hint></b>"
+ else ""
+ }

private static GetDocText(member : IMember, location : Location) :
string
{
=======================================
---
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Hints/SubHintForType.n
Fri Nov 6 11:41:29 2009
+++
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Hints/SubHintForType.n
Sun Nov 8 15:56:08 2009
@@ -7,7 +7,7 @@

namespace Nemerle.Compiler.Utils
{
- class SubHintForType : Nemerle.Compiler.Utils.Convert
+ class SubHintForType : Utils.Convert
{
public this()
{
@@ -80,7 +80,7 @@
def (kind, ext) =
if (ti.IsDelegate) ("delegate ", makeDelegateExt(ti))
else if (ti.IsModule) ("module ", "")
- else if (ti.IsValueType) ("value type ", "")
+ else if (ti.IsValueType) ("", "")
else match (ti.GetTydecl())
{
| Class with kind = "class "
=======================================
---
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
Mon Sep 21 12:39:23 2009
+++
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/Project.Type.n
Sun Nov 8 15:56:08 2009
@@ -501,7 +501,7 @@
| Some (p) => lookupType(p)
| _ => (Location.Default, null, null)
}
- | _ => (Location.Default, null, null)
+ | _ => (p.Location, null, null)
}

def processAst (tb, ast)
@@ -521,7 +521,7 @@
if (extends.OrderedContains(line, col))
match (extends.Find(t => t.Location.Contains(line, col)))
{
- | Some(p) => lookupType(p)
+ | Some(p) => (p.Location, p, p.TypedObject)
| _ => (Location.Default, null, null)
}
else if (typarms.tyvars.OrderedContains(line, col))
=======================================
---
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n
Fri Nov 6 11:41:29 2009
+++
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Nemerle.Completion2/CodeModel/QuickTipInfo.n
Sun Nov 8 15:56:08 2009
@@ -22,13 +22,17 @@

public IsLocalValue : bool { get; private set; }
public LocalValue : LocalValue { get; private set; }
+
+ public this(text : string, getHintContent : Func[string, string])
+ {
+ Text = text;
+ GetHintContent = getHintContent;
+ }

public this(location : Location, parsed : object, tExpr : TExpr,
_manager : ManagerClass)
{
+ this(HintHelper.MakeTextHintForReferenceTExpr(tExpr));
SetLocation(location);
- def (text, getHintContent) =
HintHelper.MakeTextHintForReferenceTExpr(tExpr);
- Text = text;
- GetHintContent = getHintContent;
Parsed = parsed;
this.TExpr = tExpr;
IsExpr = true;
@@ -36,7 +40,7 @@

public this(prefix : string, names : list[string], locations :
list[Location])
{
- Text = prefix + " " + names.ToString(".");
+ Text = "<keyword>" + prefix + "</keyword> " + names.ToString(".");

match (locations)
{
@@ -54,22 +58,19 @@

public this(location : Location, value : LocalValue)
{
+ this(HintHelper.MakeTextHintForLocalValue(value));
SetLocation(location);
- SetText (value);
-
this.LocalValue = value;
IsLocalValue = true;
}

public this(location : Location, tv : TyVar)
{
+ def cnv = SubHintForType();
+ cnv.ExpandTypeArgs = true;
+ cnv.AddNamespaces = true;
+ this(cnv.TypeVarToString(tv), cnv.GetDelayedHintHendler());
SetLocation(location);
-
- match (tv)
- {
- | mt is MType => SetText(mt);
- | _ => Text = tv.ToString();
- }
}

public this(location : Location, st : StaticTyVar)
@@ -80,21 +81,14 @@

public this(location : Location, fh : Typedtree.TFunHeader)
{
- match (fh.parms)
- {
- | head :: _ => SetStartStartLocation(location, head.Location);
- | [] => SetLocation (location);
- }
-
- Text = sprintf("(%s) %s(", fh.decl.GetKindText(), fh.name);
- Text += fh.parms.Map(p => p.Name + " : " +
p.ty.ToDisplayString()).ToString(", ");
- Text += ") : " + fh.ret_type.ToDisplayString();
+ this(HintHelper.MakeTextHintForLocalFunc(fh));
+ SetLocation(location);
}

public this(location : Location, parm : Typedtree.TParameter)
{
+ this(HintHelper.MakeTextHintForTParameter(parm));
SetLocation(location);
- Text = $"(function parameter) $(parm.name) : $(parm.ty)";
}

public this(location : Location, me : TExpr.MacroEnvelope)
@@ -119,10 +113,10 @@
Location = l1.Combine(l2)
}

- private SetStartStartLocation(l1 : Location, l2 : Location) : void
- {
- Location = l1.FromStart().Combine(l2.FromStart())
- }
+ //private SetStartStartLocation(l1 : Location, l2 : Location) : void
+ //{
+ // Location = l1.FromStart().Combine(l2.FromStart())
+ //}

private GetAttributeText(attrs : NemerleAttributes) : string
{
@@ -287,35 +281,35 @@
Text += GetLocationText(member.Location);
}

- private SetText(value : LocalValue) : void
- {
- Text = value.MakeHint();
- }
-
- private SetText(mtype : MType) : void
- {
- match (mtype)
- {
- | Class(tycon, _) =>
-
- Text = GetAttributeText(tycon.Attributes);
-
- //FIXMY: VladD2: I think, tycon.GetTydecl() can return wrong info
for imported "variant" and "variant option"
- Text += match (tycon.GetTydecl())
- {
- | VariantOption => "variant option"
- | Variant => "variant"
- | Class => if (tycon.Attributes %&&
NemerleAttributes.Struct) "struct" else "class"
- | Alias => "alias"
- | Interface => "interface"
- | Enum => "enum"
- }
-
- Text += " " + tycon.FullName + GetDocText(mtype, tycon.Location) +
GetLocationText(tycon.Location);
-
- | _ => Text += mtype.ToString()
- }
- }
+ //private SetText(value : LocalValue) : void
+ //{
+ // Text = value.MakeHint();
+ //}
+
+ //private SetText(mtype : MType) : void
+ //{
+ // match (mtype)
+ // {
+ // | Class(tycon, _) =>
+
+ // Text = GetAttributeText(tycon.Attributes);
+
+ // //FIXMY: VladD2: I think, tycon.GetTydecl() can return wrong
info for imported "variant" and "variant option"
+ // Text += match (tycon.GetTydecl())
+ // {
+ // | VariantOption => "variant option"
+ // | Variant => "variant"
+ // | Class => if (tycon.Attributes %&&
NemerleAttributes.Struct) "struct" else "class"
+ // | Alias => "alias"
+ // | Interface => "interface"
+ // | Enum => "enum"
+ // }
+
+ // Text += " " + tycon.FullName + GetDocText(mtype, tycon.Location)
+ GetLocationText(tycon.Location);
+
+ // | _ => Text += mtype.ToString()
+ // }
+ //}

// Shared implementation

@@ -344,31 +338,6 @@

kind
}
-
- public static MakeHint(this value : LocalValue) : string
- {
- mutable text = sprintf("(%s) %s%s",
- value.GetKindText(),
- value.Name,
- match (value.ValKind)
- {
- | Function => value.Type.ToMethodDefinitionString()
- | _ => " : " + value.Type.ToDisplayString()
- });
-
- def definedIn = value.DefinedIn.ToString();
-
- foreach (use in value.UsedIn)
- {
- when (use.ToString() != definedIn)
- {
- text += $"\ndefined in $definedIn";
- break;
- }
- }
-
- text
- }

public static MakeHint(this node : NamespaceTree.Node) : string
{
@@ -401,6 +370,31 @@
throw ArgumentException("Tish function can't process nade wich
value is No!")
}
}
+
+ public static MakeHint(this value : LocalValue) : string
+ {
+ mutable text = sprintf("(%s) %s%s",
+ value.GetKindText(),
+ value.Name,
+ match (value.ValKind)
+ {
+ | Function => value.Type.ToMethodDefinitionString()
+ | _ => " : " + value.Type.ToDisplayString()
+ });
+
+ def definedIn = value.DefinedIn.ToString();
+
+ foreach (use in value.UsedIn)
+ {
+ when (use.ToString() != definedIn)
+ {
+ text += $"<lb/>defined in $definedIn";
+ break;
+ }
+ }
+
+ text
+ }

public static MakeHint(this mc : TExpr.MacroEnvelope) : string
{
@@ -411,11 +405,17 @@
(
match (m.Keywords)
{
- | [] => ""
- | _ => $"\n\nKeywords:\n ..$(m.Keywords)"
+ | [] => null
+ | _ => $"<lb/><lb/>Keywords: <keyword>..$(m.Keywords)</keyword>"
+ + "<lb/>Syntax: " +
m.SyntaxExtension()[0].ToStringWhole()
}
)
- + try { $"\n\n$mc"; } catch { _ => "\n\nno informaition" }
+ + try
+ {
+ $"<lb/><b><hint value='After
expend'><code><pre>$(HintHelper.HtmlMangling(mc.expandedPExpr.ToString()))</pre></code></hint></b>"
+ $"<lb/><b><hint value='After expend
(typed)'><code><pre>$(HintHelper.HtmlMangling(mc.expanded.ToString()))</pre></code></hint></b>"
+ }
+ catch { _ => null }
}

_debug[T](o : T) : void
=======================================
---
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/BackgroundWorks/Engine-GetGoToInfo.n
Fri Oct 2 04:19:23 2009
+++
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Nemerle.Completion2/Engine/BackgroundWorks/Engine-GetGoToInfo.n
Sun Nov 8 15:56:08 2009
@@ -31,7 +31,7 @@
public GetGotoInfo(source : ISource, line : int, col : int, kind :
GotoKind) : array[GotoInfo]
{
def request = BeginGetGotoInfo(source, line, col, kind);
- _ = request.AsyncWaitHandle.WaitOne();
+ _ = request.AsyncWaitHandle.WaitOne(10000);
request.GotoInfos
}

=======================================
---
/nemerle/trunk/VsIntegration/Nemerle.VisualStudio/GUI/WpfHint/Parsing/HintParser.cs
Fri Oct 30 10:58:03 2009
+++
/nemerle/trunk/VsIntegration/Nemerle.VisualStudio/GUI/WpfHint/Parsing/HintParser.cs
Sun Nov 8 15:56:08 2009
@@ -20,8 +20,8 @@

static void RemoveWhitespaces(RootToken rt, RangeList list)
{
- var i1 = Clear(rt.StartIndex, rt, list);
- ClearRange(i1, rt.EndIndex, list);
+ //var i1 = Clear(rt.StartIndex, rt, list);
+ //ClearRange(i1, rt.EndIndex, list);
}

static int Clear(int i1, ElementToken root, RangeList list)

Reply all
Reply to author
Forward
0 new messages