You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When pasting multiple lines (more than 2), erlang_ls server fails to process the request and as a result, the editor and the server end up out of sync.
To Reproduce
Emacs configured with Eglot as lsp client, erlang_ls.config configured with incremental_sync=true, paste a block of code with more than 2 lines.
I captured a failing request and narrowed the call so the problem can be replicated with: els_text:apply_edits(<<"-module(rgoto_v1_http).\n-export([ get/2]).\n\nget([<<\"account\">>] = _Path, Req) ->\n ct:pal(\"wooooooooooo\"),\n {200, #{<<\"content-type\">> => <<\"text/plain\">>}, <<\"REST Hello World as text!\">>, Req};\n\nget([Value], Req) ->\n {200, #{<<\"content-type\">> => <<\"text/plain\">>}, <<\"REST Hello \",Value/binary,\" as text!\">>, Req}.\n">>, [{#{from => {6,0},to => {6,0}}, "get([<<\"ACCOUNT\">>] = _Path, Req) ->\n ct:pal(\"WOOOOOOOOOOO\"),\n {200, #{<<\"CONTENT-TYPE\">> => <<\"text/plain\">>}, <<\"REST HELLO WORLD AS TEXT!\">>, Req};"}, {#{from => {6,0},to => {8,89}}, "get([<<\"ACCOUNT\">>] = _Path, Req) ->\n ct:pal(\"WOOOOOOOOOOO\"),\n {200, #{<<\"CONTENT-TYPE\">> => <<\"text/plain\">>}, <<\"REST HELLO WORLD AS TEXT!\">>, Req};"}]).
Expected behavior
Server should be able to process the request so it keeps in sync with the client
Actual behavior
Eglot Client sends a textDocument/didChange with 2 or 3 contentChanges when pasting a block of code with more than 2 lines, the server process the first contentChange* but fails to process the subsequent ones, as a consequence, the internal representation of the document on the server side is not altered, but it is in the editor (emacs).
Context
erlang_ls version : 0.46.2
Editor used: Emacs 29.0.60 (or any version configured with Eglot)
LSP client used: Eglot 1.11
The text was updated successfully, but these errors were encountered:
This is not really a proper fix since it will make text editing
less efficient, but finding the root cause is tricky.
A follow up chagne could be made to fix the root cause.
Fixes#1427.
This is not really a proper fix since it will make text editing
less efficient, but finding the root cause is tricky.
A follow up chagne could be made to fix the root cause.
Fixes#1427.
This is not really a proper fix since it will make text editing
less efficient, but finding the root cause is tricky.
A follow up chagne could be made to fix the root cause.
Fixes#1427.
Describe the bug
When pasting multiple lines (more than 2), erlang_ls server fails to process the request and as a result, the editor and the server end up out of sync.
To Reproduce
Emacs configured with Eglot as lsp client, erlang_ls.config configured with incremental_sync=true, paste a block of code with more than 2 lines.
I captured a failing request and narrowed the call so the problem can be replicated with:
els_text:apply_edits(<<"-module(rgoto_v1_http).\n-export([ get/2]).\n\nget([<<\"account\">>] = _Path, Req) ->\n ct:pal(\"wooooooooooo\"),\n {200, #{<<\"content-type\">> => <<\"text/plain\">>}, <<\"REST Hello World as text!\">>, Req};\n\nget([Value], Req) ->\n {200, #{<<\"content-type\">> => <<\"text/plain\">>}, <<\"REST Hello \",Value/binary,\" as text!\">>, Req}.\n">>, [{#{from => {6,0},to => {6,0}}, "get([<<\"ACCOUNT\">>] = _Path, Req) ->\n ct:pal(\"WOOOOOOOOOOO\"),\n {200, #{<<\"CONTENT-TYPE\">> => <<\"text/plain\">>}, <<\"REST HELLO WORLD AS TEXT!\">>, Req};"}, {#{from => {6,0},to => {8,89}}, "get([<<\"ACCOUNT\">>] = _Path, Req) ->\n ct:pal(\"WOOOOOOOOOOO\"),\n {200, #{<<\"CONTENT-TYPE\">> => <<\"text/plain\">>}, <<\"REST HELLO WORLD AS TEXT!\">>, Req};"}]).
Expected behavior
Server should be able to process the request so it keeps in sync with the client
Actual behavior
Eglot Client sends a textDocument/didChange with 2 or 3 contentChanges when pasting a block of code with more than 2 lines, the server process the first contentChange* but fails to process the subsequent ones, as a consequence, the internal representation of the document on the server side is not altered, but it is in the editor (emacs).
Context
erlang_ls
version : 0.46.2The text was updated successfully, but these errors were encountered: