Compare commits

...

2 Commits

Author SHA1 Message Date
Vicent Marti
158f7f2bad compiler: Allow loading grammars from syntaxes folder 2018-01-30 12:22:32 +01:00
Vicent Martí
f7835f7119 compiler: Do not load TreeSitter grammars (#4013) 2018-01-29 18:14:14 +01:00

View File

@@ -108,6 +108,11 @@ func isValidGrammar(path string, info os.FileInfo) bool {
return false return false
} }
// Tree-Sitter grammars are not supported
if strings.HasPrefix(filepath.Base(path), "tree-sitter-") {
return false
}
dir := filepath.Dir(path) dir := filepath.Dir(path)
ext := filepath.Ext(path) ext := filepath.Ext(path)
@@ -117,7 +122,7 @@ func isValidGrammar(path string, info os.FileInfo) bool {
case ".tmlanguage", ".yaml-tmlanguage": case ".tmlanguage", ".yaml-tmlanguage":
return true return true
case ".cson", ".json": case ".cson", ".json":
return strings.HasSuffix(dir, "/grammars") return strings.HasSuffix(dir, "/grammars") || strings.HasSuffix(dir, "/syntaxes")
default: default:
return false return false
} }