Skip to content

Commit

Permalink
fix: TSInstallSync not found
Browse files Browse the repository at this point in the history
  • Loading branch information
vhyrro committed Mar 24, 2024
1 parent affdd6f commit df6cc22
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lua/neorg/modules/core/integrations/treesitter/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -736,12 +736,13 @@ module.public = {

-- this fixes the problem of installing neorg ts parsers on macOS without resorting to using gcc
local function install_norg_ts()
local install = require("nvim-treesitter.install")

if vim.fn.has("macunix") == 1 then
-- https://github.com/nvim-neorg/tree-sitter-norg/issues/7
-- (we have to force clang to c++11 mode on macOS manually)

local shell = require("nvim-treesitter.shell_command_selectors")
local install = require("nvim-treesitter.install")

-- save the original functions
local select_executable = shell.select_executable
Expand Down Expand Up @@ -771,7 +772,7 @@ local function install_norg_ts()
error(err)
end
else
vim.cmd.TSInstallSync({ args = { "norg" }, bang = true })
install.commands.TSInstallSync["run!"]("norg")
end
end

Expand All @@ -793,7 +794,8 @@ module.on_event = function(event)
utils.notify(string.format([[Unable to auto-install Norg parser: %s]], err), vim.log.levels.WARN)
end

pcall(vim.cmd.TSInstallSync, { args = { "norg_meta" }, bang = true })
local install = require("nvim-treesitter.install")
install.commands.TSInstallSync["run!"]("norg_meta")
end
end

Expand Down

0 comments on commit df6cc22

Please sign in to comment.