Updated analyzer to remove the need for .mist/lib
This commit is contained in:
@@ -573,7 +573,7 @@ pub fn from_mist_to_rust(mut path: PathBuf) -> PathBuf {
|
||||
let mut comps: Vec<Component> = path.components().collect();
|
||||
|
||||
if let Some(pos) = comps.iter().rposition(|c| c.as_os_str() == "src") {
|
||||
let replacement = std::path::Path::new(".mist/lsp");
|
||||
let replacement = std::path::Path::new(".mist/src");
|
||||
comps.splice(pos..=pos, replacement.components());
|
||||
comps.iter().collect()
|
||||
} else {
|
||||
@@ -587,8 +587,7 @@ pub fn from_rust_to_mist(mut path: PathBuf) -> PathBuf {
|
||||
|
||||
let comps: Vec<Component> = path.components().collect();
|
||||
|
||||
// pattern we originally inserted: ".mist/lsp"
|
||||
let pattern: Vec<Component> = std::path::Path::new(".mist/lsp").components().collect();
|
||||
let pattern: Vec<Component> = std::path::Path::new(".mist/src").components().collect();
|
||||
|
||||
// find the last occurrence of the pattern
|
||||
if let Some(pos) = comps
|
||||
|
||||
@@ -7,7 +7,7 @@ use mist_parser::{ast::TopLevel, error::ParseError};
|
||||
|
||||
pub fn build(root: &PathBuf) {
|
||||
let src_dir = root.join("src");
|
||||
let out_dir = root.join(".mist/lsp");
|
||||
let out_dir = root.join(".mist/src");
|
||||
|
||||
if let Err(e) = build_dir(root, &src_dir, &src_dir, &out_dir) {
|
||||
eprintln!("Warning: Build directory run aborted safely: {e}");
|
||||
|
||||
Reference in New Issue
Block a user