ChatGPT.nvim
ChatGPT.nvim copied to clipboard
ChatGPTCompleteCode does not work at all (ChatGPT does)
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
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)
}
When I open a new buffer with just the function in it, I get more sensible results:
func sortStringsByLength(arr []string) {
sort.Slice(arr, func(i, j int) bool {
return len(arr[i]) < len(arr[j])
})
}
some additional findings:
That one line it generates seems to be a buffer. When I :q
after :ChatGPTCompleteCode
has completed only that line dissappears.
similar functionality works wonderfully btw.
I can select the lines 7 -9 from the example and do :ChatGPTEditWithInstructions
ask implement this
and I get a solid response which I can accept.
For me :ChatGPTCompleteCode
only generates
// API ERROR: The model `text-davinci-003` has been deprecated, learn more here: https://platform.openai.com/docs/deprecations
For me
:ChatGPTCompleteCode
only generates// API ERROR: The model `text-davinci-003` has been deprecated, learn more here: https://platform.openai.com/docs/deprecations
same here