gleam-lang / tree-sitter-gleam

🌳 A tree-sitter grammar for the Gleam programming language
Apache License 2.0
78 stars 15 forks source link

Neovim: Option 'commentstring' is empty #104

Closed Nequo closed 3 weeks ago

Nequo commented 3 weeks ago

I am trying to use the default neovim binding 'gc' (introduced in https://github.com/neovim/neovim/pull/28176) for commenting a block of code in a gleam file and this does not work as it expects 'commentstring' to be set. According to the PR, this can be set by tree sitter which is why I am opening the issue here. I have tree sitter enabled and this works for other languages without extra configuration.

$ nvim --version
NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1727870382
Run "nvim -V1 -v" for more info

For now, I am setting vim.opt_local.commentstring = '// %s' in after/ftplugin/gleam.lua to get the desired behaviour, but it would be nice if this was done automatically with tree sitter enabled.

lpil commented 3 weeks ago

This repo doesn't have any particular Neovim support so I'm going to close this issue, however if you determine that there is something missing that would help Neovim users then a contribution would be accepted, thank you.