nvim-lspconfig icon indicating copy to clipboard operation
nvim-lspconfig copied to clipboard

`^@` inserted where there should presumably be a newline

Open dstein64 opened this issue 3 years ago • 1 comments

Description

^@ is inserted for completions where there should seemingly be a newline and indentation.

This occurs when the completion is the only possible candidate, as shown in the example below, and also when there are multiple completions to select from.

Neovim version

NVIM v0.7.2 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3

Nvim-lspconfig version

dcb7ebb36f0d2aafcc640f520bb1fc8a9cc1f7c8

Operating system and version

Kubuntu 22.04 LTS

Affected language servers

pyright

Steps to reproduce

  1. nvim -nu minimal_init.lua (pyright is already configured)
  2. Load a new empty Python file (e.g., :e file.py)
  3. Enter the following:
class C:
    def __st
  1. While still in insert mode, press <c-x><c-o> for auto completion

Actual behavior

The following shows the full file with the completed text. There is a ^@ string inserted where there should presumably be a newline.

class C:  
    def __str__(self) -> str:^@    pass

Expected behavior

I expected a newline and proper indentation instead of a ^@.

class C:  
    def __str__(self) -> str:
        pass

Minimal config

minimal_init.lua without modifications

LSP log

N/A

dstein64 avatar Jul 24 '22 18:07 dstein64

Isn't this more of a core issue? nvim-lspconfig is just configuration.

justinmk avatar Aug 23 '22 14:08 justinmk

"Isn't this more of a core issue? nvim-lspconfig is just configuration."

I just opened https://github.com/neovim/neovim/issues/20250.

dstein64 avatar Sep 19 '22 15:09 dstein64

It's a multiline snippet completion, which isn't supported in core yet -- you need a completion and snippet plugin for those.

clason avatar Sep 19 '22 15:09 clason