Skip to content

Commit

Permalink
chore(ts-context-commentstring): update deprecated configuration
Browse files Browse the repository at this point in the history
References: JoosepAlviste/nvim-ts-context-commentstring#82

Signed-off-by: Fletcher Nichol <fnichol@nichol.ca>
  • Loading branch information
fnichol committed Dec 6, 2023
1 parent 9f8867a commit d74e076
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions home/.config/nvim/lua/my/treesitter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,25 @@ local parsers = {
"zig",
}

local ok, configs = pcall(require, "nvim-treesitter.configs")
if not ok then
vim.notify("[my.treesitter] failed to require 'nvim-treesitter.configs'", vim.log.levels.WARN)
local utils = require("my.utils")
local require_or_warn = utils.require_or_warn

local configs_ok, configs = require_or_warn("nvim-treesitter.configs")
if not configs_ok then
return
end

local tscc_ok, tscc = require_or_warn("ts_context_commentstring")
if not tscc_ok then
return
end

-- Usage: https://github.com/nvim-treesitter/nvim-treesitter
-- Usage: https://github.com/JoosepAlviste/nvim-ts-context-commentstring

tscc.setup({
enable_autocmd = false,
})

configs.setup({
-- One of "all", "maintained" (parsers with maintainers), or a list of languages
Expand All @@ -74,8 +86,4 @@ configs.setup({
additional_vim_regex_highlighting = true,
},
indent = { enable = true, disable = { "yaml" } },
context_commentstring = {
enable = true,
enable_autocmd = false,
},
})

0 comments on commit d74e076

Please sign in to comment.