-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nix injection incorrectly highlights elements as strings #49
Comments
Are you sure you're using tree-sitter-nix in both editors? Generally, it would be good to post minimal configurations so that people can reproduce. |
Yes, they're both using treesitter as the syntax highlighter. I can use To reproduce: For helix, you don't need a config. You should be able to reproduce it with the defaults: For neovim, you just need to have 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",
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup {
"folke/tokyonight.nvim",
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup {
ensure_installed = { "nix" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
}
end,
},
}
vim.cmd.colorscheme("tokyonight") For other installation methods: https://github.com/nvim-treesitter/nvim-treesitter/wiki/Installation |
This is because nvim-treesitter highlights Helix doesn't highlight the |
This is how bash is normally highlighted (on helix, with the built-in
tokyonight
theme):And this is how it looks like in an injected nix string block:
A lot of stuff that shouldn't be highlighted as a string, gets highlighted as one.
On the other hand, neovim doesn't seem to have this problem:
Anyone know what's causing this issue?
The text was updated successfully, but these errors were encountered: