Skip to content

Commit 250f24c

Browse files
committed
Copilot.vim 1.45.0
1 parent a9228e0 commit 250f24c

File tree

8 files changed

+698
-446
lines changed

8 files changed

+698
-446
lines changed

.github/workflows/auto-close-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
gh pr close ${{ github.event.pull_request.number }} --comment \
1515
"At the moment we are not accepting contributions to the repository.
1616
17-
Feedback for Copilot.vim can be given in the [Copilot community discussions](https://github.com/orgs/community/discussions/categories/copilot)."
17+
Feedback for Copilot.vim can be given in the [feedback forum](https://github.com/github/copilot.vim/issues)."
1818
env:
1919
GH_REPO: ${{ github.repository }}
2020
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ See `:help copilot` for more information.
5858
## Troubleshooting
5959

6060
We’d love to get your help in making GitHub Copilot better! If you have
61-
feedback or encounter any problems, please reach out on our [Feedback
62-
forum](https://github.com/orgs/community/discussions/categories/copilot).
61+
feedback or encounter any problems, please reach out on our [feedback
62+
forum](https://github.com/github/copilot.vim/issues).

autoload/copilot.vim

+5-4
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ function! s:SuggestionTextWithAdjustments() abort
202202
endif
203203
let line = getline('.')
204204
let offset = col('.') - 1
205-
let choice_text = strpart(line, 0, copilot#util#UTF16ToByteIdx(line, choice.range.start.character)) . substitute(choice.insertText, "\n*$", '', '')
205+
let byte_offset = copilot#util#UTF16ToByteIdx(line, choice.range.start.character)
206+
let choice_text = strpart(line, 0, byte_offset) . substitute(choice.insertText, "\n*$", '', '')
206207
let typed = strpart(line, 0, offset)
207208
let end_offset = copilot#util#UTF16ToByteIdx(line, choice.range.end.character)
208209
if end_offset < 0
@@ -665,13 +666,13 @@ function! s:commands.setup(opts) abort
665666
if request.status ==# 'error'
666667
return 'echoerr ' . string('Copilot: Authentication failure: ' . request.error.message)
667668
else
668-
let status = request.result
669+
let data = request.result
669670
endif
670671
elseif get(data, 'status', '') isnot# 'AlreadySignedIn'
671672
return 'echoerr ' . string('Copilot: Something went wrong')
672673
endif
673674

674-
let user = get(status, 'user', '<unknown>')
675+
let user = get(data, 'user', '<unknown>')
675676

676677
echo 'Copilot: Authenticated as GitHub user ' . user
677678
endfunction
@@ -719,7 +720,7 @@ function! s:commands.version(opts) abort
719720
call s:EditorVersionWarning()
720721
endfunction
721722

722-
let s:feedback_url = 'https://github.com/orgs/community/discussions/categories/copilot'
723+
let s:feedback_url = 'https://github.com/github/copilot.vim/issues'
723724
function! s:commands.feedback(opts) abort
724725
echo s:feedback_url
725726
let browser = copilot#Browser()

autoload/copilot/logger.vim

-11
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
if !exists('s:log_file')
2-
let s:log_file = tempname() . '-copilot.log'
3-
try
4-
call writefile([], s:log_file)
5-
catch
6-
endtry
7-
endif
8-
91
let s:logs = []
102

113
function! copilot#logger#BufReadCmd() abort
@@ -26,9 +18,6 @@ function! copilot#logger#Raw(level, message) abort
2618
let lines = type(a:message) == v:t_list ? copy(a:message) : split(a:message, "\n", 1)
2719
let lines[0] = strftime('[%Y-%m-%d %H:%M:%S] ') . get(s:level_prefixes, a:level, '[UNKNOWN] ') . get(lines, 0, '')
2820
try
29-
if !filewritable(s:log_file)
30-
return
31-
endif
3221
call map(lines, { k, L -> type(L) == v:t_func ? call(L, []) : L })
3322
call extend(s:logs, lines)
3423
let overflow = len(s:logs) - get(g:, 'copilot_log_history', 10000)

autoload/copilot/version.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
function! copilot#version#String() abort
2-
return '1.44.0'
2+
return '1.45.0'
33
endfunction

dist/main.js

+685-423
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main.js.map

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lua/_copilot.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ copilot.lsp_start_client = function(cmd, handler_names, opts, settings)
2828
if #workspace_folders == 0 then
2929
workspace_folders = nil
3030
end
31-
id = vim.lsp.start_client({
31+
id = (vim.lsp.start or vim.lsp.start_client)({
3232
cmd = cmd,
3333
cmd_cwd = vim.call('copilot#job#Cwd'),
3434
name = 'GitHub Copilot',

0 commit comments

Comments
 (0)