mirror of
https://github.com/casey/just.git
synced 2024-11-25 07:06:23 +03:00
Add source information as path of the information
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.
This commit is contained in:
parent
084a2d2de3
commit
516fac504c
@ -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 {
|
||||
@ -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,
|
||||
|
@ -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)]
|
||||
|
1921
tests/json.rs
1921
tests/json.rs
File diff suppressed because it is too large
Load Diff
@ -167,6 +167,11 @@ impl Test {
|
||||
self
|
||||
}
|
||||
|
||||
pub(crate) fn stdout_with_tempdir(mut self, stdout_fn: impl Fn(&TempDir) -> String) -> Self {
|
||||
self.stdout = stdout_fn(&self.tempdir);
|
||||
self
|
||||
}
|
||||
|
||||
pub(crate) fn stdout_regex(mut self, stdout_regex: impl AsRef<str>) -> Self {
|
||||
self.stdout_regex = Some(Regex::new(&format!("^{}$", stdout_regex.as_ref())).unwrap());
|
||||
self
|
||||
|
Loading…
Reference in New Issue
Block a user