leona / helix-gpt

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

[BUG] completion doesn't get inserted correctly (codeium) #37

Closed sigmaSd closed 3 months ago

sigmaSd commented 4 months ago

helix-editor version Exact version of the Helix editor you are using.. helix 23.10 (a8761485)

helix-gpt version Exact version of Helix GPT. 4647598e9e13330bde4b818896891d0398fcea7c

Describe the bug A clear and concise description of what the bug is.

completion doesn't get inserted correctly (tried with codeium)

Screencast from 2024-02-26 15-35-31.webm

The white-space after static triggers the bug, if I request completion and the cursor is immediatly at the end of static it works correctly

helix-gpt logs Helix GPT output logs. Pass --logFile /app/helix-gpt.log to save them.

APP 2024-02-26T14:30:41.663Z --> running completion on buffer | {"uri":"file:///home/mrcool/dev/others/helix-gpt/a.ts","text":"class A {\n  static \n}\n","languageId":"typescript","version":1}

APP 2024-02-26T14:30:41.664Z --> calling completion event

APP 2024-02-26T14:30:41.664Z --> sending diagnostics | [{"message":"Fetching completion...","severity":3,"range":{"start":{"line":1,"character":0},"end":{"line":2,"character":0}}}]

APP 2024-02-26T14:30:41.664Z --> sent request | {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///home/mrcool/dev/others/helix-gpt/a.ts","diagnostics":[{"message":"Fetching completion...","severity":3,"range":{"start":{"line":1,"character":0},"end":{"line":2,"character":0}},"source":"helix-gpt"}]}}

APP 2024-02-26T14:30:41.664Z --> codeium | completion request

APP 2024-02-26T14:30:41.664Z --> fetch | /exa.language_server_pb.LanguageServerService/GetCompletions

APP 2024-02-26T14:30:41.901Z --> response | https://web-backend.codeium.com/exa.language_server_pb.LanguageServerService/GetCompletions | 200

APP 2024-02-26T14:30:41.902Z --> completion hints: |   static a = 1,  static a: number,  static foo() {

APP 2024-02-26T14:30:41.902Z --> TEST | 1 | 23

APP 2024-02-26T14:30:41.902Z --> TEST | 1 | 27

APP 2024-02-26T14:30:41.902Z --> TEST | 1 | 25

APP 2024-02-26T14:30:41.902Z --> sent request | {"jsonrpc":"2.0","id":4,"result":{"isIncomplete":false,"items":[{"label":"static a = 1","kind":1,"preselect":true,"detail":"  static a = 1","insertText":"  static a = 1","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":1,"character":23},"end":{"line":1,"character":23}}}]},{"label":"static a: number","kind":1,"preselect":true,"detail":"  static a: number","insertText":"  static a: number","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":1,"character":27},"end":{"line":1,"character":27}}}]},{"label":"static foo() {","kind":1,"preselect":true,"detail":"  static foo() {","insertText":"  static foo() {","insertTextFormat":1,"additionalTextEdits":[{"newText":"","range":{"start":{"line":1,"character":25},"end":{"line":1,"character":25}}}]}]}}