mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-28 17:20:22 +00:00
Each strategy takes as candidates the language outputted by the previous strategy if any. This was already the case for the Classifier and Heuristic strategies as these couldn't generate new candidate languages (as opposed to the Modeline, Filename, Shebang, and Extension strategies). In practice, this signifies that if, for example, the Shebang strategy finds two possible languages for a given file (as is currently possible with the perl interpreter), the next strategy, the Extension strategy, will use this information and further reduce the set of possible language. Currently, without this commit, the Extension strategy would discard the results from the previous strategy and start anew, possibly returning a different language from those returned by the Shebang strategy.