Add LIB_DIRS and PLUGIN_DIRS (#4829)

* Add LIB_DIRS and PLUGIN_DIRS

* Put plugin dirs behind plugin feature
This commit is contained in:
Jakub Žádník
2022-03-12 22:12:15 +02:00
committed by GitHub
parent 0ff9cc679e
commit c73d8d5f95
3 changed files with 75 additions and 8 deletions

View File

@ -16,6 +16,8 @@ use std::path::Path;
#[cfg(feature = "plugin")]
use std::path::PathBuf;
static PWD_ENV: &str = "PWD";
// Tells whether a decl etc. is visible or not
#[derive(Debug, Clone)]
struct Visibility {
@ -1175,11 +1177,15 @@ impl<'a> StateWorkingSet<'a> {
let pwd = self
.permanent_state
.env_vars
.get("PWD")
.get(PWD_ENV)
.expect("internal error: can't find PWD");
pwd.as_string().expect("internal error: PWD not a string")
}
pub fn get_env(&self, name: &str) -> Option<&Value> {
self.permanent_state.env_vars.get(name)
}
pub fn set_variable_type(&mut self, var_id: VarId, ty: Type) {
let num_permanent_vars = self.permanent_state.num_vars();
if var_id < num_permanent_vars {