Work on supporting both epoch and fuel

This commit is contained in:
Isaac Clayton 2022-07-13 12:41:47 +02:00
parent 10670dba70
commit 8974b0c490
3 changed files with 99 additions and 56 deletions

View file

@ -9,7 +9,10 @@ use std::{any::Any, path::PathBuf, sync::Arc};
use util::ResultExt;
pub async fn new_json(executor: Arc<Background>) -> Result<PluginLspAdapter> {
let plugin = PluginBuilder::new_with_default_ctx(PluginYield::default_epoch())?
let plugin =
PluginBuilder::new_epoch_with_default_ctx(PluginYield::default_epoch(), |future| {
executor.spawn(future).detach()
})?
.host_function_async("command", |command: String| async move {
let mut args = command.split(' ');
let command = args.next().unwrap();