Closed webdev23 closed 8 months ago
The code actions are only implemented for copilot at the moment, I'll add openai support soon. Could you check ~/.cache/helix for the log file instead?
tail -f ~/.cache/helix/helix.log
Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`.
helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`.
Willing to help debugging. Thank you.
tail -f ~/.cache/helix/helix.log
Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`. helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`.
Willing to help debugging. Thank you.
Haven't seen that error before. Best guess is that it's some helix weirdness with a language I haven't tested. I'll test it with your config when I'm home.
Also if you could run helix in verbose mode hx -v test.js
that might give us a better idea
hx -v test.php
tail -f ~/.cache/helix/helix.log
2024-01-26T19:30:26.369 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(6)), original request likely timed out
2024-01-26T19:30:26.369 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[]}}
2024-01-26T19:30:26.370 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`.
2024-01-26T19:30:28.517 helix_lsp::transport [INFO] gpt -> {"jsonrpc":"2.0","method":"workspace/executeCommand","params":{"arguments":[{"query":"Refactor this code based on the comment.","range":{"end":{"character":0,"line":3},"start":{"character":6,"line":2}}}],"command":"refactorFromComment"},"id":8}
2024-01-26T19:30:28.519 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"message":"Executing refactorFromComment...","range":{"end":{"character":0,"line":3},"start":{"character":6,"line":2}},"severity":3,"source":"helix-gpt"}]}}
2024-01-26T19:30:28.519 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`.
2024-01-26T19:30:28.520 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"message":"chat handler: openai does not exist","severity":1,"range":{"end":{"character":0,"line":3},"start":{"character":6,"line":2}},"source":"helix-gpt"}]}}
2024-01-26T19:30:28.520 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`.
2024-01-26T19:30:31.714 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[]}}
2024-01-26T19:30:31.715 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`.
2024-01-26T19:30:38.526 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[]}}
2024-01-26T19:30:38.526 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[]}}
2024-01-26T19:30:38.526 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`.
2024-01-26T19:30:38.527 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`.
2024-01-26T19:30:48.518 helix_term::commands::lsp [ERROR] execute LSP command: request 8 timed out
hx -v test.php
tail -f ~/.cache/helix/helix.log
2024-01-26T19:30:26.369 helix_lsp::transport [ERROR] Tried sending response into a closed channel (id=Num(6)), original request likely timed out 2024-01-26T19:30:26.369 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[]}} 2024-01-26T19:30:26.370 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`. 2024-01-26T19:30:28.517 helix_lsp::transport [INFO] gpt -> {"jsonrpc":"2.0","method":"workspace/executeCommand","params":{"arguments":[{"query":"Refactor this code based on the comment.","range":{"end":{"character":0,"line":3},"start":{"character":6,"line":2}}}],"command":"refactorFromComment"},"id":8} 2024-01-26T19:30:28.519 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"message":"Executing refactorFromComment...","range":{"end":{"character":0,"line":3},"start":{"character":6,"line":2}},"severity":3,"source":"helix-gpt"}]}} 2024-01-26T19:30:28.519 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`. 2024-01-26T19:30:28.520 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[{"message":"chat handler: openai does not exist","severity":1,"range":{"end":{"character":0,"line":3},"start":{"character":6,"line":2}},"source":"helix-gpt"}]}} 2024-01-26T19:30:28.520 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`. 2024-01-26T19:30:31.714 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[]}} 2024-01-26T19:30:31.715 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`. 2024-01-26T19:30:38.526 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[]}} 2024-01-26T19:30:38.526 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"diagnostics":[]}} 2024-01-26T19:30:38.526 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`. 2024-01-26T19:30:38.527 helix_term::application [ERROR] received malformed notification from Language Server: protocol error: InvalidParams: Invalid params: missing field `uri`. 2024-01-26T19:30:48.518 helix_term::commands::lsp [ERROR] execute LSP command: request 8 timed out
Thanks. And what version of helix are you on?
23.10, compiled from source.
Other LSP, such as phpactor, are working alright are fairly usable.
I tried to deactivate them all and run only helix-gpt, same errors as above^.
Same with other languages, such as bash.
23.10, compiled from source.
Other LSP, such as phpactor, are working alright are fairly usable.
I tried to deactivate them all and run only helix-gpt, same errors as above^.
Same with other languages, such as bash.
Ok leave it with me I'll check when I'm home. The error is pretty clear at least, the filepath isn't being passed.
23.10, compiled from source.
Other LSP, such as phpactor, are working alright are fairly usable.
I tried to deactivate them all and run only helix-gpt, same errors as above^.
Same with other languages, such as bash.
Could you try with release 0.11
2024-01-28T08:55:15.555 helix_vcs [INFO] file is untracked
2024-01-28T08:55:15.555 helix_vcs [INFO] failed to open diff base for /media/<--REMOVED-->/test.php
2024-01-28T08:55:15.556 helix_lsp::client [INFO] Using custom LSP config: {}
2024-01-28T08:55:15.556 helix_lsp::transport [INFO] gpt -> {"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"general":{"positionEncodings":["utf-8","utf-32","utf-16"]},"textDocument":{"codeAction":{"codeActioÆnLiteralSupport":{"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)"},"initializationOptions":{},"processId":2627793,"rootPath":"/media/<--REMOVED-->","rootUri":"file:///media/<--REMOVED-->","workspaceFolders":[{"name":"SHELIX","uri":"file:///media/<--REMOVED-->"}]},"id":0}
2024-01-28T08:55:15.632 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"initialize","id":0,"result":{"capabilities":{"codeActionProvider":true,"executeCommandProvider":{"commands":["generateDocs","improveCode","refactorFromComment"]},"completionProvider":{"resolveProvider":false,"triggerCharacters":["{","(",")","=",">"," ",",",":",".","<","/"]},"textDocumentSync":{"change":1,"openClose":true}}}}
2024-01-28T08:55:15.632 helix_lsp::transport [INFO] gpt <- {"capabilities":{"codeActionProvider":true,"completionProvider":{"resolveProvider":false,"triggerCharacters":["{","(",")","=",">"," ",",",":",".","<","/"]},"executeCommandProvider":{"commands":["generateDocs","improveCode","refactorFromComment"]},"textDocumentSync":{"change":1,"openClose":true}}}
2024-01-28T08:55:15.632 helix_lsp::transport [INFO] gpt -> {"jsonrpc":"2.0","method":"initialized","params":{}}
2024-01-28T08:55:15.632 helix_lsp::transport [INFO] gpt -> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{}}}
2024-01-28T08:55:15.633 helix_lsp::transport [INFO] gpt -> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"languageId":"php","text":"\n","uri":"file:///media/<--REMOVED-->/test.php","version":0}}}
2024-01-28T08:55:47.769 helix_lsp::transport [INFO] gpt -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"<\n"}],"textDocument":{"uri":"file:///media/<--REMOVED-->/test.php","version":1}}}
2024-01-28T08:55:47.769 helix_lsp::transport [INFO] gpt -> {"jsonrpc":"2.0","method":"textDocument/completion","params":{"position":{"character":1,"line":0},"textDocument":{"uri":"file:///media/<--REMOVED-->/test.php"}},"id":1}
2024-01-28T08:55:47.975 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///media/<--REMOVED-->/test.php","diagnostics":[{"message":"Fetching completion...","severity":3,"range":{"start":{"line":0,"character":0},"end":{"line":1,"character":0}},"source":"helix-gpt"}]}}
2024-01-28T08:55:48.164 helix_lsp::transport [INFO] gpt -> {"jsonrpc":"2.0","method":"textDocument/didChange","params":{"contentChanges":[{"text":"<?\n"}],"textDocument":{"uri":"file:///media/<--REMOVED-->/test.php","version":2}}}
2024-01-28T08:55:48.638 helix_lsp::transport [INFO] gpt <- {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///media/<--REMOVED-->/test.php","diagnostics":[{"message":"Completion failed: request error with status code 429","severity":1,"range":{"start":{"line":0,"character":0},"end":{"line":1,"character":0}},"source":"helix-gpt"}]}}y
Updated to v0.11.
hx -v test.php
tail -f ~/.cache/helix/helix.log
UI: Completion failed. Request Error with status 429
Well, now that i have an error code, that error 429 is an API quota rate limit: https://help.openai.com/en/articles/6891829-error-code-429-rate-limit-reached-for-requests
That's a bit of a misfortune :/ . i have other tools that are querying that api, and are still running. (Not the auto-completion service).
I see that each key type is sending a request, and in my opinion that is a bit aggressive, this will rapidly leads to troubles^
At this stage, can't confirm that helix-gpt
runs fine, but it looks ok, thank you.
It should only be triggered by the characters below. But Helix has its own set of characters/rules to trigger too. I haven't had any 429s yet though, so that's strange.
triggerCharacters: ["{", "(", ")", "=", ">", " ", ",", ":", ".", "<", "/"]
Looks like I am ban^ (I code a lot)
triggerCharacters: ["{", "(", ")", "=", ">", " ", ",", ":", ".", "<", "/"]
We tend to use them quite often^
Might come back later to report for your app, i guess next month.
Thanks again.
Looks like I am ban^ (I code a lot)
triggerCharacters: ["{", "(", ")", "=", ">", " ", ",", ":", ".", "<", "/"]
We tend to use them quite often^
Might come back later to report for your app, i guess next month.
Thanks again.
Yea do please. Still early days, but I think all of the features I want implemented are finished now. So my focus is on fixing any issues.
For the next release, I've updated the trigger characters to ["{", "(", " ", "."]
As I see with PHP you would be triggering it a lot with the previous set. There's also a 200ms debounce, but that's not always effective.
Test cli:
helix-gpt --handler openai --openaiKey 'sk-ogR5nc.......'
Hanging, no errors, no infos
Helix
languages.toml
:In Helix, % , Space + a, generate documentation
It's not working, no logs.
tail -f /root/.cache/helix/helix.log
Blanktail -f /app/helix-gpt.log # Or wherever you set --logFile to
No foundlocate helix-gpt.log
Not found