leona / helix-gpt

Code assistant language server for Helix with support for Copilot/OpenAI/Codeium/Ollama
MIT License
285 stars 19 forks source link

Unable to complete the final patch operation #13

Open LeeeSe opened 5 months ago

LeeeSe commented 5 months ago

helix-editor version helix 23.10 (f6021dd0)

helix-gpt version 0.21

Describe the bug helix-gpt can successfully get a reply from the copilot server, but cannot send the patched code to helix

helix-gpt logs

APP 2024-01-30T03:48:47.476Z --> received request: | {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"positionEncodings":["utf-8","utf-32","utf-16"]},"textDocument":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"dataSupport":true,"disabledSupport":true,"isPreferredSupport":true,"resolveSupport":{"properties":["edit","command"]}},"completion":{"completionItem":{"deprecatedSupport":true,"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"snippetSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{}},"hover":{"contentFormat":["markdown"]},"inlayHint":{"dynamicRegistration":false},"publishDiagnostics":{"versionSupport":true},"rename":{"dynamicRegistration":false,"honorsChangeAnnotations":false,"prepareSupport":true},"signatureHelp":{"signatureInformation":{"activeParameterSupport":true,"documentationFormat":["markdown"],"parameterInformation":{"labelOffsetSupport":true}}}},"window":{"workDoneProgress":true},"workspace":{"applyEdit":true,"configuration":true,"didChangeConfiguration":{"dynamicRegistration":false},"didChangeWatchedFiles":{"dynamicRegistration":true,"relativePatternSupport":false},"executeCommand":{"dynamicRegistration":false},"inlayHint":{"refreshSupport":false},"symbol":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":true,"failureHandling":"abort","normalizesLineEndings":false,"resourceOperations":["create","rename","delete"]},"workspaceFolders":true}},"clientInfo":{"name":"helix","version":"23.10 (f6021dd0)"},"processId":1553,"rootPath":"/Users/ls/rust/gpt","rootUri":"file:///Users/ls/rust/gpt","workspaceFolders":[{"name":"gpt","uri":"file:///Users/ls/rust/gpt"}]},"id":0}

APP 2024-01-30T03:48:47.476Z --> sent request | {"jsonrpc":"2.0","method":"initialize","id":0,"result":{"capabilities":{"codeActionProvider":true,"executeCommandProvider":{"commands":["generateDocs","improveCode","refactorFromComment","writeTest"]},"completionProvider":{"resolveProvider":false,"triggerCharacters":["{","("," ","."]},"textDocumentSync":{"change":1,"openClose":true}}}}

APP 2024-01-30T03:48:47.477Z --> received request: | {"jsonrpc":"2.0","method":"initialized","params":{}}

APP 2024-01-30T03:48:47.477Z --> received didOpen | language: rust

APP 2024-01-30T03:48:52.870Z --> received didChange | language: rust | contentVersion: 1 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:53.593Z --> received didChange | language: rust | contentVersion: 2 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:54.028Z --> received didChange | language: rust | contentVersion: 3 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:54.186Z --> received didChange | language: rust | contentVersion: 4 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:54.189Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":2,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":1}

APP 2024-01-30T03:48:54.516Z --> received didChange | language: rust | contentVersion: 5 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:54.516Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":3,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":2}

APP 2024-01-30T03:48:54.926Z --> received didChange | language: rust | contentVersion: 6 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:55.022Z --> running completion on buffer | {"uri":"file:///Users/ls/rust/gpt/src/main.rs","text":"fn main() {\n    println!(\"Hello, world!\");\n}\n\nfn p\n","languageId":"rust","version":6}

APP 2024-01-30T03:48:55.022Z --> skipping because content is stale

APP 2024-01-30T03:48:55.022Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[]}}

APP 2024-01-30T03:48:55.022Z --> sent request | {"jsonrpc":"2.0","id":2,"result":{"isIncomplete":false,"items":[]}}

APP 2024-01-30T03:48:55.071Z --> received didChange | language: rust | contentVersion: 7 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:55.072Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":5,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":3}

APP 2024-01-30T03:48:55.275Z --> received didChange | language: rust | contentVersion: 8 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:55.276Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":6,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":4}

