Skip to content

Commit

Permalink
Rename all tree-sitter-2 values to modern-tree-sitter
Browse files Browse the repository at this point in the history
Any file paths with `tree-sitter-2` in them can be renamed later.
  • Loading branch information
savetheclocktower committed Apr 7, 2023
1 parent b4fcfee commit 3655610
Show file tree
Hide file tree
Showing 23 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion packages/language-c/grammars/modern-tree-sitter-c.cson
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'C'
scopeName: 'source.c'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-c'

injectionRegex: '^(c|C)$'
Expand Down
2 changes: 1 addition & 1 deletion packages/language-c/grammars/modern-tree-sitter-cpp.cson
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'C++'
scopeName: 'source.cpp'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-cpp'

injectionRegex: '^(cpp|CPP|cc|CC)$'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'name': 'Clojure'
'scopeName': 'source.clojure'
'type': 'tree-sitter-2'
'type': 'modern-tree-sitter'
'fileTypes': [
'boot'
'clj'
Expand Down
2 changes: 1 addition & 1 deletion packages/language-css/grammars/modern-tree-sitter-css.cson
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'CSS'
scopeName: 'source.css'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-css'

fileTypes: [
Expand Down
2 changes: 1 addition & 1 deletion packages/language-go/grammars/modern-tree-sitter-go.cson
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Go'
scopeName: 'source.go'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-go'

fileTypes: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'EJS'
scopeName: 'text.html.ejs'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-embedded-template'

fileTypes: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'ERB'
scopeName: 'text.html.erb'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-embedded-template'

fileTypes: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'HTML'
scopeName: 'text.html.basic'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-html'

injectionRegex: '(HTML|html|Html)$'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# name: 'Hyperlink'
scopeName: 'text.hyperlink'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-hyperlink'

injectionRegex: 'hyperlink'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Java'
scopeName: 'source.java'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-java'

fileTypes: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'JavaScript'
scopeName: 'source.js'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-javascript'

injectionRegex: '^(js|javascript)$'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'JSDoc'
scopeName: 'source.jsdoc'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-jsdoc'

injectionRegex: '^jsdoc$'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'JavaScript RegExp'
scopeName: 'source.regexp.js'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-regex'

injectionRegex: '^(js-regex)$'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'JSON'
scopeName: 'source.json'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-json'

injectionRegex: "^(json|JSON)$"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Python'
scopeName: 'source.python'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-python'

injectionRegex: '^(py|PY|python|PYTHON)$'
Expand Down
2 changes: 1 addition & 1 deletion packages/language-ruby/grammars/tree-sitter-2-regex.cson
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
scopeName: 'source.regexp'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-regex'

# TODO: Decide whether to have one regex grammar that's shared among grammars
Expand Down
2 changes: 1 addition & 1 deletion packages/language-ruby/grammars/tree-sitter-2-ruby.cson
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Ruby'
scopeName: 'source.ruby'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-ruby'

injectionRegex: 'rb|ruby|RB|RUBY'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Rust'
scopeName: 'source.rust'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-rust'

injectionRegex: '^(rust|RUST)$'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'Shell Script'
scopeName: 'source.shell'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-bash'

fileTypes: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# name: 'TODO'
scopeName: 'text.todo'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-todo'

injectionRegex: '^(todo|TODO)$'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'TypeScript (React)'
scopeName: 'source.tsx'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-typescript/tsx'

fileTypes: ['tsx']
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 'TypeScript'
scopeName: 'source.ts'
type: 'tree-sitter-2'
type: 'modern-tree-sitter'
parser: 'tree-sitter-typescript/typescript'

fileTypes: ['ts']
Expand Down
4 changes: 2 additions & 2 deletions src/grammar-registry.js
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,10 @@ module.exports = class GrammarRegistry {
grammarPath,
CSON.readFileSync(grammarPath) || {}
);
}
}

createGrammar(grammarPath, params) {
if (params.type === 'tree-sitter-2') {
if (params.type === 'modern-tree-sitter') {
return new WASMTreeSitterGrammar(this, grammarPath, params)
} else if (params.type === 'tree-sitter') {
return new TreeSitterGrammar(this, grammarPath, params);
Expand Down

0 comments on commit 3655610

Please sign in to comment.