mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Rename grammarByShebang to grammarByFirstLineRegex
A bundle's firstLineRegex value is used for more than just shebang matches such as in the plist bundle.
This commit is contained in:
@@ -28,7 +28,7 @@ class Syntax
|
||||
extension = fs.base(filePath)
|
||||
|
||||
@grammarsByFileType[extension] or
|
||||
@grammarByShebang(filePath) or
|
||||
@grammarByFirstLineRegex(filePath) or
|
||||
@grammarByFileTypeSuffix(filePath) or
|
||||
@grammarsByFileType["txt"]
|
||||
|
||||
@@ -36,7 +36,7 @@ class Syntax
|
||||
for fileType, grammar of @grammarsByFileType
|
||||
return grammar if _.endsWith(filePath, fileType)
|
||||
|
||||
grammarByShebang: (filePath) ->
|
||||
grammarByFirstLineRegex: (filePath) ->
|
||||
try
|
||||
fileContents = fs.read(filePath)
|
||||
catch e
|
||||
|
||||
Reference in New Issue
Block a user