Closed cscherrNT closed 4 months ago
None of them seem to provide illuminate with references
One of them must be reporting that it supports textDocument/documentHighlight
which is why it is being used.
You can use filetype_overrides
to override latex files.
Ah, I see it now. Perhaps it would be helpful to add an override to the examples in the documentation? Thank you.
Describe the bug I am currently writing a latex document. I use two language-servers for latex: ltex and texlab. None of them seem to provide illuminate with references. I'd like to use
regex
instead, but changing providers seems not to be possible.My providers are set up like this, which works really well for regular programming:
Therefore, LSP is always priorized, even if regex would be more useful.
To Reproduce Steps to reproduce the behavior (include minimal
init.vim
or.vimrc
):<A-n>
is not possibleOutput from
:IlluminateDebug
Expected behavior Either switch automatically to the next provider if no references are given from the language server, or add the possibility to change providers, so that users can make an autocommand to do so.
Additional context
As requested, here is a minimal `init.lua` that just installs illuminate and sets up texlab and ltex. With this, open a latex document. Illuminate will not have references.
```lua -- Bootstrap lazy.nvim local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not (vim.uv or vim.loop).fs_stat(lazypath) then local lazyrepo = "https://github.com/folke/lazy.nvim.git" local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) if vim.v.shell_error ~= 0 then vim.api.nvim_echo({ { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, { out, "WarningMsg" }, { "\nPress any key to exit..." }, }, true, {}) vim.fn.getchar() os.exit(1) end end vim.opt.rtp:prepend(lazypath) -- Setup lazy.nvim require("lazy").setup({ { { "RRethy/vim-illuminate", lazy = false, event = { "BufReadPost", "BufNewFile" }, opts = { -- providers: provider used to get references in the buffer, ordered by priority providers = { "lsp", -- useless for tex but still used "treesitter", "regex", }, large_file_cutoff = 50000, delay = 200, under_cursor = true, modes_allowlist = { "n", "no", "nt" }, }, }, { { "neovim/nvim-lspconfig", dependencies = { { "williamboman/mason.nvim", config = true }, "williamboman/mason-lspconfig.nvim", "WhoIsSethDaniel/mason-tool-installer.nvim", }, config = function() local servers = { texlab = {}, ltex = { use_spellfile = false, settings = { ltex = { checkFrequency = "save", language = "auto", enabled = { "bibtex", "tex", "latex", "markdown", }, }, }, }, } require("mason").setup() local ensure_installed = vim.tbl_keys(servers or {}) require("mason-tool-installer").setup({ ensure_installed = ensure_installed }) local capabilities = vim.lsp.protocol.make_client_capabilities() require("mason-lspconfig").setup({ handlers = { function(server_name) local server = servers[server_name] or {} server.capabilities = vim.tbl_deep_extend("force", {}, capabilities, server.capabilities or {}) require("lspconfig")[server_name].setup(server) end, }, }) end, }, }, }, }) ```Example
.tex
file