mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Compare commits
2 Commits
vmg/treesi
...
vmg/syntax
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
158f7f2bad | ||
|
|
f7835f7119 |
@@ -108,6 +108,11 @@ func isValidGrammar(path string, info os.FileInfo) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Tree-Sitter grammars are not supported
|
||||
if strings.HasPrefix(filepath.Base(path), "tree-sitter-") {
|
||||
return false
|
||||
}
|
||||
|
||||
dir := filepath.Dir(path)
|
||||
ext := filepath.Ext(path)
|
||||
|
||||
@@ -117,7 +122,7 @@ func isValidGrammar(path string, info os.FileInfo) bool {
|
||||
case ".tmlanguage", ".yaml-tmlanguage":
|
||||
return true
|
||||
case ".cson", ".json":
|
||||
return strings.HasSuffix(dir, "/grammars")
|
||||
return strings.HasSuffix(dir, "/grammars") || strings.HasSuffix(dir, "/syntaxes")
|
||||
default:
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user