APP 2024-01-30T03:48:55.383Z --> received didChange | language: rust | contentVersion: 9 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:55.386Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":7,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":5}

APP 2024-01-30T03:48:55.510Z --> received didChange | language: rust | contentVersion: 10 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:55.510Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":8,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":6}

APP 2024-01-30T03:48:56.012Z --> running completion on buffer | {"uri":"file:///Users/ls/rust/gpt/src/main.rs","text":"fn main() {\n    println!(\"Hello, world!\");\n}\n\nfn print\n","languageId":"rust","version":10}

APP 2024-01-30T03:48:56.017Z --> calling completion event

APP 2024-01-30T03:48:56.017Z --> sending diagnostics | [{"message":"Fetching completion...","severity":3,"range":{"start":{"line":4,"character":0},"end":{"line":5,"character":0}}}]

APP 2024-01-30T03:48:56.017Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[{"message":"Fetching completion...","severity":3,"range":{"start":{"line":4,"character":0},"end":{"line":5,"character":0}},"source":"helix-gpt"}]}}

APP 2024-01-30T03:48:56.019Z --> copilot | completion request

APP 2024-01-30T03:48:56.021Z --> fetch | /copilot_internal/v2/token

APP 2024-01-30T03:48:57.007Z --> response | https://api.github.com/copilot_internal/v2/token | 200

APP 2024-01-30T03:48:57.008Z --> fetch | /v1/engines/copilot-codex/completions

APP 2024-01-30T03:48:58.397Z --> response | https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions | 200

APP 2024-01-30T03:48:58.577Z --> completion hints: | _usage(program: &str, opts: Options) {
    let brief = format!("Usage: {} [options]", program);
    print!("{}", opts.usage(&brief));
}
,_usage(program: &str, opts: &Options) {
    let brief = format!("Usage: {} [options]", program);
    print!("{}", opts.usage(&brief));
},_type_of<T>(_: &T) {
    println!("{}", std::any::type_name::<T>())
}

APP 2024-01-30T03:48:58.578Z --> sent request | {"jsonrpc":"2.0","id":6,"result":{"isIncomplete":true,"items":[{"label":"_usage(program: &str, opts: Options) {","kind":1,"preselect":true,"detail":"_usage(program: &str, opts: Options) {\n    let brief = format!(\"Usage: {} [options]\", program);\n    print!(\"{}\", opts.usage(&brief));\n}\n","insertText":"_usage(program: &str, opts: Options) {\n    let brief = format!(\"Usage: {} [options]\", program);\n    print!(\"{}\", opts.usage(&brief));\n}\n","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":8,"character":0},"end":{"line":8,"character":200}}}]},{"label":"_usage(program: &str, opts: &Options) {","kind":1,"preselect":true,"detail":"_usage(program: &str, opts: &Options) {\n    let brief = format!(\"Usage: {} [options]\", program);\n    print!(\"{}\", opts.usage(&brief));\n}","insertText":"_usage(program: &str, opts: &Options) {\n    let brief = format!(\"Usage: {} [options]\", program);\n    print!(\"{}\", opts.usage(&brief));\n}","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":7,"character":1},"end":{"line":7,"character":200}}}]},{"label":"_type_of<T>(_: &T) {","kind":1,"preselect":true,"detail":"_type_of<T>(_: &T) {\n    println!(\"{}\", std::any::type_name::<T>())\n}","insertText":"_type_of<T>(_: &T) {\n    println!(\"{}\", std::any::type_name::<T>())\n}","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":6,"character":1},"end":{"line":6,"character":200}}}]}]}}

APP 2024-01-30T03:48:58.579Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[]}}

APP 2024-01-30T03:48:58.925Z --> received didChange | language: rust | contentVersion: 11 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:48:58.926Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":9,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":7}

APP 2024-01-30T03:48:59.427Z --> running completion on buffer | {"uri":"file:///Users/ls/rust/gpt/src/main.rs","text":"fn main() {\n    println!(\"Hello, world!\");\n}\n\nfn print_\n","languageId":"rust","version":11}

APP 2024-01-30T03:48:59.429Z --> calling completion event

APP 2024-01-30T03:48:59.429Z --> sending diagnostics | [{"message":"Fetching completion...","severity":3,"range":{"start":{"line":4,"character":0},"end":{"line":5,"character":0}}}]

