mirror of
https://github.com/godotengine/godot-vscode-plugin.git
synced 2026-01-04 10:09:58 +03:00
Fix VBox and HBox docs not opening (#755)
This commit is contained in:
@@ -128,7 +128,7 @@ export function make_symbol_document(symbol: GodotNativeSymbol): string {
|
||||
const ret_type = make_link(parts[2] || "void", undefined);
|
||||
let args = (parts[1] || "").replace(
|
||||
/\:\s([A-z0-9_]+)(\,\s*)?/g,
|
||||
": <a href=\"\" onclick=\"inspect('$1')\">$1</a>$2",
|
||||
': <a href="" onclick="inspect(\'$1\')">$1</a>$2',
|
||||
);
|
||||
args = args.replace(/\s=\s(.*?)[\,\)]/g, "");
|
||||
return `${ret_type} ${with_class ? `${classlink}.` : ""}${element("a", s.name, {
|
||||
@@ -180,7 +180,7 @@ export function make_symbol_document(symbol: GodotNativeSymbol): string {
|
||||
}
|
||||
const args = (parts[2] || "").replace(
|
||||
/\:\s([A-z0-9_]+)(\,\s*)?/g,
|
||||
": <a href=\"\" onclick=\"inspect('$1')\">$1</a>$2",
|
||||
': <a href="" onclick="inspect(\'$1\')">$1</a>$2',
|
||||
);
|
||||
const title = element(
|
||||
"p",
|
||||
@@ -233,28 +233,30 @@ export function make_symbol_document(symbol: GodotNativeSymbol): string {
|
||||
let propertyies = "";
|
||||
let others = "";
|
||||
|
||||
for (const s of symbol.children as GodotNativeSymbol[]) {
|
||||
const elements = make_symbol_elements(s);
|
||||
switch (s.kind) {
|
||||
case SymbolKind.Property:
|
||||
case SymbolKind.Variable:
|
||||
properties_index += element("li", elements.index);
|
||||
propertyies += element("li", elements.body, { id: s.name });
|
||||
break;
|
||||
case SymbolKind.Constant:
|
||||
constants += element("li", elements.body, { id: s.name });
|
||||
break;
|
||||
case SymbolKind.Event:
|
||||
signals += element("li", elements.body, { id: s.name });
|
||||
break;
|
||||
case SymbolKind.Method:
|
||||
case SymbolKind.Function:
|
||||
methods_index += element("li", elements.index);
|
||||
methods += element("li", elements.body, { id: s.name });
|
||||
break;
|
||||
default:
|
||||
others += element("li", elements.body, { id: s.name });
|
||||
break;
|
||||
if (symbol.children) {
|
||||
for (const s of symbol.children as GodotNativeSymbol[]) {
|
||||
const elements = make_symbol_elements(s);
|
||||
switch (s.kind) {
|
||||
case SymbolKind.Property:
|
||||
case SymbolKind.Variable:
|
||||
properties_index += element("li", elements.index);
|
||||
propertyies += element("li", elements.body, { id: s.name });
|
||||
break;
|
||||
case SymbolKind.Constant:
|
||||
constants += element("li", elements.body, { id: s.name });
|
||||
break;
|
||||
case SymbolKind.Event:
|
||||
signals += element("li", elements.body, { id: s.name });
|
||||
break;
|
||||
case SymbolKind.Method:
|
||||
case SymbolKind.Function:
|
||||
methods_index += element("li", elements.index);
|
||||
methods += element("li", elements.body, { id: s.name });
|
||||
break;
|
||||
default:
|
||||
others += element("li", elements.body, { id: s.name });
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -330,7 +332,7 @@ function format_documentation(bbcode: string, classname: string) {
|
||||
let html = parser.parse(bbcode.trim());
|
||||
|
||||
html = html.replaceAll(/\[\/?codeblocks\](<br\/>)?/g, "");
|
||||
html = html.replaceAll(""", "\"");
|
||||
html = html.replaceAll(""", '"');
|
||||
|
||||
for (const match of html.matchAll(/\[codeblock].*?\[\/codeblock]/gs)) {
|
||||
let block = match[0];
|
||||
|
||||
Reference in New Issue
Block a user