Use plugin chain code in Vfs

This commit is contained in:
Lucien Greathouse
2017-12-18 01:52:08 -08:00
parent f90c51e923
commit 6ee9a48e20
4 changed files with 40 additions and 10 deletions

View File

@@ -33,6 +33,8 @@ use std::thread;
use core::Config;
use pathext::canonicalish;
use project::{Project, ProjectLoadError};
use plugin::{PluginChain};
use plugins::{DefaultPlugin, ScriptPlugin};
use vfs::Vfs;
use vfs_watch::VfsWatcher;
@@ -148,6 +150,13 @@ fn main() {
}
};
lazy_static! {
static ref PLUGIN_CHAIN: PluginChain = PluginChain::new(vec![
Box::new(ScriptPlugin::new()),
Box::new(DefaultPlugin::new()),
]);
}
let config = Config {
port,
verbose,
@@ -159,7 +168,7 @@ fn main() {
}
let vfs = {
let mut vfs = Vfs::new(config.clone());
let mut vfs = Vfs::new(config.clone(), &PLUGIN_CHAIN);
for (name, project_partition) in &project.partitions {
let path = {