LuaSnip icon indicating copy to clipboard operation
LuaSnip copied to clipboard

snippet is added at the end of char instead of replace it. #169

Open NateCC0902 opened this issue 1 year ago • 9 comments

When I type so and Enter

Expected: System.out.println(); But got: soSystem.out.println(); (my setup: https://github.com/NateCC0902/nvim/blob/main/after/plugin/lsp.lua)

NateCC0902 avatar Mar 30 '23 06:03 NateCC0902

Mhmm could you show the source of that snippet? Or is it provided by lsp?

L3MON4D3 avatar Mar 30 '23 07:03 L3MON4D3

According :LspInfo

Client: jdtls (id: 2, bufnr: [4]) filetypes: java autostart: true root directory: /Users/natesbiglaptop/IdeaProjects/JavaLeetcode/my-app cmd: jdtls -configuration /Users/natesbiglaptop/.cache/jdtls/config -data /Users/natesbiglaptop/.cache/jdtls/workspace

1 active client(s) not attached to this buffer:

NateCC0902 avatar Mar 30 '23 08:03 NateCC0902

can you replace

        expand = function(args)
            require 'luasnip'.lsp_expand(args.body)
        end

with

        expand = function(args)
           print(args.body)
           require 'luasnip'.lsp_expand(args.body)
       end

and trigger the issue to see what snippet is coming from jdtls? If I remember correctly there was another issue with that lsp server before.

leiserfg avatar Mar 31 '23 08:03 leiserfg

I just did that. and i rodo the situation but there is nothing triggered (printed)?

NateCC0902 avatar Mar 31 '23 09:03 NateCC0902

Could you make a recording of you triggering the bug?

L3MON4D3 avatar Mar 31 '23 10:03 L3MON4D3

Could it be that jdtls is not marking the completion as a snippet?

leiserfg avatar Mar 31 '23 10:03 leiserfg

Mhmm may be it, against that would speak that the text triggering the completion would also be removed for regular completions

L3MON4D3 avatar Mar 31 '23 12:03 L3MON4D3

https://www.youtube.com/watch?v=s_fLpgxDEgs

here is the video.

NateCC0902 avatar Mar 31 '23 13:03 NateCC0902

Doesn't tell me as much as I'd hoped :sweat_smile: Srry, I can't tell at all what's going wrong :/

L3MON4D3 avatar Mar 31 '23 14:03 L3MON4D3