Browse Source

Fix #840 - Cannot click to navigate to a built-in type

pull/844/head
Siegfried Pammer 8 years ago
parent
commit
4bdd7f48b1
  1. 30
      ICSharpCode.Decompiler/Output/TextTokenWriter.cs

30
ICSharpCode.Decompiler/Output/TextTokenWriter.cs

@ -314,9 +314,33 @@ namespace ICSharpCode.Decompiler
public override void WritePrimitiveType(string type) public override void WritePrimitiveType(string type)
{ {
output.Write(type); switch (type) {
if (type == "new") { case "new":
output.Write("()"); output.Write(type);
output.Write("()");
break;
case "bool":
case "byte":
case "sbyte":
case "short":
case "ushort":
case "int":
case "uint":
case "long":
case "ulong":
case "float":
case "double":
case "decimal":
case "char":
case "string":
case "object":
var typeSymbol = (nodeStack.Peek().GetSymbol() as IType)?.GetDefinition();
if (typeSymbol == null) goto default;
output.WriteReference(type, typeSystem.GetCecil(typeSymbol));
break;
default:
output.Write(type);
break;
} }
} }

Loading…
Cancel
Save