mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-15 16:57:08 +00:00
Merge pull request #579 from ericbn/unused-code
Remove unused code in File#get_source_files
This commit is contained in:
commit
8a711358ee
@ -8,21 +8,16 @@ impl<'a> File<'a> {
|
|||||||
/// For this file, return a vector of alternate file paths that, if any of
|
/// For this file, return a vector of alternate file paths that, if any of
|
||||||
/// them exist, mean that *this* file should be coloured as “compiled”.
|
/// them exist, mean that *this* file should be coloured as “compiled”.
|
||||||
///
|
///
|
||||||
/// The point of this is to highlight compiled files such as `foo.o` when
|
/// The point of this is to highlight compiled files such as `foo.js` when
|
||||||
/// their source file `foo.c` exists in the same directory. It's too
|
/// their source file `foo.coffee` exists in the same directory.
|
||||||
/// dangerous to highlight *all* compiled, so the paths in this vector
|
/// For example, `foo.js` is perfectly valid without `foo.coffee`, so we
|
||||||
/// are checked for existence first: for example, `foo.js` is perfectly
|
/// don't want to always blindly highlight `*.js` as compiled.
|
||||||
/// valid without `foo.coffee`.
|
/// (See also `FileExtensions#is_compiled`)
|
||||||
pub fn get_source_files(&self) -> Vec<PathBuf> {
|
pub fn get_source_files(&self) -> Vec<PathBuf> {
|
||||||
if let Some(ref ext) = self.ext {
|
if let Some(ref ext) = self.ext {
|
||||||
match &ext[..] {
|
match &ext[..] {
|
||||||
"class" => vec![self.path.with_extension("java")], // Java
|
|
||||||
"css" => vec![self.path.with_extension("sass"), self.path.with_extension("less")], // SASS, Less
|
"css" => vec![self.path.with_extension("sass"), self.path.with_extension("less")], // SASS, Less
|
||||||
"elc" => vec![self.path.with_extension("el")], // Emacs Lisp
|
|
||||||
"hi" => vec![self.path.with_extension("hs")], // Haskell
|
|
||||||
"js" => vec![self.path.with_extension("coffee"), self.path.with_extension("ts")], // CoffeeScript, TypeScript
|
"js" => vec![self.path.with_extension("coffee"), self.path.with_extension("ts")], // CoffeeScript, TypeScript
|
||||||
"o" => vec![self.path.with_extension("c"), self.path.with_extension("cpp")], // C, C++
|
|
||||||
"pyc" => vec![self.path.with_extension("py")], // Python
|
|
||||||
|
|
||||||
"aux" | // TeX: auxiliary file
|
"aux" | // TeX: auxiliary file
|
||||||
"bbl" | // BibTeX bibliography file
|
"bbl" | // BibTeX bibliography file
|
||||||
|
Loading…
Reference in New Issue
Block a user