aheber / tree-sitter-sfapex

Tree-sitter implementation for Salesforce's Apex, SOQL, and SOSL
MIT License
69 stars 14 forks source link

Syntax highlight not show #14

Closed xixiaofinland closed 1 year ago

xixiaofinland commented 1 year ago

Hi,

Firstly thanks to put the hard work :)!

My treesitter registered apex to java (as below).

Now I attempt to give your repo a shot, but no syntax highlight after all actions.

  1. I have used tree-sitter-cli to generate those parser.c files accordingly
  2. Run :TSInstall against those 3 types, output says apex, soql, sosl all installed successfully

Could you please give me a hint?

-- vim.treesitter.language.register('java', 'apexcode')

local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
parser_config.apex = {
  install_info = {
    url = "~/projects/tree-sitter-sfapex/apex", -- local path or git repo
    files = {"src/parser.c"}, -- note that some parsers also require src/scanner.c or src/scanner.cc
    -- optional entries:
    branch = "main", -- default branch in case of git repo if different from master
    generate_requires_npm = false, -- if stand-alone parser without npm dependencies
    requires_generate_from_grammar = false, -- if folder contains pre-generated src/parser.c
  },
}

parser_config.soql = {
  install_info = {
    url = "~/projects/tree-sitter-sfapex/soql", -- local path or git repo
    files = {"src/parser.c"},
    branch = "main", -- default branch in case of git repo if different from master
    generate_requires_npm = false, -- if stand-alone parser without npm dependencies
    requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c
  }
}

parser_config.sosl = {
  install_info = {
    url = "~/projects/tree-sitter-sfapex/sosl", -- local path or git repo
    files = {"src/parser.c"},
    branch = "main", -- default branch in case of git repo if different from master
    generate_requires_npm = false, -- if stand-alone parser without npm dependencies
    requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c
  }
}

require('nvim-treesitter.configs').setup {
  -- Add languages to be installed here that you want installed for treesitter
  ensure_installed = { 'lua', 'rust', 'vimdoc', 'vim', 'java', 'apex', 'sosl', 'soql' },
 -- more details...
}
xixiaofinland commented 1 year ago

I got it, missed the step to copy queries into the tree-sitter's queries folder