APP 2024-01-30T03:48:59.430Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[{"message":"Fetching completion...","severity":3,"range":{"start":{"line":4,"character":0},"end":{"line":5,"character":0}},"source":"helix-gpt"}]}}

APP 2024-01-30T03:48:59.430Z --> copilot | completion request

APP 2024-01-30T03:48:59.430Z --> fetch | /v1/engines/copilot-codex/completions

APP 2024-01-30T03:48:59.996Z --> response | https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions | 200

APP 2024-01-30T03:49:00.170Z --> completion hints: | usage(program: &str, opts: Options) {
    let brief = format!("Usage: {} [options]", program);
    print!("{}", opts.usage(&brief));
},usage(program: &str, opts: Options) {
    let brief = format!("Usage: {} [options] FILE", program);
    print!("{}", opts.usage(&brief));
}
,usage(program: &str, opts: Options) {
    let brief = format!("Usage: {} FILE [options]", program);
    print!("{}", opts.usage(&brief));
}

APP 2024-01-30T03:49:00.170Z --> sent request | {"jsonrpc":"2.0","id":7,"result":{"isIncomplete":true,"items":[{"label":"usage(program: &str, opts: Options) {","kind":1,"preselect":true,"detail":"usage(program: &str, opts: Options) {\n    let brief = format!(\"Usage: {} [options]\", program);\n    print!(\"{}\", opts.usage(&brief));\n}","insertText":"usage(program: &str, opts: Options) {\n    let brief = format!(\"Usage: {} [options]\", program);\n    print!(\"{}\", opts.usage(&brief));\n}","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":7,"character":1},"end":{"line":7,"character":200}}}]},{"label":"usage(program: &str, opts: Options) {","kind":1,"preselect":true,"detail":"usage(program: &str, opts: Options) {\n    let brief = format!(\"Usage: {} [options] FILE\", program);\n    print!(\"{}\", opts.usage(&brief));\n}\n","insertText":"usage(program: &str, opts: Options) {\n    let brief = format!(\"Usage: {} [options] FILE\", program);\n    print!(\"{}\", opts.usage(&brief));\n}\n","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":8,"character":0},"end":{"line":8,"character":200}}}]},{"label":"usage(program: &str, opts: Options) {","kind":1,"preselect":true,"detail":"usage(program: &str, opts: Options) {\n    let brief = format!(\"Usage: {} FILE [options]\", program);\n    print!(\"{}\", opts.usage(&brief));\n}\n","insertText":"usage(program: &str, opts: Options) {\n    let brief = format!(\"Usage: {} FILE [options]\", program);\n    print!(\"{}\", opts.usage(&brief));\n}\n","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":8,"character":0},"end":{"line":8,"character":200}}}]}]}}

APP 2024-01-30T03:49:00.171Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[]}}

APP 2024-01-30T03:49:00.325Z --> received didChange | language: rust | contentVersion: 12 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:49:00.326Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":10,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":8}

APP 2024-01-30T03:49:00.440Z --> received didChange | language: rust | contentVersion: 13 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:49:00.440Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":11,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":9}

APP 2024-01-30T03:49:00.759Z --> received didChange | language: rust | contentVersion: 14 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:49:00.761Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":12,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":10}

APP 2024-01-30T03:49:01.262Z --> running completion on buffer | {"uri":"file:///Users/ls/rust/gpt/src/main.rs","text":"fn main() {\n    println!(\"Hello, world!\");\n}\n\nfn print_cat\n","languageId":"rust","version":14}

APP 2024-01-30T03:49:01.266Z --> calling completion event

APP 2024-01-30T03:49:01.266Z --> sending diagnostics | [{"message":"Fetching completion...","severity":3,"range":{"start":{"line":4,"character":0},"end":{"line":5,"character":0}}}]

APP 2024-01-30T03:49:01.266Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[{"message":"Fetching completion...","severity":3,"range":{"start":{"line":4,"character":0},"end":{"line":5,"character":0}},"source":"helix-gpt"}]}}

APP 2024-01-30T03:49:01.266Z --> copilot | completion request

APP 2024-01-30T03:49:01.267Z --> fetch | /v1/engines/copilot-codex/completions

