Skip to content

Commit 8a71135

Browse files
authored
Merge pull request ogham#579 from ericbn/unused-code
Remove unused code in File#get_source_files
2 parents 1f167dd + cb933a6 commit 8a71135

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/info/sources.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,16 @@ impl<'a> File<'a> {
88
/// For this file, return a vector of alternate file paths that, if any of
99
/// them exist, mean that *this* file should be coloured as “compiled”.
1010
///
11-
/// The point of this is to highlight compiled files such as `foo.o` when
12-
/// their source file `foo.c` exists in the same directory. It's too
13-
/// dangerous to highlight *all* compiled, so the paths in this vector
14-
/// are checked for existence first: for example, `foo.js` is perfectly
15-
/// valid without `foo.coffee`.
11+
/// The point of this is to highlight compiled files such as `foo.js` when
12+
/// their source file `foo.coffee` exists in the same directory.
13+
/// For example, `foo.js` is perfectly valid without `foo.coffee`, so we
14+
/// don't want to always blindly highlight `*.js` as compiled.
15+
/// (See also `FileExtensions#is_compiled`)
1616
pub fn get_source_files(&self) -> Vec<PathBuf> {
1717
if let Some(ref ext) = self.ext {
1818
match &ext[..] {
19-
"class" => vec![self.path.with_extension("java")], // Java
2019
"css" => vec![self.path.with_extension("sass"), self.path.with_extension("less")], // SASS, Less
21-
"elc" => vec![self.path.with_extension("el")], // Emacs Lisp
22-
"hi" => vec![self.path.with_extension("hs")], // Haskell
2320
"js" => vec![self.path.with_extension("coffee"), self.path.with_extension("ts")], // CoffeeScript, TypeScript
24-
"o" => vec![self.path.with_extension("c"), self.path.with_extension("cpp")], // C, C++
25-
"pyc" => vec![self.path.with_extension("py")], // Python
2621

2722
"aux" | // TeX: auxiliary file
2823
"bbl" | // BibTeX bibliography file

0 commit comments

Comments
 (0)