From 8824370a2024d81514b1ce3ebab33dc1a524c812 Mon Sep 17 00:00:00 2001 From: Morteza Karimi Date: Tue, 8 Oct 2024 14:29:30 -0700 Subject: [PATCH 1/3] Fix outgoing links from datatypes --- quasar_site/src/pages/DataType.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quasar_site/src/pages/DataType.vue b/quasar_site/src/pages/DataType.vue index 95f29cf6..6bdf7276 100644 --- a/quasar_site/src/pages/DataType.vue +++ b/quasar_site/src/pages/DataType.vue @@ -104,7 +104,7 @@
- From 36e188500c33c7fbbadc245805288db07d7cdab0 Mon Sep 17 00:00:00 2001 From: Morteza Karimi Date: Tue, 8 Oct 2024 14:49:15 -0700 Subject: [PATCH 2/3] Return correct type if param type is namespaced --- quasar_site/src/components/MemberSignature.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/quasar_site/src/components/MemberSignature.vue b/quasar_site/src/components/MemberSignature.vue index b6b97a01..bf999570 100644 --- a/quasar_site/src/components/MemberSignature.vue +++ b/quasar_site/src/components/MemberSignature.vue @@ -250,7 +250,12 @@ export default { //WWW-2098: try looking for enums which have . separated names in this dictionary type = typeMap[`${this.datatype.name}.${token}`]; if (!type){ - return null; + console.log(`typeFromToken: ${token} type: ${type}`) + //WWW-2523 RhinoCommon docs: Some method argument type links are disabled + type = typeMap[token.split(".").slice(-1)[0]]; + if (!type){ + return null; + } } } return type @@ -266,7 +271,7 @@ export default { link = `https://learn.microsoft.com/en-us/dotnet/api/${cleanType}` } } - console.log("returning link", this.baseUrl) + // console.log(`returning link for ${typeToken} path: ${tokenPath}`, link) return link; }, }, From 138c656ff3bae7408c327816d5612c505847d0bb Mon Sep 17 00:00:00 2001 From: Morteza Karimi Date: Tue, 8 Oct 2024 15:13:00 -0700 Subject: [PATCH 3/3] Use correct system types --- .../src/components/MemberSignature.vue | 32 +++++++-- src/Parse/JsonBuilder.cs | 2 +- src/Parse/ParsedMember.cs | 71 ++++++++++--------- src/Program.cs | 2 +- 4 files changed, 66 insertions(+), 41 deletions(-) diff --git a/quasar_site/src/components/MemberSignature.vue b/quasar_site/src/components/MemberSignature.vue index bf999570..8bec887b 100644 --- a/quasar_site/src/components/MemberSignature.vue +++ b/quasar_site/src/components/MemberSignature.vue @@ -265,10 +265,34 @@ export default { let link = tokenPath ? this.baseUrl + tokenPath : null //Try to get system links if(!link){ - if( typeToken.toLowerCase().startsWith("system")){ - let cleanType = typeToken.split("<")[0]; - cleanType = cleanType.split("[")[0]; - link = `https://learn.microsoft.com/en-us/dotnet/api/${cleanType}` + // if( typeToken.toLowerCase().startsWith("system")){ + // let cleanType = typeToken.split("<")[0]; + // cleanType = cleanType.split("[")[0]; + // link = `https://learn.microsoft.com/en-us/dotnet/api/${cleanType}` + // } + const standardCSharpTypes = { + "int": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types", + "string": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/reference-types#the-string-type", + "bool": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/bool", + "double": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types", + "float": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types", + "decimal": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types", + "char": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/char", + "byte": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types", + "void": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/void", + "object": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/reference-types#the-object-type", + "DateTime": "https://learn.microsoft.com/en-us/dotnet/api/system.datetime", + "uint": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types", + "sbyte": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types", + "short": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types", + "ushort": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types", + "long": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types", + "ulong": "https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/integral-numeric-types", + // Add more standard types as needed + }; + + if (!link && standardCSharpTypes[typeToken]) { + link = standardCSharpTypes[typeToken]; } } // console.log(`returning link for ${typeToken} path: ${tokenPath}`, link) diff --git a/src/Parse/JsonBuilder.cs b/src/Parse/JsonBuilder.cs index 9b524c68..1d9a7ec1 100755 --- a/src/Parse/JsonBuilder.cs +++ b/src/Parse/JsonBuilder.cs @@ -477,7 +477,7 @@ static string MemberAsJsonArray(ParsedMember member, bool asJavascript = true) //sb.Append($" deprecated: '{deprecated}'"); } - if (member.Signature(false).Contains("Plane EquitorialPlane")){ + if (member.Signature(false).Contains("explodeNestedInstances")){ var inspecting = member; } string remarks = member.Remarks(); diff --git a/src/Parse/ParsedMember.cs b/src/Parse/ParsedMember.cs index ee025123..994da8d0 100644 --- a/src/Parse/ParsedMember.cs +++ b/src/Parse/ParsedMember.cs @@ -87,41 +87,42 @@ public string FullTypeName(string shortName) shortName = shortName.Substring(0, shortName.Length - 1); } - switch (shortName) - { - case "int": - return typeof(int).FullName + suffix; - case "bool": - return typeof(bool).FullName + suffix; - case "float": - return typeof(float).FullName + suffix; - case "double": - return typeof(double).FullName + suffix; - case "string": - return typeof(string).FullName + suffix; - case "void": - return typeof(void).FullName + suffix; - case "uint": - return typeof(uint).FullName + suffix; - case "object": - return typeof(object).FullName + suffix; - case "byte": - return typeof(byte).FullName + suffix; - case "sbyte": - return typeof(sbyte).FullName + suffix; - case "short": - return typeof(short).FullName + suffix; - case "ushort": - return typeof(ushort).FullName + suffix; - case "long": - return typeof(long).FullName + suffix; - case "ulong": - return typeof(ulong).FullName + suffix; - case "char": - return typeof(char).FullName + suffix; - default: - return shortName; - } + // switch (shortName) + // { + // case "int": + // return typeof(int).FullName + suffix; + // case "bool": + // return typeof(bool).FullName + suffix; + // case "float": + // return typeof(float).FullName + suffix; + // case "double": + // return typeof(double).FullName + suffix; + // case "string": + // return typeof(string).FullName + suffix; + // case "void": + // return typeof(void).FullName + suffix; + // case "uint": + // return typeof(uint).FullName + suffix; + // case "object": + // return typeof(object).FullName + suffix; + // case "byte": + // return typeof(byte).FullName + suffix; + // case "sbyte": + // return typeof(sbyte).FullName + suffix; + // case "short": + // return typeof(short).FullName + suffix; + // case "ushort": + // return typeof(ushort).FullName + suffix; + // case "long": + // return typeof(long).FullName + suffix; + // case "ulong": + // return typeof(ulong).FullName + suffix; + // case "char": + // return typeof(char).FullName + suffix; + // default: + // return shortName; + // } + return shortName; } if (_usingDirectives!=null) diff --git a/src/Program.cs b/src/Program.cs index 60c1aa9c..c168a668 100644 --- a/src/Program.cs +++ b/src/Program.cs @@ -97,7 +97,7 @@ static void Docify(string projDir, string examplesDir, string outputDir) continue; if (!parsedItem.IsPublic && !parsedItem.IsProtected) continue; - if (parsedItem.Signature(false).Contains("KeyboardHookEvent(int key)")){ + if (parsedItem.Signature(false).Contains("explodeNestedInstances")){ var inspecting = parsedItem; } string className = parsedItem.ClassPath;