Skip to content

Commit

Permalink
add jinja2 parser
Browse files Browse the repository at this point in the history
  • Loading branch information
wrapperup committed Jul 25, 2023
1 parent 3e500c3 commit b0b1868
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
13 changes: 12 additions & 1 deletion lua/wrap/lazy.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ require('lazy').setup({
{ "rebelot/kanagawa.nvim" },
{ "lukas-reineke/indent-blankline.nvim" },

{ 'nmac427/guess-indent.nvim' },
{ 'NMAC427/guess-indent.nvim' },

-- syntax highlighting
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
Expand Down Expand Up @@ -62,6 +62,17 @@ require('lazy').setup({
}
},

{
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"jose-elias-alvarez/null-ls.nvim",
},
config = function()
end,
},

{ "ray-x/lsp_signature.nvim" },

{ "github/copilot.vim" },
Expand Down
31 changes: 29 additions & 2 deletions lua/wrap/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,24 @@ require('guess-indent').setup {}
vim.filetype.add({
extension = {
wgsl = "wgsl",
eta = "vue",
}
})

local parser_confg = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.jinja2 = {
install_info = {
url = "https://github.com/dbt-labs/tree-sitter-jinja2.git",
files = { "src/parser.c" },
branch = "main",
generate_requires_npm = false,
requires_generate_from_grammar = false,
},
filetype = "html",
}

-- syntax highlighting
require("nvim-treesitter.configs").setup({
ensure_installed = { "c", "cpp", "lua", "typescript", "javascript", "astro", "wgsl", "pug", "html", "htmldjango" },
ensure_installed = { "c", "cpp", "lua", "typescript", "javascript", "astro", "wgsl", "pug", "html", "jinja2" },
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
Expand Down Expand Up @@ -62,3 +73,19 @@ lspconfig.rust_analyzer.setup {
}

lsp.setup()

require("mason-null-ls").setup({
ensure_installed = {
-- Opt to list sources here, when available in mason.
},
automatic_installation = false,
handlers = {},
})

local null_ls = require("null-ls")

null_ls.setup({
sources = {
null_ls.builtins.formatting.djhtml,
},
})

0 comments on commit b0b1868

Please sign in to comment.