ray-x / lsp_signature.nvim

LSP signature hint as you type
Apache License 2.0
1.98k stars 53 forks source link

Errors on empty lines for terraform files #299

Open rodhash opened 7 months ago

rodhash commented 7 months ago

Hi

Whenever I add new empty lines on terraform files I start getting this error msg:

lsp_signatur handler RPC[Error] code_name = unknown, code = -32098, message = "testfile.tf: position 1,2 is out of range testfile.tf:

xMonody commented 6 months ago

Hi, were you able to resolve the issue? I received the same error as you.

ray-x commented 6 months ago

what lsp you are using?

xMonody commented 6 months ago

您使用的是什么 LSP?

I'm using the clangd server. When I normally open and add header files, there's no problem. However, all header files will encounter an issue if I delete a header file.

ray-x commented 6 months ago

I do not think the signature will be active when you edit/delete the header file of c++ source code. Could you send the minimum vimrc and also the c++ file to reproduce? Would be helpful if you could send the steps to reproduce and/or a screen recording as well.

xMonody commented 6 months ago

我不认为当您编辑/删除 c++ 源代码的头文件时签名会处于活动状态。你能发送最小的 vimrc 和 c++ 文件来重现吗?如果您也可以发送重现步骤和/或屏幕录制,那将很有帮助。

https://github.com/ray-x/lsp_signature.nvim/assets/76483540/e43917f3-c893-4673-af52-a7a2f38442cc I'm sorry, but my English is not very good. Also, I'm unsure about whether to use MP4 or GIF on GitHub. Could you please advise?

xMonody commented 6 months ago

I do not think the signature will be active when you edit/delete the header file of c++ source code. Could you send the minimum vimrc and also the c++ file to reproduce? Would be helpful if you could send the steps to reproduce and/or a screen recording as well.

This is my minimum configuration.

local cfg = {
    debug = false, -- set to true to enable debug logging
    log_path = vim.fn.stdpath("cache") .. "/lsp_signature.log", -- log dir when debug is on
    verbose = false, -- show debug line number
    bind = true, -- This is mandatory, otherwise border config won't get registered.
    doc_lines = 3, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
    max_height = 12, -- max height of signature floating_window
    max_width = 80, -- max_width of signature floating_window
    noice = false, -- set to true if you using noice to render markdown
    wrap = true, -- allow doc/signature text wrap inside floating_window, useful if your lsp return doc/sig is too long
    floating_window = true, -- show hint in a floating window, set to false for virtual text only mode
    floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note:
    floating_window_off_x = 1, -- adjust float windows x position. 
    floating_window_off_y = 0, -- adjust float windows y position. e.g -2 move window up 2 lines; 2 move down 2 lines
    close_timeout = 4000, -- close floating window after ms when laster parameter is entered
    fix_pos = false,  -- set to true, the floating window will not auto-close until finish all parameters
    hint_enable = true, -- virtual hint enable
    hint_prefix = "",  -- Panda for parameter, NOTE: for the terminal not support emoji, might crash
    hint_scheme = "String",
    hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
    handler_opts = {
        border = "rounded"   -- double, rounded, single, shadow, none, or a table of borders
    },

    always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
    auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil.
    extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
    zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
    padding = '', -- character to pad on left and right of signature can be ' ', or '|'  etc
    transparency = nil, -- disabled by default, allow floating win transparent value 1~100
    shadow_blend = 36, -- if you using shadow as border use this set the opacity
    shadow_guibg = 'Black', -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
    timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency
    toggle_key = nil, -- toggle signature on and off in insert mode,  e.g. toggle_key = '<M-x>'
    select_signature_key = nil, -- cycle to next signature, e.g. '<M-n>' function overloading
    move_cursor_key = nil, -- imap, use nvim_set_current_win to move cursor between current win and floating
}
require'lsp_signature'.setup(cfg) -- no need to specify bufnr if you don't use toggle_key
ray-x commented 6 months ago

最好能提供完整的init.lua 文件 (< 100行)。 您可以参考https://github.com/ray-x/lsp_signature.nvim/blob/master/tests/init_pack.lua 录屏可以用gif格式。

我不认为当您编辑/删除 c++ 源代码的头文件时签名会处于活动状态。你能发送最小的 vimrc 和 c++ 文件来重现吗?如果您也可以发送重现步骤和/或屏幕录制,那将很有帮助。

https://github.com/ray-x/lsp_signature.nvim/assets/76483540/e43917f3-c893-4673-af52-a7a2f38442cc I'm sorry, but my English is not very good. Also, I'm unsure about whether to use MP4 or GIF on GitHub. Could you please advise?

rodhash commented 6 months ago

Hi, were you able to resolve the issue? I received the same error as you.

Sorry delay I got disconnected a little bit during holidays

No solution yet, the issue remains.. I actually disabled the lsp signature to stop this annoying msg that keeps poping up all the time

rodhash commented 6 months ago

I do not think the signature will be active when you edit/delete the header file of c++ source code. Could you send the minimum vimrc and also the c++ file to reproduce? Would be helpful if you could send the steps to reproduce and/or a screen recording as well.

I tried the default config and this issue still happens:

require'lsp_signature'.setup()

I noticed other issues were raised for similar issue, I saw one for python but it seems to work normal on my Python files .. not sure why only terraform is having this issue on my end.

update: I just built a minimal config and this issue is no longer happening .. this is weird, not sure what is causing this.