Closed ocharles closed 3 years ago
Ok, I think I got this working. I needed:
local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.haskell = {
install_info = {
url = "~/work/tree-sitter-haskell", -- local path or git repo
files = {"src/parser.c", "src/scanner.cc"}
},
filetype = "haskell"
}
require'nvim-treesitter.configs'.setup {
highlight = {
enable = true,
-- custom_captures = {
-- -- Highlight the @foo.bar capture group with the "Identifier" highlight group.
-- ["foo.bar"] = "Identifier",
-- },
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
require'nvim-treesitter.install'.compilers = { "clang++" }
What I missed was:
compilers = { "clang++" }
I'll add the nvim config snippet to the readme.
Great idea!
wait, you had to set clang++
? did it not work with clang
?
No, clang
didn't work. I ran into this:
nvim-treesitter[haskell]: Error during compilation
src/scanner.cc:2:10: fatal error: 'vector' file not found
#include <vector>
^~~~~~~~
1 error generated.
This goes away if I use clang++
.
added this as well :+1:
I think I've followed instructions correctly:
tree-sitter generate
using Tree Sitter 0.2TSInstall haskell
which succeeded without an errorNow, when I open a Haskell file, I get:
I'm not really sure what's up at this point. The generated
.so
certainly hastree_sitter_haskell_external_scanner_create
when I lookupstrings haskell.so