latex-lsp / texlab

An implementation of the Language Server Protocol for LaTeX
GNU General Public License v3.0
1.49k stars 51 forks source link

Texlab lsp server exits on unicode letter 1F582 #1130

Closed rommeswi closed 2 months ago

rommeswi commented 3 months ago

Both when I paste 🖂 or use insert-char BACK OF ENVELOPE, the LSP server exits. Deleting the character causes the LSP server again to exit. However, undo after inserting the character leaves the LSP server running.

pfoerster commented 3 months ago

@rommeswi Which client do you use? It tried reproducing it with Visual Studio Code and Neovim without success so far.

rommeswi commented 2 months ago

I use Emacs.

pfoerster commented 2 months ago

@rommeswi This is an issue wihin Emacs, it is sending faulty notifications instead of a single correct one:

{
  "jsonrpc": "2.0",
  "method": "textDocument/didChange",
  "params": {
    "textDocument": { "uri": "...", "version": 1 },
    "contentChanges": [
      {
        "range": {
          "start": { "line": 0, "character": 0 },
          "end": { "line": 0, "character": 0 }
        },
        "rangeLength": 0,
        "text": "🖂"
      }
    ]
  }
}
{
  "jsonrpc": "2.0",
  "method": "textDocument/didChange",
  "params": {
    "textDocument": { "uri": "...", "version": 2 },
    "contentChanges": [
      {
        "range": {
          "start": { "line": 0, "character": 0 },
          "end": { "line": 0, "character": 1 }
        },
        "rangeLength": 1,
        "text": "🖂"
      }
    ]
  }
}
{
  "jsonrpc": "2.0",
  "method": "textDocument/didChange",
  "params": {
    "textDocument": { "uri": "...", "version": 3 },
    "contentChanges": [
      {
        "range": {
          "start": { "line": 0, "character": 0 },
          "end": { "line": 0, "character": 1 }
        },
        "rangeLength": 1,
        "text": "🖂"
      }
    ]
  }
}
rommeswi commented 2 months ago

Thank you, I would have never figured this out! I will report it to the emacs bugtracker.