chore: implemented user_list for lua, js, py

This commit is contained in:
əlemi 2024-09-21 13:18:38 +02:00
parent 2f6557f971
commit db77fce3ab
Signed by: alemi
GPG key ID: A4895B84D311642C
3 changed files with 14 additions and 0 deletions

View file

@ -16,6 +16,11 @@ impl Workspace {
self.filetree(filter, strict) self.filetree(filter, strict)
} }
#[napi(js_name = "user_list")]
pub fn js_user_list(&self) -> Vec<String> {
self.user_list()
}
#[napi(js_name = "cursor")] #[napi(js_name = "cursor")]
pub fn js_cursor(&self) -> CursorController { pub fn js_cursor(&self) -> CursorController {
self.cursor() self.cursor()

View file

@ -41,6 +41,10 @@ impl LuaUserData for CodempWorkspace {
methods.add_method("filetree", |_, this, (filter, strict,):(Option<String>, Option<bool>,)| methods.add_method("filetree", |_, this, (filter, strict,):(Option<String>, Option<bool>,)|
Ok(this.filetree(filter.as_deref(), strict.unwrap_or(false))) Ok(this.filetree(filter.as_deref(), strict.unwrap_or(false)))
); );
methods.add_method("user_list", |_, this, ()|
Ok(this.user_list())
);
} }
fn add_fields<F: LuaUserDataFields<Self>>(fields: &mut F) { fn add_fields<F: LuaUserDataFields<Self>>(fields: &mut F) {

View file

@ -86,4 +86,9 @@ impl Workspace {
fn pyfiletree(&self, filter: Option<&str>, strict: bool) -> Vec<String> { fn pyfiletree(&self, filter: Option<&str>, strict: bool) -> Vec<String> {
self.filetree(filter, strict) self.filetree(filter, strict)
} }
#[pyo3(name = "user_list")]
fn pyuser_list(&self) -> Vec<String> {
self.user_list()
}
} }