Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hints corrupts lines. InvalidParams: Received a completion with overlapping edits #5693

Closed
woojiq opened this issue Jan 26, 2023 · 6 comments
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@woojiq
Copy link
Contributor

woojiq commented Jan 26, 2023

Summary

I know of an issue where you press Enter during a suggestion and some characters are removed. But this is slightly different issue (I believe).

If you can't reproduce it and don't understand what I'm talking about, let me know, Ill record a video later.

Reproduction Steps

You don't need to create new project. The main point is to use rust and write println statement with env! macro.
I tried this:

  1. cargo new lolkek
  2. cd lolkek; hx src/main.rs
  3. write it in the main: println("{}", env!("CA
  4. Hit Tab any number of times

The preview is shown somewhere other than on this line. Also if you hit Enter it pastes selected hint in a strange place.

I expected this to happen:
Lsp and helix work the same as with other hints.

Instead, this happened:
Strange behavior.

I see this error only with the env! macro.

Helix log

~/.cache/helix/helix.log
2023-01-26T21:39:07.798 helix_lsp::transport [ERROR] <- InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-26T21:39:07.798 helix_view::editor [ERROR] editor error: Async job failed: protocol error: InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
-v
2023-01-27T08:24:11.932 helix_lsp::transport [ERROR] <- InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:24:11.932 helix_view::editor [ERROR] editor error: Async job failed: protocol error: InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:24:12.251 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":53,"line":12},"start":{"character":30,"line":12}},"text":"}\""}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":23}}}
2023-01-27T08:24:12.252 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}},"text":"CARGO_PKG_VERSION_MINOR"}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":24}}}
2023-01-27T08:24:12.456 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"completionItem/resolve","params":{"additionalTextEdits":[],"deprecated":false,"detail":"The minor version of your package","filterText":"CARGO_PKG_VERSION_MINOR","kind":14,"label":"CARGO_PKG_VERSION_MINOR","preselect":true,"sortText":"ffffffef","textEdit":{"insert":{"end":{"character":42,"line":12},"start":{"character":30,"line":12}},"newText":"CARGO_PKG_VERSION_MINOR","replace":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}}}},"id":12}
2023-01-27T08:24:12.457 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":12,"error":{"code":-32602,"message":"Received a completion with overlapping edits, this is not LSP-compliant"}}
2023-01-27T08:24:12.457 helix_lsp::transport [ERROR] <- InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:24:12.457 helix_view::editor [ERROR] editor error: Async job failed: protocol error: InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:24:13.004 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":53,"line":12},"start":{"character":30,"line":12}},"text":"}\""}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":25}}}
2023-01-27T08:24:13.005 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}},"text":"CARGO_PKG_VERSION_PATCH"}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":26}}}
2023-01-27T08:24:13.209 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"completionItem/resolve","params":{"additionalTextEdits":[],"deprecated":false,"detail":"The patch version of your package","filterText":"CARGO_PKG_VERSION_PATCH","kind":14,"label":"CARGO_PKG_VERSION_PATCH","preselect":true,"sortText":"ffffffef","textEdit":{"insert":{"end":{"character":42,"line":12},"start":{"character":30,"line":12}},"newText":"CARGO_PKG_VERSION_PATCH","replace":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}}}},"id":13}
2023-01-27T08:24:13.210 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":13,"error":{"code":-32602,"message":"Received a completion with overlapping edits, this is not LSP-compliant"}}
2023-01-27T08:24:13.210 helix_lsp::transport [ERROR] <- InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:24:13.210 helix_view::editor [ERROR] editor error: Async job failed: protocol error: InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:24:14.146 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":53,"line":12},"start":{"character":30,"line":12}},"text":"}\""}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":27}}}
2023-01-27T08:24:14.147 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"completionItem/resolve","params":{"additionalTextEdits":[],"deprecated":false,"detail":"The patch version of your package","filterText":"CARGO_PKG_VERSION_PATCH","kind":14,"label":"CARGO_PKG_VERSION_PATCH","preselect":true,"sortText":"ffffffef","textEdit":{"insert":{"end":{"character":42,"line":12},"start":{"character":30,"line":12}},"newText":"CARGO_PKG_VERSION_PATCH","replace":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}}}},"id":14}
2023-01-27T08:24:14.147 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}},"text":"CARGO_PKG_VERSION_PATCH"}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":28}}}
2023-01-27T08:24:14.148 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":14,"error":{"code":-32602,"message":"Received a completion with overlapping edits, this is not LSP-compliant"}}
2023-01-27T08:24:14.148 helix_lsp::transport [ERROR] <- InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:24:14.148 helix_term::ui::completion [ERROR] Failed to resolve completion item: protocol error: InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:24:20.845 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"shutdown","id":15}
2023-01-27T08:24:20.845 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":15,"result":null}
2023-01-27T08:24:20.845 helix_lsp::transport [INFO] <- null
2023-01-27T08:24:20.845 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"exit"}
-vvv
2023-01-27T08:48:42.946 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/user/test1/src/main.rs","diagnostics":[{"range":{"start":{"line":14,"character":0},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: expected R_PAREN"},{"range":{"start":{"line":14,"character":0},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: expected SEMICOLON"},{"range":{"start":{"line":14,"character":0},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: expected R_CURLY"},{"range":{"start":{"line":12,"character":57},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: Missing trailing `\"` symbol to terminate the string literal"}],"version":25}}
2023-01-27T08:48:42.947 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: expected R_PAREN"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(0), "line": Number(14)}}, "severity": Number(1), "source": String("rust-analyzer")}, Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: expected SEMICOLON"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(0), "line": Number(14)}}, "severity": Number(1), "source": String("rust-analyzer")}, Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: expected R_CURLY"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(0), "line": Number(14)}}, "severity": Number(1), "source": String("rust-analyzer")}, Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: Missing trailing `\"` symbol to terminate the string literal"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(57), "line": Number(12)}}, "severity": Number(1), "source": String("rust-analyzer")}], "uri": String("file:///home/user/test1/src/main.rs"), "version": Number(25)}) })))
2023-01-27T08:48:42.948 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:43.144 helix_term::application [DEBUG] received editor event: IdleTimer
2023-01-27T08:48:43.145 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:43.148 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"completionItem/resolve","params":{"additionalTextEdits":[],"deprecated":false,"detail":"The full version of your package","filterText":"CARGO_PKG_VERSION","kind":14,"label":"CARGO_PKG_VERSION","preselect":true,"sortText":"ffffffef","textEdit":{"insert":{"end":{"character":42,"line":12},"start":{"character":30,"line":12}},"newText":"CARGO_PKG_VERSION","replace":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}}}},"id":12}
2023-01-27T08:48:43.148 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":12,"error":{"code":-32602,"message":"Received a completion with overlapping edits, this is not LSP-compliant"}}
2023-01-27T08:48:43.148 helix_lsp::transport [ERROR] <- InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:48:43.148 helix_view::editor [ERROR] editor error: Async job failed: protocol error: InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:48:43.149 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:43.216 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":47,"line":12},"start":{"character":30,"line":12}},"text":"}\""}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":26}}}
2023-01-27T08:48:43.216 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}},"text":"CARGO_PKG_VERSION_MAJOR"}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":27}}}
2023-01-27T08:48:43.216 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:43.217 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/user/test1/src/main.rs","diagnostics":[{"range":{"start":{"line":14,"character":0},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: expected R_PAREN"},{"range":{"start":{"line":14,"character":0},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: expected SEMICOLON"},{"range":{"start":{"line":14,"character":0},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: expected R_CURLY"},{"range":{"start":{"line":12,"character":63},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: Missing trailing `\"` symbol to terminate the string literal"}],"version":27}}
2023-01-27T08:48:43.217 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: expected R_PAREN"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(0), "line": Number(14)}}, "severity": Number(1), "source": String("rust-analyzer")}, Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: expected SEMICOLON"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(0), "line": Number(14)}}, "severity": Number(1), "source": String("rust-analyzer")}, Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: expected R_CURLY"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(0), "line": Number(14)}}, "severity": Number(1), "source": String("rust-analyzer")}, Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: Missing trailing `\"` symbol to terminate the string literal"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(63), "line": Number(12)}}, "severity": Number(1), "source": String("rust-analyzer")}], "uri": String("file:///home/user/test1/src/main.rs"), "version": Number(27)}) })))
2023-01-27T08:48:43.218 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:43.418 helix_term::application [DEBUG] received editor event: IdleTimer
2023-01-27T08:48:43.418 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:43.419 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"completionItem/resolve","params":{"additionalTextEdits":[],"deprecated":false,"detail":"The major version of your package","filterText":"CARGO_PKG_VERSION_MAJOR","kind":14,"label":"CARGO_PKG_VERSION_MAJOR","preselect":true,"sortText":"ffffffef","textEdit":{"insert":{"end":{"character":42,"line":12},"start":{"character":30,"line":12}},"newText":"CARGO_PKG_VERSION_MAJOR","replace":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}}}},"id":13}
2023-01-27T08:48:43.419 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":13,"error":{"code":-32602,"message":"Received a completion with overlapping edits, this is not LSP-compliant"}}
2023-01-27T08:48:43.419 helix_lsp::transport [ERROR] <- InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:48:43.420 helix_view::editor [ERROR] editor error: Async job failed: protocol error: InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:48:43.420 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:43.616 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":53,"line":12},"start":{"character":30,"line":12}},"text":"}\""}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":28}}}
2023-01-27T08:48:43.617 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}},"text":"CARGO_PKG_VERSION_MINOR"}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":29}}}
2023-01-27T08:48:43.617 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:43.817 helix_term::application [DEBUG] received editor event: IdleTimer
2023-01-27T08:48:43.817 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:43.820 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"completionItem/resolve","params":{"additionalTextEdits":[],"deprecated":false,"detail":"The minor version of your package","filterText":"CARGO_PKG_VERSION_MINOR","kind":14,"label":"CARGO_PKG_VERSION_MINOR","preselect":true,"sortText":"ffffffef","textEdit":{"insert":{"end":{"character":42,"line":12},"start":{"character":30,"line":12}},"newText":"CARGO_PKG_VERSION_MINOR","replace":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}}}},"id":14}
2023-01-27T08:48:43.820 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":14,"error":{"code":-32602,"message":"Received a completion with overlapping edits, this is not LSP-compliant"}}
2023-01-27T08:48:43.821 helix_lsp::transport [ERROR] <- InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:48:43.821 helix_view::editor [ERROR] editor error: Async job failed: protocol error: InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:48:43.821 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:44.192 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":53,"line":12},"start":{"character":30,"line":12}},"text":"}\""}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":30}}}
2023-01-27T08:48:44.193 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}},"text":"CARGO_PKG_VERSION_PATCH"}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":31}}}
2023-01-27T08:48:44.193 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:44.394 helix_term::application [DEBUG] received editor event: IdleTimer
2023-01-27T08:48:44.395 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:44.397 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"completionItem/resolve","params":{"additionalTextEdits":[],"deprecated":false,"detail":"The patch version of your package","filterText":"CARGO_PKG_VERSION_PATCH","kind":14,"label":"CARGO_PKG_VERSION_PATCH","preselect":true,"sortText":"ffffffef","textEdit":{"insert":{"end":{"character":42,"line":12},"start":{"character":30,"line":12}},"newText":"CARGO_PKG_VERSION_PATCH","replace":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}}}},"id":15}
2023-01-27T08:48:44.398 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":15,"error":{"code":-32602,"message":"Received a completion with overlapping edits, this is not LSP-compliant"}}
2023-01-27T08:48:44.398 helix_lsp::transport [ERROR] <- InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:48:44.398 helix_view::editor [ERROR] editor error: Async job failed: protocol error: InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:48:44.399 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:44.565 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":53,"line":12},"start":{"character":30,"line":12}},"text":"}\""}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":32}}}
2023-01-27T08:48:44.566 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"range":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}},"text":"CARGO_PKG_VERSION_PRE"}],"textDocument":{"uri":"file:///home/user/test1/src/main.rs","version":33}}}
2023-01-27T08:48:44.566 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:44.568 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/user/test1/src/main.rs","diagnostics":[{"range":{"start":{"line":14,"character":0},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: expected R_PAREN"},{"range":{"start":{"line":14,"character":0},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: expected SEMICOLON"},{"range":{"start":{"line":14,"character":0},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: expected R_CURLY"},{"range":{"start":{"line":12,"character":61},"end":{"line":14,"character":0}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: Missing trailing `\"` symbol to terminate the string literal"}],"version":33}}
2023-01-27T08:48:44.568 helix_term::application [DEBUG] received editor event: LanguageServerMessage((0, Notification(Notification { jsonrpc: Some(V2), method: "textDocument/publishDiagnostics", params: Map({"diagnostics": Array [Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: expected R_PAREN"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(0), "line": Number(14)}}, "severity": Number(1), "source": String("rust-analyzer")}, Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: expected SEMICOLON"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(0), "line": Number(14)}}, "severity": Number(1), "source": String("rust-analyzer")}, Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: expected R_CURLY"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(0), "line": Number(14)}}, "severity": Number(1), "source": String("rust-analyzer")}, Object {"code": String("syntax-error"), "codeDescription": Object {"href": String("https://rust-analyzer.github.io/manual.html#syntax-error")}, "message": String("Syntax Error: Missing trailing `\"` symbol to terminate the string literal"), "range": Object {"end": Object {"character": Number(0), "line": Number(14)}, "start": Object {"character": Number(61), "line": Number(12)}}, "severity": Number(1), "source": String("rust-analyzer")}], "uri": String("file:///home/user/test1/src/main.rs"), "version": Number(33)}) })))
2023-01-27T08:48:44.569 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:44.765 helix_term::application [DEBUG] received editor event: IdleTimer
2023-01-27T08:48:44.772 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:44.774 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"completionItem/resolve","params":{"additionalTextEdits":[],"deprecated":false,"detail":"The pre-release version of your package","filterText":"CARGO_PKG_VERSION_PRE","kind":14,"label":"CARGO_PKG_VERSION_PRE","preselect":true,"sortText":"ffffffef","textEdit":{"insert":{"end":{"character":42,"line":12},"start":{"character":30,"line":12}},"newText":"CARGO_PKG_VERSION_PRE","replace":{"end":{"character":32,"line":12},"start":{"character":30,"line":12}}}},"id":16}
2023-01-27T08:48:44.775 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":16,"error":{"code":-32602,"message":"Received a completion with overlapping edits, this is not LSP-compliant"}}
2023-01-27T08:48:44.775 helix_lsp::transport [ERROR] <- InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:48:44.775 helix_view::editor [ERROR] editor error: Async job failed: protocol error: InvalidParams: Received a completion with overlapping edits, this is not LSP-compliant
2023-01-27T08:48:44.775 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 0
2023-01-27T08:48:45.203 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2023-01-27T08:48:45.204 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2023-01-27T08:48:45.404 helix_term::application [DEBUG] received editor event: IdleTimer
2023-01-27T08:48:45.590 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2023-01-27T08:48:45.791 helix_term::application [DEBUG] received editor event: IdleTimer
2023-01-27T08:48:46.113 helix_term::commands::typed [DEBUG] quitting...
2023-01-27T08:48:46.114 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2023-01-27T08:48:46.370 helix_view::document [DEBUG] id 1 modified - last saved: 0, current: 1
2023-01-27T08:48:46.558 helix_term::job [DEBUG] waiting on jobs...
2023-01-27T08:48:46.558 helix_term::job [DEBUG] waiting on jobs...
2023-01-27T08:48:46.558 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"shutdown","id":17}
2023-01-27T08:48:46.559 helix_lsp::transport [INFO] <- {"jsonrpc":"2.0","id":17,"result":null}
2023-01-27T08:48:46.559 helix_lsp::transport [INFO] <- null
2023-01-27T08:48:46.559 helix_lsp::transport [INFO] -> {"jsonrpc":"2.0","method":"exit"}
2023-01-27T08:48:46.561 mio::poll [TRACE] deregistering event source from poller
2023-01-27T08:48:46.562 mio::poll [TRACE] deregistering event source from poller
2023-01-27T08:48:46.562 mio::poll [TRACE] deregistering event source from poller
2023-01-27T08:48:46.562 mio::poll [TRACE] deregistering event source from poller
2023-01-27T08:48:46.563 mio::poll [TRACE] deregistering event source from poller

Platform

Pop!_OS 22.04 LTS

Terminal Emulator

alacritty 0.11.0

Helix Version

helix 22.12 (97083f8)

@woojiq woojiq added the C-bug Category: This is a bug label Jan 26, 2023
@woojiq woojiq changed the title Hints breaks lines. InvalidParams: Received a completion with overlapping edits Hints corrupts lines. InvalidParams: Received a completion with overlapping edits Jan 26, 2023
@the-mikedavis
Copy link
Member

Are you setting editor.auto-pairs to false in the config?

Could you make an asciinema recording of this? And also provide the log while running in verbose mode (hx -v)? https://github.com/helix-editor/helix/wiki/FAQ#access-the-log-file

@woojiq
Copy link
Contributor Author

woojiq commented Jan 27, 2023

Are you setting editor.auto-pairs to false in the config?

No, I just showed what I wrote, not what the editor pastes for me.

And also provide the log while running in verbose mode (hx -v)

I've updated the log to the Helix log section above.

Asciinema:

asciicast

@woojiq
Copy link
Contributor Author

woojiq commented Jan 27, 2023

Also, sometimes if the file is bigger than in the video, the CARGO... is even inserted on the wrong line and messes up my code.

@kirawi kirawi added the A-helix-term Area: Helix term improvements label Feb 5, 2023
@pascalkuthe
Copy link
Member

this looks like a rust-analyzer bug. I am not able to reproduce this on the lastest RA nightly. Perhaphs #6594 also helped here. Either way this seems to be fixed now so I am closing this

@woojiq
Copy link
Contributor Author

woojiq commented Jul 26, 2023

Fun fact: I can't reproduce this problem even with an old helix and old rust now (how did I have this problem before? :D ). There is just no completion when I type inside env!. Anyway, yes, it's fixed, thx.

@pascalkuthe
Copy link
Member

I do get completions inside env' but not when inside another macro (like println`) so I guess RA disabled that at some point

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

4 participants