nvim-treesitter / nvim-treesitter-context

Show code context
MIT License
2.5k stars 201 forks source link

OCaml support doesn't work #458

Closed last-genius closed 4 months ago

last-genius commented 4 months ago

Description

With the default setup, context is present in Lua files, C files and more. OCaml, despite declared support, doesn't work.

OCaml: image

C: image

Neovim version

NVIM v0.10.0 Build type: Release LuaJIT 2.1.1713484068

Expected behavior

The context window showing up in OCaml files

Actual behavior

Context window doesn't show up in OCaml files.

Minimal config

local plugins = {
  ts         = 'https://github.com/nvim-treesitter/nvim-treesitter',
  ts_context = 'https://github.com/nvim-treesitter/nvim-treesitter-context',
  -- ADD ADDITIONAL PLUGINS THAT ARE _NECESSARY_ TO REPRODUCE THE ISSUE
}

for name, url in pairs(plugins) do
  local install_path = '/tmp/nvim/site/'..name
  if vim.fn.isdirectory(install_path) == 0 then
    vim.fn.system { 'git', 'clone', '--depth=1', url, install_path }
  end
  vim.o.runtimepath = install_path..','..vim.o.runtimepath
end

-- ADD INIT.LUA SETTINGS THAT IS _NECESSARY_ FOR REPRODUCING THE ISSUE

Steps to reproduce

  1. nvim --clean -u minimal.lua
  2. Clone https://github.com/mirage/ocaml-ipaddr, for an example OCaml application
  3. nvim lib/ipaddr.ml
  4. Go to line 375, for example. Module should be showing up in the context window above. It isn't
lewis6991 commented 4 months ago

Queries for specific languages is community maintained. If you want it to work, then you'll need to fix it.

lewis6991 commented 4 months ago

Tried repro steps and works for me. Make sure the parser in installed.