mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Improve .cls language detection
This commit is contained in:
@@ -423,8 +423,15 @@ module Linguist
|
||||
def guess_cls_language
|
||||
if lines.grep(/^(%|\\)/).any?
|
||||
Language['TeX']
|
||||
else
|
||||
elsif lines.grep(/^\s*(CLASS|METHOD|INTERFACE).*:\s*/i).any? || lines.grep(/^\s*(USING|DEFINE)/i).any?
|
||||
Language['OpenEdge ABL']
|
||||
elsif lines.grep(/\{$/).any? || lines.grep(/\}$/).any?
|
||||
Language['Apex']
|
||||
elsif lines.grep(/^(\'\*|Attribute|Option|Sub|Private|Protected|Public|Friend)/i).any?
|
||||
Language['Visual Basic']
|
||||
else
|
||||
# The most common language should be the fallback
|
||||
Language['TeX']
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -54,6 +54,12 @@ Ada:
|
||||
- .adb
|
||||
- .ads
|
||||
|
||||
Apex:
|
||||
type: programming
|
||||
lexer: Text only
|
||||
extensions:
|
||||
- .cls
|
||||
|
||||
AppleScript:
|
||||
aliases:
|
||||
- osascript
|
||||
@@ -747,8 +753,6 @@ OpenEdge ABL:
|
||||
- openedge
|
||||
- abl
|
||||
primary_extension: .p
|
||||
overrides:
|
||||
- .cls
|
||||
extensions:
|
||||
- .cls
|
||||
- .p
|
||||
@@ -1053,6 +1057,8 @@ Tcsh:
|
||||
TeX:
|
||||
type: markup
|
||||
primary_extension: .tex
|
||||
overrides:
|
||||
- .cls
|
||||
extensions:
|
||||
- .aux
|
||||
- .cls
|
||||
|
||||
Reference in New Issue
Block a user