AndCake/micro-plugin-lsp

problem with Zig ls

Closed this issue · 8 comments

the plugin works with Zig language server.
hover, definition lookup, formatting, looking up references, those work fine.
Ctrl-space for completion though throws the error below

Lua API error: main:475: attempt to index a non-table object(nil) with key 'start'
stack traceback:
main:475: in function 'response'
main:295: in main chunk
[G]: ?

completion with pyhon works though

EDIT: in order for plugin to work with ZLS, I had to edit main.lua and add manually 'zig=zls' in both

function startServer(filetype, callback)v
function init()

zls must be in $PATH

Originally posted by @raidenXR in #16 (comment)

@raidenXR, can you provide some minimal (zig code) example with which to reproduce the issue?

https://zigbin.io/9d6771

^ sample of Zig code

@raidenXR I investigated the problem and created a fix for it. Can you confirm if the PR fixed your issue? Thanks!

Same issue remains, it throws the same error as before. On top of that Alt+r creates a new tab. I think that was not the case before.

Just to be sure: did you checkout the branch bug/28-problem-with-zig-ls before testing? I accidentally had merged the PR with master and then reverted the merge again, so the original state is in master again. The changes can be seen (and tested) in the aforementioned branch. Sorry if that was a cause for confusion.

I'll test it again. Besides, there is a slight possibility that's a problem of ZLS, not the lsp-plugin's

Well I got it working on my side, here. I can do auto completions and am even getting signature information and type declarations for the completions, so zls seems to be working fine.

Yes, it works!! Great work, thanks!