diff --git a/grammar.js b/grammar.js index 21acfa8..885b756 100644 --- a/grammar.js +++ b/grammar.js @@ -1,5 +1,5 @@ /** - * @file Bruno grammar for tree-sitter + * @file Bruno grammar for tree-sitter * @author Kristofers Solo * @license MIT */ @@ -8,13 +8,9 @@ // @ts-check module.exports = grammar({ - name: "bruno", + name: "bruno", - extras: (_) => [/\s+|(\r?\n)/], - - externals: ($) => [$.rawtext], - - rules: { + rules: { source_file: ($) => repeat( field( @@ -129,5 +125,5 @@ module.exports = grammar({ key: (_) => /[^\s\r\n:]+/, value: (_) => /[^\r\n]*/, - }, + }, }); diff --git a/plugin/init.lua b/plugin/init.lua deleted file mode 100644 index 5348140..0000000 --- a/plugin/init.lua +++ /dev/null @@ -1,11 +0,0 @@ -vim.filetype.add({ - extension = { bru = "bruno" }, -}) - -require("nvim-treesitter.parsers").get_parser_configs().bruno = { - install_info = { - url = "https://github.com/kristoferssolo/tree-sitter-bruno", - files = { "src/parser.c", "src/scanner.c" }, - branch = "main", - }, -} diff --git a/queries/bruno/folds.scm b/queries/bruno/folds.scm deleted file mode 100644 index 62ece2a..0000000 --- a/queries/bruno/folds.scm +++ /dev/null @@ -1,3 +0,0 @@ -(dictionary) @fold -(array) @fold -(textblock) @fold diff --git a/queries/bruno/highlights.scm b/queries/bruno/highlights.scm deleted file mode 100644 index dee9177..0000000 --- a/queries/bruno/highlights.scm +++ /dev/null @@ -1,17 +0,0 @@ -(keyword) @keyword -[ - "{" - "}" - "[" - "]" -] @punctuation.bracket -":" @punctuation.delimiter - - -(key) @type -[ - (value) - (array_value) -] @string - -(ERROR) @error diff --git a/queries/bruno/indents.scm b/queries/bruno/indents.scm deleted file mode 100644 index 2bb689e..0000000 --- a/queries/bruno/indents.scm +++ /dev/null @@ -1,10 +0,0 @@ -(dictionary) @indent.begin -(dictionary - "}" @indent.end) -"}" @indent.branch - -(textblock) @indent.begin -(textblock - "}" @indent.end) -"}" @indent.branch - diff --git a/queries/bruno/injections.scm b/queries/bruno/injections.scm deleted file mode 100644 index 6f5d8f7..0000000 --- a/queries/bruno/injections.scm +++ /dev/null @@ -1,59 +0,0 @@ -((body - (keyword) - (textblock - (rawtext) @injection.content)) - (#set! injection.language "json")) - -((bodyjson - (keyword) - (textblock - (rawtext) @injection.content)) - (#set! injection.language "json")) - -((bodyxml - (keyword) - (textblock - (rawtext) @injection.content)) - (#set! injection.language "xml")) - -((bodysparql - (keyword) - (textblock - (rawtext) @injection.content)) - (#set! injection.language "sparql")) - -((bodygraphql - (keyword) - (textblock - (rawtext) @injection.content)) - (#set! injection.language "graphql")) - -((bodygraphqlvars - (keyword) - (textblock - (rawtext) @injection.content)) - (#set! injection.language "json")) - -((scriptres - (keyword) - (textblock - (rawtext) @injection.content)) - (#set! injection.language "javascript")) - -((scriptreq - (keyword) - (textblock - (rawtext) @injection.content)) - (#set! injection.language "javascript")) - -((tests - (keyword) - (textblock - (rawtext) @injection.content)) - (#set! injection.language "javascript")) - -((docs - (keyword) - (textblock - (rawtext) @injection.content)) - (#set! injection.language "markdown")) diff --git a/queries/bruno/tags.scm b/queries/bruno/tags.scm deleted file mode 100644 index ed74453..0000000 --- a/queries/bruno/tags.scm +++ /dev/null @@ -1,12 +0,0 @@ -(source_file) @tag.root - -(meta) @tag.meta -(http) @tag.http -(query) @tag.query -(headers) @tag.headers -(auths) @tag.auths -(bodies) @tag.bodies -(varsandassert) @tag.varsandassert -(script) @tag.script -(tests) @tag.tests -(docs) @tag.docs diff --git a/tree-sitter.json b/tree-sitter.json index 847606f..8ac89d5 100644 --- a/tree-sitter.json +++ b/tree-sitter.json @@ -1,35 +1,22 @@ { + "$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/config.schema.json", "grammars": [ { "name": "bruno", "camelcase": "Bruno", + "title": "Bruno", "scope": "source.bruno", - "path": ".", "file-types": [ "bru" ], "injection-regex": "^bruno$", - "highlights": [ - "queries/bruno/highlights.scm" - ], - "injections": [ - "queries/bruno/injections.scm" - ], - "tags": [ - "queries/bruno/tags.scm" - ], - "folds": [ - "queries/bruno/folds.scm" - ], - "indents": [ - "queries/bruno/folds.scm" - ] + "class-name": "TreeSitterBruno" } ], "metadata": { "version": "0.1.0", "license": "MIT", - "description": " Bruno grammar for tree-sitter", + "description": "Bruno grammar for tree-sitter", "authors": [ { "name": "Kristofers Solo", @@ -37,7 +24,7 @@ } ], "links": { - "repository": "https://github.com/kristoferssolo/tree-sitter-bruno" + "repository": "https://codeberg.org/kristoferssolo/tree-sitter-bruno" } }, "bindings": { @@ -46,6 +33,8 @@ "node": true, "python": true, "rust": true, - "swift": true + "swift": true, + "zig": false } } +