Skip to content

Commit 670bfb6

Browse files
committed
fix(client): filetype can be nil on nightly for get_language_id
1 parent f8d8d87 commit 670bfb6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/copilot/client.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ local function prepare_client_config(overrides)
194194
root_dir = vim.loop.cwd(),
195195
name = "copilot",
196196
capabilities = capabilities,
197-
get_language_id = function(_, filetype)
197+
get_language_id = function(buf, filetype)
198+
filetype = filetype or vim.bo[buf].filetype
198199
return util.language_for_file_type(filetype)
199200
end,
200201
on_init = function(client, initialize_result)

0 commit comments

Comments
 (0)