From 7967c0f87e6dbbcb78bca07fa8eadba90c44ca36 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Tue, 4 Jul 2023 19:37:17 +0200 Subject: [PATCH] feat: add hurl Signed-off-by: kjuulh --- lua/plugins/treesitter.lua | 28 ++++++++++++++++++++++++++++ queries/hurl/highlights.scm | 17 +++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 lua/plugins/treesitter.lua create mode 100644 queries/hurl/highlights.scm diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..1d1e6f4 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,28 @@ +return { + "nvim-treesitter/nvim-treesitter", + opts = function(_, _) + local parser_config = require "nvim-treesitter.parsers".get_parser_configs() + + + -- https://github.com/nvim-treesitter/nvim-treesitter/tree/master#adding-parsers + parser_config.hurl = { + install_info = { + url = "~/git/github.com/kjuulh/tree-sitter-hurl", + files = { "src/parser.c" }, + branch = "main", + generate_requires_npm = false, + requires_generate_from_grammar = false, + }, + filetype = "hurl", + } + + + -- https://neovim.io/doc/user/lua.html#vim.filetype.add() + -- Search for vim.filetype.add + vim.filetype.add({ + extension = { + hurl = "hurl" + } + }) + end +} diff --git a/queries/hurl/highlights.scm b/queries/hurl/highlights.scm new file mode 100644 index 0000000..837da55 --- /dev/null +++ b/queries/hurl/highlights.scm @@ -0,0 +1,17 @@ +[ + "GET" + "POST" + "PUT" + "DELETE" + "CONNECT" + "OPTIONS" + "TRACE" + "PATCH" + "LINK" + "UNLINK" + "PURGE" + "LOCK" + "UNLOCK" + "PROPFIND" + "VIEW" + ] @keyword