diff --git a/luneDocs.json b/luneDocs.json index 3cb9cce..1f80b3e 100644 --- a/luneDocs.json +++ b/luneDocs.json @@ -240,7 +240,7 @@ }, { "documentation": "@roblox/global/net.serve/param/1", - "name": "handler" + "name": "handlerOrConfig" } ], "returns": [] @@ -249,7 +249,27 @@ "documentation": "The port to use for the server" }, "@roblox/global/net.serve/param/1": { - "documentation": "The handler function to use for the server" + "documentation": "The handler function or config to use for the server" + }, + "@roblox/global/net.socket": { + "code_sample": "", + "documentation": "Connects to a web socket at the given URL.\n\nThrows an error if the server at the given URL does not support\nweb sockets, or if a miscellaneous network or I/O error occurs.", + "learn_more_link": "", + "params": [ + { + "documentation": "@roblox/global/net.socket/param/0", + "name": "url" + } + ], + "returns": [ + "@roblox/global/net.socket/return/0" + ] + }, + "@roblox/global/net.socket/param/0": { + "documentation": "The URL to connect to" + }, + "@roblox/global/net.socket/return/0": { + "documentation": "A web socket handle" }, "@roblox/global/process": { "code_sample": "", diff --git a/packages/cli/src/gen/mod.rs b/packages/cli/src/gen/mod.rs index a2154e4..606b672 100644 --- a/packages/cli/src/gen/mod.rs +++ b/packages/cli/src/gen/mod.rs @@ -13,11 +13,19 @@ mod visitor; use self::{doc::DocsFunctionParamLink, visitor::DocumentationVisitor}; fn parse_definitions(contents: &str) -> Result { + // TODO: Properly handle the "declare class" syntax, for now we just skip it + let mut no_declares = contents.to_string(); + while let Some(dec) = no_declares.find("\ndeclare class") { + let end = no_declares.find("\nend").unwrap(); + let before = &no_declares[0..dec]; + let after = &no_declares[end + 4..]; + no_declares = format!("{before}{after}"); + } let (regex, replacement) = ( Regex::new(r#"declare (?P\w+): "#).unwrap(), r#"export type $n = "#, ); - let defs_ast = parse_luau_ast(®ex.replace_all(contents, replacement))?; + let defs_ast = parse_luau_ast(®ex.replace_all(&no_declares, replacement))?; let mut visitor = DocumentationVisitor::new(); visitor.visit_ast(&defs_ast); Ok(visitor)