Closed saadparwaiz1 closed 3 years ago
I also used to have issues with the texlab lsp, however it works for me right now. What versions of nvim, compe, texlab are you on? I have NVIM v0.5.0-dev+1459-g384f9870f
, most recent compe and texlab 2.2.2.
Currently on stable neovim v0.5.0 (stable) and texlab 3.2.0; I'll try downgrading texlab to see if the issue gets fixed.
edit: tried downgrading texlab still doesn't work. Here's a video of what happens:
Could you show the output of :lua Luasnip_current_nodes[vim.api.nvim_get_current_buf()].parent:dump()
directly after expanding?
I haven't seen anything like that before, but maybe the extmarks get messed up in some spectacular way
Another possibility could be some lsp-weirdness (and maybe compe?). My texlab
-config:
nvim_lsp.texlab.setup{
cmd = { "texlab" },
filetypes = { "tex", "bib" },
settings = {
bibtex = {
formatting = {
lineLength = 120
}
},
latex = {
build = {
args = { "-pdf", "-interaction=nonstopmode", "-synctex=1", "%f" },
executable = "latexmk",
onSave = true,
onChange = true
},
forwardSearch = {
args = {},
onSave = false
},
lint = {
onChange = false,
onSave = true
}
}
},
on_attach = lsp_attach,
capabilities = capabilities
}
maybe try setting it to the same?
Here's my lspconfig which is pretty similar to yours:
local lspconfig = require('lspconfig')
local util = require('s.util')
lspconfig.texlab.setup {
on_attach = util.lsp.on_attach,
capabilities = util.lsp.capabilities,
texlab = {
latexFormatter = 'latexindent',
latexindent = {
['local'] = nil,
modifyLineBreaks = false;
}
},
settings = {
latex = {
forwardSearch = {
args = {"%l", "%p", "%f"},
executable = "/Applications/Skim.app/Contents/SharedSupport/displayline",
onSave = false,
},
build = {
args = {
"-pdf",
"-interaction=nonstopmode",
"-synctex=1",
"-shell-escape",
"-pvc",
"%f"
},
executable = "latexmk";
onSave = false;
},
}
}
}
Here's the output for
:lua Luasnip_current_nodes[vim.api.nvim_get_current_buf()].parent:dump()
Extmarks look fine, maybe the latex-formatter
messes something up?
Try :lua ls.snippets = {all = {ls.parser.parse_snippet({trig = 'beg'}, "\\begin{$1}\n\t$0\n\\end{$1}")}}
and then expand that using beg
. That should tell us whether it's the formatter or something else.
The above snippet works fine I also tried disabling the formatter and the issue still persists. Thank you so much for helping out with this issue!
Yeah, of course. If you do figure out what went wrong, please update here :D
will do!
The issues doesn't seem to occur with snippets.nvim; Is there any way I can test this without compe? I just want to rule out it's not compe causing the issue. Thanks again for a great plugin and all the help!
Apart from just parsing and expanding the snippet manually, no :/
Nevermind that, I think it's possible to expand lsp-snippets using omnifunc, I think I saw a PR on the neovim-github, maybe check that out.
Ah thanks will try it out. Thank you so much!
This issue is fixed in latest master now!
Hah, nice!
I'm not sure if this is an issue with the texlab language server or LuaSnip. Let me know and I'll close this issue and create one on their repo.
Here's the v:completed_item dictionary if that might be helpful