APP 2024-01-30T03:49:01.877Z --> received didChange | language: rust | contentVersion: 15 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:49:01.877Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":13,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":11}

APP 2024-01-30T03:49:01.958Z --> response | https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions | 200

APP 2024-01-30T03:49:01.965Z --> completion hints: | () {
    let cat = "cat";
    println!("Hello, {}!", cat);
},() {
    println!("cat");
},() {
    println!("       _._     _,-'\"\"`-._");
    println!("      (,-.`._,'(       |\\`-/|");
    println!("          `-.-' \\ )-`( , o o)");
    println!("                `-    \\`_`\"'-");
}

APP 2024-01-30T03:49:01.965Z --> sent request | {"jsonrpc":"2.0","id":10,"result":{"isIncomplete":true,"items":[{"label":"() {","kind":1,"preselect":true,"detail":"() {\n    let cat = \"cat\";\n    println!(\"Hello, {}!\", cat);\n}","insertText":"() {\n    let cat = \"cat\";\n    println!(\"Hello, {}!\", cat);\n}","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":7,"character":1},"end":{"line":7,"character":200}}}]},{"label":"() {","kind":1,"preselect":true,"detail":"() {\n    println!(\"cat\");\n}","insertText":"() {\n    println!(\"cat\");\n}","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":6,"character":1},"end":{"line":6,"character":200}}}]},{"label":"() {","kind":1,"preselect":true,"detail":"() {\n    println!(\"       _._     _,-'\\\"\\\"`-._\");\n    println!(\"      (,-.`._,'(       |\\\\`-/|\");\n    println!(\"          `-.-' \\\\ )-`( , o o)\");\n    println!(\"                `-    \\\\`_`\\\"'-\");\n}\n","insertText":"() {\n    println!(\"       _._     _,-'\\\"\\\"`-._\");\n    println!(\"      (,-.`._,'(       |\\\\`-/|\");\n    println!(\"          `-.-' \\\\ )-`( , o o)\");\n    println!(\"                `-    \\\\`_`\\\"'-\");\n}\n","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":10,"character":3},"end":{"line":10,"character":200}}}]}]}}

APP 2024-01-30T03:49:01.966Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[]}}

APP 2024-01-30T03:49:02.382Z --> running completion on buffer | {"uri":"file:///Users/ls/rust/gpt/src/main.rs","text":"fn main() {\n    println!(\"Hello, world!\");\n}\n\nfn print_cat()\n","languageId":"rust","version":15}

APP 2024-01-30T03:49:02.383Z --> calling completion event

APP 2024-01-30T03:49:02.383Z --> sending diagnostics | [{"message":"Fetching completion...","severity":3,"range":{"start":{"line":4,"character":0},"end":{"line":5,"character":0}}}]

APP 2024-01-30T03:49:02.383Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[{"message":"Fetching completion...","severity":3,"range":{"start":{"line":4,"character":0},"end":{"line":5,"character":0}},"source":"helix-gpt"}]}}

APP 2024-01-30T03:49:02.383Z --> copilot | completion request

APP 2024-01-30T03:49:02.384Z --> fetch | /v1/engines/copilot-codex/completions

APP 2024-01-30T03:49:02.962Z --> response | https://copilot-proxy.githubusercontent.com/v1/engines/copilot-codex/completions | 200

APP 2024-01-30T03:49:02.966Z --> completion hints: | ) {
    println!("        /\\_/\\");
    println!("   ____/ o o \\");
    println!(" /~____  =ø= /");
    println!("(______)__m_m)");
}
,cat: &Cat) {
    println!("{} says {}", cat.name, cat.sound);
}

APP 2024-01-30T03:49:02.967Z --> sent request | {"jsonrpc":"2.0","id":11,"result":{"isIncomplete":true,"items":[{"label":") {","kind":1,"preselect":true,"detail":") {\n    println!(\"        /\\\\_/\\\\\");\n    println!(\"   ____/ o o \\\\\");\n    println!(\" /~____  =ø= /\");\n    println!(\"(______)__m_m)\");\n}\n","insertText":") {\n    println!(\"        /\\\\_/\\\\\");\n    println!(\"   ____/ o o \\\\\");\n    println!(\" /~____  =ø= /\");\n    println!(\"(______)__m_m)\");\n}\n","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":10,"character":0},"end":{"line":10,"character":200}}}]},{"label":"cat: &Cat) {","kind":1,"preselect":true,"detail":"cat: &Cat) {\n    println!(\"{} says {}\", cat.name, cat.sound);\n}","insertText":"cat: &Cat) {\n    println!(\"{} says {}\", cat.name, cat.sound);\n}","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":6,"character":1},"end":{"line":6,"character":200}}}]}]}}

