Skip to content

Commit

Permalink
Add source information as path of the information
Browse files Browse the repository at this point in the history
Motivation: To add support for module integration in justl which is an
Emacs extension for driving justfiles within Emacs.

This would allow me to easily discover the file locations of different
just modules and allow the ability to individually open justl buffers
for them within the editor.
  • Loading branch information
psibi committed Nov 17, 2024
1 parent 084a2d2 commit 516fac5
Show file tree
Hide file tree
Showing 4 changed files with 1,053 additions and 911 deletions.
3 changes: 2 additions & 1 deletion src/analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ impl<'run, 'src> Analyzer<'run, 'src> {
unstable_features.insert(UnstableFeature::ScriptInterpreterSetting);
}

let source = root.canonicalize().unwrap();
let root = paths.get(root).unwrap();

Ok(Justfile {
Expand All @@ -205,7 +206,7 @@ impl<'run, 'src> Analyzer<'run, 'src> {
name,
recipes,
settings,
source: root.into(),
source,
unexports: self.unexports,
unstable_features,
warnings: self.warnings,
Expand Down
1 change: 0 additions & 1 deletion src/justfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ pub(crate) struct Justfile<'src> {
pub(crate) name: Option<Name<'src>>,
pub(crate) recipes: Table<'src, Rc<Recipe<'src>>>,
pub(crate) settings: Settings<'src>,
#[serde(skip)]
pub(crate) source: PathBuf,
pub(crate) unexports: HashSet<String>,
#[serde(skip)]
Expand Down
Loading

0 comments on commit 516fac5

Please sign in to comment.