Skip to content

Commit 7fd60a2

Browse files
committed
chore: update TODOs
1 parent b83981c commit 7fd60a2

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

lsp/copilot.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
---@type vim.lsp.Config
22
return {
3+
--NOTE: This name means that existing blink completion works
34
name = "copilot",
45
cmd = {
56
"copilot-language-server",
67
"--stdio",
78
},
89
init_options = {
10+
--TODO: Grab versions from the editor
911
editorInfo = { name = "neovim", version = "0.11" },
1012
editorPluginInfo = {
1113
name = "Github Copilot LSP for Neovim",
@@ -17,7 +19,7 @@ return {
1719
enabled = true,
1820
},
1921
},
20-
root_markers = { ".git" },
22+
root_dir = vim.uv.cwd(),
2123
on_init = function(client)
2224
vim.api.nvim_set_hl(0, "NesAdd", { link = "DiffAdd", default = true })
2325
vim.api.nvim_set_hl(0, "NesDelete", { link = "DiffDelete", default = true })
@@ -26,10 +28,12 @@ return {
2628
local nes = require("copilot-lsp.nes")
2729
local inline_completion = require("copilot-lsp.completion")
2830

31+
-- TODO: make this configurable for key maps, or just expose commands to map in config
2932
vim.keymap.set("i", "<c-i>", function()
3033
inline_completion.request_inline_completion(1)
3134
end)
3235

36+
--TODO: This should go on an auto command
3337
vim.keymap.set("n", "<leader>x", function()
3438
nes.request_nes(client)
3539
end)

lua/copilot-lsp/completion/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ local function handle_inlineCompletion_response(results, _ctx, _config)
1717
end
1818

1919
for _, result in pairs(results1) do
20+
--TODO: Ghost text for completions
2021
-- This is where we show the completion results
21-
-- dd(result)
22+
-- However, the LSP being named "copilot" is enough for blink-cmp to show the completion
2223
end
2324
end
2425

@@ -31,6 +32,7 @@ function M.request_inline_completion(type)
3132
triggerKind = type,
3233
},
3334
formattingOptions = {
35+
--TODO: Grab this from editor also
3436
tabSize = 4,
3537
insertSpaces = true,
3638
},

lua/copilot-lsp/util.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function M.apply_inline_edit(edit)
44
local bufnr = vim.uri_to_bufnr(edit.textDocument.uri)
55

66
---@diagnostic disable-next-line: assign-type-mismatch
7-
vim.lsp.util.apply_text_edits({ edit }, bufnr, "utf-8")
7+
vim.lsp.util.apply_text_edits({ edit }, bufnr, "utf-16")
88
end
99

1010
return M

0 commit comments

Comments
 (0)