@@ -8,21 +8,16 @@ impl<'a> File<'a> {
8
8
/// For this file, return a vector of alternate file paths that, if any of
9
9
/// them exist, mean that *this* file should be coloured as “compiled”.
10
10
///
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`)
16
16
pub fn get_source_files ( & self ) -> Vec < PathBuf > {
17
17
if let Some ( ref ext) = self . ext {
18
18
match & ext[ ..] {
19
- "class" => vec ! [ self . path. with_extension( "java" ) ] , // Java
20
19
"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
23
20
"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
26
21
27
22
"aux" | // TeX: auxiliary file
28
23
"bbl" | // BibTeX bibliography file
0 commit comments