APP 2024-01-30T03:49:02.967Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[]}}

APP 2024-01-30T03:49:03.470Z --> received didChange | language: rust | contentVersion: 16 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:49:03.471Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":15,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":12}

APP 2024-01-30T03:49:03.791Z --> received didChange | language: rust | contentVersion: 17 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:49:03.792Z --> received request: | {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":16,"line":4},"textDocument":{"uri":"file:///Users/ls/rust/gpt/src/main.rs"}},"id":13}

APP 2024-01-30T03:49:04.142Z --> received didChange | language: rust | contentVersion: 18 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:49:04.296Z --> running completion on buffer | {"uri":"file:///Users/ls/rust/gpt/src/main.rs","text":"fn main() {\n    println!(\"Hello, world!\");\n}\n\nfn print_cat() {\n    \n}\n","languageId":"rust","version":18}

APP 2024-01-30T03:49:04.297Z --> skipping because content is stale

APP 2024-01-30T03:49:04.298Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[]}}

APP 2024-01-30T03:49:04.298Z --> sent request | {"jsonrpc":"2.0","id":13,"result":{"isIncomplete":false,"items":[]}}

APP 2024-01-30T03:49:06.022Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[]}}

APP 2024-01-30T03:49:09.431Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[]}}

APP 2024-01-30T03:49:11.270Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[]}}

APP 2024-01-30T03:49:12.384Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///Users/ls/rust/gpt/src/main.rs","diagnostics":[]}}

APP 2024-01-30T03:49:12.412Z --> received didChange | language: rust | contentVersion: 19 | uri: file:///Users/ls/rust/gpt/src/main.rs

APP 2024-01-30T03:49:52.649Z --> received request: | {"jsonrpc":"2.0","method":"shutdown","id":14}

APP 2024-01-30T03:49:52.649Z --> received shutdown request

helix logs

2024-01-30T11:49:01.965 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(10)), original request likely timed out
2024-01-30T11:49:02.967 helix_lsp::transport [ERROR] gpt err: <- Parse(Error("EOF while parsing an object", line: 1, column: 935))
2024-01-30T11:49:52.650 helix_lsp::transport [ERROR] gpt err: <- StreamClosed
2024-01-30T11:49:52.732 helix_lsp::transport [ERROR] rust-analyzer err: <- StreamClosed
2024-01-30T11:49:55.650 helix_term::application [ERROR] Timed out waiting for language servers to shutdown
leona commented 5 months ago

@LeeeSe Did none of the previous completions go through, or was it just the last one that failed?

LeeeSe commented 5 months ago

In many tests, it never completes, the top right corner always says "Fetching completion..." and rust-ana's completion function fails. The completion function of rust-ana also failed. But when I was about to give up, I opened it once and suddenly everything worked again, all completions were completed, I can't guess why this happened!

leona commented 5 months ago

In many tests, it never completes, the top right corner always says "Fetching completion..." and rust-ana's completion function fails. The completion function of rust-ana also failed. But when I was about to give up, I opened it once and suddenly everything worked again, all completions were completed, I can't guess why this happened!

Not sure what's going on then. If you can find a way to reproduce let me know but I'll keep an eye on this anyway.

leona commented 5 months ago

Ok I think I found something that might be causing this. To do with Bun not propagating errors in async methods properly, another reason why Bun isn't production ready yet. Also Helix kind of recovers, but only sends events and won't accept any, complaining about a broken pipe.

I've added some more error checking, but a catch all solution would be ideal.

LeeeSe commented 5 months ago

Would switching to node or deno improve this?

leona commented 5 months ago

Would switching to node or deno improve this?

Yea but would require a lot of changes. I'm enjoying the Bun life but definitely has a few quirks still.

LeeeSe commented 5 months ago

It's like we prefer helix to write code. Although it doesn't yet support plugins.