Skip to content

neovim-lsp: Weird behavior after inserting non-ascii characters #3494

@pauljunova

Description

@pauljunova

Description

Inputting some non-ascii characters causes the LSP to panic, failing to parse the file correctly and throwing error messages.

Ruby LSP Information

Running ruby-lsp on default config through neovim, using mason-lspconfig.
OS is Fedora 42.

$ ruby-lsp --version
0.23.20
$ nvim --version
NVIM v0.11.1
Build type: RelWithDebInfo
LuaJIT 2.1.1744318430
Run "nvim -V1 -v" for more info
$ ruby --version
ruby 3.4.3 (2025-04-14 revision d0b7e5b6a0) +PRISM [x86_64-linux]

Reproduction steps

  1. Start the Ruby LSP in neovim
  2. Open a Ruby file
  3. Input some string with non-ascii characters (type them one by one, the issue does not immediatly happen on copy-paste, or interact in some other way
  4. The Ruby LSP starts panicking, throwing seemingly random errors and warning (looks like it is misinterpreting or skipping some characters)

Code snippet or error message
By typing the following:

def test
  ["test", "test", "tést"]
end

I get these error messages:

unexpected local variable or method; expected a `,` separator for the array elements
unexpected end-of-input, assuming it is closing the parent top level context        
unexpected end-of-input; expected a `]` to close the array
unexpected end-of-input; expected a `,` separator for the array elements                                     
expected an expression for the array element                                                                 
expected an `end` to close the `def` statement  

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions