-- Install lazy.nvim automatically
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'https://github.com/folke/lazy.nvim.git',
'--branch=stable', -- latest stable release
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
-- Or some other small value (Vim default is 4000)
vim.opt.updatetime = 100
require('lazy').setup {
'JoosepAlviste/nvim-ts-context-commentstring',
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
config = function()
require('nvim-treesitter.configs').setup {
ensure_installed = { 'vim', 'lua', 'ruby', 'embedded_template', 'html' },
highlight = {
enable = true,
},
}
end,
},
{
'numToStr/Comment.nvim',
config = function()
require('Comment').setup {
pre_hook = function()
return vim.bo.commentstring
end,
}
end,
},
}
Description
Fails to recognize and comment out erb tags, instead it uses HTML comments.
Steps to reproduce
Try to comment out the third line of the following erb file:
<div>
<p>test</p>
<%= test %>
</div>
Expected behavior
<div>
<!-- <p>test</p> -->
<%# test %>
</div>
Actual behavior
<div>
<!-- <p>test</p> -->
<!-- <%= test %> -->
</div>
Additional context
nvim-treesitter uses embedded_template to highlight eruby (erb) files. I'm not sure if this is a nvim-ts-context-commentstring or a tree-sitter-embedded-template issue but would appreciate your insights.
Minimal reproducible full config
Description
Fails to recognize and comment out erb tags, instead it uses HTML comments.
Steps to reproduce
Try to comment out the third line of the following erb file:
Expected behavior
Actual behavior
Additional context
nvim-treesitter
uses embedded_template to highlight eruby (erb) files. I'm not sure if this is anvim-ts-context-commentstring
or atree-sitter-embedded-template
issue but would appreciate your insights.