jackMort / jackMort/ChatGPT.nvim

ChatGPTCompleteCode does not work at all (ChatGPT does)

Open
#327 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Lua
Stars
4k
Forks
317
PR merge metrics
No merged PRs in 30d

Description

Hi,

I have just configured this plugin with the api_key_cmd like so:
`api_key_cmd = "op read op://somePath --no-newline",`

When I set my cursor on line 9 in the following buffer and issue ChatGPTCompleteCode
It kind of bugs out neovim. What happens is:
- ` // TODO: implement` will appear on line 9
- the closing curly brace of the message dissapears
- I can no longer undo and get the following error: `E21: Cannot make changes, 'modifiable' is off`

The code completion feature is completely unusable like this.
Any help would be greatly appreciated because what I have seen from the Dreams of Code video seems amazing.

regards,
Chris

```go
package main

import (
"flag"
"fmt"
)

func sortStringsByLength(arr []string) {
// this is line 9, in my actual test the comment is not here but the line is empty
}

func main() {
var nFlag = flag.Int("n", 1234, "help message for flag n")
flag.Parse()
fmt.Printf("nflag: %d", *nFlag)
}

```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with the ChatGPTCompleteCode command, the api_key_cmd configuration, and the provided Go buffer. Trace the completion flow around the inserted TODO, disappearing closing brace, and modifiable state; done means completion works without corrupting the buffer and undo remains available.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, lua
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.