[nemerle] r8422 committed - Working on Integration: Implementing code hints. Type hint improved.

1 view
Skip to first unread message

codesite...@google.com

unread,
Nov 3, 2009, 11:43:18 AM11/3/09
to nemer...@googlegroups.com
Revision: 8422
Author: v...@rsdn.ru
Date: Tue Nov 3 08:42:10 2009
Log: Working on Integration: Implementing code hints. Type hint improved.
http://code.google.com/p/nemerle/source/detail?r=8422

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

/nemerle/trunk/VsIntegration/Nemerle.VisualStudio/GUI/WpfHint/HintWindow.xaml.cs

=======================================
---
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Hints/SubHintForType.n
Tue Nov 3 07:48:08 2009
+++
/nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Hints/SubHintForType.n
Tue Nov 3 08:42:10 2009
@@ -28,6 +28,12 @@
{
$"<font color='DarkCyan'><hint value='$name' key='$(GetTypeId(ty))'
/></font>"
}
+
+ public static MakeAccessModifiers(ti : IMember) : string
+ {
+ def mods = ti.Attributes.ToString().ToLower().Replace(",", "");
+ $"<keyword>$mods</keyword> "
+ }

public GetDelayedHintHendler() : Func[string, string]
{
@@ -44,7 +50,7 @@
+ "Inferred: " + TypeVarToString(ty.TypeOfMember(m))
}

- def baseTypesInfo(ti : TypeInfo) : string
+ def baseTypesExt(ti : TypeInfo) : string
{
def implementsInfo(itfs : list[MType.Class]) : string
{
@@ -65,19 +71,20 @@
match (ty)
{
| Class(ti, _args) =>
- if (ti.IsInterface) ("interface ", baseTypesInfo(ti))
- else if (ti.IsDelegate) ("delegate ", makeDelegateExt(ti))
- else if (ti.IsEnum) ("enum ", "")
- else if (ti.IsModule) ("module ", "")
- else if (ti.IsValueType) ("value type ", "")
- else
- {
- def text = "class ";
- def text = if (ti.IsSealed) "sealed " + text else text;
- def text = if (ti.IsAbstract) "abstract " + text else text;
- def text = if (ti.IsObsolete) "obsolete " + text else text;
- (text, baseTypesInfo(ti))
- }
+ def (kind, ext) =
+ if (ti.IsInterface) ("interface ", baseTypesExt(ti))
+ else if (ti.IsDelegate) ("delegate ", makeDelegateExt(ti))
+ else if (ti.IsEnum) ("enum ", "")
+ else if (ti.IsModule) ("module ", "")
+ else if (ti.IsValueType) ("value type ", "")
+ else
+ {
+ def text = "class ";
+ def text = if (ti.IsObsolete) "obsolete " + text else
text;
+ (text, baseTypesExt(ti))
+ };
+
+ ("<keyword>" + MakeAccessModifiers(ti) + kind
+ "</keyword>", ext)

| TyVarRef => ("type parameter ", "")
| Fun => ("function type ", "")
=======================================
--- /nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Utils.n Tue Nov 3
07:48:08 2009
+++ /nemerle/trunk/VsIntegration/Nemerle.Compiler.Utils/Utils.n Tue Nov 3
08:42:10 2009
@@ -754,8 +754,9 @@
def tyShort = cnv.TypeVarToString(declTy);
def tyParams = method.Header.typarms;
def methodTyParams = if (inferred || tyParams.IsEmpty) "" else
$<#[..$tyParams]#>;
-
- $<#$tyShort.$name$methodTyParams(<params>..$argsStrs</params>) :
$retTyStr#>;
+ def mods = SubHintForType.MakeAccessModifiers(method);
+
+
$<#$mods$tyShort.$name$methodTyParams(<params>..$argsStrs</params>) :
$retTyStr#>;
}


=======================================
---
/nemerle/trunk/VsIntegration/Nemerle.VisualStudio/GUI/WpfHint/HintWindow.xaml.cs
Tue Nov 3 07:48:08 2009
+++
/nemerle/trunk/VsIntegration/Nemerle.VisualStudio/GUI/WpfHint/HintWindow.xaml.cs
Tue Nov 3 08:42:10 2009
@@ -65,7 +65,7 @@
Left = 0;
Top = 0;
SizeToContent = SizeToContent.WidthAndHeight;
- Opacity = 0.9;
+ Opacity = 1;

timer.Tick += OnTimerTick;
LayoutUpdated += OnLayoutUpdated;

Reply all
Reply to author
Forward
0 new messages