Open mjacobus opened 1 year ago
Hum... I see this is dup of https://github.com/zbirenbaum/copilot-cmp/issues/87, though I have the latest plugins, that is still a problem.
Is this occurring globally or only with specific filetypes/languages? Also, have you tried using just copilot.lua and not copilot-cmp on the files where this issue is present? If the same issue persists with just copilot.lua, it is almost certainly an issue with copilot itself.
I also observe this behavior. I only get one-liner suggestions. See my config here https://github.com/crzdg/dotfiles
Is this occurring globally or only with specific filetypes/languages? Also, have you tried using just copilot.lua and not copilot-cmp on the files where this issue is present? If the same issue persists with just copilot.lua, it is almost certainly an issue with copilot itself.
That is globally, @zbirenbaum.
I haven't tried using copilot without cmp. I will try that and get back to you.
Thank you for your superfast response and follow questions, @zbirenbaum 🙇🏻
Is this occurring globally or only with specific filetypes/languages? Also, have you tried using just copilot.lua and not copilot-cmp on the files where this issue is present? If the same issue persists with just copilot.lua, it is almost certainly an issue with copilot itself.
@zbirenbaum sorry for the late response.
I am actually using lunarvim, and I setup my plugins like so:
lvim.builtin.cmp.active = false
-- plugins
{
"zbirenbaum/copilot.lua",
cmd = "Copilot",
event = "InsertEnter",
config = function()
require("copilot").setup({
suggestion = {
enabled = true,
auto_trigger = true,
debounce = 75,
keymap = {
accept = "<c-l>",
accept_word = false,
accept_line = false,
next = "<M-]>",
prev = "<M-[>",
dismiss = "<C-]>",
},
},
})
end,
},
-- {
-- "zbirenbaum/copilot-cmp",
-- config = function ()
-- require("copilot_cmp").setup()
-- end
-- },
I get multiple-line suggestions, so I believe that is actually a copilot-cmp issue.
I'm also unable to get multi-line suggestions with copilot-cmp. Would be curious if anyone has found a fix yet. EDIT: After updating copilot-cmp to the latest commit, it's now working as expected.
Same thing happening to me on latest version of both plugins, but only with TS/JS https://github.com/zbirenbaum/copilot.lua/issues/229
Same here, I've noticed this long thread here with a potential solution for vscode https://github.com/orgs/community/discussions/40522#discussioncomment-6350781
I'm observing a quite bizarre behaviour. Not sure what's the origin. Right now I'm checking with Ruby.
If I take an existing class with any method and type def fibon
I get as suggestion def fibonnaci(n)
or similar as a 1-liner. However, if I type this as the last method of the class, I get a full suggestion. Same if I do it before the end
word of a method definition(which is syntactically incorrect, but anyway)
class Foo
# here wouldn't work
def bar
# here wouldn't work
puts "hi"
# here it works
end
# here it works
end
If I create a new file, set the syntax to Ruby and start typing, I get multi-line suggestions all the time, wherever I try to write the method. However, if I save this file as test.rb
and start editing , I only get a suggestions as explained before.
Hum, that is good input, @dgmora
I opened a new buffer did class Fib
This was the first suggestion, which I accepted:
# fibonacci method
class Fibonacci
def self.fib(n)
return 0 if n == 0
return 1 if n == 1
fib(n - 1) + fib(n - 2)
end
end
# Path: tmp/copilot.rb
# fibonacci method
class Fibonacci
def self.fib(n)
return 0 if n == 0
return 1 if n == 1
fib(n - 1) + fib(n - 2)
end
end
# Path: tmp/copilot.rb
# fibonacci method
class Fibonacci
def self.fib(n)
return 0 if n == 0
return 1 if n == 1
fib(n - 1) + fib(n - 2)
end
end
# Path: tmp/copilot.rb
# fibonacci method
class Fibonacci
def self.fib(n)
return 0 if n == 0
return 1 if n == 1
fib(n - 1) + fib(n - 2)
end
end
# Path: tmp/copilot.rb
# fibonacci method
class Fibonacci
def self.fib(n)
return 0 if n == 0
return 1 if n == 1
fib(n - 1) + fib(n - 2)
end
end
# Path: tmp/copilot.rb
# fibonacci method
class Fibonacci
def self.fib(n)
return 0 if n == 0
return 1 if n == 1
fib(n - 1) + fib(n - 2)
end
end
# Path: tmp/copilot.rb
# fibonacci method
class Fibonacci
def self.fib(n)
return 0 if n == 0
return 1 if n == 1
fib(n - 1) + fib(n - 2)
end
end
# Path: tmp/copilot.rb
# fibonacci method
class Fibonacci
def self.fib(n)
return 0 if n == 0
return 1 if n == 1
fib(n - 1) + fib(n - 2)
end
end
I tried again, and then:
# fibonacci method
class Fibonacci
def self.fibonacci(n)
return 0 if n == 0
return 1 if n == 1
fibonacci(n - 1) + fibonacci(n - 2)
end
end
# then I tried def fib...
def fibonacci(n)
Fibonacci.fibonacci(n)
end
I saved and it kept working...
def sqrt(n)
Math.sqrt(n)
end
def camelize(string)
string.split('_').map(&:capitalize).join
end
I closed nvim, reopened it, and now it works for that file 🤷🏻
Then I closed vim, opened an existing file in the project, and now it is back to one-liners.
Then I tried your workaround, adding an "end", without a def. I typed def resolve(number)
and tada!
Hey there @zbirenbaum , thank you for this awesome plugin! 🙇🏻
I have this issue. My suggestions are all one-liners.
Instead of having this:
I get just the first line of the suggestion:
Once I accept the suggestion, and start editing the next line, it offers the second line, and so on.
Could this be a miss-configuration?
This is what I had
And this is what I have now, but the behavior is the same:
Thank you in advance