Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mkarimi/system types link #141

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions quasar_site/src/components/MemberSignature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -260,13 +265,37 @@ 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", this.baseUrl)
// console.log(`returning link for ${typeToken} path: ${tokenPath}`, link)
return link;
},
},
Expand Down
2 changes: 1 addition & 1 deletion quasar_site/src/pages/DataType.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

<q-list>
<div v-for="(member, index) in section.items.filter(m => filterByVersion(m))" :key="index">
<q-item dense :clickable="section.type != 'values'" :to="member.path+'#'+ViewModel.signatureAnchorRef(member.signature)"
<q-item dense :clickable="section.type != 'values'" :to="'/'+member.path+'#'+ViewModel.signatureAnchorRef(member.signature)"
:class="memberClass(member)" class="row">
<q-item-label :class="section.type == 'values' ? '' : 'text-accent'" class="col"
style="overflow-wrap: break-word;">
Expand Down
2 changes: 1 addition & 1 deletion src/Parse/JsonBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
71 changes: 36 additions & 35 deletions src/Parse/ParsedMember.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading