File tree Expand file tree Collapse file tree 4 files changed +7
-21
lines changed
Expand file tree Collapse file tree 4 files changed +7
-21
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,6 @@ require('copilot').setup({
109109 [" ." ] = false ,
110110 },
111111 copilot_node_command = ' node' , -- Node version must be < 18
112- plugin_manager_path = vim .fn .stdpath (" data" ) .. " /site/pack/packer" ,
113112 server_opts_overrides = {},
114113})
115114```
@@ -201,18 +200,6 @@ Example:
201200copilot_node_command = vim .fn .expand (" $HOME" ) .. " /.config/nvm/versions/node/v16.14.2/bin/node" , -- Node version must be < 18
202201```
203202
204- ### plugin_manager_path
205-
206- This is installation path of Packer, change this to the plugin manager installation path of your choice.
207-
208- Example:
209-
210- ``` lua
211- require (" copilot" ).setup {
212- plugin_manager_path = vim .fn .stdpath (" data" ) .. " /site/pack/packer" ,
213- }
214- ```
215-
216203### server_opts_overrides
217204
218205Override copilot lsp client settings. The ` settings ` field is where you can set the values of the options defined in [ SettingsOpts.md] ( ./SettingsOpts.md ) .
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ M.merge_server_opts = function(params)
4747 return vim .tbl_deep_extend (" force" , {
4848 cmd = {
4949 params .copilot_node_command ,
50- require (" copilot.util" ).get_copilot_path (params . plugin_manager_path ),
50+ require (" copilot.util" ).get_copilot_path (),
5151 },
5252 cmd_cwd = vim .fn .expand (" ~" ),
5353 root_dir = vim .loop .cwd (),
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ local defaults = {
2929 ft_disable = nil ,
3030 filetypes = {},
3131 copilot_node_command = " node" ,
32- plugin_manager_path = vim .fn .stdpath (" data" ) .. " /site/pack/packer" ,
3332 server_opts_overrides = {},
3433}
3534
Original file line number Diff line number Diff line change @@ -229,12 +229,12 @@ function M.get_editor_configuration()
229229 }
230230end
231231
232- M .get_copilot_path = function (plugin_path )
233- for _ , loc in ipairs ({ " /opt " , " /start " , " " }) do
234- local copilot_path = plugin_path .. loc .. " /copilot.lua/copilot/index.js "
235- if vim . fn . filereadable ( copilot_path ) ~= 0 then
236- return copilot_path
237- end
232+ M .get_copilot_path = function ()
233+ local copilot_path = vim . api . nvim_get_runtime_file ( ' copilot/index.js ' , false )[ 1 ]
234+ if vim . fn . filereadable ( copilot_path ) ~= 0 then
235+ return copilot_path
236+ else
237+ print ( " [Copilot] could not read " .. copilot_path )
238238 end
239239end
240240
You can’t perform that action at this time.
0 commit comments