Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Change default settings for parsers#6751

Unanswered
mrmodolo asked this question inQ&A
Nov 5, 2025· 3 comments· 3 replies
Discussion options

Hi!

How can I change the parser settings that are in the parses.lua file? I've tried several ways, but the values ​​in that file can't be overwritten. Any ideas?

You must be logged in to vote

Replies: 3 comments 3 replies

Comment options

https://github.com/nvim-treesitter/nvim-treesitter/tree/main?tab=readme-ov-file#adding-custom-languages

You must be logged in to vote
2 replies
@mrmodolo
Comment options

https://github.com/nvim-treesitter/nvim-treesitter/tree/main?tab=readme-ov-file#adding-custom-languages

Hi!
I added the entry to the ~/.config/nvim/lua/config/options.lua file, I see that the parser table has been changed but nothing is installed.

vim.api.nvim_create_autocmd("User", {pattern="TSUpdate",callback=function()require("nvim-treesitter.parsers").jsonc= {install_info= {path="/srv/ARCHER/BRRIOLN036503/src/tree-sitter-jsonc",      },    }end,})
@dpetka2001
Comment options

No idea, never done this before. Just prompted you to what the official docs say.

Actually you should see a bit to the bottom of the README about modifying parsers. Apparently, in~/.config/nvim/lua/config/autocmds.lua put this

vim.api.nvim_create_autocmd('User', {pattern='TSUpdate',callback=function()require('nvim-treesitter.parsers').jsonc.install_info.path="/srv/ARCHER/BRRIOLN036503/src/tree-sitter-jsonc"end})
Comment options

The modification is applied to the parser table, but the parser is not compiled; nothing happens when I use theTSInstall jsonc command.
When I list the parses table, I see that the path has been added.

print(vim.inspect(require("nvim-treesitter.parsers")))

  jsonc = {    install_info = {      path = "/srv/ARCHER/BRRIOLN036503/src/tree-sitter-jsonc",      revision = "02b01653c8a1c198ae7287d566efa86a135b30d5",      url = "https://gitlab.com/WhyNotHugo/tree-sitter-jsonc"    },    maintainers = { "@WhyNotHugo" },    requires = { "json" },    tier = 2  },
You must be logged in to vote
1 reply
@dpetka2001
Comment options

There are bothurl andpath. I don't know how nvim-treesitter internals work, but maybe url takes precedence over the path. Try setting url tonil or empty string.

Comment options

It worked!
All I had to do was run the TSUminstall jsonc command first.
Thank you so much! This is all because Cloudflare is blocking cURL from downloading from the original website (gitlab).

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@mrmodolo@dpetka2001

[8]ページ先頭

©2009-2025 Movatter.jp