Currently calling monaco::languages::register and presumably any other function in tho module) lead to ReferenceError: register is not defined. AFAICT this is due to languages.rs not telling wasm_bindgen where to find the functions.
I just dabble with this Rust / WebAssembly stuff in hobby projects, so I could be going about this wrong :) But I took what I saw in editor.rs, and
added the module annotation to the top-level wasm_bindgen macro
applied js_namespace = "languages" to every wasm_bindgen macro in languages.rs. There may be better ways of going about this, and in particular I'm unsure if this is needed / useful for methods, but at least this Makes It Work in my use-case.
Currently calling
monaco::languages::register
and presumably any other function in tho module) lead toReferenceError: register is not defined
. AFAICT this is due tolanguages.rs
not tellingwasm_bindgen
where to find the functions.I just dabble with this Rust / WebAssembly stuff in hobby projects, so I could be going about this wrong :) But I took what I saw in
editor.rs
, andmodule
annotation to the top-levelwasm_bindgen
macrojs_namespace = "languages"
to everywasm_bindgen
macro inlanguages.rs
. There may be better ways of going about this, and in particular I'm unsure if this is needed / useful for methods, but at least this Makes It Work in my use-case.