Adds a little logic to main to get other mappings from config

This commit is contained in:
Alex Novak authored and David Peter committed 2020-06-03 19:44:41 +02:00
1 parent 92e93682c6
commit 48b4a6a906
2 files changed
+36 -1

No files matched your search

+4
View File
@@ -59,6 +59,10 @@ impl<'a> SyntaxMapping<'a> {
Ok(())
}
pub fn mappings(&self) -> &Vec<(GlobMatcher, MappingTarget<'a>)> {
&self.mappings
}
pub(crate) fn get_syntax_for(&self, path: impl AsRef<Path>) -> Option<MappingTarget<'a>> {
let candidate = Candidate::new(path.as_ref());
let canddidate_filename = path.as_ref().file_name().map(Candidate::new);