nvim: treesitter: Register haskell parser in ftplugin
4468c8b
made PureScript use Haskell for treesitter queries. However,
setting them up globally sometimes seems to result in Haskell files
getting identified as PureScript and triggering a PureScript LSP
server attach. At least that's what the behaviour seems like.
To prevent this, register the usage of Haskell treesitter queries
in ftplugin viz. when PureScript file type is detected.
This commit is contained in:
parent
6f78a23ab3
commit
d3775127f8
2 changed files with 3 additions and 3 deletions
|
@ -12,3 +12,6 @@ vim.api.nvim_create_autocmd({ "BufReadPre", "BufWinEnter" }, {
|
||||||
vim.bo.buflisted = false
|
vim.bo.buflisted = false
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Make PureScript use Haskell parser and queries.
|
||||||
|
vim.treesitter.language.register('haskell', 'purescript')
|
||||||
|
|
|
@ -17,8 +17,5 @@ require'nvim-treesitter.configs'.setup {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Make PureScript use Haskell parser and queries.
|
|
||||||
vim.treesitter.language.register('haskell', 'purescript')
|
|
||||||
|
|
||||||
vim.keymap.set('o', '<Leader>m', ':<C-U>lua require(\'tsht\').nodes()<CR>', { noremap=false, unique=true, silent=true })
|
vim.keymap.set('o', '<Leader>m', ':<C-U>lua require(\'tsht\').nodes()<CR>', { noremap=false, unique=true, silent=true })
|
||||||
vim.keymap.set('x', '<Leader>m', ':lua require(\'tsht\').nodes()<CR>' , { noremap=true , unique=true, silent=true })
|
vim.keymap.set('x', '<Leader>m', ':lua require(\'tsht\').nodes()<CR>' , { noremap=true , unique=true, silent=true })
|
||||||
|
|
Loading…
Reference in a new issue