-
Notifications
You must be signed in to change notification settings - Fork 8
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
Can't get the parser to attach and highlight the .astro file #16
Comments
Looks like you've done quite a bit of debugging already :P Alright, let's try to isolate the problem.
|
Did already have the tree-sitter CLI util installed through Mason. Just tried installing it with the official This is my
Sorry for the long output, could certainly uninstall some parsers. |
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(vim.env.LAZY or lazypath)
require('lazy').setup({
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
lazy = false,
opts = {
ensure_installed = {'astro', 'tsx', 'typescript', 'html'},
auto_install = true,
highlight = {
enable = true,
}
}
}
}) Save the above code to |
Ultimately, the problem is inside my config (I have no clue where) but it is outside the treesitter.lua file, and it only happens with Thanks for all the help! |
Wait, I just realised that the example config is actually extremely weird. Why would |
I am currently trying out this plugin and it does not work unless I specifically execute In other LSPs / Treesitter modules, like with I am also going to investigate around this. Thanks again for all the help :) |
I figured out the require('nvim-treesitter.configs').setup({
-- ...
}) Working minimal example: local lazypath = vim.env.LAZY or (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)
require('lazy').setup({
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
}
})
require('nvim-treesitter.configs').setup({
ensure_installed = {'astro', 'tsx', 'typescript', 'html'},
auto_install = true,
highlight = {
enable = true
}
}) |
I did try before using the Sorry for the inconvenience of troubleshooting my own problem. I have seen the |
No problem. Seems like lazy.nvim is the new trendy Neovim plugin, so I'll add a disclaimer to the README. Thanks for being the first one to report it, I guess :P |
Hi @virchau13 @mrs4ndman My TS Config
|
Great work, as I have seen from the tree-sitter issues related to astro and this repo ;)
tsx
,html
andtypescript
).astro
files with a defaultlspconfig
setup.:TSBufEnable
,TSInstall astro
,TSUninstall astro
, the oldparsers.lua
treesitter mod adding theastro = "astro"
line. All other parsers work, and have them installed.OK
for everything.Can provide configuration files (currently hosted at this repo
I am a bit at a dead end, so hope I can find some help
Thanks in advance
The text was updated successfully, but these errors were encountered: